-
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
Malli schemas added to components #18949
Conversation
Jenkins BuildsClick to see older builds (35)
|
As we discovered in other Malli pr's we can easily introduce changes that break the schema within the application code. Can we make it a standard practice for the developer to navigate to pages that use components with a new schema and check if everything is okay across all uses of the respective component? has to be done in a dev build ofc |
5fe5e90
to
9df4a90
Compare
@@ -102,7 +102,7 @@ | |||
[details-view props]]] | |||
[rn/flat-list | |||
{:data accounts | |||
:render-fn account-list-card/view | |||
:render-fn (fn [item _rest&] [account-list-card/view item]) |
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.
Here we can just pass :render-fn account-list-card/view
no? The ampersand is a bit weird, I've never seen it like that.
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.
That ampersand was a misprint, can be ignored, already fixed)
@@ -15,6 +15,6 @@ | |||
:parent-height 560 | |||
:animated? false}] | |||
[rn/flat-list | |||
{:render-fn quo/token-value | |||
{:render-fn (fn [item & _rest] [quo/token-value item]) |
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.
@vkjr, could you expand on why are we wrapping the function token-value
?
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 turned out that :render-fn
receives bunch of arguments and value from data
goes as a first argument, whereas all others cause schema error. So I had to leave them out.
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.
Since we have a recommendation to only pass non-anonymous functions to flat-list
, I think it would be better to extract to a separate function. It's verbose, but at least we don't pay any cost in production runtime.
modified src/status_im/contexts/wallet/home/tabs/assets/view.cljs
@@ -5,6 +5,10 @@
[status-im.contexts.wallet.home.tabs.assets.style :as style]
[utils.re-frame :as rf]))
+(defn- token-value
+ [item & _]
+ [quo/token-value item])
+
(defn view
[]
(let [tokens-loading? (rf/sub [:wallet/tokens-loading?])
@@ -15,6 +19,6 @@
:parent-height 560
:animated? false}]
[rn/flat-list
- {:render-fn (fn [item & _rest] [quo/token-value item])
+ {:render-fn token-value
:data tokens
:content-container-style style/list-container}])))
[:percentage-change {:optional true} :string] | ||
[:fiat-change {:optional true} :string]]) | ||
|
||
(def ^private ?schema |
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.
Just saw there's a minor typo, missing colon to make it metadata. There are many instances of this typo in the PR. Sorry I missed this in previous review pass.
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 noticing!
162b8fa
to
fde92e3
Compare
43f0c58
to
f411eb8
Compare
65% of end-end tests have passed
Failed tests (16)Click to expandClass TestCommunityMultipleDeviceMergedTwo:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (31)Click to expandClass TestActivityMultipleDevicePRTwo:
Class TestCommunityOneDeviceMerged:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestDeepLinksOneDevice:
|
88% of end-end tests have passed
Failed tests (5)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMergedTwo:
Expected to fail tests (1)Click to expandClass TestCommunityOneDeviceMerged:
Passed tests (42)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestDeepLinksOneDevice:
Class TestOneToOneChatMultipleSharedDevicesNewUiTwo:
Class TestCommunityMultipleDeviceMergedTwo:
Class TestCommunityOneDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePR:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityMultipleDevicePRTwo:
Class TestGroupChatMultipleDeviceMergedNewUI:
|
@vkjr thanks for the PR. Failed e2e are not PR related |
fixes #18353
Summary
Malli schemas added to following components:
Quo / List Item
Component tests fixed
status: ready