Remove old unused track changes onboarding

This commit is contained in:
Alasdair Smith 2017-11-22 14:48:22 +00:00
parent c11ea59dc1
commit 8f32f0d65f
6 changed files with 1 additions and 202 deletions

View file

@ -234,25 +234,6 @@ module.exports = ProjectController =
#don't need to wait for this to complete
ProjectUpdateHandler.markAsOpened project_id, ->
cb()
showTrackChangesOnboarding: (cb) ->
cb = underscore.once(cb)
if !user_id?
return cb()
timestamp = user_id.toString().substring(0,8)
userSignupDate = new Date( parseInt( timestamp, 16 ) * 1000 )
if userSignupDate > new Date("2017-03-09") # 8th March
# Don't show for users who registered after it was released
return cb(null, false)
timeout = setTimeout cb, 500
AnalyticsManager.getLastOccurance user_id, "shown-track-changes-onboarding-2", (error, event) ->
clearTimeout timeout
if error?
return cb(null, false)
else if event?
return cb(null, false)
else
logger.log { user_id, event }, "track changes onboarding not shown yet to this user"
return cb(null, true)
showPerUserTCNotice: (cb) ->
cb = underscore.once(cb)
if !user_id?
@ -331,7 +312,7 @@ module.exports = ProjectController =
project = results.project
user = results.user
subscription = results.subscription
{ showTrackChangesOnboarding, showPerUserTCNotice, showAutoCompileOnboarding } = results
{ showPerUserTCNotice, showAutoCompileOnboarding } = results
daysSinceLastUpdated = (new Date() - project.lastUpdated) / 86400000
logger.log project_id:project_id, daysSinceLastUpdated:daysSinceLastUpdated, "got db results for loading editor"
@ -383,7 +364,6 @@ module.exports = ProjectController =
syntaxValidation: user.ace.syntaxValidation
}
trackChangesState: project.track_changes
showTrackChangesOnboarding: !!showTrackChangesOnboarding
showPerUserTCNotice: !!showPerUserTCNotice
autoCompileEnabled: !!showAutoCompileOnboarding?.enabled
showAutoCompileOnboarding: !!showAutoCompileOnboarding?.showOnboarding

View file

@ -20,8 +20,6 @@ block content
p.loading-screen-error(ng-if="state.error").ng-cloak
span(ng-bind-html="state.error")
include ./editor/feature-onboarding
.global-alerts(ng-cloak)
.alert.alert-danger.small(ng-if="connection.forced_disconnect")
strong #{translate("disconnected")}
@ -122,7 +120,6 @@ block requirejs
window.isTokenMember = #{!!isTokenMember};
window.maxDocLength = #{maxDocLength};
window.trackChangesState = data.trackChangesState;
window.showTrackChangesOnboarding = #{!!showTrackChangesOnboarding};
window.showPerUserTCNotice = #{!!showPerUserTCNotice};
window.autoCompileEnabled = #{!!autoCompileEnabled};
window.showAutoCompileOnboarding = #{!!showAutoCompileOnboarding}

View file

@ -1,112 +0,0 @@
.feat-onboard(
ng-controller="FeatureOnboardingController"
ng-class="('feat-onboard-step' + onboarding.innerStep)"
ng-if="!state.loading && ui.showCollabFeaturesOnboarding"
ng-cloak
stop-propagation="click"
)
a.feat-onboard-dismiss(
href
ng-click="dismiss();"
) ×
.feat-onboard-wrapper
h1.feat-onboard-title
| Introducing 
span.feat-onboard-highlight Commenting
| &
span.feat-onboard-highlight Track Changes
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(ng-src="{{ '/img/onboarding/review-panel/open-review.mp4' }}", type="video/mp4")
img(ng-src="{{ '/img/onboarding/review-panel/open-review.gif' }}", alt="Open review panel demo")
div(ng-show="onboarding.innerStep === 2;")
video.feat-onboard-video(
video-play-state="onboarding.innerStep === 2;"
autoplay
loop
)
source(ng-src="{{ '/img/onboarding/review-panel/commenting.mp4' }}", type="video/mp4")
img(ng-src="{{ '/img/onboarding/review-panel/commenting.gif' }}", alt="Commenting demo")
div(ng-show="onboarding.innerStep === 3;")
video.feat-onboard-video(
video-play-state="onboarding.innerStep === 3;"
autoplay
loop
)
source(ng-src="{{ '/img/onboarding/review-panel/add-changes.mp4' }}", type="video/mp4")
img(ng-src="{{ '/img/onboarding/review-panel/add-changes.gif' }}", alt="Add changes demo")
div(ng-show="onboarding.innerStep === 4;")
video.feat-onboard-video(
video-play-state="onboarding.innerStep === 4;"
autoplay
loop
)
source(ng-src="{{ '/img/onboarding/review-panel/accept-changes.mp4' }}", type="video/mp4")
img(ng-src="{{ '/img/onboarding/review-panel/accept-changes.gif' }}", alt="Accept changes demo")
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.
.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.

View file

@ -12,7 +12,6 @@ define [
"ide/labels/LabelsManager"
"ide/review-panel/ReviewPanelManager"
"ide/SafariScrollPatcher"
"ide/FeatureOnboardingController",
"ide/AutoCompileOnboardingController",
"ide/LinkSharingOnboardingController",
"ide/settings/index"
@ -92,10 +91,6 @@ define [
$scope.__enableTokenAccessUI = false
$scope.$digest
$scope.$watch "project.features.trackChangesVisible", (visible) ->
return if !visible?
$scope.ui.showCollabFeaturesOnboarding = window.showTrackChangesOnboarding and visible
$scope.shouldABTestPlans = false
if $scope.user.signUpDate >= '2016-10-27'
$scope.shouldABTestPlans = true

View file

@ -1,32 +0,0 @@
define [
"base"
], (App) ->
App.controller "FeatureOnboardingController", ($scope, settings, event_tracking) ->
$scope.onboarding =
innerStep: 1
nSteps: 4
$scope.dismiss = () ->
event_tracking.sendMB "shown-track-changes-onboarding-2"
$scope.$applyAsync(() -> $scope.ui.showCollabFeaturesOnboarding = false)
$scope.gotoPrevStep = () ->
if $scope.onboarding.innerStep > 1
$scope.$applyAsync(() -> $scope.onboarding.innerStep--)
$scope.gotoNextStep = () ->
if $scope.onboarding.innerStep < 4
$scope.$applyAsync(() -> $scope.onboarding.innerStep++)
handleKeydown = (e) ->
switch e.keyCode
when 37 then $scope.gotoPrevStep() # left directional key
when 39, 13 then $scope.gotoNextStep() # right directional key, enter
when 27 then $scope.dismiss() # escape
$(document).on "keydown", handleKeydown
$(document).on "click", $scope.dismiss
$scope.$on "$destroy", () ->
$(document).off "keydown", handleKeydown
$(document).off "click", $scope.dismiss

View file

@ -493,35 +493,6 @@ describe "ProjectController", ->
done()
@ProjectController.loadEditor @req, @res
it "should set showTrackChangesOnboarding = false if there is an event", (done) ->
@AnalyticsManager.getLastOccurance.yields(null, {"mock": "event"})
@res.render = (pageName, opts)=>
opts.showTrackChangesOnboarding.should.equal false
done()
@ProjectController.loadEditor @req, @res
it "should set showTrackChangesOnboarding = true if there is no event", (done) ->
@AnalyticsManager.getLastOccurance.yields(null, null)
@res.render = (pageName, opts)=>
opts.showTrackChangesOnboarding.should.equal true
done()
@ProjectController.loadEditor @req, @res
it "should set showTrackChangesOnboarding = false if there is an error", (done) ->
@AnalyticsManager.getLastOccurance.yields(new Error("oops"), null)
@res.render = (pageName, opts)=>
opts.showTrackChangesOnboarding.should.equal false
done()
@ProjectController.loadEditor @req, @res
it "should set showTrackChangesOnboarding = false if the user signed up after release", (done) ->
@AuthenticationController.getLoggedInUserId.returns("58c11a608ba0d6e49e8ce5d5")
@AnalyticsManager.getLastOccurance.yields(null, null)
@res.render = (pageName, opts)=>
opts.showTrackChangesOnboarding.should.equal false
done()
@ProjectController.loadEditor @req, @res
describe '_isInPercentageRollout', ->
before ->
@ids = [