OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Build primerized table
Klaus Zanders817ab1be574c
diff --git a/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb b/modules/costs/app/components/admin/time_entry_activities/index_component.html.erbnew file mode 100644index 00000000000..9884eb58a26--- /dev/null+++ b/modules/costs/app/components/admin/time_entry_activities/index_component.html.erb@@ -0,0 +1,85 @@+<%=+ 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: "Search time entry activity",+ visually_hide_label: true,+ placeholder: "Search time entry activity",+ leading_visual: {+ icon: :search,+ size: :small+ },+ show_clear_button: false,+ data: {+ action: "input->projects--settings--border-box-filter#filterLists",+ "projects--settings--border-box-filter-target": "filter"+ }+ )+ subheader.with_action_button(scheme: :primary) do |button|+ button.with_leading_visual_icon(icon: :plus)+ "Activity"+ end+ end+ end++ flex.with_row do+ render(border_box_container(data: { test_selector: "admin-time-entry-activity" })) do |component|+ component.with_header(font_weight: :bold) { "Time entry activities" }++ if time_entry_activities.empty?+ component.with_row do+ render(Primer::Beta::Text.new(color: :subtle)) { "No activities exist" }+ end+ else+ time_entry_activities.each do |activity|+ component.with_row(test_selector: "time-entry-activity-row-#{activity.id}") do+ flex_layout(align_items: :center, justify_content: :space_between) do |activity_container|+ activity_container.with_column(flex_layout: true) do |activity_info|+ activity_info.with_column(mr: 2) do+ render(Primer::OpenProject::DragHandle.new(draggable: true))+ end++ activity_info.with_column(mr: 2) do+ render(Primer::Beta::Link.new(href: edit_admin_time_entry_activity_path(activity), underline: false)) do+ render(Primer::Beta::Text.new(font_weight: :bold)) { activity.name }+ end+ end++ activity_info.with_column(mr: 2) do+ render(Primer::Beta::Text.new(color: :subtle)) { activity.active? ? "Active" : "Inactive" }+ end+ end++ activity_container.with_column do+ render(Primer::Alpha::ActionMenu.new(test_selector: "op-time-entry-acrtivity--action-menu")) do |menu|+ menu.with_show_button(+ icon: "kebab-horizontal",+ scheme: :invisible,+ "aria-label": "Actions"+ )++ menu.with_item(label: I18n.t(:button_edit), tag: :a, href: edit_admin_time_entry_activity_path(activity)) do |item|+ item.with_leading_visual_icon(icon: :pencil)+ end++ menu.with_item(+ label: I18n.t(:button_delete),+ scheme: :danger,+ tag: :a,+ method: :delete,+ href: admin_time_entry_activity_path(activity)+ ) do |item|+ item.with_leading_visual_icon(icon: :trash)+ end+ end+ end+ end+ end+ end+ end+ end+ end+ end+%>diff --git a/modules/costs/app/components/admin/time_entry_activities/index_component.rb b/modules/costs/app/components/admin/time_entry_activities/index_component.rbnew file mode 100644index 00000000000..35845b2d96d--- /dev/null+++ b/modules/costs/app/components/admin/time_entry_activities/index_component.rb@@ -0,0 +1,49 @@+# frozen_string_literal: true++# -- copyright+# OpenProject is an open source project management software.+# Copyright (C) 2010-2024 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 Admin+ module TimeEntryActivities+ class IndexComponent < ApplicationComponent+ include ApplicationHelper+ include OpPrimer::ComponentHelpers++ options :time_entry_activities++ private++ def wrapper_data_attributes+ {+ # controller: "projects--settings--border-box-filter",+ "application-target": "dynamic"+ }+ end+ end+ end+enddiff --git a/modules/costs/app/views/admin/time_entry_activities/index.html.erb b/modules/costs/app/views/admin/time_entry_activities/index.html.erbindex e66471f304e..73ca6b23379 100644--- a/modules/costs/app/views/admin/time_entry_activities/index.html.erb+++ b/modules/costs/app/views/admin/time_entry_activities/index.html.erb@@ -42,8 +42,4 @@ See COPYRIGHT and LICENSE files for more details.end%>-<ul>-<%- @time_entry_activities.each do |activity| %>- <li><%= activity.name %>-<%- end %>-</ul>+<%= render(Admin::TimeEntryActivities::IndexComponent.new(time_entry_activities: @time_entry_activities)) %>