Skip to content

Commit

Permalink
[#55021] add id and identifier to project list query
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobias Dillmann committed Sep 11, 2024
1 parent 0bd53cc commit 439e21b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
14 changes: 14 additions & 0 deletions app/components/projects/row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ def required_disk_space
number_to_human_size(project.required_disk_space, precision: 2)
end

def id
content = "".html_safe

content << project.id.to_s
content
end

def identifier
content = "".html_safe

content << project.identifier
content
end

def name
content = content_tag(:i, "", class: "projects-table--hierarchy-icon")

Expand Down
2 changes: 1 addition & 1 deletion app/models/queries/projects/orders/default_order.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ class Queries::Projects::Orders::DefaultOrder < Queries::Orders::Base
self.model = Project

def self.key
/\A(id|created_at|public|lft)\z/
/\A(id|identifier|created_at|public|lft)\z/
end
end
2 changes: 1 addition & 1 deletion app/models/queries/projects/selects/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
# ++

class Queries::Projects::Selects::Default < Queries::Selects::Base
KEYS = %i[status_explanation hierarchy name public description].freeze
KEYS = %i[id identifier status_explanation hierarchy name public description].freeze

def self.key
Regexp.new(KEYS.join("|"))
Expand Down
4 changes: 4 additions & 0 deletions spec/models/queries/projects/project_query_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@
it "lists registered selects" do
expect(instance.available_selects.map(&:attribute))
.to match_array(%i[
id
identifier
name
favored
public
Expand All @@ -151,6 +153,8 @@
it "includes admin columns" do
expect(instance.available_selects.map(&:attribute))
.to match_array(%i[
id
identifier
name
favored
public
Expand Down

0 comments on commit 439e21b

Please sign in to comment.