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
primerize session table
Behrokh Satarnejad53865592f571
diff --git a/app/components/users/sessions/row_component.rb b/app/components/users/sessions/row_component.rbindex cabe1f0ce2d..09975f60a3e 100644--- a/app/components/users/sessions/row_component.rb+++ b/app/components/users/sessions/row_component.rb@@ -30,7 +30,7 @@module Usersmodule Sessions- class RowComponent < ::RowComponent+ class RowComponent < ::OpPrimer::BorderBoxRowComponentproperty :firstname, :lastnamedelegate :current_session, to: :table@@ -47,9 +47,7 @@ module Usersenddef is_current # rubocop:disable Naming/PredicateName- if current?- helpers.op_icon "icon-yes"- end+ helpers.op_icon("icon-yes") if current?enddef device@@ -74,22 +72,47 @@ module Usersendend+ def actions+ action_menu+ end++ private+def button_links- [delete_link].compact+ [action_menu]end- def delete_link+ def action_menu+ render(Primer::Alpha::ActionMenu.new(anchor_align: :end)) do |menu|+ menu.with_show_button(+ icon: "kebab-horizontal",+ "aria-label": t(:label_more),+ scheme: :invisible,++ data: { "test-selector": "more-button" }+ )+ delete_action(menu)+ end+ end++ def delete_action(menu)return if current?- link_to(- helpers.op_icon("icon icon-delete"),- { controller: "/my/sessions", action: "destroy", id: session },- class: "button--link",- role: :button,- method: :delete,- data: { confirm: I18n.t(:text_are_you_sure), disable_with: I18n.t(:label_loading) },- title: I18n.t(:button_delete)- )+ menu.with_item(+ label: I18n.t(:button_delete),+ scheme: :danger,+ href: url_for({ controller: "/my/sessions", action: "destroy", id: session }),+ tag: :button,+ form_arguments: { method: :delete },+ content_arguments: {+ data: {+ confirm: I18n.t(:text_are_you_sure),+ disable_with: I18n.t(:label_loading)+ }+ }+ ) do |item|+ item.with_leading_visual_icon(icon: :trash)+ endendendenddiff --git a/app/components/users/sessions/table_component.rb b/app/components/users/sessions/table_component.rbindex f0adacc435d..39246572414 100644--- a/app/components/users/sessions/table_component.rb+++ b/app/components/users/sessions/table_component.rb@@ -27,14 +27,21 @@## See COPYRIGHT and LICENSE files for more details.#++-module Usersmodule Sessions- class TableComponent < ::TableComponent+ class TableComponent < ::OpPrimer::BorderBoxTableComponentcolumns :is_current, :browser, :device, :updated_atsortable_columns :updated_atoptions :current_session+ mobile_columns :is_current, :browser, :device, :updated_at++ def mobile_title+ t("users.sessions.title")+ end+ def has_actions?+ true+ enddef initial_sort%i[updated_at desc]end