Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#57854] Primerised Meeting index pages #16860

Draft
wants to merge 2 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions app/components/op_primer/border_box_table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ module OpPrimer
class BorderBoxTableComponent < TableComponent
include ComponentHelpers

def before_render
raise ArgumentError, "BorderBoxTableComponent cannot be #sortable?" if sortable?

super
end

def header_args(_column)
{}
end
Expand Down
17 changes: 8 additions & 9 deletions modules/meeting/app/components/meetings/row_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,14 @@
#++

module Meetings
class RowComponent < ::RowComponent
class RowComponent < ::OpPrimer::BorderBoxRowComponent
def column_args(column)
if column == :title
{ style: "grid-column: span 2" }
else
super
end
end
def project_name
helpers.link_to_project model.project, {}, {}, false
end
Expand All @@ -38,14 +45,6 @@ def title
link_to model.title, project_meeting_path(model.project, model)
end

def type
if model.is_a?(StructuredMeeting)
I18n.t("meeting.types.structured")
else
I18n.t("meeting.types.classic")
end
end

def start_time
safe_join([helpers.format_date(model.start_time), helpers.format_time(model.start_time, include_date: false)], " ")
end
Expand Down
32 changes: 13 additions & 19 deletions modules/meeting/app/components/meetings/table_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,32 @@
#++

module Meetings
class TableComponent < ::TableComponent
class TableComponent < ::OpPrimer::BorderBoxTableComponent
options :current_project # used to determine if displaying the projects column

sortable_columns :title, :project_name, :type, :start_time, :duration, :location
columns :title, :project_name, :start_time, :duration, :location

def initial_sort
%i[start_time asc]
end

def sortable_columns_correlation
super.merge(
project_name: "projects.name",
type: "meetings.type"
)
def sortable?
true
end

def initialize_sorted_model
helpers.sort_clear

super
def initial_sort
%i[start_time asc]
end

def paginated?
true
def header_args(column)
if column == :title
{ style: "grid-column: span 2" }
else
super
end
end

def headers
@headers ||= [
[:title, { caption: Meeting.human_attribute_name(:title) }],
current_project.blank? ? [:project_name, { caption: Meeting.human_attribute_name(:project) }] : nil,
[:type, { caption: Meeting.human_attribute_name(:type) }],
[:start_time, { caption: Meeting.human_attribute_name(:start_time) }],
[:start_time, { caption: I18n.t(:label_meeting_date_and_time) }],
[:duration, { caption: Meeting.human_attribute_name(:duration) }],
[:location, { caption: Meeting.human_attribute_name(:location) }]
].compact
Expand Down
2 changes: 2 additions & 0 deletions modules/meeting/config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ en:
label_meeting_open: "Open"
label_meeting_agenda_close: "Close the agenda to begin the Minutes"
label_meeting_date_time: "Date/Time"
label_meeting_date_and_time: "Date and time"
label_meeting_diff: "Diff"
label_upcoming_meetings: "Upcoming meetings"
label_past_meetings: "Past meetings"
Expand All @@ -128,6 +129,7 @@ en:
label_time_zone: "Time zone"
label_start_date: "Start date"


meeting:
attachments:
text: "Attached files are available to all meeting participants. You can also drag and drop these into agenda item notes."
Expand Down
Loading