Skip to content

Commit

Permalink
fix rubocop issues on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
jjabari-op committed Oct 7, 2024
1 parent c80efd4 commit aaf47f5
Showing 1 changed file with 34 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,31 +116,47 @@ def render_journal_type_for_desktop(container)
end

def render_user_name_and_time_for_mobile(container)
container.with_column(
container.with_column(**mobile_container_options) do |user_name_and_time_container|
render_mobile_user_name(user_name_and_time_container)
render_mobile_time_info(user_name_and_time_container)
end
end

def mobile_container_options
{
mr: 1,
classes: "work-packages-activities-tab-journals-item-component-details--user-name-container hidden-for-desktop",
flex_layout: true
) do |user_name_and_time_container|
user_name_and_time_container.with_row(
classes: "work-packages-activities-tab-journals-item-component-details--user-name ellipsis"
) do
truncated_user_name(journal.user)
end
user_name_and_time_container.with_row(flex_layout: true) do |time_container|
if journal.initial?
time_container.with_column(mr: 1) do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) do
I18n.t("activities.work_packages.activity_tab.created_on")
end
end
end
time_container.with_column do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) { format_time(journal.updated_at) }
end
}
end

def render_mobile_user_name(container)
container.with_row(classes: "work-packages-activities-tab-journals-item-component-details--user-name ellipsis") do
truncated_user_name(journal.user)
end
end

def render_mobile_time_info(container)
container.with_row(flex_layout: true) do |time_container|
render_mobile_journal_type(time_container) if journal.initial?
render_mobile_updated_time(time_container)
end
end

def render_mobile_journal_type(container)
container.with_column(mr: 1) do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) do
I18n.t("activities.work_packages.activity_tab.created_on")
end
end
end

def render_mobile_updated_time(container)
container.with_column do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) { format_time(journal.updated_at) }
end
end

def render_updated_time(container)
container.with_column(mr: 1, classes: "hidden-for-mobile") do
render(Primer::Beta::Text.new(font_size: :small, color: :subtle, mt: 1)) { format_time(journal.updated_at) }
Expand Down

0 comments on commit aaf47f5

Please sign in to comment.