-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate linking packages modal and remove outdated methods and routes
Since the linking packages dialog is now a partial which resolves in a bootstrap modal, there are no dedicated controller methods and routes needed anymore. Fixes #8348
- Loading branch information
1 parent
72b7dfa
commit 508b4c8
Showing
5 changed files
with
25 additions
and
30 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
37 changes: 19 additions & 18 deletions
37
src/api/app/views/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 |
---|---|---|
@@ -1,18 +1,19 @@ | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title Derived Packages | ||
.modal-body | ||
%ul.list-unstyled | ||
- @package.linking_packages.each do |linking_package| | ||
:ruby | ||
# FIXME: get rid of these helpers | ||
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) | ||
end | ||
%li= link_to(name, package_show_path(project: linking_package.project.name, package: linking_package.name)) | ||
.modal-footer | ||
%a.btn.btn-sm.btn-outline-danger.px-4{ data: { dismiss: 'modal' } } | ||
Cancel | ||
.modal.fade#linking-packages-modal{ tabindex: -1, role: 'dialog', aria: { labelledby: 'linking-packages-modal-label', hidden: true } } | ||
.modal-dialog.modal-dialog-centered{ role: 'document' } | ||
.modal-content | ||
.modal-header | ||
%h5.modal-title#linking-packages-modal-label Derived Packages | ||
.modal-body | ||
%ul.list-unstyled | ||
- package.linking_packages.each do |linking_package| | ||
:ruby | ||
# FIXME: get rid of these helpers | ||
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) | ||
end | ||
%li= link_to(name, package_show_path(project: linking_package.project.name, package: linking_package.name)) | ||
.modal-footer | ||
%a.btn.btn-sm.btn-outline-danger.px-4{ data: { dismiss: 'modal' } } | ||
Cancel |
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
3 changes: 2 additions & 1 deletion
3
src/api/app/views/webui/package/side_links/_show_derived_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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
%li | ||
%i.fas.fa-info-circle.text-info | ||
= package.linking_packages.size | ||
= link_to('derived packages', linking_packages_path(project: project, package: package), remote: true) | ||
= link_to('derived packages', '#', title: 'derived packages', data: { toggle: 'modal', target: '#linking-packages-modal'}) | ||
= render partial: 'webui/package/linking_packages', locals: { package: package } |
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