-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Feature/58161 global stage administration #17358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
1886d1e
[#58161] Global stage administration
toy df017fe
add menu entry
toy 905ce22
make life cycle step definitions default to order by position
toy 5310980
routing
toy fea5dad
index header
toy aee3c30
add form and new/edit actions
toy 1af2048
Project::LifeCycleStepDefinition.with_project_count
toy 425eda7
basic index - list definitions
toy c676588
show project count in index
toy 7b239c8
cleanup row component
toy 418374f
add menu, handle moving and destroying
toy 3255e23
{,row-,column-}gap-? classes
toy 946b6a8
handle drag-n-drop ordering, except for expected turbo stream response
toy 1cb482e
simplify ApplicationRecord.most_recently_changed
toy 5b26a8a
highlight_css_updated_at should depend on Project::LifeCycleStepDefin…
toy 8288304
rename border box filter bulkActionContainer target to hideWhenFiltering
toy 1d75e20
hide movement controls when filtering
toy 68ba0a1
require enterprise token
toy d4c732d
combine subheaders with filter and buttons
toy 2079b57
fix title for form
toy ddec167
handle responses for destroy/move/drop using turbo streams
toy f028c7d
no need for global error messages for life cycle step definition form
toy b7be7f8
move allowed_to_customize_life_cycle? to a module
toy d1c7c87
make both life cycle project settings and definitions list behave whe…
toy 375752c
change heading description
toy 23270b8
fix color input size, after it was enabled by #17482
toy 73fecde
rename update_flash_message_via_turbo_stream to render_flash_message_…
toy 9f066c6
add render_success_flash_message_via_turbo_stream helper method
toy bd09315
banner with schema success when successfully destroying definition
toy 8eebf55
use render_error_flash_message_via_turbo_stream where scheme: :danger…
toy 9aa7332
remove placeholder route for project_life_cycle_step_definitions and …
toy ea9f972
use double quotes
toy d9e750c
feature spec for all actions except moving using handler
toy 1977224
feature spec for moving using handler
toy 8469741
add frozen string literal magic comment
toy 9f6ad47
Using American English
toy 63ecbe0
ensure not showing admin without feature flag set
toy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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
app/components/projects/settings/life_cycle_steps/step_component.html.erb
This file contains hidden or 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 hidden or 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
34 changes: 34 additions & 0 deletions
34
app/components/settings/project_life_cycle_step_definitions/form_header_component.html.erb
This file contains hidden or 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,34 @@ | ||
| <%#-- copyright | ||
| OpenProject is an open source project management software. | ||
| Copyright (C) the OpenProject GmbH | ||
|
|
||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU General Public License version 3. | ||
|
|
||
| OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
| Copyright (C) 2006-2013 Jean-Philippe Lang | ||
| Copyright (C) 2010-2013 the ChiliProject Team | ||
|
|
||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
|
||
| See COPYRIGHT and LICENSE files for more details. | ||
|
|
||
| ++#%> | ||
|
|
||
| <%= render Primer::OpenProject::PageHeader.new do |header| | ||
| header.with_title { t("settings.project_life_cycle_step_definitions.#{heading_scope}.heading") } | ||
| header.with_description { t("settings.project_life_cycle_step_definitions.new.description") } | ||
| header.with_breadcrumbs(breadcrumbs_items) | ||
| end %> |
55 changes: 55 additions & 0 deletions
55
app/components/settings/project_life_cycle_step_definitions/form_header_component.rb
This file contains hidden or 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,55 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| #-- copyright | ||
| # OpenProject is an open source project management software. | ||
| # Copyright (C) the OpenProject GmbH | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License version 3. | ||
| # | ||
| # OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
| # Copyright (C) 2006-2013 Jean-Philippe Lang | ||
| # Copyright (C) 2010-2013 the ChiliProject Team | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| # | ||
| # See COPYRIGHT and LICENSE files for more details. | ||
| #++ | ||
|
|
||
| module Settings | ||
| module ProjectLifeCycleStepDefinitions | ||
| class FormHeaderComponent < ApplicationComponent | ||
| options :heading_scope | ||
|
|
||
| def breadcrumbs_items | ||
| [ | ||
| { | ||
| href: admin_index_path, | ||
| text: t("label_administration") | ||
| }, | ||
| { | ||
| href: admin_settings_project_custom_fields_path, | ||
| text: t("label_project_plural") | ||
| }, | ||
| { | ||
| href: admin_settings_project_life_cycle_step_definitions_path, | ||
| text: t("settings.project_life_cycle_step_definitions.heading") | ||
| }, | ||
| t("settings.project_life_cycle_step_definitions.#{heading_scope}.heading") | ||
| ] | ||
| end | ||
| end | ||
| end | ||
| end |
128 changes: 128 additions & 0 deletions
128
app/components/settings/project_life_cycle_step_definitions/index_component.html.erb
This file contains hidden or 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,128 @@ | ||
| <%#-- copyright | ||
| OpenProject is an open source project management software. | ||
| Copyright (C) the OpenProject GmbH | ||
|
|
||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU General Public License version 3. | ||
|
|
||
| OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
| Copyright (C) 2006-2013 Jean-Philippe Lang | ||
| Copyright (C) 2010-2013 the ChiliProject Team | ||
|
|
||
| This program is free software; you can redistribute it and/or | ||
| modify it under the terms of the GNU General Public License | ||
| as published by the Free Software Foundation; either version 2 | ||
| of the License, or (at your option) any later version. | ||
|
|
||
| This program is distributed in the hope that it will be useful, | ||
| but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| GNU General Public License for more details. | ||
|
|
||
| You should have received a copy of the GNU General Public License | ||
| along with this program; if not, write to the Free Software | ||
| Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
|
|
||
| See COPYRIGHT and LICENSE files for more details. | ||
|
|
||
| ++#%> | ||
|
|
||
| <%= | ||
| component_wrapper do | ||
| flex_layout(data: wrapper_data_attributes) do |flex| | ||
| flex.with_row do | ||
| if allowed_to_customize_life_cycle? | ||
| render(Primer::OpenProject::SubHeader.new) do |subheader| | ||
| subheader.with_filter_input( | ||
| name: "border-box-filter", | ||
| label: t("settings.project_life_cycle_step_definitions.filter.label"), | ||
| visually_hide_label: true, | ||
| placeholder: t("settings.project_life_cycle_step_definitions.filter.label"), | ||
| leading_visual: { | ||
| icon: :search, | ||
| size: :small | ||
| }, | ||
| show_clear_button: true, | ||
| data: { | ||
| action: "input->projects--settings--border-box-filter#filterLists", | ||
| "projects--settings--border-box-filter-target": "filter" | ||
| } | ||
| ) | ||
| subheader.with_action_component do | ||
| render(Primer::Alpha::ActionMenu.new( | ||
| anchor_align: :end) | ||
| ) do |menu| | ||
| menu.with_show_button( | ||
| scheme: :primary, | ||
| aria: { label: I18n.t("settings.project_life_cycle_step_definitions.label_add_description") }, | ||
| ) do |button| | ||
| button.with_leading_visual_icon(icon: :plus) | ||
| button.with_trailing_action_icon(icon: :"triangle-down") | ||
| I18n.t("settings.project_life_cycle_step_definitions.label_add") | ||
| end | ||
|
|
||
| menu.with_item( | ||
| label: I18n.t("settings.project_life_cycle_step_definitions.label_add_stage"), | ||
| href: new_stage_admin_settings_project_life_cycle_step_definitions_path | ||
| ) do |item| | ||
| item.with_leading_visual_icon(icon: "git-commit") | ||
| end | ||
|
|
||
| menu.with_item( | ||
| label: I18n.t("settings.project_life_cycle_step_definitions.label_add_gate"), | ||
| href: new_gate_admin_settings_project_life_cycle_step_definitions_path | ||
| ) do |item| | ||
| item.with_leading_visual_icon(icon: "diamond") | ||
| end | ||
| end | ||
| end | ||
| end | ||
| else | ||
| render EnterpriseEdition::BannerComponent.new(:customize_life_cycle, mb: 3) | ||
| end | ||
| end | ||
|
|
||
| flex.with_row do | ||
| render(border_box_container(mb: 3, data: drop_target_config)) do |component| | ||
| component.with_header(font_weight: :bold, py: 2) do | ||
| flex_layout(justify_content: :space_between, align_items: :center) do |header_container| | ||
| header_container.with_column do | ||
| render(Primer::Beta::Text.new(font_weight: :bold)) do | ||
| I18n.t("settings.project_life_cycle_step_definitions.section_header") | ||
| end | ||
| end | ||
| end | ||
| end | ||
| if definitions.empty? | ||
| component.with_row do | ||
| render(Primer::Beta::Text.new(color: :subtle)) do | ||
| t("settings.project_life_cycle_step_definitions.non_defined") | ||
| end | ||
| end | ||
| else | ||
| definitions.each do |definition| | ||
| component.with_row( | ||
| data: { | ||
| "projects--settings--border-box-filter-target": "searchItem", | ||
| test_selector: "project-life-cycle-step-definition", | ||
| **draggable_item_config(definition) | ||
| } | ||
| ) do | ||
| render(Settings::ProjectLifeCycleStepDefinitions::RowComponent.new( | ||
| definition, | ||
| first?: definition == definitions.first, | ||
| last?: definition == definitions.last, | ||
| )) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| end | ||
| flex.with_row(display: :none, data: { "projects--settings--border-box-filter-target": "noResultsText" }) do | ||
| render Primer::Beta::Text.new do | ||
| I18n.t("js.autocompleter.notFoundText") | ||
| end | ||
| end | ||
| end | ||
| end | ||
| %> |
65 changes: 65 additions & 0 deletions
65
app/components/settings/project_life_cycle_step_definitions/index_component.rb
This file contains hidden or 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,65 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| #-- copyright | ||
| # OpenProject is an open source project management software. | ||
| # Copyright (C) the OpenProject GmbH | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License version 3. | ||
| # | ||
| # OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows: | ||
| # Copyright (C) 2006-2013 Jean-Philippe Lang | ||
| # Copyright (C) 2010-2013 the ChiliProject Team | ||
| # | ||
| # This program is free software; you can redistribute it and/or | ||
| # modify it under the terms of the GNU General Public License | ||
| # as published by the Free Software Foundation; either version 2 | ||
| # of the License, or (at your option) any later version. | ||
| # | ||
| # This program is distributed in the hope that it will be useful, | ||
| # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| # GNU General Public License for more details. | ||
| # | ||
| # You should have received a copy of the GNU General Public License | ||
| # along with this program; if not, write to the Free Software | ||
| # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
| # | ||
| # See COPYRIGHT and LICENSE files for more details. | ||
| #++ | ||
|
|
||
| module Settings | ||
| module ProjectLifeCycleStepDefinitions | ||
| class IndexComponent < ApplicationComponent | ||
| include OpPrimer::ComponentHelpers | ||
| include OpTurbo::Streamable | ||
| include Projects::LifeCycleDefinitionHelper | ||
|
|
||
| options :definitions | ||
|
|
||
| private | ||
|
|
||
| def wrapper_data_attributes | ||
| { | ||
| controller: "projects--settings--border-box-filter generic-drag-and-drop", | ||
| "application-target": "dynamic" | ||
| } | ||
| end | ||
|
|
||
| def drop_target_config | ||
| { | ||
| "is-drag-and-drop-target": true, | ||
| "target-container-accessor": "& > ul", | ||
| "target-allowed-drag-type": "life-cycle-step-definition" | ||
| } | ||
| end | ||
|
|
||
| def draggable_item_config(definition) | ||
| { | ||
| "draggable-type": "life-cycle-step-definition", | ||
| "drop-url": drop_admin_settings_project_life_cycle_step_definition_path(definition) | ||
| } | ||
| end | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job fixing the bug within ferrum. As soon as a new version with your merged PR is released, we can use the original gem once again. 🚀 Do you happen to know when they plan to release a new version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea, I only saw that allowing ferrum dependency to be 0.16.* was merged in cuprite.
Not required for this PR, but I created rubycdp/cuprite#288 to scroll to destination when dragging.