Skip to content

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

Fix reactions style (#17869)

Ivan Kuchin41c9cd97f99d
diff --git a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
index 4e4b254e909..a952d1358e4 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.html.erb
@@ -12,14 +12,14 @@
icon: "smiley",
"aria-label": I18n.t("reactions.add_reaction"),
name: I18n.t("reactions.add_reaction"),
- mr: 2,
+ mr: 1,
test_selector: "add-reactions-button"
)
overlay.with_body(pt: 2, test_selector: "emoji-reactions-overlay") do
flex_layout(flex_wrap: :wrap, classes: "op-add-reactions-overlay") do |add_reactions_container|
EmojiReaction.available_emoji_reactions.each do |emoji, reaction|
- add_reactions_container.with_column(mr: 2) do
+ add_reactions_container.with_column(mr: 1) do
render(
Primer::Beta::Button.new(
scheme: button_scheme(reaction),
@@ -34,7 +34,9 @@
turbo_method: :put,
"work-packages--activities-tab--index-target": "reactionButton"
},
- aria: { label: I18n.t("reactions.react_with", reaction: reaction.to_s.humanize(capitalize: false)) }
+ aria: { label: I18n.t("reactions.react_with", reaction: reaction.to_s.humanize(capitalize: false)) },
+ font_size: 4,
+ classes: "op-add-reactions-button"
)
) do
emoji
diff --git a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.sass b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.sass
index bae487d87b6..dbc22364b61 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/add_reactions.sass
+++ b/app/components/work_packages/activities_tab/journals/item_component/add_reactions.sass
@@ -2,3 +2,7 @@
row-gap: var(--base-size-4, 4px)
@media screen and (max-width: $breakpoint-sm)
max-width: 200px
+
+.op-add-reactions-button
+ width: var(--control-medium-size)
+ padding: unset
diff --git a/app/components/work_packages/activities_tab/journals/item_component/reactions.html.erb b/app/components/work_packages/activities_tab/journals/item_component/reactions.html.erb
index f40c99678dd..1408169ae93 100644
--- a/app/components/work_packages/activities_tab/journals/item_component/reactions.html.erb
+++ b/app/components/work_packages/activities_tab/journals/item_component/reactions.html.erb
@@ -3,29 +3,32 @@
if grouped_emoji_reactions.present?
flex_layout(test_selector: "emoji-reactions", flex_wrap: :wrap, classes: "op-emoji-reactions--gap") do |reactions_container|
grouped_emoji_reactions.each do |reaction, data|
- reactions_container.with_column(mr: 2) do
- render(Primer::Beta::Button.new(
- scheme: button_scheme(data[:users]),
- color: :default,
- bg: counter_color(data[:users]),
- id: "#{journal.id}-#{reaction}",
- test_selector: "reaction-#{reaction}",
- tag: :a,
- href: href(reaction:),
- data: {
- turbo_stream: true,
- turbo_method: :put,
- "work-packages--activities-tab--index-target": "reactionButton"
- },
- aria: { label: aria_label_text(reaction, data[:users]) },
- disabled: current_user_cannot_react?,
- classes: "op-reactions-button"
- )) do |button|
- button.with_tooltip(text: number_of_user_reactions_text(data[:users]),
- test_selector: "reaction-tooltip-#{reaction}") do
- button.with_icon(EmojiReactions.emoji(reaction), size: :small)
- end
- "#{EmojiReaction.emoji(reaction)} #{data[:count]}"
+ reactions_container.with_column(mr: 1) do
+ render(
+ Primer::Beta::Button.new(
+ scheme: button_scheme(data[:users]),
+ color: :default,
+ bg: counter_color(data[:users]),
+ id: "#{journal.id}-#{reaction}",
+ test_selector: "reaction-#{reaction}",
+ tag: :a,
+ href: href(reaction:),
+ data: {
+ turbo_stream: true,
+ turbo_method: :put,
+ "work-packages--activities-tab--index-target": "reactionButton"
+ },
+ aria: { label: aria_label_text(reaction, data[:users]) },
+ disabled: current_user_cannot_react?,
+ classes: "op-reactions-button",
+ px: 2
+ )
+ ) do |button|
+ button.with_tooltip(
+ text: number_of_user_reactions_text(data[:users]),
+ test_selector: "reaction-tooltip-#{reaction}"
+ )
+ render(Primer::Beta::Text.new(font_size: 4)) { EmojiReaction.emoji(reaction) } + " #{data[:count]}"
end
end
end
diff --git a/spec/support/finders/test_selector.rb b/spec/support/finders/test_selector_finders.rb
similarity index 100%
rename from spec/support/finders/test_selector.rb
rename to spec/support/finders/test_selector_finders.rb