Skip to content

Commit

Permalink
fix: request reviewer buttons render "show more"
Browse files Browse the repository at this point in the history
Some actions, e.g links pass :text attribute instead of :label, and collapsible base action happened to only expect :label, which is the preferred way to pass label. Due to this cascade, request review action links rendered collapsible default "show more" instead of the actual translation.
  • Loading branch information
aatkin committed Nov 25, 2024
1 parent e0efd95 commit 21e245c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cljs/rems/collapsible.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,19 @@

(defn- base-action
"Base attributes for collapsible action."
[{:keys [collapsible-id label] :as action}]
[{:keys [collapsible-id] :as action}]
(let [state @(rf/subscribe [::expanded collapsible-id])]
(-> action
(dissoc :collapsible-id :hide? :on-close :on-open :show?)
(assoc :aria-controls collapsible-id
:aria-expanded (if state
"true"
"false"))
(assoc-some :label (cond label nil
state (text :t.collapse/hide)
:else (text :t.collapse/show))))))
(assoc-some :label (when-not (or (:label action)
(:text action))
(if state
(text :t.collapse/hide)
(text :t.collapse/show)))))))

(defn focus-on-first-input [id]
(focus/scroll-into-view-and-focus (rfmt/format "#%s .collapse-open :is(textarea, input)" id)))
Expand Down

0 comments on commit 21e245c

Please sign in to comment.