diff --git a/services/web/app/coffee/Features/Project/ProjectController.coffee b/services/web/app/coffee/Features/Project/ProjectController.coffee index 563ace8a51..ce9bfbd727 100644 --- a/services/web/app/coffee/Features/Project/ProjectController.coffee +++ b/services/web/app/coffee/Features/Project/ProjectController.coffee @@ -224,6 +224,11 @@ module.exports = ProjectController = 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 diff --git a/services/web/app/coffee/Features/Project/ProjectEditorHandler.coffee b/services/web/app/coffee/Features/Project/ProjectEditorHandler.coffee index 8ec25ace10..c7acdee766 100644 --- a/services/web/app/coffee/Features/Project/ProjectEditorHandler.coffee +++ b/services/web/app/coffee/Features/Project/ProjectEditorHandler.coffee @@ -22,11 +22,6 @@ module.exports = ProjectEditorHandler = if !result.invites? result.invites = [] - trackChangesVisible = false - for member in members - if member.privilegeLevel == "owner" and (member.user?.featureSwitches?.track_changes or member.user?.betaProgram) - trackChangesVisible = true - {owner, ownerFeatures, members} = @buildOwnerAndMembersViews(members) result.owner = owner result.members = members @@ -40,7 +35,7 @@ module.exports = ProjectEditorHandler = templates: false references: false trackChanges: false - trackChangesVisible: ProjectEditorHandler.trackChangesAvailable and trackChangesVisible + trackChangesVisible: ProjectEditorHandler.trackChangesAvailable }) return result diff --git a/services/web/app/coffee/models/User.coffee b/services/web/app/coffee/models/User.coffee index e4097aaa67..099b9ef8e2 100644 --- a/services/web/app/coffee/models/User.coffee +++ b/services/web/app/coffee/models/User.coffee @@ -39,9 +39,6 @@ UserSchema = new Schema references: { type:Boolean, default: Settings.defaultFeatures.references } trackChanges: { type:Boolean, default: Settings.defaultFeatures.trackChanges } } - featureSwitches : { - track_changes: { type: Boolean } - } referal_id : {type:String, default:() -> uuid.v4().split("-")[0]} refered_users: [ type:ObjectId, ref:'User' ] refered_user_count: { type:Number, default: 0 } diff --git a/services/web/app/views/beta_program/opt_in.pug b/services/web/app/views/beta_program/opt_in.pug index c740b894a6..b9fb1062e7 100644 --- a/services/web/app/views/beta_program/opt_in.pug +++ b/services/web/app/views/beta_program/opt_in.pug @@ -18,9 +18,7 @@ block content | #{translate("beta_program_badge_description")} span.beta-feature-badge p.text-centered - strong We're currently testing track changes and commenting: - p.text-centered - img(src="/img/teasers/track-changes/track-changes-beta.png", style="max-width: 100%; border-bottom: 1px solid #ddd") + strong We're not currently testing anything in beta, but keep checking back! .row.text-centered .col-md-12 if user.betaProgram diff --git a/services/web/app/views/project/editor/header.pug b/services/web/app/views/project/editor/header.pug index fe3732de97..b90201b397 100644 --- a/services/web/app/views/project/editor/header.pug +++ b/services/web/app/views/project/editor/header.pug @@ -94,7 +94,6 @@ header.toolbar.toolbar-header.toolbar-with-labels( i.review-icon p.toolbar-label | #{translate("review")} - span(style="vertical-align: 20%; margin-left: 4px; padding: 2px 4px;").beta-feature-badge a.btn.btn-full-height( href, ng-if="permissions.admin", diff --git a/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee b/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee index ba92046c28..b2cfb6efc1 100644 --- a/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee +++ b/services/web/test/UnitTests/coffee/Project/ProjectControllerTests.coffee @@ -13,7 +13,7 @@ describe "ProjectController", -> @project_id = "123213jlkj9kdlsaj" @user = - _id:"!£123213kjljkl" + _id:"588f3ddae8ebc1bac07c9fa4" first_name: "bjkdsjfk" @settings = apis: @@ -302,7 +302,7 @@ describe "ProjectController", -> name:"my proj" _id:"213123kjlkj" @user = - _id:"123kj21k3lj" + _id: "588f3ddae8ebc1bac07c9fa4" ace: fontSize:"massive" theme:"sexy" @@ -381,3 +381,11 @@ describe "ProjectController", -> 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