-
Notifications
You must be signed in to change notification settings - Fork 984
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Keypair name handling #19423
feat: Keypair name handling #19423
Conversation
6122bec
to
a6c5bed
Compare
Jenkins BuildsClick to see older builds (29)
|
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
a5f5b4e
to
3a1301c
Compare
Thanks for your reviews @J-Son89 and @ulisesmac ! I have addressed the review comments |
Note regarding QA: There are 2 more follow-up issues for Keypair. To reduce the load on QA I think they can be QAed together in the last one. The code changes should have no side-effects on the current flow. |
e8a4029
to
ec918dc
Compare
src/status_im/contexts/wallet/create_account/new_keypair/keypair_name/view.cljs
Outdated
Show resolved
Hide resolved
ec918dc
to
da96b34
Compare
src/status_im/common/validators.cljs
Outdated
@@ -13,3 +13,11 @@ | |||
(and (string? s) | |||
(not-empty s) | |||
(boolean (re-matches constants/regx-compressed-key s)))) | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm why do we have common/validators
and common/validation?
probably should just be one name space properly organised.
cc @mohsen-ghafouri wdyt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm.. I'll look into it and see if they can be moved over to one file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Personally I don't think we should move to one file, rather one folder with various uses.
E.g
Common/validation/profile
Common/validation/wallet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's good idea to move common regex to different file as validators and also have separate validation file for different use case as you mentioned like validation/profile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moved the ones under validators
to a common namespace: common/validation/general
:size :default | ||
:icon :i/info} | ||
(get error-messages error)])]])) | ||
(def view (quo.theme/with-theme view-internal)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be a line break before this line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me but I think we should clean up the validators/validation organisation properly.
Too often utils just becoming a large bucket of all sorts of functionality and with some categorisation of use cases it becomes a lot easier to maintain.
96% of end-end tests have passed
Failed tests (1)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (46)Click to expandClass TestActivityCenterContactRequestMultipleDevicePR:
Class TestDeepLinksOneDevice:
Class TestActivityMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
|
[floating-button-page/view | ||
{:header [quo/page-nav | ||
{:icon-name :i/arrow-left | ||
:on-press #(rf/dispatch [:navigate-back]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this dispatch could be extracted into a defn
?
:on-press #(rf/dispatch [:navigate-back]) | |
(defn navigate-back [] (rf/dispatch [:navigate-back]) | |
//// | |
:on-press navigate-back |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohsen-ghafouri we can, but is there a meaningful difference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as It doesn't depend on any parameter, it should be outside so that even if it's compared by reference, it will hold equal and not cause unnecessary re-rendering
refer to #19139 (comment)
(<= (count keypair-name) | ||
keypair-name-min-length)) | ||
:customization-color customization-color | ||
:on-press #(rf/dispatch [:wallet/new-keypair-continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should :on-press
and :on-change-text
use hooks as callback?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mohsen-ghafouri why do we need hooks here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry if my comment wasn't clear, it's about new guidelines
We no longer need to create an anonymous function for rendering
https://github.com/status-im/status-mobile/blob/develop/doc/ui-guidelines.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @mohsen-ghafouri :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing the comments @OmarBasem 👍
(> (count value) keypair-name-max-length) (set-error :length) | ||
(validators/has-emojis? value) (set-error :emoji) | ||
(validators/has-special-characters? value) (set-error :special-char) | ||
:else (set-error nil))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
a662cab
to
c7cefc4
Compare
c7cefc4
to
07d41db
Compare
fixes: #19376
This PR implements keypair name error handling.
Designs
Demo:
Screen_Recording_20240327_212951_Status.mp4