Remove unused autocompile rollout logic now that at 100%

This commit is contained in:
Alasdair Smith 2018-01-17 15:04:24 +00:00
parent cd4d27c587
commit 45de9bb5dc
7 changed files with 10 additions and 92 deletions

View file

@ -241,36 +241,6 @@ module.exports = ProjectController =
if !user_id?
return cb()
CollaboratorsHandler.userIsTokenMember user_id, project_id, cb
showAutoCompileOnboarding: (cb) ->
cb = underscore.once(cb)
# Force autocompile rollout if query param set
if req.query?.ac == 't'
return cb(null, { enabled: true, showOnboarding: true })
if !user_id?
return cb()
# Extract data from user's ObjectId
timestamp = parseInt(user_id.toString().substring(0, 8), 16)
rolloutPercentage = 100 # Percentage of users to roll out to
if !ProjectController._isInPercentageRollout('autocompile', user_id, rolloutPercentage)
# Don't show if user is not part of roll out
return cb(null, { enabled: false, showOnboarding: false })
userSignupDate = new Date(timestamp * 1000)
if userSignupDate > new Date("2017-10-16")
# Don't show for users who registered after it was released
return cb(null, { enabled: true, showOnboarding: false })
timeout = setTimeout cb, 500
AnalyticsManager.getLastOccurance user_id, "shown-autocompile-onboarding-2", (error, event) ->
clearTimeout timeout
if error?
return cb(null, { enabled: true, showOnboarding: false })
else if event?
return cb(null, { enabled: true, showOnboarding: false })
else
logger.log { user_id, event }, "autocompile onboarding not shown yet to this user"
return cb(null, { enabled: true, showOnboarding: true })
couldShowLinkSharingOnboarding: (cb) ->
cb = underscore.once(cb)
if !user_id?
@ -295,7 +265,6 @@ module.exports = ProjectController =
project = results.project
user = results.user
subscription = results.subscription
{ showAutoCompileOnboarding } = results
daysSinceLastUpdated = (new Date() - project.lastUpdated) / 86400000
logger.log project_id:project_id, daysSinceLastUpdated:daysSinceLastUpdated, "got db results for loading editor"
@ -340,8 +309,6 @@ module.exports = ProjectController =
syntaxValidation: user.ace.syntaxValidation
}
trackChangesState: project.track_changes
autoCompileEnabled: !!showAutoCompileOnboarding?.enabled
showAutoCompileOnboarding: !!showAutoCompileOnboarding?.showOnboarding
privilegeLevel: privilegeLevel
chatUrl: Settings.apis.chat.url
anonymous: anonymous

View file

@ -121,8 +121,6 @@ block requirejs
window.isTokenMember = #{!!isTokenMember};
window.maxDocLength = #{maxDocLength};
window.trackChangesState = data.trackChangesState;
window.autoCompileEnabled = #{!!autoCompileEnabled};
window.showAutoCompileOnboarding = #{!!showAutoCompileOnboarding}
window.showLinkSharingOnboarding = #{!!showLinkSharingOnboarding}
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
window.requirejs = {

View file

@ -94,20 +94,6 @@ div.full-size(
)
include ./pdf
#onboarding-autocompile.onboarding-autocompile.popover(
ng-controller="AutoCompileOnboardingController"
ng-if="onboarding.autoCompile == 'show'"
ng-class="placement"
)
.popover-inner
h3.popover-title #{translate("auto_compile")}
.popover-content
p #{translate("try_out_auto_compile_setting")}
img(src="/img/onboarding/autocompile/setting-dropdown.png" width="100%")
p #{translate("auto_compile_onboarding_description")}
button.btn.btn-default.btn-block(ng-click="dismiss()")
| #{translate("got_it")}
#onboarding-linksharing.onboarding-linksharing.popover(
ng-controller="LinkSharingOnboardingController"
ng-if="permissions.admin && onboarding.linkSharing == 'unseen'"

View file

@ -26,17 +26,15 @@ div.full-size.pdf(ng-controller="PdfController")
)
span.caret
ul.dropdown-menu.dropdown-menu-left
// Only show if on beta program or part of rollout
if user.betaProgram || autoCompileEnabled
li.dropdown-header #{translate("auto_compile")}
li
a(href, ng-click="autocompile_enabled = true")
i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}")
|  #{translate('on')}
li
a(href, ng-click="autocompile_enabled = false")
i.fa.fa-fw(ng-class="{'fa-check': !autocompile_enabled}")
|  #{translate('off')}
li.dropdown-header #{translate("auto_compile")}
li
a(href, ng-click="autocompile_enabled = true")
i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}")
|  #{translate('on')}
li
a(href, ng-click="autocompile_enabled = false")
i.fa.fa-fw(ng-class="{'fa-check': !autocompile_enabled}")
|  #{translate('off')}
li.dropdown-header #{translate("compile_mode")}
li
a(href, ng-click="draft = false")

View file

@ -13,7 +13,6 @@ define [
"ide/metadata/MetadataManager"
"ide/review-panel/ReviewPanelManager"
"ide/SafariScrollPatcher"
"ide/AutoCompileOnboardingController",
"ide/LinkSharingOnboardingController",
"ide/settings/index"
"ide/share/index"
@ -83,7 +82,6 @@ define [
chatResizerSizeClosed: window.uiConfig.chatResizerSizeClosed
}
$scope.onboarding = {
autoCompile: if window.showAutoCompileOnboarding then 'unseen' else 'dismissed'
linkSharing: if window.showLinkSharingOnboarding then 'unseen' else 'dismissed'
}
$scope.user = window.user

View file

@ -1,26 +0,0 @@
define [
"base"
], (App) ->
App.controller "AutoCompileOnboardingController", ($scope, event_tracking) ->
recompileBtn = angular.element('#recompile')
popover = angular.element('#onboarding-autocompile')
{ top, left } = recompileBtn.offset()
# If pdf panel smaller than recompile button + popover, show to left.
# Otherwise show to right
if $scope.ui.pdfWidth < 475
$scope.placement = 'left'
popover.offset({
top: top,
left: left - popover.width()
})
else
$scope.placement = 'right'
popover.offset({
top: top,
left: left + recompileBtn.width()
})
$scope.dismiss = () ->
$scope.onboarding.autoCompile = 'dismissed'
event_tracking.sendMB "shown-autocompile-onboarding-2"

View file

@ -115,7 +115,7 @@ define [
toggleAutoCompile(newValue)
event_tracking.sendMB "autocompile-setting-changed", { value: newValue }
if (window.user?.betaProgram or window.autoCompileEnabled) and $scope.autocompile_enabled
if $scope.autocompile_enabled
toggleAutoCompile(true)
# abort compile if syntax checks fail
@ -426,9 +426,6 @@ define [
$scope.recompile = (options = {}) ->
return if $scope.pdf.compiling
if !options.isAutoCompileOnLoad and $scope.onboarding.autoCompile == 'unseen'
$scope.onboarding.autoCompile = 'show'
event_tracking.sendMBSampled "editor-recompile-sampled", options
$scope.pdf.compiling = true