From f708cdcf5075a26eb929585adb2f311e07b4d694 Mon Sep 17 00:00:00 2001 From: Flavio Fraschetti Date: Thu, 18 Apr 2024 07:44:32 -0300 Subject: [PATCH] Feature flag descoped features from MVP to streamline initial release (#19690) Feature flag descoped features from MVP: - edit derivation path - wallet/send/contacts --- .../confirm_address/view.cljs | 4 +--- .../create_account/select_keypair/view.cljs | 3 --- .../wallet/add_account/create_account/view.cljs | 17 ++++++----------- .../wallet/send/select_address/view.cljs | 4 +++- src/status_im/feature_flags.cljs | 3 ++- src/tests/contract_test/wallet_test.cljs | 1 + 6 files changed, 13 insertions(+), 19 deletions(-) diff --git a/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs index b1a2b5c814..23db69b630 100644 --- a/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs +++ b/src/status_im/contexts/wallet/add_account/add_address_to_watch/confirm_address/view.cljs @@ -25,9 +25,7 @@ (fn [] [rn/view {:style style/container} [create-or-edit-account/view - {:page-nav-right-side [{:icon-name :i/info - :on-press #(js/alert "Get info (to be implemented)")}] - :placeholder placeholder + {:placeholder placeholder :account-name @account-name :account-emoji @account-emoji :account-color @account-color diff --git a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs index 89f2831efb..fb27039cf8 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/select_keypair/view.cljs @@ -20,9 +20,6 @@ :accessibility-label :import-using-phrase :label (i18n/label :t/import-using-phrase) :add-divider? true} - {:icon :i/keycard-card - :accessibility-label :import-from-keycard - :label (i18n/label :t/import-from-keycard)} {:icon :i/key :accessibility-label :import-private-key :label (i18n/label :t/import-private-key)}]]]) diff --git a/src/status_im/contexts/wallet/add_account/create_account/view.cljs b/src/status_im/contexts/wallet/add_account/create_account/view.cljs index 46aadc36cd..1c6102d8d1 100644 --- a/src/status_im/contexts/wallet/add_account/create_account/view.cljs +++ b/src/status_im/contexts/wallet/add_account/create_account/view.cljs @@ -46,19 +46,18 @@ {:title (i18n/label :t/derivation-path) :image :icon :image-props :i/derivated-path - :action :button - :action-props {:on-press #(if (ff/enabled? ::ff/wallet.edit-derivation-path) - (rf/dispatch [:standard-auth/authorize - {:on-auth-success on-auth-success - :auth-button-label (i18n/label :t/continue)}]) - (js/alert "Coming soon!")) + :action (if (ff/enabled? ::ff/wallet.edit-derivation-path) :button :none) + :action-props {:on-press #(rf/dispatch [:standard-auth/authorize + {:on-auth-success on-auth-success + :auth-button-label (i18n/label :t/continue)}]) + :button-text (i18n/label :t/edit) :icon-left :i/face-id :alignment :flex-start} :description :text :description-props {:text formatted-path}}])) -(defn- f-view +(defn- view-internal [_] (let [top (safe-area/get-top) bottom (safe-area/get-bottom) @@ -180,8 +179,4 @@ :derivation-path derivation-path :customization-color customization-color})}]])))) -(defn- view-internal - [] - [:f> f-view]) - (def view (quo.theme/with-theme view-internal)) diff --git a/src/status_im/contexts/wallet/send/select_address/view.cljs b/src/status_im/contexts/wallet/send/select_address/view.cljs index fb0aade3be..ad14c40d3c 100644 --- a/src/status_im/contexts/wallet/send/select_address/view.cljs +++ b/src/status_im/contexts/wallet/send/select_address/view.cljs @@ -11,6 +11,7 @@ [status-im.contexts.wallet.item-types :as types] [status-im.contexts.wallet.send.select-address.style :as style] [status-im.contexts.wallet.send.select-address.tabs.view :as tabs] + [status-im.feature-flags :as ff] [utils.debounce :as debounce] [utils.i18n :as i18n] [utils.re-frame :as rf])) @@ -18,7 +19,8 @@ (def ^:private tabs-data [{:id :tab/recent :label (i18n/label :t/recent) :accessibility-label :recent-tab} {:id :tab/saved :label (i18n/label :t/saved) :accessibility-label :saved-tab} - {:id :tab/contacts :label (i18n/label :t/contacts) :accessibility-label :contacts-tab} + (when (ff/enabled? ::wallet.contacts) + {:id :tab/contacts :label (i18n/label :t/contacts) :accessibility-label :contacts-tab}) {:id :tab/my-accounts :label (i18n/label :t/my-accounts) :accessibility-label :my-accounts-tab}]) (defn- address-input diff --git a/src/status_im/feature_flags.cljs b/src/status_im/feature_flags.cljs index 83325fd2d7..1f331d6e6b 100644 --- a/src/status_im/feature_flags.cljs +++ b/src/status_im/feature_flags.cljs @@ -16,7 +16,8 @@ ::wallet.long-press-watch-only-asset (enabled-in-env? :FLAG_LONG_PRESS_WATCH_ONLY_ASSET_ENABLED) ::wallet.assets-modal-manage-tokens (enabled-in-env? :FLAG_ASSETS_MODAL_MANAGE_TOKENS) ::wallet.assets-modal-hide (enabled-in-env? :FLAG_ASSETS_MODAL_HIDE) - ::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED)})) + ::community.edit-account-selection (enabled-in-env? :FLAG_EDIT_ACCOUNT_SELECTION_ENABLED) + ::wallet.contacts (enabled-in-env? :FLAG_CONTACTS_ENABLED)})) (defn feature-flags [] @feature-flags-config) diff --git a/src/tests/contract_test/wallet_test.cljs b/src/tests/contract_test/wallet_test.cljs index 6fe23900d9..1a52e7ee12 100644 --- a/src/tests/contract_test/wallet_test.cljs +++ b/src/tests/contract_test/wallet_test.cljs @@ -105,6 +105,7 @@ chain-id ens-address)] (assert-address-details response))))) + (defn assert-search-ens [expected-result actual-result] (is (= expected-result actual-result)))