mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Label updates with an origin when migrating history (#5689)
* Label updates with an origin when migrating history GitOrigin-RevId: 78b2b521a08610a178ea84f78f8f9644d798d509
This commit is contained in:
parent
f97f753b1e
commit
37018af773
2 changed files with 14 additions and 3 deletions
|
@ -87,11 +87,18 @@ async function deleteProjectHistory(projectId) {
|
|||
}
|
||||
}
|
||||
|
||||
async function resyncProject(projectId, force = false) {
|
||||
async function resyncProject(projectId, options = {}) {
|
||||
try {
|
||||
const body = {}
|
||||
if (options.force) {
|
||||
body.force = options.force
|
||||
}
|
||||
if (options.origin) {
|
||||
body.origin = options.origin
|
||||
}
|
||||
await request.post({
|
||||
url: `${settings.apis.project_history.url}/project/${projectId}/resync`,
|
||||
qs: { force }, // TODO: only send if true?
|
||||
json: body,
|
||||
})
|
||||
} catch (err) {
|
||||
throw OError.tag(err, 'failed to resync project history', { projectId })
|
||||
|
|
|
@ -177,13 +177,17 @@ script(type="text/ng-template", id="historyEntryTpl")
|
|||
ng-style="$ctrl.getUserCSSStyle(update_user);"
|
||||
) #{translate("anonymous")}
|
||||
li.history-entry-metadata-user(
|
||||
ng-if="::$ctrl.entry.meta.origin"
|
||||
ng-if="::$ctrl.entry.meta.origin && $ctrl.entry.meta.users.length == 0"
|
||||
ng-switch on="::$ctrl.entry.meta.origin.kind"
|
||||
)
|
||||
span.name(
|
||||
ng-switch-when="history-resync"
|
||||
ng-style="$ctrl.getUserCSSStyle()"
|
||||
) #{translate("overleaf_history_system")}
|
||||
span.name(
|
||||
ng-switch-when="history-migration"
|
||||
ng-style="$ctrl.getUserCSSStyle()"
|
||||
) #{translate("overleaf_history_system")}
|
||||
span.name(
|
||||
ng-switch-default
|
||||
ng-style="$ctrl.getUserCSSStyle()"
|
||||
|
|
Loading…
Reference in a new issue