-
Notifications
You must be signed in to change notification settings - Fork 437
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move 'Create Package' modal to its own page
Refactor the controllers/routes to make this RESTful and follow Rails conventions. The routes aren't using resources since it's too much work for now with the huge amount of routes in the package_controller.
- Loading branch information
Dany Marcoux
committed
May 14, 2020
1 parent
cc62e11
commit c65f844
Showing
25 changed files
with
1,256 additions
and
2,372 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
93 changes: 49 additions & 44 deletions
93
src/api/app/views/webui/package/_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 |
---|---|---|
@@ -1,46 +1,51 @@ | ||
= render partial: 'webui/project/breadcrumb_items' | ||
|
||
%li.breadcrumb-item.text-word-break-all | ||
- if flipper_responsive? | ||
%i.fa.fa-archive | ||
= link_to(@package, package_show_path(@project, @package)) | ||
- else | ||
= link_to truncate(@package.to_s, length: 50), package_show_path(@project, @package) | ||
- if current_page?(package_add_file_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Add File | ||
- if current_page?(package_view_revisions_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Revisions | ||
- if current_page?(package_requests_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Requests | ||
- if current_page?(package_users_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Users | ||
- if controller_name == 'package' && action_name == 'binaries' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Repository State | ||
- if controller_name == 'package' && action_name == 'binary' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Binary | ||
- if current_page?(package_dependency_path) | ||
%li.breadcrumb-item | ||
= link_to('Binary', package_binary_path(project: @dependant_project, package: @package_name, repository: @dependant_repository, | ||
arch: @arch, filename: @filename)) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Dependency | ||
- if current_page?(package_show_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Overview | ||
- if controller_name == 'package' && action_name == 'live_build_log' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Build Log | ||
- if controller_name == 'package' && action_name == 'statistics' | ||
%li.breadcrumb-item | ||
= link_to 'Repository State', package_binaries_path(@project, @package_name, @repository) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Statistics | ||
- if current_page?(package_view_file_path) | ||
%li.breadcrumb-item.active.text-word-break-all{ 'aria-current' => 'page' } | ||
= truncate(@filename, length: 50) | ||
-# The package doesn't exist in the context of package#new, so we don't check other paths below to avoid exceptions | ||
- if current_page?(new_package_path(@project)) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Create Package | ||
- else | ||
%li.breadcrumb-item.text-word-break-all | ||
- if flipper_responsive? | ||
%i.fa.fa-archive | ||
= link_to(@package, package_show_path(@project, @package)) | ||
- else | ||
= link_to truncate(@package.to_s, length: 50), package_show_path(@project, @package) | ||
- if current_page?(package_add_file_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Add File | ||
- if current_page?(package_view_revisions_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Revisions | ||
- if current_page?(package_requests_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Requests | ||
- if current_page?(package_users_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Users | ||
- if controller_name == 'package' && action_name == 'binaries' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Repository State | ||
- if controller_name == 'package' && action_name == 'binary' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Binary | ||
- if current_page?(package_dependency_path) | ||
%li.breadcrumb-item | ||
= link_to('Binary', package_binary_path(project: @dependant_project, package: @package_name, repository: @dependant_repository, | ||
arch: @arch, filename: @filename)) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Dependency | ||
- if current_page?(package_show_path) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Overview | ||
- if controller_name == 'package' && action_name == 'live_build_log' | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Build Log | ||
- if controller_name == 'package' && action_name == 'statistics' | ||
%li.breadcrumb-item | ||
= link_to 'Repository State', package_binaries_path(@project, @package_name, @repository) | ||
%li.breadcrumb-item.active{ 'aria-current' => 'page' } | ||
Statistics | ||
- if current_page?(package_view_file_path) | ||
%li.breadcrumb-item.active.text-word-break-all{ 'aria-current' => 'page' } | ||
= truncate(@filename, length: 50) |
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,31 @@ | ||
- @pagetitle = "Create Package for #{@project}" | ||
|
||
.row | ||
.col | ||
.card | ||
-# We display the project tabs since we're creating a package in the context of the project `@project` | ||
= render partial: 'webui/project/tabs', locals: { project: @project } | ||
.card-body | ||
.row | ||
.col-12 | ||
%h3= @pagetitle | ||
.col-12.col-md-9.col-lg-6 | ||
= form_for(:package, url: packages_url(@project)) do |f| | ||
.form-group | ||
= f.label(:name) | ||
%abbr.text-danger{ title: 'required' } * | ||
= f.text_field(:name, size: 80, required: true, class: 'form-control', placeholder: 'Enter Name') | ||
.form-group | ||
= f.label(:title) | ||
= f.text_field(:title, size: 80, class: 'form-control', placeholder: 'Enter Title') | ||
.form-group | ||
= f.label(:description) | ||
= f.text_area(:description, cols: 80, rows: 10, class: 'form-control') | ||
- unless @configuration['hide_private_options'] | ||
.form-group.custom-control.custom-checkbox | ||
= check_box_tag :source_protection, 1, false, class: 'custom-control-input', type: 'checkbox' | ||
%label.custom-control-label{ for: 'source_protection' } Deny access to source of package | ||
.form-group.custom-control.custom-checkbox | ||
= check_box_tag :disable_publishing, 1, false, class: 'custom-control-input', type: 'checkbox' | ||
%label.custom-control-label{ for: 'disable_publishing' } Disable build results publishing | ||
= f.submit('Create', class: 'btn btn-primary px-4') |
23 changes: 0 additions & 23 deletions
23
src/api/app/views/webui/project/_create_package_form.html.haml
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
src/api/app/views/webui/project/_create_package_modal.html.haml
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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.