From c08c8e09ff4d2c3ac6bc1e88f735bd99f0bbb78b Mon Sep 17 00:00:00 2001 From: James Allen Date: Tue, 14 Feb 2017 11:09:37 +0100 Subject: [PATCH] Only show onboarding for users with track changes enabled --- .../project/editor/feature-onboarding.pug | 218 +++++++++--------- .../coffee/directives/videoPlayState.coffee | 1 - services/web/public/coffee/ide.coffee | 1 - .../ide/FeatureOnboardingController.coffee | 6 +- 4 files changed, 114 insertions(+), 112 deletions(-) diff --git a/services/web/app/views/project/editor/feature-onboarding.pug b/services/web/app/views/project/editor/feature-onboarding.pug index 27d581ed46..9234abacce 100644 --- a/services/web/app/views/project/editor/feature-onboarding.pug +++ b/services/web/app/views/project/editor/feature-onboarding.pug @@ -1,112 +1,112 @@ -.feat-onboard( - ng-controller="FeatureOnboardingController" - ng-class="('feat-onboard-step' + onboarding.innerStep)" - ng-if="!state.loading && ui.showCollabFeaturesOnboarding" - ng-cloak -) - a.feat-onboard-dismiss( - href - ng-click="dismiss();" - ) × - .feat-onboard-wrapper - h1.feat-onboard-title - span.feat-onboard-highlight Commenting - | & - span.feat-onboard-highlight Track Changes - p.feat-onboard-description - | Collaboration features are here! - p.feat-onboard-description - span.feat-onboard-highlight Commenting - | and - span.feat-onboard-highlight Track Changes - | will make it easier for you to work with peers in your documents. +div(ng-controller="FeatureOnboardingController") + .feat-onboard( + ng-class="('feat-onboard-step' + onboarding.innerStep)" + ng-if="!state.loading && showCollabFeaturesOnboarding" + ng-cloak + ) + a.feat-onboard-dismiss( + href + ng-click="dismiss();" + ) × + .feat-onboard-wrapper + h1.feat-onboard-title + span.feat-onboard-highlight Commenting + | & + span.feat-onboard-highlight Track Changes + p.feat-onboard-description + | Collaboration features are here! + p.feat-onboard-description + span.feat-onboard-highlight Commenting + | and + span.feat-onboard-highlight Track Changes + | will make it easier for you to work with peers in your documents. - .feat-onboard-tutorial-wrapper - button.btn.btn-primary.feat-onboard-nav-btn( - ng-click="gotoPrevStep();" - ng-disabled="onboarding.innerStep === 1;") - i.fa.fa-arrow-left - div(ng-show="onboarding.innerStep === 1;") - video.feat-onboard-video( - video-play-state="onboarding.innerStep === 1;" - autoplay - loop - ) - source(src="/img/onboarding/review-panel/open-review.mp4", type="video/mp4") - img(src="/img/onboarding/review-panel/open-review.gif") - div(ng-show="onboarding.innerStep === 2;") - video.feat-onboard-video( - video-play-state="onboarding.innerStep === 2;" - autoplay - loop - ) - source(src="/img/onboarding/review-panel/commenting.mp4", type="video/mp4") - img(src="/img/onboarding/review-panel/commenting.gif") - div(ng-show="onboarding.innerStep === 3;") - video.feat-onboard-video( - video-play-state="onboarding.innerStep === 3;" - autoplay - loop - ) - source(src="/img/onboarding/review-panel/add-changes.mp4", type="video/mp4") - img(src="/img/onboarding/review-panel/add-changes.gif") - div(ng-show="onboarding.innerStep === 4;") - video.feat-onboard-video( - video-play-state="onboarding.innerStep === 4;" - autoplay - loop - ) - source(src="/img/onboarding/review-panel/accept-changes.mp4", type="video/mp4") - img(src="/img/onboarding/review-panel/accept-changes.gif") - button.btn.btn-primary.feat-onboard-nav-btn( - ng-click="gotoNextStep();" - ng-disabled="onboarding.innerStep === onboarding.nSteps;") - i.fa.fa-arrow-right + .feat-onboard-tutorial-wrapper + button.btn.btn-primary.feat-onboard-nav-btn( + ng-click="gotoPrevStep();" + ng-disabled="onboarding.innerStep === 1;") + i.fa.fa-arrow-left + div(ng-show="onboarding.innerStep === 1;") + video.feat-onboard-video( + video-play-state="onboarding.innerStep === 1;" + autoplay + loop + ) + source(src="/img/onboarding/review-panel/open-review.mp4", type="video/mp4") + img(src="/img/onboarding/review-panel/open-review.gif") + div(ng-show="onboarding.innerStep === 2;") + video.feat-onboard-video( + video-play-state="onboarding.innerStep === 2;" + autoplay + loop + ) + source(src="/img/onboarding/review-panel/commenting.mp4", type="video/mp4") + img(src="/img/onboarding/review-panel/commenting.gif") + div(ng-show="onboarding.innerStep === 3;") + video.feat-onboard-video( + video-play-state="onboarding.innerStep === 3;" + autoplay + loop + ) + source(src="/img/onboarding/review-panel/add-changes.mp4", type="video/mp4") + img(src="/img/onboarding/review-panel/add-changes.gif") + div(ng-show="onboarding.innerStep === 4;") + video.feat-onboard-video( + video-play-state="onboarding.innerStep === 4;" + autoplay + loop + ) + source(src="/img/onboarding/review-panel/accept-changes.mp4", type="video/mp4") + img(src="/img/onboarding/review-panel/accept-changes.gif") + button.btn.btn-primary.feat-onboard-nav-btn( + ng-click="gotoNextStep();" + ng-disabled="onboarding.innerStep === onboarding.nSteps;") + i.fa.fa-arrow-right - div(ng-switch="onboarding.innerStep") - .row(ng-switch-when="1") - .col-xs-6 - h2.feat-onboard-adv-title Commenting - p.feat-onboard-description Want to discuss specific parts of the text? - p.feat-onboard-description Use our brand-new commenting system. - .col-xs-6 - h2.feat-onboard-adv-title Track Changes - p.feat-onboard-description See changes in your documents, live. - p.feat-onboard-description Track, accept and reject changes individually. - .row(ng-switch-when="2") - .col-xs-12 - h2.feat-onboard-adv-title Commenting - p.feat-onboard-description Just select a span of text and click on - span.feat-onboard-highlight “Add comment” - | . - p.feat-onboard-description - span.feat-onboard-highlight Comments - | can be - span.feat-onboard-highlight replied - | to, - span.feat-onboard-highlight resolved - | and permanently - span.feat-onboard-highlight deleted - | . - .row(ng-switch-when="3") - .col-xs-12 - h2.feat-onboard-adv-title Track Changes - p.feat-onboard-description - | Let your peers know what you've been up to. - p.feat-onboard-description - | Click on the - span.feat-onboard-highlight “Track Changes” - | toggle to start marking your insertions, as well as your deletions. + div(ng-switch="onboarding.innerStep") + .row(ng-switch-when="1") + .col-xs-6 + h2.feat-onboard-adv-title Commenting + p.feat-onboard-description Want to discuss specific parts of the text? + p.feat-onboard-description Use our brand-new commenting system. + .col-xs-6 + h2.feat-onboard-adv-title Track Changes + p.feat-onboard-description See changes in your documents, live. + p.feat-onboard-description Track, accept and reject changes individually. + .row(ng-switch-when="2") + .col-xs-12 + h2.feat-onboard-adv-title Commenting + p.feat-onboard-description Just select a span of text and click on + span.feat-onboard-highlight “Add comment” + | . + p.feat-onboard-description + span.feat-onboard-highlight Comments + | can be + span.feat-onboard-highlight replied + | to, + span.feat-onboard-highlight resolved + | and permanently + span.feat-onboard-highlight deleted + | . + .row(ng-switch-when="3") + .col-xs-12 + h2.feat-onboard-adv-title Track Changes + p.feat-onboard-description + | Let your peers know what you've been up to. + p.feat-onboard-description + | Click on the + span.feat-onboard-highlight “Track Changes” + | toggle to start marking your insertions, as well as your deletions. - .row(ng-switch-when="4") - .col-xs-12 - h2.feat-onboard-adv-title Track Changes - p.feat-onboard-description Upon reviewing, - span.feat-onboard-highlight changes - | can be accepted or undone. - p.feat-onboard-description - | Click  - span.feat-onboard-highlight “Accept” - | or  - span.feat-onboard-highlight “Reject” - | to incorporate or discard an individual change. + .row(ng-switch-when="4") + .col-xs-12 + h2.feat-onboard-adv-title Track Changes + p.feat-onboard-description Upon reviewing, + span.feat-onboard-highlight changes + | can be accepted or undone. + p.feat-onboard-description + | Click  + span.feat-onboard-highlight “Accept” + | or  + span.feat-onboard-highlight “Reject” + | to incorporate or discard an individual change. diff --git a/services/web/public/coffee/directives/videoPlayState.coffee b/services/web/public/coffee/directives/videoPlayState.coffee index bd7e41e26c..5dbf470bee 100644 --- a/services/web/public/coffee/directives/videoPlayState.coffee +++ b/services/web/public/coffee/directives/videoPlayState.coffee @@ -6,7 +6,6 @@ define [ restrict: "A", link: (scope, element, attrs) -> videoDOMEl = element[0] - console.dir videoDOMEl scope.$watch (() -> $parse(attrs.videoPlayState)(scope)), (shouldPlay) -> if shouldPlay videoDOMEl.currentTime = 0 diff --git a/services/web/public/coffee/ide.coffee b/services/web/public/coffee/ide.coffee index 83863b45be..9bf86d576e 100644 --- a/services/web/public/coffee/ide.coffee +++ b/services/web/public/coffee/ide.coffee @@ -70,7 +70,6 @@ define [ chatOpen: false pdfLayout: 'sideBySide' reviewPanelOpen: localStorage("ui.reviewPanelOpen.#{window.project_id}") - showCollabFeaturesOnboarding: window.showTrackChangesOnboarding } $scope.user = window.user diff --git a/services/web/public/coffee/ide/FeatureOnboardingController.coffee b/services/web/public/coffee/ide/FeatureOnboardingController.coffee index 69122f3388..149cca7e5b 100644 --- a/services/web/public/coffee/ide/FeatureOnboardingController.coffee +++ b/services/web/public/coffee/ide/FeatureOnboardingController.coffee @@ -5,10 +5,14 @@ define [ $scope.onboarding = innerStep: 1 nSteps: 4 + + $scope.$watch "project.features.trackChangesVisible", (visible) -> + return if !visible? + $scope.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible $scope.dismiss = () -> event_tracking.sendMB "shown-track-changes-onboarding" - $scope.ui.showCollabFeaturesOnboarding = false + $scope.showCollabFeaturesOnboarding = false $scope.gotoPrevStep = () -> if $scope.onboarding.innerStep > 1