-
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.
- Loading branch information
Showing
7 changed files
with
234 additions
and
0 deletions.
There are no files selected for viewing
87 changes: 87 additions & 0 deletions
87
app/components/settings/project_life_cycle_step_definitions/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,87 @@ | ||
<%#-- 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. | ||
++#%> | ||
|
||
<%= | ||
flex_layout(data: wrapper_data_attributes) do |flex| | ||
flex.with_row do | ||
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" | ||
} | ||
) | ||
end | ||
end | ||
|
||
flex.with_row do | ||
render(border_box_container(mb: 3)) 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)) { t("settings.project_life_cycle_step_definitions.non_defined") } | ||
end | ||
else | ||
definitions.each do |definition| | ||
component.with_row(data: { "projects--settings--border-box-filter-target": "searchItem" }) do | ||
render(Settings::ProjectLifeCycleStepDefinitions::RowComponent.new(definition)) | ||
end | ||
end | ||
end | ||
end | ||
end | ||
flex.with_row do | ||
render Primer::Beta::Text.new( | ||
display: :none, | ||
data: { | ||
"projects--settings--border-box-filter-target": "noResultsText", | ||
} | ||
) do | ||
I18n.t("js.autocompleter.notFoundText") | ||
end | ||
end | ||
end | ||
%> |
48 changes: 48 additions & 0 deletions
48
app/components/settings/project_life_cycle_step_definitions/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,48 @@ | ||
#-- 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 ApplicationHelper | ||
include OpPrimer::ComponentHelpers | ||
include OpTurbo::Streamable | ||
|
||
options :definitions | ||
|
||
private | ||
|
||
def wrapper_data_attributes | ||
{ | ||
controller: "projects--settings--border-box-filter", | ||
"application-target": "dynamic" | ||
} | ||
end | ||
end | ||
end | ||
end |
48 changes: 48 additions & 0 deletions
48
app/components/settings/project_life_cycle_step_definitions/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,48 @@ | ||
<%#-- 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. | ||
++#%> | ||
|
||
<%= | ||
flex_layout(align_items: :center, | ||
justify_content: :space_between) do |step_container| | ||
step_container.with_column(flex_layout: true) do |title_container| | ||
title_container.with_column(pt: 1, mr: 3) do | ||
render(Primer::Beta::Link.new( | ||
classes: 'filter-target-visible-text', | ||
href: edit_admin_settings_project_life_cycle_step_definition_path(definition), | ||
font_weight: :bold | ||
)) do | ||
definition.name | ||
end | ||
end | ||
title_container.with_column(pt: 1) do | ||
render(Projects::LifeCycleTypeComponent.new(definition)) | ||
end | ||
end | ||
end | ||
%> |
39 changes: 39 additions & 0 deletions
39
app/components/settings/project_life_cycle_step_definitions/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,39 @@ | ||
#-- 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 RowComponent < ApplicationComponent | ||
include ApplicationHelper | ||
include OpPrimer::ComponentHelpers | ||
include OpTurbo::Streamable | ||
|
||
alias_method :definition, :model | ||
end | ||
end | ||
end |
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