-
Notifications
You must be signed in to change notification settings - Fork 433
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 #9605 from dmarcoux/page-request-deletion
Move 'Request Deletion' modal to its own page
- Loading branch information
Showing
18 changed files
with
125 additions
and
143 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
23 changes: 23 additions & 0 deletions
23
src/api/app/controllers/webui/requests/deletions_controller.rb
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,23 @@ | ||
module Webui | ||
module Requests | ||
class DeletionsController < Webui::RequestController | ||
before_action :require_login | ||
before_action :set_package | ||
before_action :set_project | ||
|
||
after_action :verify_authorized | ||
|
||
def new | ||
bs_request_action = BsRequestAction.new(target_package: @package, target_project: @project, type: 'delete') | ||
@bs_request = BsRequest.new(bs_request_actions: [bs_request_action]) | ||
authorize @bs_request, :create? | ||
end | ||
|
||
private | ||
|
||
def bs_request_params | ||
params.require(:bs_request).permit(:description, bs_request_actions_attributes: [:target_project, :target_package, :type]) | ||
end | ||
end | ||
end | ||
end |
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
6 changes: 3 additions & 3 deletions
6
src/api/app/views/webui/package/bottom_actions/_request_deletion.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
%li.list-inline-item | ||
= link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-request-modal' }) do | ||
%i.fas.fa-list-alt.text-danger | ||
Request deletion | ||
= link_to(new_project_package_deletion_path(project, package), class: 'nav-link') do | ||
%i.fas.fa-times-circle.text-danger | ||
Request Deletion |
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
6 changes: 3 additions & 3 deletions
6
src/api/app/views/webui/package/responsive_ux/show_actions/_request_deletion.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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
%li.nav-item | ||
= link_to('#', class: 'nav-link', data: { toggle: 'modal', target: '#delete-request-modal' }) do | ||
%i.fas.fa-list-alt.fa-lg.mr-2 | ||
Request deletion | ||
= link_to(new_project_package_deletion_path(project, package), class: 'nav-link') do | ||
%i.fas.fa-times-circle.fa-lg.mr-2 | ||
Request Deletion |
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
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
30 changes: 0 additions & 30 deletions
30
src/api/app/views/webui/request/_delete_request_dialog.html.haml
This file was deleted.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
src/api/app/views/webui/requests/deletions/_breadcrumb_items.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,7 @@ | ||
- if @package | ||
= render partial: 'webui/package/breadcrumb_items' | ||
- else | ||
= render partial: 'webui/project/breadcrumb_items' | ||
|
||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Request Deletion |
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,36 @@ | ||
- @pagetitle = 'Request Deletion' | ||
|
||
.row | ||
.col | ||
.card | ||
- if @package | ||
= render partial: 'webui/package/tabs', locals: { project: @project, package: @package } | ||
- else | ||
= render partial: 'webui/project/tabs', locals: { project: @project } | ||
.card-body | ||
.row | ||
.col-12 | ||
%h3= @pagetitle | ||
.col-12.col-md-9.col-lg-8 | ||
%p | ||
-# FIXME: get rid of the helper project_or_package_link | ||
Do you really want to request the deletion of | ||
= project_or_package_link(project: @project.name, package: @package.try(:name)) | ||
? | ||
.col-12.col-md-9.col-lg-6 | ||
- form_path = @package ? project_package_role_additions_path(@project, @package) : project_role_additions_path(@project) | ||
= form_for(@bs_request, url: form_path) do |f| | ||
= f.fields_for(:bs_request_actions) do |bs_request_actions| | ||
= bs_request_actions.hidden_field(:target_project) | ||
= bs_request_actions.hidden_field(:type) | ||
- if @package | ||
.form-group | ||
= bs_request_actions.hidden_field(:target_package) | ||
= bs_request_actions.label(:target_project, 'In target project:') | ||
= bs_request_actions.text_field(:target_project, disabled: true, class: 'form-control') | ||
.form-group | ||
= f.label(:description, "Please describe your reasons to request the deletion of this #{@package ? 'package' : 'project'}:") | ||
%abbr.text-danger{ title: 'required' } * | ||
= f.text_area(:description, row: 3, class: 'form-control', required: true) | ||
|
||
= submit_tag('Request', class: 'btn btn-primary px-4') |
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
Oops, something went wrong.