-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feature/40749-consistent-calculation-of-perce…
…nt-complete
- Loading branch information
Showing
397 changed files
with
13,942 additions
and
2,744 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
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
50 changes: 50 additions & 0 deletions
50
...nents/projects/settings/project_custom_field_sections/custom_field_row_component.html.erb
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,50 @@ | ||
<%= | ||
component_wrapper do | ||
flex_layout(align_items: :center, justify_content: :space_between, classes: 'op-project-custom-field', data: { | ||
qa_selector: "project-custom-field-#{@project_custom_field.id}" | ||
}) do |custom_field_container| | ||
custom_field_container.with_column(flex_layout: true) do |title_container| | ||
title_container.with_column(pt: 1, mr: 2) do | ||
render(Primer::Beta::Text.new) do | ||
@project_custom_field.name | ||
end | ||
end | ||
title_container.with_column(pt: 1, mr: 2, data: { qa_selector: "custom-field-type" } ) do | ||
render(Primer::Beta::Text.new(font_size: :small, color: :subtle)) do | ||
@project_custom_field.field_format.capitalize | ||
end | ||
end | ||
if @project_custom_field.required? | ||
title_container.with_column(pt: 1) do | ||
render(Primer::Beta::Label.new(scheme: :attention, size: :medium)) do | ||
t("label_required") | ||
end | ||
end | ||
end | ||
end | ||
# py: 1 quick fix: prevents the row from bouncing as the toggle switch currently changes height while toggling | ||
custom_field_container.with_column(py: 1, mr: 2) do | ||
# buggy currently: | ||
# small variant + status_label_position: :start leads to a small bounce while toggling | ||
# behavior can be seen on primer's viewbook as well -> https://view-components-storybook.eastus.cloudapp.azure.com/view-components/lookbook/inspect/primer/alpha/toggle_switch/small | ||
# quick fix: don't display loading indicator which is causing the bounce | ||
render(Primer::Alpha::ToggleSwitch.new( | ||
src: toggle_project_settings_project_custom_fields_path( | ||
project_custom_field_project_mapping: { | ||
project_id: @project.id, | ||
custom_field_id: @project_custom_field.id | ||
} | ||
), | ||
csrf_token: form_authenticity_token, | ||
data: { 'turbo-method': :put, 'turbo-stream': true, | ||
qa_selector: "toggle-project-custom-field-mapping-#{@project_custom_field.id}" }, | ||
checked: active_in_project?, | ||
enabled: !@project_custom_field.required?, # required fields cannot be disabled | ||
size: :small, | ||
status_label_position: :start, | ||
classes: "op-primer-adjustments__toggle-switch--hidden-loading-indicator", | ||
)) | ||
end | ||
end | ||
end | ||
%> |
59 changes: 59 additions & 0 deletions
59
app/components/projects/settings/project_custom_field_sections/custom_field_row_component.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,59 @@ | ||
#-- copyright | ||
# OpenProject is an open source project management software. | ||
# Copyright (C) 2012-2023 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 Projects | ||
module Settings | ||
module ProjectCustomFieldSections | ||
class CustomFieldRowComponent < ApplicationComponent | ||
include ApplicationHelper | ||
include OpPrimer::ComponentHelpers | ||
include OpTurbo::Streamable | ||
|
||
def initialize(project:, project_custom_field:) | ||
super | ||
|
||
@project = project | ||
@project_custom_field = project_custom_field | ||
@project_custom_field_project_mappings = project.project_custom_field_project_mappings | ||
end | ||
|
||
private | ||
|
||
def wrapper_uniq_by | ||
@project_custom_field.id | ||
end | ||
|
||
def active_in_project? | ||
@project_custom_field_project_mappings.any? do |mapping| | ||
mapping.custom_field_id == @project_custom_field.id | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end |
33 changes: 33 additions & 0 deletions
33
app/components/projects/settings/project_custom_field_sections/index_component.html.erb
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 @@ | ||
<%= | ||
component_wrapper(data: wrapper_data_attributes) do | ||
flex_layout do |flex| | ||
flex.with_row(mt: 3) do | ||
render(Primer::Alpha::TextField.new( | ||
name: "project-custom-fields-mapping-filter", | ||
label: t('projects.settings.project_custom_fields.filter.label'), | ||
visually_hide_label: true, | ||
placeholder: t('projects.settings.project_custom_fields.filter.label'), | ||
leading_visual: { | ||
icon: :search, | ||
size: :small | ||
}, | ||
show_clear_button: true, | ||
clear_button_id: "project-custom-fields-mapping-filter-clear-button", | ||
data: { | ||
action: "input->projects--settings--project-custom-fields-mapping-filter#filterLists", | ||
"projects--settings--project-custom-fields-mapping-filter-target": "filter" | ||
} | ||
)) | ||
end | ||
|
||
@project_custom_field_sections.each do |project_custom_field_section| | ||
flex.with_row do | ||
render(Projects::Settings::ProjectCustomFieldSections::ShowComponent.new( | ||
project: @project, | ||
project_custom_field_section: | ||
)) | ||
end | ||
end | ||
end | ||
end | ||
%> |
55 changes: 55 additions & 0 deletions
55
app/components/projects/settings/project_custom_field_sections/index_component.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,55 @@ | ||
#-- copyright | ||
# OpenProject is an open source project management software. | ||
# Copyright (C) 2012-2023 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 Projects | ||
module Settings | ||
module ProjectCustomFieldSections | ||
class IndexComponent < ApplicationComponent | ||
include ApplicationHelper | ||
include OpPrimer::ComponentHelpers | ||
include OpTurbo::Streamable | ||
|
||
def initialize(project:, project_custom_field_sections:) | ||
super | ||
|
||
@project = project | ||
@project_custom_field_sections = project_custom_field_sections | ||
end | ||
|
||
private | ||
|
||
def wrapper_data_attributes | ||
{ | ||
controller: 'projects--settings--project-custom-fields-mapping-filter', | ||
'application-target': 'dynamic' | ||
} | ||
end | ||
end | ||
end | ||
end | ||
end |
3 changes: 3 additions & 0 deletions
3
app/components/projects/settings/project_custom_field_sections/index_component.sass
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,3 @@ | ||
.Box | ||
.hidden-by-filter | ||
display: none |
Oops, something went wrong.