mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
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:
parent
3afaa258f1
commit
c4b9cc1e25
4 changed files with 5 additions and 50 deletions
|
@ -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")
|
||||
|
|
|
@ -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")}
|
||||
|
||||
|
|
|
@ -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")
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue