Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
We adapt the view of the dialogs related with Package#show to use the new frontend framework. Afected dialogs: * Submit request dialog * Delete dialog * Branch dialog * Add role dialog * Linking package dialog * Change devel request project dialog Co-authored-by: Ana María Martínez Gómez <ammartinez@suse.de> Co-authored-by: Moises Deniz Aleman <mdeniz@suse.com>
- Loading branch information
1 parent
30164e4
commit 8c83347
Showing
16 changed files
with
238 additions
and
8 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
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
4 changes: 4 additions & 0 deletions
4
src/api/app/views/webui2/shared/_dialog_action_buttons.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,4 @@ | ||
%button.btn.btn-sm.btn-outline-danger.px-4{ data: { dismiss: 'modal' }} | ||
Cancel | ||
= submit_tag('Accept', class: 'btn btn-sm btn-primary px-4') | ||
|
26 changes: 26 additions & 0 deletions
26
src/api/app/views/webui2/shared/_package_branch_form.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,26 @@ | ||
- if show_project_field | ||
%p | ||
%strong Change Branch Destination | ||
.form-group | ||
%label{ for: 'target_project' } | ||
%strong Branch project name | ||
= text_field_tag 'target_project', target_project, size: 80, maxlength: 200, class: 'form-control' | ||
.form-group | ||
%label{ for: 'target_package' } | ||
%strong Branch package name | ||
= text_field_tag 'target_package', @package.try(:name), size: 80, maxlength: 200, class: 'form-control' | ||
.form-group.form-check | ||
= check_box_tag(:current_revision, false, class: 'form-check-input') | ||
= label_tag(:current_revision, class: 'form-check-label') do | ||
Stay on current revision | ||
- if @revision | ||
(##{@revision}) | ||
- if show_project_field && Configuration.cleanup_after_days | ||
.form-group.form-check | ||
%input.form-check-input#disable-autocleanup{ type: "checkbox" } | ||
%label.form-check-label{ for: 'disable-autocleanup' } Disable Autocleanup | ||
= hidden_field_tag(:autocleanup, true) | ||
:javascript | ||
$("#disable-autocleanup").click(function(){ | ||
$("#autocleanup").val($("#disable-autocleanup").prop("checked") ? "false" : "true"); | ||
}); |
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
25 changes: 25 additions & 0 deletions
25
src/api/app/views/webui2/webui/package/_delete_dialog.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,25 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title Do you really want to delete this package? | ||
.modal-body | ||
- if @package.develpackages.any? | ||
%p | ||
%i.fas.fa-exclamation-circle.text-danger | ||
%span.small Warning: This package is used by the following packages for development | ||
%ul.no-list-style | ||
- @package.develpackages.each do |package| | ||
%li.small | ||
= project_or_package_link(project: package.project.name, package: package.name, short: true) | ||
- else | ||
%p Please confirm deletion of #{package_link @package} | ||
= form_tag({controller: :package, action: :remove}, method: :post) do | ||
= hidden_field_tag(:project, @project) | ||
= hidden_field_tag(:package, @package) | ||
- if @package.develpackages.any? | ||
.form-group.form-check | ||
= check_box_tag(:force, 'cleanup', @cleanup_source, class: 'form-check-input') | ||
= label_tag(:force, 'Delete anyway?', class: 'form-check-label') | ||
|
||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' |
15 changes: 15 additions & 0 deletions
15
src/api/app/views/webui2/webui/package/_linking_packages.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,15 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title Derived Packages | ||
.modal-body | ||
%ul.no-list-style | ||
- @package.linking_packages.each do |linking_package| | ||
- if linking_package.name != @package.name | ||
- name = elide_two(linking_package.project.name, linking_package.name, 46).join(' / ') | ||
- else | ||
- name = elide(linking_package.project.name, 46) | ||
%li= link_to(name, package_show_path(project: linking_package.project.name, package: linking_package.name)) | ||
.modal-footer | ||
%button.btn.btn-sm.btn-outline-danger.px-4{ data: { dismiss: 'modal' }} | ||
Cancel |
52 changes: 52 additions & 0 deletions
52
src/api/app/views/webui2/webui/package/_submit_request_dialog.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,52 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
= form_tag({controller: 'package', action: 'submit_request'}, method: 'post') do | ||
.modal-header | ||
%h5.modal-title Create Submit Request | ||
.modal-body | ||
%p | ||
Do you want to submit #{package_link @package, rev: @revision}? | ||
|
||
= hidden_field_tag(:project, @project) | ||
= hidden_field_tag(:package, @package) | ||
= hidden_field_tag(:rev, @revision) | ||
.form-group | ||
= label_tag(:sourceproject, 'From source project:') | ||
= text_field_tag(:sourceproject, elide(@project.name, 40), disabled: true, class: 'form-control') | ||
.form-group | ||
= label_tag(:targetproject, 'To target project:') | ||
= text_field_tag(:targetproject, @tprj, disabled: params[:readonly], required: true, class: 'form-control', | | ||
data: { autocomplete_url: url_for(controller: :project, action: :autocomplete_projects), | | ||
requests_url: url_for(controller: :request, action: :list_small), | | ||
develpackage_url: url_for(controller: :package, action: :devel_project) }) | ||
- if params[:readonly] | ||
= hidden_field_tag(:targetproject, @tprj) | ||
|
||
.form-group | ||
= label_tag(:targetpackage, 'To target package:') | ||
= text_field_tag(:targetpackage, @tpkg, disabled: params[:readonly], class: 'form-control') | ||
- if params[:readonly] | ||
= hidden_field_tag(:targetpackage, @tpkg) | ||
|
||
.form-group | ||
= label_tag(:description, 'Description:') | ||
~ text_area_tag(:description, @description, size: '40x3', class: 'form-control') | ||
|
||
.form-group.d-none#supersede-display | ||
= label_tag(:supersede_requests, 'Supersede requests:') | ||
%br/ | ||
%span#supersede-requests | ||
|
||
.form-group.form-check#sourceupdate-display | ||
= check_box_tag(:sourceupdate, 'cleanup', @cleanup_source, class: 'form-check-input') | ||
= label_tag(:sourceupdate, 'Remove local package if request is accepted', class: 'form-check-label') | ||
|
||
%p.d-none#devel-project-warning | ||
You are about to bypass the devel project, please submit to | ||
%b#devel-project-name | ||
instead. | ||
|
||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' | ||
|
||
= javascript_tag 'setup_request_dialog();' |
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
25 changes: 25 additions & 0 deletions
25
src/api/app/views/webui2/webui/request/_add_role_request_dialog.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,25 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
= form_tag(action: 'add_role_request', project: @project) do | ||
.modal-header | ||
%h5.modal-title Add Role Request | ||
.modal-body | ||
%p | ||
Do you want to request a role addition to #{project_or_package_link project: @project, package: @package}? | ||
= hidden_field_tag(:package, @package) if defined? @package | ||
.form-group | ||
= label_tag(:role, 'Add role:') | ||
= select_tag(:role, options_for_select([['Maintainer', 'maintainer'], ['Bugowner', 'bugowner']]), class: 'form-control') | ||
.form-group | ||
= label_tag(:user, 'For user:') | ||
= text_field_tag(:user, User.current.login, class: 'form-control' ) | ||
- if defined? @package | ||
.form-group | ||
= label_tag(:target_project, 'In target project:') | ||
= text_field_tag(:target_project, @project, disabled: true, class: 'form-control') | ||
.form-group | ||
= label_tag(:description, 'Description:') | ||
= text_area_tag(:description, '', row: 3, class: 'form-control') | ||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' | ||
|
33 changes: 33 additions & 0 deletions
33
src/api/app/views/webui2/webui/request/_change_devel_request_dialog.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,33 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
= form_tag({ action: :change_devel_request, project: @project, package: @package }, method: :post) do | ||
.modal-header | ||
%h5.modal-title Change Devel Project Request | ||
.modal-body | ||
- if @current_devel_project && @current_devel_package | ||
%p | ||
Do you want to request to change the devel project for #{package_link @package} from | ||
\#{project_or_package_link project: @current_devel_project}? | ||
- else | ||
%p | ||
Do you want to request to set the devel project for #{package_link @package}? | ||
.form-group | ||
- if @current_devel_project && @current_devel_package | ||
= label_tag('devel-project', 'New Devel project (leave free to delete the current one):') | ||
- else | ||
= label_tag('devel-project', 'Devel project:') | ||
= text_field_tag('devel-project', '', required: true, class: 'form-control') | ||
.form-group | ||
= label_tag(:description, 'Description:') | ||
= text_area_tag(:description, '', row: 3, class: 'form-control') | ||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' | ||
|
||
:javascript | ||
$("#devel_project").autocomplete({source: '#{url_for controller: 'project', action: 'autocomplete_projects'}', search: function(event, ui) { | ||
$(this).addClass('loading-spinner'); | ||
}, | ||
response: function(event, ui) { | ||
$(this).removeClass('loading-spinner'); | ||
}, minLength: 2}); | ||
|
20 changes: 20 additions & 0 deletions
20
src/api/app/views/webui2/webui/request/_delete_request_dialog.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,20 @@ | ||
.modal-dialog{ role: 'document' } | ||
.modal-content | ||
= form_tag({ action: :delete_request, project: @project }, method: :post) do | ||
.modal-header | ||
%h5.modal-title Create Delete Request | ||
.modal-body | ||
%p | ||
Do you really want to request the deletion of #{project_or_package_link project: @project, package: @package}? | ||
= hidden_field_tag(:package, @package) if defined? @package | ||
%p | ||
- if defined? @package | ||
.form-group | ||
= label_tag(:target_project, 'In target project:') | ||
= text_field_tag(:target_project, @project, disabled: true, class: 'form-control') | ||
.form-group | ||
= label_tag(:description, 'Please explain why:') | ||
= text_area_tag(:description, '', row: 3, class: 'form-control') | ||
.modal-footer | ||
= render partial: 'webui2/shared/dialog_action_buttons' | ||
|
12 changes: 12 additions & 0 deletions
12
src/api/app/views/webui2/webui/request/_requests_small.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,12 @@ | ||
- if requests.blank? | ||
%p No requests. | ||
- else | ||
%ul.no-list-style | ||
- requests.each do |req| | ||
%li | ||
.form-group.form-check | ||
= check_box_tag('supersede_request_numbers[]', req.number, false, id: "supersede_request_numbers#{req.number}", class: 'form-check-input') | ||
= link_to(req.number, controller: :request, action: :show, number: req.number) | ||
by | ||
= user_with_realname_and_icon(req.creator, short: true) | ||
(#{fuzzy_time(req.created_at)}) |
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,5 @@ | ||
$('#modal').html('<%= raw @dialog_html %>'); | ||
<% unless @dialog_init.blank? -%> | ||
<%= @dialog_init %>(); | ||
<% end -%> | ||
$('#modal').modal('show'); |
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