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 the auto login table
Behrokh Satarnejade317d8867e99
diff --git a/app/components/users/auto_login_tokens/row_component.rb b/app/components/users/auto_login_tokens/row_component.rbindex 95c8eeabf9d..d79cc05bf31 100644--- a/app/components/users/auto_login_tokens/row_component.rb+++ b/app/components/users/auto_login_tokens/row_component.rb@@ -30,7 +30,7 @@module Usersmodule AutoLoginTokens- class RowComponent < ::RowComponent+ class RowComponent < ::OpPrimer::BorderBoxRowComponentdelegate :current_token, to: :tabledef token@@ -68,22 +68,47 @@ module Usershelpers.format_date(expires)end+ def actions+ action_menu+ end++ private+def button_links- [delete_link].compact+ [action_menu]+ end++ 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)+ endend- def delete_link+ def delete_action(menu)return if current?- link_to(- helpers.op_icon("icon icon-delete"),- { controller: "/my/auto_login_tokens", action: "destroy", id: token.id },- 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/auto_login_tokens", action: "destroy", id: token.id }),+ 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/auto_login_tokens/table_component.rb b/app/components/users/auto_login_tokens/table_component.rbindex 11c2879d7ea..fc0a6a239c9 100644--- a/app/components/users/auto_login_tokens/table_component.rb+++ b/app/components/users/auto_login_tokens/table_component.rb@@ -30,13 +30,18 @@module Usersmodule AutoLoginTokens- class TableComponent < ::TableComponent+ class TableComponent < ::OpPrimer::BorderBoxTableComponentcolumns :is_current, :browser, :device, :expires_onsortable_columns :updated_atoptions :current_token+ mobile_columns :is_current, :browser, :device, :expires_on- def sortable?- false+ def mobile_title+ t("users.sessions.remembered_devices")+ end++ def has_actions?+ trueenddef headersdiff --git a/app/components/users/sessions/table_component.rb b/app/components/users/sessions/table_component.rbindex 39246572414..17314f0eeaf 100644--- a/app/components/users/sessions/table_component.rb+++ b/app/components/users/sessions/table_component.rb@@ -42,6 +42,7 @@ module Usersdef has_actions?trueend+def initial_sort%i[updated_at desc]end