Skip to content

Commit

Permalink
Merge branch 'develop' into milad/19657-remove-watch-only-balance-in-…
Browse files Browse the repository at this point in the history
…overal
  • Loading branch information
mmilad75 committed Apr 22, 2024
2 parents af02dd8 + 96b09eb commit d913140
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 55 deletions.
9 changes: 6 additions & 3 deletions src/quo/components/wallet/account_origin/schema.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@
[:type {:optional true} [:enum :default-keypair :recovery-phrase :private-key]]
[:stored {:optional true} [:enum :on-device :on-keycard]]])

(def ^:private ?keypair-name
[:map
[:keypair-name {:optional true} [:maybe :string]]])

(def ^:private ?default-keypair
[:map
[:user-name {:optional true} [:maybe :string]]
[:profile-picture {:optional true} [:maybe :schema.common/image-source]]
[:derivation-path {:optional true} [:maybe :string]]
[:on-press {:optional true} [:maybe fn?]]
Expand All @@ -23,7 +26,7 @@
[:catn
[:props
[:multi {:dispatch :type}
[:default-keypair [:merge ?base ?default-keypair]]
[:recovery-phrase [:merge ?base ?recovery-phrase]]
[:default-keypair [:merge ?base ?default-keypair ?keypair-name]]
[:recovery-phrase [:merge ?base ?recovery-phrase ?keypair-name]]
[:private-key ?base]]]]
:any])
10 changes: 5 additions & 5 deletions src/quo/components/wallet/account_origin/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
[utils.i18n :as i18n]))

(defn- row-title
[type user-name]
[type keypair-name]
[text/text
{:weight :medium
:size :paragraph-1}
(case type
:default-keypair (i18n/label :t/user-keypair {:name user-name})
:default-keypair (i18n/label :t/user-keypair {:name keypair-name})
:derivation-path (i18n/label :t/derivation-path)
(i18n/label :t/trip-accounts))])
keypair-name)])

(defn- row-icon
[customization-color profile-picture type secondary-color]
Expand Down Expand Up @@ -72,7 +72,7 @@
{:color secondary-color}]])])

(defn- list-view
[{:keys [type stored customization-color profile-picture user-name theme secondary-color]}]
[{:keys [type stored customization-color profile-picture keypair-name theme secondary-color]}]
(let [stored-name (if (= :on-device stored)
(i18n/label :t/on-device)
(i18n/label :t/on-keycard))]
Expand All @@ -81,7 +81,7 @@
:stored stored
:customization-color customization-color
:profile-picture profile-picture
:title user-name
:title keypair-name
:subtitle stored-name
:theme theme
:secondary-color secondary-color}]))
Expand Down
27 changes: 19 additions & 8 deletions src/status_im/contexts/chat/messenger/messages/list/style.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,27 @@
:right 0
:height (+ top-margin messages.constants/header-container-radius)}))

(defn header-bottom-part
[bottom theme top-margin]
(defn header-bottom-container
[bottom top-margin]
(reanimated/apply-animations-to-style
{:bottom bottom}
(merge
(shadows/get 2 theme :inverted)
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
:padding-horizontal 20
:border-radius 20
:margin-top top-margin})))
{:margin-top top-margin}))

(defn header-bottom-part
[theme]
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
:padding-horizontal 20
:border-radius 20})

(defn header-bottom-shadow
[theme]
(assoc
(shadows/get 2 theme :inverted)
:left 0
:right 0
:height 40
:position :absolute
:border-radius 20))

(defn header-image
[scale top left theme]
Expand Down
56 changes: 29 additions & 27 deletions src/status_im/contexts/chat/messenger/messages/list/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -260,33 +260,35 @@
[:<>
[reanimated/view
{:style (style/background-container background-color background-opacity top-margin)}]
[reanimated/view {:style (style/header-bottom-part bottom theme top-margin)}
[list-footer-avatar
{:distance-from-list-top distance-from-list-top
:display-name display-name
:online? online?
:theme theme
:profile-picture photo-path
:group-chat group-chat
:color color
:emoji emoji
:chat-type chat-type
:chat-name chat-name
:last-message last-message}]
[chat-display-name
{:distance-from-list-top distance-from-list-top
:display-name display-name
:theme theme
:contact contact
:group-chat group-chat
:last-message last-message}]
[bio-and-actions
{:distance-from-list-top distance-from-list-top
:bio bio
:chat-id chat-id
:customization-color customization-color
:description description
:last-message last-message}]]]))
[reanimated/view {:style (style/header-bottom-container bottom top-margin)}
[rn/view {:style (style/header-bottom-shadow theme)}]
[rn/view {:style (style/header-bottom-part theme)}
[list-footer-avatar
{:distance-from-list-top distance-from-list-top
:display-name display-name
:online? online?
:theme theme
:profile-picture photo-path
:group-chat group-chat
:color color
:emoji emoji
:chat-type chat-type
:chat-name chat-name
:last-message last-message}]
[chat-display-name
{:distance-from-list-top distance-from-list-top
:display-name display-name
:theme theme
:contact contact
:group-chat group-chat
:last-message last-message}]
[bio-and-actions
{:distance-from-list-top distance-from-list-top
:bio bio
:chat-id chat-id
:customization-color customization-color
:description description
:last-message last-message}]]]]))

(defn list-footer
[props]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@

(defn view
[{:keys [distance-from-list-top chat-screen-layout-calculations-complete?]}]
(let [{:keys [chat-id chat-type last-message]
(let [{:keys [chat-id chat-type]
:as chat} (rf/sub [:chats/current-chat-chat-view])
all-loaded? (reanimated/use-shared-value false)
all-loaded-sub (rf/sub [:chats/all-loaded? chat-id])
Expand All @@ -137,12 +137,11 @@
[all-loaded-sub])
[rn/view
{:style (style/navigation-view navigation-view-height messages.constants/pinned-banner-height)}
(when (seq last-message)
[animated-background-and-pinned-banner
{:chat-id chat-id
:navigation-view-height navigation-view-height
:distance-from-list-top distance-from-list-top
:all-loaded? all-loaded?}])
[animated-background-and-pinned-banner
{:chat-id chat-id
:navigation-view-height navigation-view-height
:distance-from-list-top distance-from-list-top
:all-loaded? all-loaded?}]
[rn/view {:style (style/header-container top-insets top-bar-height)}
[reanimated/view {:style (style/button-animation-container navigation-buttons-opacity)}
[quo/button
Expand Down
6 changes: 4 additions & 2 deletions src/status_im/contexts/wallet/account/tabs/about/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@
[]
(let [{:keys [customization-color] :as profile} (rf/sub [:profile/profile-with-image])
{:keys [address path watch-only?]} (rf/sub [:wallet/current-viewing-account])
{keypair-name :name
keypair-type :type} (rf/sub [:wallet/current-viewing-account-keypair])
networks (rf/sub [:wallet/network-preference-details])]
[rn/scroll-view
{:style style/about-tab
Expand All @@ -88,10 +90,10 @@
:on-press #(rf/dispatch [:show-bottom-sheet {:content about-options}])}]
(when (not watch-only?)
[quo/account-origin
{:type :default-keypair
{:type (if (= keypair-type "seed") :recovery-phrase :default-keypair)
:stored :on-device
:profile-picture (profile.utils/photo profile)
:customization-color customization-color
:derivation-path path
:user-name (profile.utils/displayed-name profile)
:keypair-name keypair-name
:on-press #(js/alert "To be implemented")}])]))
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@
selected-keypair (rf/sub [:wallet/selected-keypair-uid])
profile-picture (rf/sub [:profile/image])
[selected-key-uid set-selected-key-uid] (rn/use-state selected-keypair)]
(rn/use-mount #(rf/dispatch [:wallet/get-keypairs]))
[rn/view {:style {:flex 1}}
[quo/page-nav
{:icon-name :i/close
Expand Down
2 changes: 2 additions & 0 deletions src/status_im/contexts/wallet/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
:wallet/remove-account-success
(fn [_ [toast-message _]]
{:fx [[:dispatch [:wallet/get-accounts]]
[:dispatch [:wallet/get-keypairs]]
[:dispatch-later
{:ms 100
:dispatch [:hide-bottom-sheet]}]
Expand Down Expand Up @@ -183,6 +184,7 @@
:navigate-to-account address
:new-account? true)
:fx [[:dispatch [:wallet/get-accounts]]
[:dispatch [:wallet/get-keypairs]]
[:dispatch [:wallet/clear-new-keypair]]]}))

(rf/reg-event-fx :wallet/add-account
Expand Down
7 changes: 7 additions & 0 deletions src/status_im/subs/wallet/wallet.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,13 @@
(assoc :balance balance
:formatted-balance formatted-balance)))))

(rf/reg-sub
:wallet/current-viewing-account-keypair
:<- [:wallet/current-viewing-account]
:<- [:wallet/keypairs]
(fn [[{:keys [key-uid]} keypairs]]
(first (filter #(= key-uid (:key-uid %)) keypairs))))

(rf/reg-sub
:wallet/current-viewing-account-tokens-in-selected-networks
:<- [:wallet/current-viewing-account]
Expand Down
4 changes: 3 additions & 1 deletion test/appium/support/base_test_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import json
import os
import re
import urllib
from hashlib import md5

from support.test_data import SingleTestData
Expand Down Expand Up @@ -107,8 +108,9 @@ def get_sauce_job_url(self, job_id, first_command=0):

@staticmethod
def get_jenkins_link_to_rerun_e2e(branch_name="develop", pr_id="", tr_case_ids=""):
branch_name = urllib.parse.quote(branch_name)
return 'https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs-rerun/parambuild/' \
'?BRANCH_NAME=%s&PR_ID=%s&APK_URL=%s.apk&TR_CASE_IDS=%s' % (branch_name, pr_id, pr_id, tr_case_ids)
'?BRANCH_NAME=%s&PR_ID=%s&APK_NAME=%s.apk&TR_CASE_IDS=%s' % (branch_name, pr_id, pr_id, tr_case_ids)

def get_sauce_final_screenshot_url(self, job_id):
return 'https://media.giphy.com/media/9M5jK4GXmD5o1irGrF/giphy.gif'
Expand Down
5 changes: 4 additions & 1 deletion test/appium/support/testrail_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ def add_run(self, run_name):
'case_ids': self.get_regression_cases(),
'include_all': False}
run = self.post('add_run/%s' % self.project_id, request_body)
self.run_id = run['id']
try:
self.run_id = run['id']
except KeyError:
print("TestRail error when creating a run: %s" % run)
print("Testrun: %sruns/view/%s" % (self.url, self.run_id))

def get_cases(self, section_ids):
Expand Down

0 comments on commit d913140

Please sign in to comment.