-
Notifications
You must be signed in to change notification settings - Fork 434
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6164 from krauselukas/feature/staging/delete_stag…
…ing_project Delete Staging Workflows
- Loading branch information
Showing
8 changed files
with
106 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
function setSpinnersForDeletion() { // jshint ignore:line | ||
$("#staging-workflow-delete").on('ajax:beforeSend', function(){ | ||
$(this).find('.delete-spinner').removeClass('d-none'); | ||
}); | ||
|
||
$("#staging-workflow-delete").on('ajax:complete', function(){ | ||
$(this).find('.delete-spinner').addClass('d-none'); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,6 @@ def edit? | |
end | ||
|
||
def destroy? | ||
update? | ||
ProjectPolicy.new(@user, @record.project).destroy? | ||
end | ||
end |
28 changes: 28 additions & 0 deletions
28
src/api/app/views/webui2/webui/staging_workflows/_delete.html.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
%button.btn.btn-danger{ data: { toggle: 'modal', target: '#delete-staging-workflow' } } | ||
Delete Staging Workflow | ||
|
||
.modal.fade{ id: 'delete-staging-workflow', tabindex: -1, role: 'dialog' } | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title | ||
Do you want to delete the staging workflow for #{project.name}? | ||
.modal-body | ||
%p Please confirm deletion of the staging workflow for #{project.name} | ||
= form_tag staging_workflow_path, method: :delete, remote: true, id: 'staging-workflow-delete' do | ||
- if @staging_workflow.staging_projects.any? | ||
%p Check the staging projects you want to be deleted: | ||
- @staging_workflow.staging_projects.each do |staging_project| | ||
.form-check | ||
= check_box_tag 'staging_project_ids[]', staging_project.id, false, class: 'form-check-input' | ||
%label.form-check-label | ||
= staging_project.name | ||
%br | ||
.modal-footer | ||
%i.fas.fa-spinner.fa-spin.delete-spinner.d-none | ||
%button.btn.btn-sm.btn-outline-secondary.px-4{ data: { dismiss: 'modal' } } | ||
Cancel | ||
= submit_tag 'Delete', class: 'btn btn-sm btn-danger px-4' | ||
|
||
= content_for :ready_function do | ||
setSpinnersForDeletion(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters