mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Remove unused autocompile rollout logic now that at 100%
This commit is contained in:
parent
cd4d27c587
commit
45de9bb5dc
7 changed files with 10 additions and 92 deletions
|
@ -241,36 +241,6 @@ module.exports = ProjectController =
|
||||||
if !user_id?
|
if !user_id?
|
||||||
return cb()
|
return cb()
|
||||||
CollaboratorsHandler.userIsTokenMember user_id, project_id, 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) ->
|
couldShowLinkSharingOnboarding: (cb) ->
|
||||||
cb = underscore.once(cb)
|
cb = underscore.once(cb)
|
||||||
if !user_id?
|
if !user_id?
|
||||||
|
@ -295,7 +265,6 @@ module.exports = ProjectController =
|
||||||
project = results.project
|
project = results.project
|
||||||
user = results.user
|
user = results.user
|
||||||
subscription = results.subscription
|
subscription = results.subscription
|
||||||
{ showAutoCompileOnboarding } = results
|
|
||||||
|
|
||||||
daysSinceLastUpdated = (new Date() - project.lastUpdated) / 86400000
|
daysSinceLastUpdated = (new Date() - project.lastUpdated) / 86400000
|
||||||
logger.log project_id:project_id, daysSinceLastUpdated:daysSinceLastUpdated, "got db results for loading editor"
|
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
|
syntaxValidation: user.ace.syntaxValidation
|
||||||
}
|
}
|
||||||
trackChangesState: project.track_changes
|
trackChangesState: project.track_changes
|
||||||
autoCompileEnabled: !!showAutoCompileOnboarding?.enabled
|
|
||||||
showAutoCompileOnboarding: !!showAutoCompileOnboarding?.showOnboarding
|
|
||||||
privilegeLevel: privilegeLevel
|
privilegeLevel: privilegeLevel
|
||||||
chatUrl: Settings.apis.chat.url
|
chatUrl: Settings.apis.chat.url
|
||||||
anonymous: anonymous
|
anonymous: anonymous
|
||||||
|
|
|
@ -121,8 +121,6 @@ block requirejs
|
||||||
window.isTokenMember = #{!!isTokenMember};
|
window.isTokenMember = #{!!isTokenMember};
|
||||||
window.maxDocLength = #{maxDocLength};
|
window.maxDocLength = #{maxDocLength};
|
||||||
window.trackChangesState = data.trackChangesState;
|
window.trackChangesState = data.trackChangesState;
|
||||||
window.autoCompileEnabled = #{!!autoCompileEnabled};
|
|
||||||
window.showAutoCompileOnboarding = #{!!showAutoCompileOnboarding}
|
|
||||||
window.showLinkSharingOnboarding = #{!!showLinkSharingOnboarding}
|
window.showLinkSharingOnboarding = #{!!showLinkSharingOnboarding}
|
||||||
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
window.wikiEnabled = #{!!(settings.apis.wiki && settings.apis.wiki.url)};
|
||||||
window.requirejs = {
|
window.requirejs = {
|
||||||
|
|
|
@ -94,20 +94,6 @@ div.full-size(
|
||||||
)
|
)
|
||||||
include ./pdf
|
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(
|
#onboarding-linksharing.onboarding-linksharing.popover(
|
||||||
ng-controller="LinkSharingOnboardingController"
|
ng-controller="LinkSharingOnboardingController"
|
||||||
ng-if="permissions.admin && onboarding.linkSharing == 'unseen'"
|
ng-if="permissions.admin && onboarding.linkSharing == 'unseen'"
|
||||||
|
|
|
@ -26,17 +26,15 @@ div.full-size.pdf(ng-controller="PdfController")
|
||||||
)
|
)
|
||||||
span.caret
|
span.caret
|
||||||
ul.dropdown-menu.dropdown-menu-left
|
ul.dropdown-menu.dropdown-menu-left
|
||||||
// Only show if on beta program or part of rollout
|
li.dropdown-header #{translate("auto_compile")}
|
||||||
if user.betaProgram || autoCompileEnabled
|
li
|
||||||
li.dropdown-header #{translate("auto_compile")}
|
a(href, ng-click="autocompile_enabled = true")
|
||||||
li
|
i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}")
|
||||||
a(href, ng-click="autocompile_enabled = true")
|
| #{translate('on')}
|
||||||
i.fa.fa-fw(ng-class="{'fa-check': autocompile_enabled}")
|
li
|
||||||
| #{translate('on')}
|
a(href, ng-click="autocompile_enabled = false")
|
||||||
li
|
i.fa.fa-fw(ng-class="{'fa-check': !autocompile_enabled}")
|
||||||
a(href, ng-click="autocompile_enabled = false")
|
| #{translate('off')}
|
||||||
i.fa.fa-fw(ng-class="{'fa-check': !autocompile_enabled}")
|
|
||||||
| #{translate('off')}
|
|
||||||
li.dropdown-header #{translate("compile_mode")}
|
li.dropdown-header #{translate("compile_mode")}
|
||||||
li
|
li
|
||||||
a(href, ng-click="draft = false")
|
a(href, ng-click="draft = false")
|
||||||
|
|
|
@ -13,7 +13,6 @@ define [
|
||||||
"ide/metadata/MetadataManager"
|
"ide/metadata/MetadataManager"
|
||||||
"ide/review-panel/ReviewPanelManager"
|
"ide/review-panel/ReviewPanelManager"
|
||||||
"ide/SafariScrollPatcher"
|
"ide/SafariScrollPatcher"
|
||||||
"ide/AutoCompileOnboardingController",
|
|
||||||
"ide/LinkSharingOnboardingController",
|
"ide/LinkSharingOnboardingController",
|
||||||
"ide/settings/index"
|
"ide/settings/index"
|
||||||
"ide/share/index"
|
"ide/share/index"
|
||||||
|
@ -83,7 +82,6 @@ define [
|
||||||
chatResizerSizeClosed: window.uiConfig.chatResizerSizeClosed
|
chatResizerSizeClosed: window.uiConfig.chatResizerSizeClosed
|
||||||
}
|
}
|
||||||
$scope.onboarding = {
|
$scope.onboarding = {
|
||||||
autoCompile: if window.showAutoCompileOnboarding then 'unseen' else 'dismissed'
|
|
||||||
linkSharing: if window.showLinkSharingOnboarding then 'unseen' else 'dismissed'
|
linkSharing: if window.showLinkSharingOnboarding then 'unseen' else 'dismissed'
|
||||||
}
|
}
|
||||||
$scope.user = window.user
|
$scope.user = window.user
|
||||||
|
|
|
@ -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"
|
|
|
@ -115,7 +115,7 @@ define [
|
||||||
toggleAutoCompile(newValue)
|
toggleAutoCompile(newValue)
|
||||||
event_tracking.sendMB "autocompile-setting-changed", { value: 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)
|
toggleAutoCompile(true)
|
||||||
|
|
||||||
# abort compile if syntax checks fail
|
# abort compile if syntax checks fail
|
||||||
|
@ -426,9 +426,6 @@ define [
|
||||||
$scope.recompile = (options = {}) ->
|
$scope.recompile = (options = {}) ->
|
||||||
return if $scope.pdf.compiling
|
return if $scope.pdf.compiling
|
||||||
|
|
||||||
if !options.isAutoCompileOnLoad and $scope.onboarding.autoCompile == 'unseen'
|
|
||||||
$scope.onboarding.autoCompile = 'show'
|
|
||||||
|
|
||||||
event_tracking.sendMBSampled "editor-recompile-sampled", options
|
event_tracking.sendMBSampled "editor-recompile-sampled", options
|
||||||
|
|
||||||
$scope.pdf.compiling = true
|
$scope.pdf.compiling = true
|
||||||
|
|
Loading…
Reference in a new issue