Skip to content

Commit b1f64b9

Browse files
vharmainclaude
andcommitted
Migrate itrs-segment component from UIX to Reagent 2.0
Post-merge fix: this component came from feature/itrs-classification and still used defui/$, which broke the production build after merging the UIX removal branch. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6ab0f81 commit b1f64b9

File tree

1 file changed

+57
-57
lines changed

1 file changed

+57
-57
lines changed

webapp/src/cljs/lipas/ui/map/views.cljs

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -606,69 +606,69 @@
606606
(defmethod popup-body :route-part-difficulty [popup]
607607
[route-part-difficulty {:data (:data popup)}])
608608

609-
(defui itrs-segment [{:keys [data]}]
609+
(r/defc itrs-segment [{:keys [data]}]
610610
(let [{:keys [lipas-id fid]} data
611-
tr (use-subscribe [:lipas.ui.subs/translator])
611+
tr @(rf/subscribe [:lipas.ui.subs/translator])
612612
locale (tr)
613-
properties (use-subscribe [::subs/edit-geom-properties fid])
613+
properties @(rf/subscribe [::subs/edit-geom-properties fid])
614614
technical-value (:itrs-technical properties)
615615
exposure-value (:itrs-exposure properties)]
616-
($ Paper
617-
{:sx
618-
#js {:padding 2
619-
:width "350px"}}
620-
($ TextField
621-
{:label (tr :map/itrs-technical)
622-
:select true
623-
:fullWidth true
624-
:value (or technical-value "")
625-
:onChange (fn [e]
626-
(rf/dispatch [::events/set-itrs-technical lipas-id fid (.. e -target -value)]))
627-
:sx #js {:marginBottom 2}}
628-
($ MenuItem
629-
{:key "empty"
630-
:value ""}
631-
"-")
632-
(for [[k {:keys [label description]}] activities-data/itrs-technical-options]
633-
($ MenuItem
634-
{:key k
635-
:value k
636-
:sx #js {:flexDirection "column"
637-
:alignItems "flex-start"
638-
:maxWidth "350px"}}
639-
($ Typography
640-
(get label locale))
641-
($ Typography
642-
{:sx #js {:fontSize "body2.fontSize"
643-
:whiteSpace "normal"}}
644-
(get description locale)))))
645-
($ TextField
646-
{:label (tr :map/itrs-exposure)
647-
:select true
648-
:fullWidth true
649-
:value (or exposure-value "")
650-
:onChange (fn [e]
651-
(rf/dispatch [::events/set-itrs-exposure lipas-id fid (.. e -target -value)]))}
652-
($ MenuItem
653-
{:key "empty"
654-
:value ""}
655-
"-")
656-
(for [[k {:keys [label description]}] activities-data/itrs-exposure-options]
657-
($ MenuItem
658-
{:key k
659-
:value k
660-
:sx #js {:flexDirection "column"
661-
:alignItems "flex-start"
662-
:maxWidth "350px"}}
663-
($ Typography
664-
(get label locale))
665-
($ Typography
666-
{:sx #js {:fontSize "body2.fontSize"
667-
:whiteSpace "normal"}}
668-
(get description locale))))))))
616+
[:> Paper
617+
{:sx
618+
#js {:padding 2
619+
:width "350px"}}
620+
[:> TextField
621+
{:label (tr :map/itrs-technical)
622+
:select true
623+
:fullWidth true
624+
:value (or technical-value "")
625+
:onChange (fn [e]
626+
(rf/dispatch [::events/set-itrs-technical lipas-id fid (.. e -target -value)]))
627+
:sx #js {:marginBottom 2}}
628+
[:> MenuItem
629+
{:key "empty"
630+
:value ""}
631+
"-"]
632+
(for [[k {:keys [label description]}] activities-data/itrs-technical-options]
633+
[:> MenuItem
634+
{:key k
635+
:value k
636+
:sx #js {:flexDirection "column"
637+
:alignItems "flex-start"
638+
:maxWidth "350px"}}
639+
[:> Typography
640+
(get label locale)]
641+
[:> Typography
642+
{:sx #js {:fontSize "body2.fontSize"
643+
:whiteSpace "normal"}}
644+
(get description locale)]])]
645+
[:> TextField
646+
{:label (tr :map/itrs-exposure)
647+
:select true
648+
:fullWidth true
649+
:value (or exposure-value "")
650+
:onChange (fn [e]
651+
(rf/dispatch [::events/set-itrs-exposure lipas-id fid (.. e -target -value)]))}
652+
[:> MenuItem
653+
{:key "empty"
654+
:value ""}
655+
"-"]
656+
(for [[k {:keys [label description]}] activities-data/itrs-exposure-options]
657+
[:> MenuItem
658+
{:key k
659+
:value k
660+
:sx #js {:flexDirection "column"
661+
:alignItems "flex-start"
662+
:maxWidth "350px"}}
663+
[:> Typography
664+
(get label locale)]
665+
[:> Typography
666+
{:sx #js {:fontSize "body2.fontSize"
667+
:whiteSpace "normal"}}
668+
(get description locale)]])]]))
669669

670670
(defmethod popup-body :itrs-segment [popup]
671-
($ itrs-segment {:data (:data popup)}))
671+
[itrs-segment {:data (:data popup)}])
672672

673673
(defmethod popup-body :heatmap [popup]
674674
(let [tr (<== [:lipas.ui.subs/translator])

0 commit comments

Comments
 (0)