Skip to content

Tour breaks when tour has tour-step-enabled="false" and tour-step-on-next="redirectTo" on it #145

Description

@RusinovAnton

Hello, thanks for you work on this project, very appreciated.

I am using the exact versions of the following:

  • Browser: Google Chrome Version 60.0.3112.90 (Official Build) (64-bit)
  • AngularJS: 1.6.5
  • Angular Bootstrap: 2.5.0
  • Angular UI Tour: 0.8.2
  • Angular UI Router: 0.4.2

I have installed this library via: Bower

I have observed the following behavior:
I have around 25 steps on different pages and I need to check whether user has permission to see some steps. Now I have issue when my step with on-next redirect is disabled the tour breaks down, because redirect function wasn't run and I have no next enabled step on my page.

This is how I expected it to behave:
Maybe I could run on-next redirect function for last disabled step before enabled one?
Is there some solution to this case? Thanks.

Here is my tour config, and all related step configs:

      uiTourService.createDetachedTour('MyTour', {
            backdrop: true,
            useUiRouter: true,
            templateUrl: 'views/tour/tour_step.html',
            scrollOffset: 250,
        });
tour-step="currentTourStepId"
tour-step-order="3"
tour-step-placement="top"
tour-step-title="CurrentStepTitle"
tour-step-content="CurrentStepContent"
tour-enabled="$ctrl.checkPermissions('currentTourStepId')"
tour-step-on-next="tourRedirect('next.state', { ...nextParams }, 'nextStepId')"
tour-step="nextStepId"
tour-step-order="4"
tour-step-placement="right"
tour-step-title="NextStepTitle"
tour-step-content="NextStepContent"
tour-enabled="$ctrl.checkPermissions('nextStepId')"
tour-step-on-next="tourRedirect('nextnext.state', { ...nextnextParams }, 'nextnextStepId')"

Additional notes/code:

$scope.tourRedirect = function (state, params, nextStepId) {
    if (!$scope.currentTour) {
        return;
    }
    $state.go(state, params);
    return $scope.currentTour.waitFor(nextStepId);
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions