-
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
chore: small refactor to remove some uses of status-im in status-im2 #16358
Conversation
@@ -304,7 +305,7 @@ | |||
(re-frame/dispatch [:set-in [:wallet/recipient :searching] | |||
:searching]) | |||
(debounce/debounce-and-dispatch [:wallet.recipient/address-changed | |||
(utils/safe-trim %)] | |||
(utils.string/safe-trim %)] |
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 safe-trim to utils at src/utils
src/status_im/utils/http.cljs
Outdated
@@ -190,7 +190,3 @@ | |||
[url] | |||
(string/lower-case (apply str (map filter-letters-numbers-and-replace-dot-on-dash (url-host url))))) | |||
|
|||
(defn replace-port |
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.
replace-port
only used in chat context, for now moved to utils in status_im2/contexts/chat
.
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.
http will be moved to status-im2, so it's better to keep replace-port 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.
ok cool, I can either add this to that pr or just remove the replace-port
changes and do that in another pr. I will see what's involved.
Any idea where http stuff should go in the codebase?
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.
utils.http
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.
ah okay, thanks @flexsurfer I will sort this!
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.
so I removed the http migrations from this pr and will do it in a follow up as I believe it will be a much bigger pr and want to keep things as focused as possible 👍
@@ -116,16 +116,6 @@ | |||
(gstring/format (str "%." places "f") amount) | |||
(or (str amount) 0)))) | |||
|
|||
(defn safe-trim |
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 safe-trim and safe-replace to utils at src/utils
@@ -4,78 +4,63 @@ | |||
[react-native.gesture :as gesture] | |||
[react-native.reanimated :as reanimated] | |||
[reagent.core :as reagent] | |||
[status-im.utils.utils :as utils.utils] | |||
[react-native.background-timer :as background-timer] |
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.
use background timer from react native tooling in root of src
pan-down? (> evt-translation-y 100) | ||
pan-up? (< evt-translation-y -30)] | ||
(cond | ||
pan-down? (reset-translate-y translate-y) |
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.
removed use of comments and used named vars instead 👍
Jenkins BuildsClick to see older builds (15)
|
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.
better to keep port in http, or move it to utils.http its too genetal, and not related to chat somehow
src/status_im/utils/http.cljs
Outdated
@@ -190,7 +190,3 @@ | |||
[url] | |||
(string/lower-case (apply str (map filter-letters-numbers-and-replace-dot-on-dash (url-host url))))) | |||
|
|||
(defn replace-port |
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.
http will be moved to status-im2, so it's better to keep replace-port here
@@ -50,8 +50,8 @@ | |||
colors/neutral-100-opa-70 | |||
colors/neutral-100-opa-0) | |||
{:keys [background-color opacity]} animations | |||
uri (http/replace-port (:image content) | |||
(rf/sub [:mediaserver/port]))] | |||
uri (chat-utils/replace-port (:image content) |
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 definitely http utils, not chat
@churik I will remove label for the moment as I have to make some small adjustments first. Thanks for adding it initially! :) |
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.
LGTM! Only comment I have is as Andrey mentioned that replace-port
is not specific to chat.
54fdf16
to
2fab8bf
Compare
39% of end-end tests have passed
Failed tests (20)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestGroupChatMultipleDeviceMergedNewUI:
Passed tests (13)Click to expandClass TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestActivityMultipleDevicePR:
|
@J-Son89 can you please check lint? Thanks! |
thanks @churik - sorting now! |
61% of end-end tests have passed
Failed tests (13)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityMultipleDeviceMerged:
Class TestActivityMultipleDevicePR:
Passed tests (20)Click to expandClass TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestCommunityMultipleDeviceMerged:
Class TestCommunityOneDeviceMerged:
|
82% of end-end tests have passed
Failed tests (6)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Passed tests (27)Click to expandClass TestCommunityMultipleDeviceMerged:
Class TestGroupChatMultipleDeviceMergedNewUI:
Class TestActivityCenterContactRequestMultipleDevicePR:
Class TestCommunityOneDeviceMerged:
Class TestOneToOneChatMultipleSharedDevicesNewUi:
Class TestActivityMultipleDevicePR:
|
@churik I can merge? :) |
@J-Son89 yes:) |
not at all, thanks! 🙌 |
This pr includes a few small changes to remove the use of status_im requires within status-im2 namespace.
There are three small changes:
moved safe-trim and safe replace from
src/status_im/utils/utils.cljs
to utils atsrc/utils/string.cljs
updated use of background-timer in toasts to use same feature from
react-native.background-timer
moved
replace-port
function insrc/status_im/utils/http.cljs
tosrc/status_im2/contexts/chat/utils/core.cljs
as this function is only used in the context of chatTo test:
This adds no new functionality as it's just moving code around. But some good places to check are in chat / sending images.
Toasts and also wallet with views related to reciepients 👍