Merge pull request #3539 from overleaf/em-jel-error-dialog

Fix dismiss button in general error dialog

GitOrigin-RevId: b06f4fa3f6a8dc05065ffd1b09b18f5bb77c880c
This commit is contained in:
Eric Mc Sween 2021-01-14 09:01:17 -05:00 committed by Copybot
parent 3afaa258f1
commit c4b9cc1e25
4 changed files with 5 additions and 50 deletions

View file

@ -62,16 +62,14 @@ td.project-list-table-lastupdated-cell
td.project-list-table-actions-cell
div(
ng-if="!project.isTableActionInflight"
)
div
button.btn.btn-link.action-btn(
ng-if="!(project.archived || project.trashed)"
aria-label=translate('copy'),
tooltip=translate('copy'),
tooltip-placement="top",
tooltip-append-to-body="true",
ng-click="clone($event)"
ng-click="openCloneProjectModal(project)"
)
i.icon.fa.fa-files-o(aria-hidden="true")
button.btn.btn-link.action-btn(
@ -136,8 +134,3 @@ td.project-list-table-actions-cell
ng-click="delete($event)"
)
i.icon.fa.fa-ban(aria-hidden="true")
div(
ng-if="project.isTableActionInflight"
aria-label=translate('processing')
)
i.fa.fa-spinner.fa-spin(aria-hidden="true")

View file

@ -293,23 +293,3 @@ script(type="text/ng-template", id="uploadProjectModalTemplate")
)
.modal-footer
button.btn.btn-default(ng-click="cancel()") #{translate("cancel")}
script(type="text/ng-template", id="showErrorModalTemplate")
.modal-header
button.close(
type="button"
data-dismiss="modal"
ng-click="cancel()"
aria-label="Close"
)
span(aria-hidden="true") ×
h3 #{translate("generic_something_went_wrong")}
.modal-body
.alert.alert-danger(ng-show="error.message") {{error.message === "invalid element name" ? "#{translate("invalid_element_name")}" : error.message}}
.alert.alert-danger(ng-show="error && !error.message") #{translate("generic_something_went_wrong")}
.modal-footer
button.btn.btn-default(ng-click="cancel()") #{translate("cancel")}
.modal-footer
button.btn.btn-info(ng-click="done()") #{translate("done")}

View file

@ -113,7 +113,7 @@
li
a(
href,
ng-click="openCloneProjectModal()"
ng-click="openCloneProjectModal(getFirstSelectedProject())"
) #{translate("make_copy")}
.btn-group(ng-show="filter === 'archived' && selectedProjects.length > 0")

View file

@ -530,8 +530,7 @@ App.controller('ProjectPageController', function(
})
}
$scope.openCloneProjectModal = function() {
let project = $scope.getFirstSelectedProject()
$scope.openCloneProjectModal = function(project) {
if (!project) {
return
}
@ -877,24 +876,7 @@ App.controller('ProjectListItemController', function(
$scope.clone = function(e) {
e.stopPropagation()
$scope.project.isTableActionInflight = true
return $scope
.cloneProject($scope.project, `${$scope.project.name} (Copy)`)
.then(() => ($scope.project.isTableActionInflight = false))
.catch(function(response) {
const { data, status } = response
const error = status === 400 ? { message: data } : true
$modal.open({
templateUrl: 'showErrorModalTemplate',
controller: 'ShowErrorModalController',
resolve: {
error() {
return error
}
}
})
$scope.project.isTableActionInflight = false
})
$scope.openCloneProjectModal($scope.project)
}
$scope.download = function(e) {