From ef3fedee59e71398214a8d52811c5ab615415954 Mon Sep 17 00:00:00 2001 From: Eva Date: Mon, 3 Jul 2023 12:57:59 +0200 Subject: [PATCH] :bug: Fix some warnings and format some files --- .../app/main/ui/components/dropdown_menu.cljs | 2 +- .../src/app/main/ui/dashboard/sidebar.cljs | 35 ++++++++++--------- .../options/menus/layout_container.cljs | 32 ++++++++--------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/frontend/src/app/main/ui/components/dropdown_menu.cljs b/frontend/src/app/main/ui/components/dropdown_menu.cljs index c397b5c26..75e32b60b 100644 --- a/frontend/src/app/main/ui/components/dropdown_menu.cljs +++ b/frontend/src/app/main/ui/components/dropdown_menu.cljs @@ -25,7 +25,7 @@ on-key-down (gobj/get props "on-key-down") id (gobj/get props "id") klass (gobj/get props "klass") - key (gobj/get props "key") + key (gobj/get props "unique-key") data-test (gobj/get props "data-test")] [:li {:id id :class klass diff --git a/frontend/src/app/main/ui/dashboard/sidebar.cljs b/frontend/src/app/main/ui/dashboard/sidebar.cljs index a494b1b36..571b97fca 100644 --- a/frontend/src/app/main/ui/dashboard/sidebar.cljs +++ b/frontend/src/app/main/ui/dashboard/sidebar.cljs @@ -243,6 +243,7 @@ (when (kbd/enter? event) (team-selected (:default-team-id profile) event))) :id "teams-selector-default-team" + :unique-key "default-team" :klass "team-name"} [:span.team-icon i/logo-icon] [:span.team-text (tr "dashboard.your-penpot")] @@ -256,7 +257,7 @@ (team-selected (:id team-item) event))) :id (str "teams-selector-" (:id team-item)) :klass "team-name" - :key (dm/str (:id team-item))} + :unique-key (dm/str (:id team-item))} [:span.team-icon [:img {:src (cf/resolve-team-photo-url team-item) :alt (:name team-item)}]] @@ -270,7 +271,7 @@ (on-create-clicked event))) :id "teams-selector-create-team" :klass "team-name action" - :key "teams-selector-create-team"} + :unique-key "teams-selector-create-team"} [:span.team-icon.new-team i/close] [:span.team-text (tr "dashboard.create-new-team")]]])) @@ -364,16 +365,16 @@ (when (kbd/enter? event) (go-members))) :id "teams-options-members" - :key "teams-options-members" - :data-test "team-members"} + :unique-key "teams-options-members" + :data-test "team-members"} (tr "labels.members")] [:& dropdown-menu-item {:on-click go-invitations :on-key-down (fn [event] (when (kbd/enter? event) (go-invitations))) :id "teams-options-invitations" - :key "teams-options-invitations" - :data-test "team-invitations"} + :unique-key "teams-options-invitations" + :data-test "team-invitations"} (tr "labels.invitations")] (when (contains? cf/flags :webhooks) @@ -382,7 +383,7 @@ (when (kbd/enter? event) (go-webhooks))) :id "teams-options-webhooks" - :key "teams-options-webhooks"} + :unique-key "teams-options-webhooks"} (tr "labels.webhooks")]) [:& dropdown-menu-item {:on-click go-settings @@ -390,8 +391,8 @@ (when (kbd/enter? event) (go-settings))) :id "teams-options-settings" - :key "teams-options-settings" - :data-test "team-settings"} + :unique-key "teams-options-settings" + :data-test "team-settings"} (tr "labels.settings")] [:hr] @@ -401,8 +402,8 @@ (when (kbd/enter? event) (on-rename-clicked))) :id "teams-options-rename" - :key "teams-options-rename" - :data-test "rename-team"} + :unique-key "teams-options-rename" + :data-test "rename-team"} (tr "labels.rename")]) (cond @@ -412,7 +413,7 @@ (when (kbd/enter? event) (leave-and-close))) :id "teams-options-leave-team" - :key "teams-options-leave-team"} + :unique-key "teams-options-leave-team"} (tr "dashboard.leave-team")] @@ -422,8 +423,8 @@ (when (kbd/enter? event) (on-leave-as-owner-clicked))) :id "teams-options-leave-team" - :key "teams-options-leave-team" - :data-test "leave-team"} + :unique-key "teams-options-leave-team" + :data-test "leave-team"} (tr "dashboard.leave-team")] (> (count members) 1) @@ -432,7 +433,7 @@ (when (kbd/enter? event) (on-leave-clicked))) :id "teams-options-leave-team" - :key "teams-options-leave-team"} + :unique-key "teams-options-leave-team"} (tr "dashboard.leave-team")]) @@ -442,9 +443,9 @@ (when (kbd/enter? event) (on-delete-clicked))) :id "teams-options-delete-team" - :key "teams-options-delete-team" + :unique-key "teams-options-delete-team" :klass "warning" - :data-test "delete-team"} + :data-test "delete-team"} (tr "dashboard.delete-team")])])) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs index a3a388393..1e987b488 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/menus/layout_container.cljs @@ -93,13 +93,13 @@ :space-between i/align-content-row-between :stretch nil)) - (case val - :start i/align-content-row-start - :end i/align-content-row-end - :center i/align-content-row-center - :space-around i/align-content-row-around - :space-between i/align-content-row-between - :stretch nil) + (case val + :start i/align-content-row-start + :end i/align-content-row-end + :center i/align-content-row-center + :space-around i/align-content-row-around + :space-between i/align-content-row-between + :stretch nil) :align-self (if is-col? @@ -275,8 +275,8 @@ {:placeholder "--" :on-change (partial on-change :simple :p1) :on-focus #(do - (dom/select-target %) - (select-paddings true false true false)) + (dom/select-target %) + (select-paddings true false true false)) :value p1}]] [:div.padding-item.tooltip.tooltip-bottom-left @@ -354,7 +354,7 @@ i/auto-gap] [:> numeric-input {:no-validate true :placeholder "--" - :on-focus (fn [event] + :on-focus (fn [event] (select-gap :row-gap) (reset! gap-selected? :row-gap) (dom/select-target event)) @@ -638,12 +638,12 @@ (if (and (not multiple) (:layout values)) [:div.title-actions #_[:div.layout-btns - [:button {:on-click set-flex - :class (dom/classnames - :active (= :flex layout-type))} "Flex"] - [:button {:on-click set-grid - :class (dom/classnames - :active (= :grid layout-type))} "Grid"]] + [:button {:on-click set-flex + :class (dom/classnames + :active (= :flex layout-type))} "Flex"] + [:button {:on-click set-grid + :class (dom/classnames + :active (= :grid layout-type))} "Grid"]] [:button.remove-layout {:on-click on-remove-layout} i/minus]] [:button.add-page {:on-click #(on-add-layout :flex)} i/close])]]