mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
Merge pull request #15781 from overleaf/ds-react-history-split-test-tear-down
History View React - Split test tear down GitOrigin-RevId: 6095ea94a74fc96c7031a4d1bbefdc6211cc934c
This commit is contained in:
committed by
Copybot
parent
53e13a73ee
commit
a0f818120e
@@ -663,21 +663,6 @@ const ProjectController = {
|
||||
}
|
||||
)
|
||||
},
|
||||
historyViewAssignment(cb) {
|
||||
SplitTestHandler.getAssignment(
|
||||
req,
|
||||
res,
|
||||
'history-view-version',
|
||||
(error, assignment) => {
|
||||
// do not fail editor load if assignment fails
|
||||
if (error) {
|
||||
cb(null, { variant: 'default' })
|
||||
} else {
|
||||
cb(null, assignment)
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
reviewPanelAssignment(cb) {
|
||||
SplitTestHandler.getAssignment(
|
||||
req,
|
||||
@@ -728,7 +713,6 @@ const ProjectController = {
|
||||
isInvitedMember,
|
||||
brandVariation,
|
||||
pdfjsAssignment,
|
||||
historyViewAssignment,
|
||||
reviewPanelAssignment,
|
||||
idePageAssignment,
|
||||
personalAccessTokenAssignment,
|
||||
@@ -922,7 +906,6 @@ const ProjectController = {
|
||||
fixedSizeDocument: true,
|
||||
useOpenTelemetry: Settings.useOpenTelemetryClient,
|
||||
showCM6SwitchAwaySurvey: Settings.showCM6SwitchAwaySurvey,
|
||||
historyViewReact: historyViewAssignment.variant === 'react',
|
||||
isReviewPanelReact: reviewPanelAssignment.variant === 'react',
|
||||
idePageReact,
|
||||
showPersonalAccessToken,
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
aside.editor-sidebar.full-size.history-file-tree#history-file-tree(
|
||||
ng-show="history.isReact && ui.view == 'history'"
|
||||
ng-show="ui.view == 'history'"
|
||||
)
|
||||
|
||||
@@ -1,86 +0,0 @@
|
||||
div#history(ng-show="ui.view == 'history' && history.updates.length > 0")
|
||||
include ./history/entriesListV2
|
||||
include ./history/previewPanelV2
|
||||
|
||||
.full-size(ng-if="ui.view == 'history' && history.updates.length === 0 && !isHistoryLoading()")
|
||||
.no-history-available
|
||||
h3
|
||||
| #{translate('no_history_available')}
|
||||
script(type="text/ng-template", id="historyRestoreDiffModalTemplate")
|
||||
.modal-header
|
||||
button.close(
|
||||
type="button"
|
||||
data-dismiss="modal"
|
||||
ng-click="cancel()"
|
||||
aria-label="Close"
|
||||
)
|
||||
span(aria-hidden="true") ×
|
||||
h3 #{translate("restore")} {{diff.doc.name}}
|
||||
.modal-body.modal-body-share
|
||||
p !{translate("sure_you_want_to_restore_before", {filename: "{{diff.doc.name}}", date:"{{diff.start_ts | formatDate}}"}, ['strong'])}
|
||||
.modal-footer
|
||||
button.btn.btn-default(
|
||||
ng-click="cancel()",
|
||||
ng-disabled="state.inflight"
|
||||
) #{translate("cancel")}
|
||||
button.btn.btn-danger(
|
||||
ng-click="restore()",
|
||||
ng-disabled="state.inflight"
|
||||
)
|
||||
span(ng-show="!state.inflight") #{translate("restore")}
|
||||
span(ng-show="state.inflight") #{translate("restoring")} …
|
||||
|
||||
|
||||
script(type="text/ng-template", id="historyLabelTpl")
|
||||
.history-label(
|
||||
ng-class="{\
|
||||
'history-label-own' : $ctrl.isOwnedByCurrentUser,\
|
||||
'history-label-pseudo-current-state': $ctrl.isPseudoCurrentStateLabel,\
|
||||
}"
|
||||
)
|
||||
span.history-label-comment(
|
||||
tooltip-append-to-body="true"
|
||||
tooltip-template="'historyLabelTooltipTpl'"
|
||||
tooltip-placement="left"
|
||||
tooltip-enable="$ctrl.showTooltip"
|
||||
)
|
||||
i.fa.fa-tag
|
||||
| {{ ::$ctrl.isPseudoCurrentStateLabel ? '#{translate("history_label_project_current_state")}' : $ctrl.labelText }}
|
||||
button.history-label-delete-btn(
|
||||
ng-if="$ctrl.isOwnedByCurrentUser && !$ctrl.isPseudoCurrentStateLabel"
|
||||
stop-propagation="click"
|
||||
ng-click="$ctrl.onLabelDelete()"
|
||||
aria-label=translate("delete")
|
||||
)
|
||||
span(aria-hidden="true") ×
|
||||
|
||||
script(type="text/ng-template", id="historyLabelTooltipTpl")
|
||||
.history-label-tooltip
|
||||
p.history-label-tooltip-title
|
||||
i.fa.fa-tag
|
||||
| {{ $ctrl.labelText }}
|
||||
p.history-label-tooltip-owner #{translate("history_label_created_by")} {{ $ctrl.labelOwnerName }}
|
||||
time.history-label-tooltip-datetime {{ $ctrl.labelCreationDateTime | formatDate }}
|
||||
|
||||
|
||||
script(type="text/ng-template", id="historyV2DeleteLabelModalTemplate")
|
||||
.modal-header
|
||||
h3 #{translate("history_delete_label")}
|
||||
.modal-body
|
||||
.alert.alert-danger(ng-show="state.error.message") {{ state.error.message}}
|
||||
.alert.alert-danger(ng-show="state.error && !state.error.message") #{translate("generic_something_went_wrong")}
|
||||
p(ng-if="labelDetails")
|
||||
| #{translate("history_are_you_sure_delete_label")}
|
||||
strong "{{ labelDetails.comment }}"
|
||||
| ?
|
||||
.modal-footer
|
||||
button.btn.btn-secondary(
|
||||
type="button"
|
||||
ng-disabled="state.inflight"
|
||||
ng-click="$dismiss()"
|
||||
) #{translate("cancel")}
|
||||
button.btn.btn-danger(
|
||||
type="button"
|
||||
ng-click="deleteLabel()"
|
||||
ng-disabled="state.inflight"
|
||||
) {{ state.inflight ? '#{translate("history_deleting_label")}' : '#{translate("history_delete_label")}' }}
|
||||
@@ -1,275 +0,0 @@
|
||||
aside.change-list(
|
||||
ng-controller="HistoryV2ListController"
|
||||
)
|
||||
history-entries-list(
|
||||
ng-if="!history.showOnlyLabels && !history.error"
|
||||
entries="history.updates"
|
||||
range-selection-enabled="history.viewMode === HistoryViewModes.COMPARE"
|
||||
selected-history-version="history.selection.range.toV"
|
||||
selected-history-range="history.selection.range"
|
||||
current-user="user"
|
||||
current-user-is-owner="project.owner._id === user.id"
|
||||
users="projectUsers"
|
||||
load-entries="loadMore()"
|
||||
load-disabled="history.loading || history.atEnd"
|
||||
load-initialize="ui.view == 'history'"
|
||||
is-loading="history.loading"
|
||||
free-history-limit-hit="history.freeHistoryLimitHit"
|
||||
on-version-select="handleVersionSelect(version)"
|
||||
on-range-select="handleRangeSelect(selectedToV, selectedFromV)"
|
||||
on-label-delete="handleLabelDelete(label)"
|
||||
)
|
||||
history-labels-list(
|
||||
ng-if="history.showOnlyLabels && !history.error"
|
||||
labels="history.labels"
|
||||
range-selection-enabled="history.viewMode === HistoryViewModes.COMPARE"
|
||||
selected-history-version="history.selection.range.toV"
|
||||
selected-history-range="history.selection.range"
|
||||
current-user="user"
|
||||
users="projectUsers"
|
||||
is-loading="history.loading"
|
||||
on-version-select="handleVersionSelect(version)"
|
||||
on-range-select="handleRangeSelect(selectedToV, selectedFromV)"
|
||||
on-label-delete="handleLabelDelete(label)"
|
||||
)
|
||||
|
||||
script(type="text/ng-template", id="historyEntriesListTpl")
|
||||
.history-entries(
|
||||
infinite-scroll="$ctrl.loadEntries()"
|
||||
infinite-scroll-disabled="$ctrl.loadDisabled"
|
||||
infinite-scroll-initialize="$ctrl.loadInitialize"
|
||||
)
|
||||
.infinite-scroll-inner
|
||||
history-entry(
|
||||
ng-repeat="entry in $ctrl.entries"
|
||||
range-selection-enabled="$ctrl.rangeSelectionEnabled"
|
||||
is-dragging="$ctrl.isDragging"
|
||||
selected-history-version="$ctrl.selectedHistoryVersion"
|
||||
selected-history-range="$ctrl.selectedHistoryRange"
|
||||
hovered-history-range="$ctrl.hoveredHistoryRange"
|
||||
entry="entry"
|
||||
current-user="$ctrl.currentUser"
|
||||
users="$ctrl.users"
|
||||
on-select="$ctrl.handleEntrySelect(selectedEntry)"
|
||||
on-label-delete="$ctrl.onLabelDelete({ label: label })"
|
||||
)
|
||||
.loading(ng-show="$ctrl.isLoading")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
| #{translate("loading")}…
|
||||
.history-entries-list-upgrade-prompt(
|
||||
ng-if="$ctrl.freeHistoryLimitHit && $ctrl.currentUserIsOwner"
|
||||
ng-controller="FreeTrialModalController"
|
||||
)
|
||||
p #{translate("currently_seeing_only_24_hrs_history")}
|
||||
p: strong #{translate("upgrade_to_get_feature", {feature:"full Project History"})}
|
||||
ul.list-unstyled
|
||||
li
|
||||
i.fa.fa-check
|
||||
| #{translate("unlimited_projects")}
|
||||
|
||||
li
|
||||
i.fa.fa-check
|
||||
| #{translate("collabs_per_proj", {collabcount:'Multiple'})}
|
||||
|
||||
li
|
||||
i.fa.fa-check
|
||||
| #{translate("full_doc_history")}
|
||||
|
||||
li
|
||||
i.fa.fa-check
|
||||
| #{translate("sync_to_dropbox")}
|
||||
|
||||
li
|
||||
i.fa.fa-check
|
||||
| #{translate("sync_to_github")}
|
||||
|
||||
li
|
||||
i.fa.fa-check
|
||||
|#{translate("compile_larger_projects")}
|
||||
p.text-center
|
||||
a.btn.btn-primary(
|
||||
href
|
||||
ng-class="buttonClass"
|
||||
ng-click="startFreeTrial('history')"
|
||||
) #{translate("start_free_trial")}
|
||||
p.small(ng-show="startedFreeTrial") #{translate("refresh_page_after_starting_free_trial")}
|
||||
.history-entries-list-upgrade-prompt(
|
||||
ng-if="$ctrl.freeHistoryLimitHit && !$ctrl.currentUserIsOwner"
|
||||
)
|
||||
p #{translate("currently_seeing_only_24_hrs_history")}
|
||||
strong #{translate("ask_proj_owner_to_upgrade_for_full_history")}
|
||||
|
||||
script(type="text/ng-template", id="historyEntryTpl")
|
||||
time.history-entry-day(ng-if="::$ctrl.entry.meta.first_in_day") {{ ::$ctrl.entry.meta.end_ts | relativeDate }}
|
||||
|
||||
.history-entry(
|
||||
ng-class="{\
|
||||
'history-entry-first-in-day': $ctrl.entry.meta.first_in_day,\
|
||||
'history-entry-selected': !$ctrl.isDragging && $ctrl.isEntrySelected(),\
|
||||
'history-entry-selected-to': $ctrl.rangeSelectionEnabled && !$ctrl.isDragging && $ctrl.selectedHistoryRange.toV === $ctrl.entry.toV,\
|
||||
'history-entry-selected-from': $ctrl.rangeSelectionEnabled && !$ctrl.isDragging && $ctrl.selectedHistoryRange.fromV === $ctrl.entry.fromV,\
|
||||
'history-entry-hover-selected': $ctrl.rangeSelectionEnabled && $ctrl.isDragging && $ctrl.isEntryHoverSelected(),\
|
||||
'history-entry-hover-selected-to': $ctrl.rangeSelectionEnabled && $ctrl.isDragging && $ctrl.hoveredHistoryRange.toV === $ctrl.entry.toV,\
|
||||
'history-entry-hover-selected-from': $ctrl.rangeSelectionEnabled && $ctrl.isDragging && $ctrl.hoveredHistoryRange.fromV === $ctrl.entry.fromV,\
|
||||
}"
|
||||
history-droppable-area
|
||||
history-droppable-area-on-drop="$ctrl.onDrop(boundary)"
|
||||
history-droppable-area-on-over="$ctrl.onOver(boundary)"
|
||||
)
|
||||
.history-entry-details(
|
||||
ng-click="$ctrl.onSelect({ selectedEntry: $ctrl.entry })"
|
||||
)
|
||||
.history-entry-toV-handle(
|
||||
ng-show="$ctrl.rangeSelectionEnabled && $ctrl.selectedHistoryRange && ((!$ctrl.isDragging && $ctrl.selectedHistoryRange.toV === $ctrl.entry.toV) || ($ctrl.isDragging && $ctrl.hoveredHistoryRange.toV === $ctrl.entry.toV))"
|
||||
history-draggable-boundary="toV"
|
||||
history-draggable-boundary-on-drag-start="$ctrl.onDraggingStart()"
|
||||
history-draggable-boundary-on-drag-stop="$ctrl.onDraggingStop(isValidDrop, boundary)"
|
||||
)
|
||||
|
||||
history-label(
|
||||
ng-repeat="label in $ctrl.entry.labels | orderBy : '-created_at'"
|
||||
ng-init="user = $ctrl.buildUserView(label)"
|
||||
label-text="label.comment"
|
||||
label-owner-name="$ctrl.displayNameById(label.user_id) || 'Anonymous'"
|
||||
label-creation-date-time="label.created_at"
|
||||
is-owned-by-current-user="label.user_id === $ctrl.currentUser.id"
|
||||
on-label-delete="$ctrl.onLabelDelete({ label: label })"
|
||||
)
|
||||
|
||||
ol.history-entry-changes
|
||||
li.history-entry-change(
|
||||
ng-repeat="pathname in ::$ctrl.entry.pathnames"
|
||||
)
|
||||
span.history-entry-change-action #{translate("file_action_edited")}
|
||||
span.history-entry-change-doc {{ ::pathname }}
|
||||
li.history-entry-change(
|
||||
ng-repeat="project_op in ::$ctrl.entry.project_ops"
|
||||
)
|
||||
span.history-entry-change-action(
|
||||
ng-if="::project_op.rename"
|
||||
) #{translate("file_action_renamed")}
|
||||
span.history-entry-change-action(
|
||||
ng-if="::project_op.add"
|
||||
) #{translate("file_action_created")}
|
||||
span.history-entry-change-action(
|
||||
ng-if="::project_op.remove"
|
||||
) #{translate("file_action_deleted")}
|
||||
span.history-entry-change-doc {{ ::$ctrl.getProjectOpDoc(project_op) }}
|
||||
.history-entry-metadata
|
||||
time.history-entry-metadata-time {{ ::$ctrl.entry.meta.end_ts | formatDate:'h:mm a' }}
|
||||
span
|
||||
|
|
||||
| •
|
||||
|
|
||||
ol.history-entry-metadata-users
|
||||
li.history-entry-metadata-user(ng-repeat="update_user in ::$ctrl.entry.meta.users")
|
||||
span.name(
|
||||
ng-if="::update_user && update_user.id != $ctrl.currentUser.id"
|
||||
ng-style="$ctrl.getUserCSSStyle(update_user);"
|
||||
) {{ ::$ctrl.displayName(update_user) }}
|
||||
span.name(
|
||||
ng-if="::update_user && update_user.id == $ctrl.currentUser.id"
|
||||
ng-style="$ctrl.getUserCSSStyle(update_user);"
|
||||
) You
|
||||
span.name(
|
||||
ng-if="::update_user == null"
|
||||
ng-style="$ctrl.getUserCSSStyle(update_user);"
|
||||
) #{translate("anonymous")}
|
||||
li.history-entry-metadata-user(
|
||||
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()"
|
||||
) #{translate("anonymous")}
|
||||
li.history-entry-metadata-user(ng-if="::!$ctrl.entry.meta.origin && $ctrl.entry.meta.users.length == 0")
|
||||
span.name(
|
||||
ng-style="$ctrl.getUserCSSStyle();"
|
||||
) #{translate("anonymous")}
|
||||
span(ng-if="::$ctrl.entry.meta.origin.kind === 'dropbox'")
|
||||
| (#{translate("history_entry_origin_dropbox")})
|
||||
span(ng-if="::$ctrl.entry.meta.origin.kind === 'upload'")
|
||||
| (#{translate("history_entry_origin_upload")})
|
||||
span(ng-if="::$ctrl.entry.meta.origin.kind === 'git-bridge'")
|
||||
| (#{translate("history_entry_origin_git")})
|
||||
span(ng-if="::$ctrl.entry.meta.origin.kind === 'github'")
|
||||
| (#{translate("history_entry_origin_github")})
|
||||
|
||||
.history-entry-fromV-handle(
|
||||
ng-show="$ctrl.rangeSelectionEnabled && $ctrl.selectedHistoryRange && ((!$ctrl.isDragging && $ctrl.selectedHistoryRange.fromV === $ctrl.entry.fromV) || ($ctrl.isDragging && $ctrl.hoveredHistoryRange.fromV === $ctrl.entry.fromV))"
|
||||
history-draggable-boundary="fromV"
|
||||
history-draggable-boundary-on-drag-start="$ctrl.onDraggingStart()"
|
||||
history-draggable-boundary-on-drag-stop="$ctrl.onDraggingStop(isValidDrop, boundary)"
|
||||
)
|
||||
|
||||
script(type="text/ng-template", id="historyLabelsListTpl")
|
||||
.history-labels-list
|
||||
.history-version-with-label(
|
||||
ng-repeat="versionWithLabel in $ctrl.versionsWithLabels | orderBy:'-version' track by versionWithLabel.version"
|
||||
ng-class="{\
|
||||
'history-version-with-label-selected': !$ctrl.isDragging && $ctrl.isVersionSelected(versionWithLabel.version),\
|
||||
'history-version-with-label-selected-to': !$ctrl.isDragging && $ctrl.selectedHistoryRange.toV === versionWithLabel.version,\
|
||||
'history-version-with-label-selected-from': !$ctrl.isDragging && $ctrl.selectedHistoryRange.fromV === versionWithLabel.version,\
|
||||
'history-version-with-label-hover-selected': $ctrl.isDragging && $ctrl.isVersionHoverSelected(versionWithLabel.version),\
|
||||
'history-version-with-label-hover-selected-to': $ctrl.isDragging && $ctrl.hoveredHistoryRange.toV === versionWithLabel.version,\
|
||||
'history-version-with-label-hover-selected-from': $ctrl.isDragging && $ctrl.hoveredHistoryRange.fromV === versionWithLabel.version,\
|
||||
}"
|
||||
ng-click="$ctrl.handleVersionSelect(versionWithLabel)"
|
||||
history-droppable-area
|
||||
history-droppable-area-on-drop="$ctrl.onDrop(boundary, versionWithLabel)"
|
||||
history-droppable-area-on-over="$ctrl.onOver(boundary, versionWithLabel)"
|
||||
)
|
||||
.history-entry-toV-handle(
|
||||
ng-show="$ctrl.rangeSelectionEnabled && $ctrl.selectedHistoryRange && ((!$ctrl.isDragging && $ctrl.selectedHistoryRange.toV === versionWithLabel.version) || ($ctrl.isDragging && $ctrl.hoveredHistoryRange.toV === versionWithLabel.version))"
|
||||
history-draggable-boundary="toV"
|
||||
history-draggable-boundary-on-drag-start="$ctrl.onDraggingStart()"
|
||||
history-draggable-boundary-on-drag-stop="$ctrl.onDraggingStop(isValidDrop, boundary)"
|
||||
)
|
||||
div(
|
||||
ng-repeat="label in versionWithLabel.labels track by label.id"
|
||||
)
|
||||
history-label(
|
||||
show-tooltip="false"
|
||||
label-text="label.comment"
|
||||
is-owned-by-current-user="label.user_id === $ctrl.currentUser.id"
|
||||
on-label-delete="$ctrl.onLabelDelete({ label: label })"
|
||||
is-pseudo-current-state-label="label.isPseudoCurrentStateLabel"
|
||||
)
|
||||
.history-entry-label-metadata
|
||||
.history-entry-label-metadata-user(
|
||||
ng-if="!label.isPseudoCurrentStateLabel"
|
||||
ng-init="user = $ctrl.buildUserView(label)"
|
||||
)
|
||||
| Saved by
|
||||
span.name(
|
||||
ng-if="user && user._id !== $ctrl.currentUser.id"
|
||||
ng-style="$ctrl.getUserCSSStyle(user, versionWithLabel);"
|
||||
) {{ ::user.displayName }}
|
||||
span.name(
|
||||
ng-if="user && user._id == $ctrl.currentUser.id"
|
||||
ng-style="$ctrl.getUserCSSStyle(user, versionWithLabel);"
|
||||
) You
|
||||
span.name(
|
||||
ng-if="user == null"
|
||||
ng-style="$ctrl.getUserCSSStyle(user, versionWithLabel);"
|
||||
) #{translate("anonymous")}
|
||||
time.history-entry-label-metadata-time {{ ::label.created_at | formatDate }}
|
||||
.history-entry-fromV-handle(
|
||||
ng-show="$ctrl.rangeSelectionEnabled && $ctrl.selectedHistoryRange && ((!$ctrl.isDragging && $ctrl.selectedHistoryRange.fromV === versionWithLabel.version) || ($ctrl.isDragging && $ctrl.hoveredHistoryRange.fromV === versionWithLabel.version))"
|
||||
history-draggable-boundary="fromV"
|
||||
history-draggable-boundary-on-drag-start="$ctrl.onDraggingStart()"
|
||||
history-draggable-boundary-on-drag-stop="$ctrl.onDraggingStop(isValidDrop, boundary)"
|
||||
)
|
||||
|
||||
.loading(ng-show="$ctrl.isLoading")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
| #{translate("loading")}…
|
||||
@@ -1,57 +0,0 @@
|
||||
aside.editor-sidebar.full-size(
|
||||
ng-controller="HistoryV2FileTreeController"
|
||||
ng-if="ui.view == 'history'"
|
||||
)
|
||||
.history-file-tree-inner
|
||||
history-file-tree(
|
||||
files="history.selection.files"
|
||||
selected-pathname="history.selection.pathname"
|
||||
on-selected-file-change="handleFileSelection(file)"
|
||||
is-loading="history.loadingFileTree"
|
||||
)
|
||||
|
||||
script(type="text/ng-template", id="historyFileTreeTpl")
|
||||
.history-file-tree
|
||||
history-file-entity(
|
||||
ng-repeat="fileEntity in $ctrl._fileTree | orderBy : [ '-type', 'operation', 'name' ]"
|
||||
file-entity="fileEntity"
|
||||
ng-show="!$ctrl.isLoading"
|
||||
)
|
||||
|
||||
script(type="text/ng-template", id="historyFileEntityTpl")
|
||||
.history-file-entity-wrapper
|
||||
a.history-file-entity-link(
|
||||
href
|
||||
ng-click="$ctrl.isSelected ? '' : $ctrl.handleClick()"
|
||||
ng-class="{ 'history-file-entity-link-selected': $ctrl.isSelected }"
|
||||
)
|
||||
span.history-file-entity-name-container
|
||||
i.history-file-entity-icon.history-file-entity-icon-folder-state.fa.fa-fw(
|
||||
ng-class="{\
|
||||
'fa-chevron-down': ($ctrl.fileEntity.type === 'folder' && $ctrl.isOpen),\
|
||||
'fa-chevron-right': ($ctrl.fileEntity.type === 'folder' && !$ctrl.isOpen)\
|
||||
}"
|
||||
)
|
||||
i.history-file-entity-icon.fa(
|
||||
ng-class="::$ctrl.entityTypeIconClass"
|
||||
)
|
||||
span.history-file-entity-name(
|
||||
ng-class="::$ctrl.entityOpTextClass"
|
||||
) {{ ::$ctrl.fileEntity.name }}
|
||||
span.history-file-entity-operation-badge(
|
||||
ng-if="::$ctrl.hasOperation && $ctrl.fileEntity.operation !== 'renamed' && $ctrl.fileEntity.operation !== 'removed'"
|
||||
) {{ ::$ctrl.getFileOperationName() }}
|
||||
span.history-file-entity-operation-badge(
|
||||
ng-if="::$ctrl.hasOperation && $ctrl.fileEntity.operation === 'renamed'"
|
||||
tooltip-append-to-body="true"
|
||||
tooltip-placement="right"
|
||||
tooltip-class="tooltip-history-file-tree"
|
||||
tooltip-html=`::$ctrl.getRenameTooltip()`
|
||||
) {{ ::$ctrl.getFileOperationName() }}
|
||||
div(
|
||||
ng-show="$ctrl.isOpen"
|
||||
)
|
||||
history-file-entity(
|
||||
ng-repeat="childEntity in $ctrl.fileEntity.children"
|
||||
file-entity="childEntity"
|
||||
)
|
||||
@@ -1,62 +0,0 @@
|
||||
.diff-panel.full-size(
|
||||
ng-if="history.viewMode === HistoryViewModes.COMPARE && history.updates.length !== 0"
|
||||
)
|
||||
.diff(
|
||||
ng-show="!!history.selection.diff && !isHistoryLoading() && !history.selection.diff.error",
|
||||
ng-class="{ 'diff-binary': history.selection.diff.binary }"
|
||||
)
|
||||
.diff-editor-v2.hide-ace-cursor(
|
||||
ng-if="!history.selection.diff.binary"
|
||||
ace-editor="history",
|
||||
theme="settings.editorTheme",
|
||||
font-size="settings.fontSize",
|
||||
text="history.selection.diff.text",
|
||||
highlights="history.selection.diff.highlights",
|
||||
read-only="true",
|
||||
resize-on="layout:main:resize,history:toggle",
|
||||
navigate-highlights="true"
|
||||
)
|
||||
.alert.alert-info(ng-if="history.selection.diff.binary")
|
||||
| #{translate("binary_history_error")}
|
||||
|
||||
.loading-panel(ng-show="isHistoryLoading()")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
| #{translate("loading")}…
|
||||
.error-panel(ng-show="history.selection.diff.error && !isHistoryLoading()")
|
||||
.alert.alert-danger #{translate("generic_something_went_wrong")}
|
||||
|
||||
.point-in-time-panel.full-size(
|
||||
ng-if="history.viewMode === HistoryViewModes.POINT_IN_TIME && history.updates.length !== 0"
|
||||
)
|
||||
.point-in-time-editor-container(
|
||||
ng-if="!!history.selection.file && !history.selection.file.loading && !history.selection.file.error"
|
||||
)
|
||||
.hide-ace-cursor(
|
||||
ng-if="!history.selection.file.binary"
|
||||
ace-editor="history-pointintime",
|
||||
theme="settings.editorTheme",
|
||||
font-size="settings.fontSize",
|
||||
text="history.selection.file.text",
|
||||
read-only="true",
|
||||
resize-on="layout:main:resize,history:toggle",
|
||||
)
|
||||
.alert.alert-info(ng-if="history.selection.file.binary")
|
||||
| #{translate("binary_history_error")}
|
||||
.loading-panel(ng-show="isHistoryLoading()")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
| #{translate("loading")}…
|
||||
.error-panel(ng-show="history.error")
|
||||
.alert.alert-danger
|
||||
p
|
||||
| #{translate("generic_history_error")}
|
||||
a(
|
||||
ng-href="mailto:#{settings.adminEmail}?Subject=Error%20loading%20history%20for%project%20{{ project_id }}",
|
||||
ng-non-bindable
|
||||
) #{settings.adminEmail}
|
||||
p.clearfix
|
||||
a.alert-link-as-btn.pull-right(
|
||||
href
|
||||
ng-click="toggleHistory()"
|
||||
) #{translate("back_to_editor")}
|
||||
.error-panel(ng-show="history.selection.file.error")
|
||||
.alert.alert-danger #{translate("generic_something_went_wrong")}
|
||||
@@ -1,135 +0,0 @@
|
||||
.history-toolbar(
|
||||
ng-controller="HistoryV2ToolbarController"
|
||||
ng-if="ui.view == 'history'"
|
||||
)
|
||||
span.history-toolbar-selected-version(ng-show="history.loadingFileTree")
|
||||
i.fa.fa-spin.fa-refresh
|
||||
| #{translate("loading")}…
|
||||
|
||||
//- point-in-time mode info
|
||||
span.history-toolbar-selected-version(
|
||||
ng-show="!history.loadingFileTree && history.viewMode === HistoryViewModes.POINT_IN_TIME && !history.showOnlyLabels && currentUpdate && !history.error"
|
||||
) #{translate("browsing_project_as_of")}
|
||||
time.history-toolbar-time {{ currentUpdate.meta.end_ts | formatDate:'Do MMM YYYY, h:mm a' }}
|
||||
span.history-toolbar-selected-version(
|
||||
ng-show="!history.loadingFileTree && history.viewMode === HistoryViewModes.POINT_IN_TIME && history.showOnlyLabels && currentUpdate && !history.error"
|
||||
)
|
||||
span(ng-if="currentUpdate.labels.length > 0")
|
||||
| #{translate("browsing_project_labelled")}
|
||||
span.history-toolbar-selected-label(
|
||||
ng-repeat="label in currentUpdate.labels"
|
||||
)
|
||||
| {{ label.comment }}
|
||||
span(ng-if="!$last") ,
|
||||
span.history-toolbar-selected-label(ng-if="currentUpdate.labels.length === 0 && history.labels[0].isPseudoCurrentStateLabel && currentUpdate.toV === history.labels[0].version")
|
||||
| #{translate("browsing_project_latest_for_pseudo_label")}
|
||||
|
||||
|
||||
|
||||
//- compare mode info
|
||||
span.history-toolbar-selected-version(ng-if="history.viewMode === HistoryViewModes.COMPARE && history.selection.diff && !history.selection.diff.binary && !history.selection.diff.loading && !history.selection.diff.error && !history.loadingFileTree")
|
||||
| <strong>{{history.selection.diff.highlights.length}} </strong>
|
||||
ng-pluralize(
|
||||
count="history.selection.diff.highlights.length",
|
||||
when="{\
|
||||
'one': 'change',\
|
||||
'other': 'changes'\
|
||||
}"
|
||||
)
|
||||
| in <strong>{{history.selection.diff.pathname}}</strong>
|
||||
|
||||
//- point-in-time mode actions
|
||||
div.history-toolbar-actions(
|
||||
ng-if="history.viewMode === HistoryViewModes.POINT_IN_TIME && !history.error && history.updates.length > 0"
|
||||
)
|
||||
button.history-toolbar-btn(
|
||||
ng-click="showAddLabelDialog();"
|
||||
ng-if="!history.showOnlyLabels && permissions.write"
|
||||
ng-disabled="isHistoryLoading() || history.selection.range.toV == null || history.selection.range.fromV == null"
|
||||
)
|
||||
i.fa.fa-tag
|
||||
| #{translate("history_label_this_version")}
|
||||
button.history-toolbar-btn(
|
||||
ng-click="toggleHistoryViewMode();"
|
||||
ng-disabled="isHistoryLoading()"
|
||||
)
|
||||
i.fa.fa-exchange
|
||||
| #{translate("compare_to_another_version")}
|
||||
|
||||
a.history-toolbar-btn-danger.pull-right(
|
||||
ng-hide="history.loadingFileTree || history.selection.range.toV == null"
|
||||
ng-href="/project/{{ project_id }}/version/{{ history.selection.range.toV }}/zip"
|
||||
target="_blank"
|
||||
)
|
||||
i.fa.fa-download
|
||||
| #{translate("download_project_at_this_version")}
|
||||
|
||||
|
||||
|
||||
//- compare mode actions
|
||||
div.history-toolbar-actions(
|
||||
ng-if="history.viewMode === HistoryViewModes.COMPARE && !history.error && history.updates.length > 0"
|
||||
)
|
||||
button.history-toolbar-btn(
|
||||
ng-click="toggleHistoryViewMode();"
|
||||
ng-disabled="isHistoryLoading()"
|
||||
)
|
||||
i.fa
|
||||
| #{translate("view_single_version")}
|
||||
button.history-toolbar-btn-danger.pull-right(
|
||||
ng-if="history.selection.file.deletedAtV"
|
||||
ng-click="restoreDeletedFile()"
|
||||
ng-show="!restoreState.error"
|
||||
ng-disabled="restoreState.inflight"
|
||||
)
|
||||
i.fa.fa-fw.fa-step-backward
|
||||
span(ng-show="!restoreState.inflight")
|
||||
| Restore this deleted file
|
||||
span(ng-show="restoreState.inflight")
|
||||
| Restoring…
|
||||
span.text-danger(ng-show="restoreState.error")
|
||||
| Error restoring, sorry
|
||||
|
||||
.history-toolbar-entries-list(
|
||||
ng-if="!history.error && history.updates.length > 0"
|
||||
)
|
||||
toggle-switch(
|
||||
ng-model="toolbarUIConfig.showOnlyLabels"
|
||||
label-true=translate("history_view_labels")
|
||||
label-false=translate("history_view_all")
|
||||
description=translate("history_view_a11y_description")
|
||||
)
|
||||
|
||||
script(type="text/ng-template", id="historyV2AddLabelModalTemplate")
|
||||
form(
|
||||
name="addLabelModalForm"
|
||||
ng-submit="addLabelModalFormSubmit();"
|
||||
novalidate
|
||||
)
|
||||
.modal-header
|
||||
h3 #{translate("history_add_label")}
|
||||
.modal-body
|
||||
.alert.alert-danger(ng-show="state.error.message") {{ state.error.message}}
|
||||
.alert.alert-danger(ng-show="state.error && !state.error.message") #{translate("generic_something_went_wrong")}
|
||||
.form-group
|
||||
input.form-control(
|
||||
type="text"
|
||||
placeholder=translate("history_new_label_name")
|
||||
ng-model="inputs.labelName"
|
||||
focus-on="open"
|
||||
required
|
||||
)
|
||||
p.help-block(ng-if="update")
|
||||
| #{translate("history_new_label_added_at")}
|
||||
strong {{ update.meta.end_ts | formatDate:'ddd Do MMM YYYY, h:mm a' }}
|
||||
.modal-footer
|
||||
button.btn.btn-secondary(
|
||||
type="button"
|
||||
ng-disabled="state.inflight"
|
||||
ng-click="$dismiss()"
|
||||
) #{translate("cancel")}
|
||||
input.btn.btn-primary(
|
||||
ng-disabled="addLabelModalForm.$invalid || state.inflight"
|
||||
ng-value="state.inflight ? '" + translate("history_adding_label") + "' : '" + translate("history_add_label") + "'"
|
||||
type="submit"
|
||||
)
|
||||
@@ -10,13 +10,9 @@ include ./left-menu-react
|
||||
.ui-layout-center
|
||||
include ./header-react
|
||||
|
||||
if (!historyViewReact)
|
||||
include ./history/toolbarV2.pug
|
||||
|
||||
main#ide-body(
|
||||
ng-cloak,
|
||||
role="main",
|
||||
ng-class="{ 'ide-history-open' : (ui.view == 'history' && !history.isReact) }",
|
||||
layout="main",
|
||||
ng-hide="state.loading",
|
||||
resize-on="layout:chat:resize,history:toggle,layout:flat-screen:toggle,south-pane-toggled",
|
||||
@@ -31,18 +27,11 @@ include ./left-menu-react
|
||||
)
|
||||
.ui-layout-west
|
||||
include ./file-tree-react
|
||||
if (historyViewReact)
|
||||
include ./file-tree-history-react
|
||||
else
|
||||
include ./history/fileTreeV2
|
||||
include ./file-tree-history-react
|
||||
|
||||
.ui-layout-center
|
||||
include ./editor
|
||||
|
||||
if (historyViewReact)
|
||||
history-root()
|
||||
else
|
||||
include ./history
|
||||
history-root()
|
||||
|
||||
if !isRestrictedTokenMember
|
||||
.ui-layout-east
|
||||
|
||||
@@ -5,7 +5,6 @@ import ToolbarDatetime from './toolbar-datetime'
|
||||
import ToolbarFileInfo from './toolbar-file-info'
|
||||
import ToolbarRestoreFileButton from './toolbar-restore-file-button'
|
||||
import { isFileRemoved } from '../../../utils/file-diff'
|
||||
import SplitTestBadge from '../../../../../shared/components/split-test-badge'
|
||||
|
||||
type ToolbarProps = {
|
||||
diff: Nullable<Diff>
|
||||
@@ -18,10 +17,6 @@ export default function Toolbar({ diff, selection }: ToolbarProps) {
|
||||
|
||||
return (
|
||||
<div className="history-react-toolbar">
|
||||
<SplitTestBadge
|
||||
splitTestName="history-view-version"
|
||||
displayOnVariants={['react']}
|
||||
/>
|
||||
<ToolbarDatetime selection={selection} />
|
||||
{selection.selectedFile?.pathname ? (
|
||||
<ToolbarFileInfo diff={diff} selection={selection} />
|
||||
|
||||
@@ -125,12 +125,6 @@ export default HistoryManager = (function () {
|
||||
)
|
||||
}
|
||||
|
||||
isReact() {
|
||||
return (
|
||||
getMeta('ol-splitTestVariants')?.['history-view-version'] === 'react'
|
||||
)
|
||||
}
|
||||
|
||||
hardReset() {
|
||||
this.$scope.history = {
|
||||
updates: [],
|
||||
@@ -159,7 +153,6 @@ export default HistoryManager = (function () {
|
||||
showOnlyLabels: this._getShowOnlyLabelsUserPref(),
|
||||
labels: null,
|
||||
loadingFileTree: true,
|
||||
isReact: this.isReact(),
|
||||
}
|
||||
const _deregisterFeatureWatcher = this.$scope.$watch(
|
||||
'project.features.versioning',
|
||||
|
||||
@@ -87,9 +87,6 @@
|
||||
background-color: @pdf-bg;
|
||||
.full-size;
|
||||
top: @ide-body-top-offset;
|
||||
&.ide-history-open {
|
||||
top: @ide-body-top-offset + @editor-toolbar-height;
|
||||
}
|
||||
}
|
||||
|
||||
#editor {
|
||||
|
||||
@@ -142,7 +142,6 @@
|
||||
"automatic_user_registration": "automatic user registration",
|
||||
"back": "Back",
|
||||
"back_to_account_settings": "Back to account settings",
|
||||
"back_to_editor": "Back to the editor",
|
||||
"back_to_log_in": "Back to log in",
|
||||
"back_to_subscription": "Back to Subscription",
|
||||
"back_to_your_projects": "Back to your projects",
|
||||
@@ -171,9 +170,6 @@
|
||||
"bonus_share_link_text": "Online LaTeX Editor __appName__",
|
||||
"bonus_twitter_share_text": "I’m using __appName__, the free online collaborative LaTeX editor - it’s awesome and easy to use!",
|
||||
"browser": "Browser",
|
||||
"browsing_project_as_of": "Browsing project as of",
|
||||
"browsing_project_labelled": "Browsing project version labelled",
|
||||
"browsing_project_latest_for_pseudo_label": "Browsing your project’s current state",
|
||||
"built_in": "Built-In",
|
||||
"bulk_accept_confirm": "Are you sure you want to accept the selected __nChanges__ changes?",
|
||||
"bulk_reject_confirm": "Are you sure you want to reject the selected __nChanges__ changes?",
|
||||
@@ -273,7 +269,6 @@
|
||||
"compact": "Compact",
|
||||
"company_name": "Company Name",
|
||||
"compare": "Compare",
|
||||
"compare_to_another_version": "Compare to another version",
|
||||
"comparing_from_x_to_y": "Comparing from <0>__startTime__</0> to <0>__endTime__</0>",
|
||||
"compile_error_entry_description": "An error which prevented this project from compiling",
|
||||
"compile_error_handling": "Compile Error Handling",
|
||||
@@ -424,7 +419,6 @@
|
||||
"dont_have_account": "Don’t have an account?",
|
||||
"download": "Download",
|
||||
"download_pdf": "Download PDF",
|
||||
"download_project_at_this_version": "Download project at this version",
|
||||
"download_zip_file": "Download .zip File",
|
||||
"drag_here": "drag here",
|
||||
"drag_here_paste_an_image_or": "Drag here, paste an image, or ",
|
||||
@@ -643,7 +637,6 @@
|
||||
"gallery_page_title": "Gallery - Templates, Examples and Articles written in LaTeX",
|
||||
"gallery_show_all": "Show all __itemPlural__",
|
||||
"generate_token": "Generate token",
|
||||
"generic_history_error": "Something went wrong trying to fetch your project’s history. If the error persists, please contact us via:",
|
||||
"generic_if_problem_continues_contact_us": "If the problem continues please contact us",
|
||||
"generic_linked_file_compile_error": "This project’s output files are not available because it failed to compile. Please open the project to see the compilation error details.",
|
||||
"generic_something_went_wrong": "Sorry, something went wrong",
|
||||
@@ -760,7 +753,6 @@
|
||||
"history_label_created_by": "Created by",
|
||||
"history_label_project_current_state": "Current state",
|
||||
"history_label_this_version": "Label this version",
|
||||
"history_new_label_added_at": "A new label will be added as of",
|
||||
"history_new_label_name": "New label name",
|
||||
"history_view_a11y_description": "Show all of the project history or only labelled versions.",
|
||||
"history_view_all": "All history",
|
||||
@@ -1151,7 +1143,6 @@
|
||||
"no_existing_password": "Please use the password reset form to set your password",
|
||||
"no_featured_templates": "No featured templates",
|
||||
"no_folder": "No folder",
|
||||
"no_history_available": "This project doesn’t have any history yet. Please make some changes to the project and try again.",
|
||||
"no_image_files_found": "No image files found",
|
||||
"no_members": "No members",
|
||||
"no_messages": "No messages",
|
||||
@@ -1746,7 +1737,6 @@
|
||||
"sure_you_want_to_change_plan": "Are you sure you want to change plan to <0>__planName__</0>?",
|
||||
"sure_you_want_to_delete": "Are you sure you want to permanently delete the following files?",
|
||||
"sure_you_want_to_leave_group": "Are you sure you want to leave this group?",
|
||||
"sure_you_want_to_restore_before": "Are you sure you want to restore <0>__filename__</0> to before the changes on __date__?",
|
||||
"sv": "Swedish",
|
||||
"switch_to_editor": "Switch to editor",
|
||||
"switch_to_pdf": "Switch to PDF",
|
||||
@@ -2030,7 +2020,6 @@
|
||||
"view_metrics_group_subtext": "Monitor and download usage metrics for your group subscription",
|
||||
"view_other_options_to_log_in": "View other options to log in",
|
||||
"view_pdf": "View PDF",
|
||||
"view_single_version": "View single version",
|
||||
"view_source": "View Source",
|
||||
"view_templates": "View templates",
|
||||
"view_which_changes": "View which changes have been",
|
||||
|
||||
Reference in New Issue
Block a user