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
[DDW-881] Enhance logic for updating menus #2838
Conversation
…nu on changes from various stores
…dedicated feature
source/renderer/app/features/menu-updater/makeReactionCallback.js
Outdated
Show resolved
Hide resolved
@szymonmaslowski Here are a couple of scenarios where the "wallet settings" option is still visible and enabled: |
getAssetSettingsDialogWasOpened = (): Promise<boolean> => | ||
LocalStorageApi.get(keys.ASSET_SETTINGS_DIALOG_WAS_OPENED, false); | ||
|
||
setAssetSettingsDialogWasOpened = (): Promise<void> => | ||
LocalStorageApi.set(keys.ASSET_SETTINGS_DIALOG_WAS_OPENED, true); | ||
|
||
unsetAssetSettingsDialogWasOpened = (): Promise<void> => | ||
LocalStorageApi.unset(keys.ASSET_SETTINGS_DIALOG_WAS_OPENED); | ||
|
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.
I removed those three methods since they look like an overhead. We should not use persistent storage to store the information about whether the dialog is open since it is just a runtime information. Except the usage in the AssetsStore
which was just checking whether the dialog was open I didn't found any other usages so they were safe to remove.
Thanks @gabriela-ponce for rising those. |
…ostic dialog and all of Redeem Rewards dialogs
3a070aa
to
2b9d727
Compare
…ove to WalletSendForm
…daedalus into feature/ddw-881
@@ -38,7 +40,15 @@ const makeRebuildApplicationMenu = ({ | |||
send = () => {}, | |||
} = {}): RebuildApplicationMenu => ({ send }: any); | |||
|
|||
const defaultArgs: MakeReactionCallbackArgs = { | |||
const renderComponent = (args) => { | |||
const Component = () => { |
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.
Another suggestion is that you could test the MenuUpdater
to have a better integration test. Currently you are only testing the internal implementation.
function renderComponent(spy) {
return <>
<MenuUpdaterProvider appStore={{}} profileStore={{}} router={{}} stakingStore={{}} uiDialogsStore={{}}>
<MenuUpdater onUpdate={({isNavigationEnabled, walletSettingsState}) => spy({isNavigationEnabled, walletSettingsState})} />
</MenuUpdaterProvider>
}
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.
The MenuUpdater
component itself is not important as its role is only to provide required data using the mobx api. The sole logic is contained in the useMenuUpdater. Testing the MenuUpdater would require from me to involve mobx to testing which IMO is not worth for value it would give. I think we don't need to test things like connecting the component to mobx store
@szymonmaslowski The scenarios were updated according to the new requirements you mentioned. And the latest fixes look good, great job 🚀 I found this issue on build 20711 (doesn't reproduce on develop).
|
The change responsible for opening that dialog should have been missed during merging. It is reverted already and should be working fine now. Thanks @gabriela-ponce. |
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.
Good job 🚀
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.
Great job! 🚀
64014eb
to
54ff345
Compare
Co-authored-by: Michael Chappell <michael.chappell@iohk.io>
Co-authored-by: Michael Chappell <michael.chappell@iohk.io>
Co-authored-by: Michael Chappell <michael.chappell@iohk.io>
This PR:
channel.send()
calls from react components and stores methodsTodos
Screenshots
Testing Checklist
Test scenarios
Scenario 1 - Validate the menu is updated after switching languages
Scenario 2 - Validate the wallet settings option while wallet is selected
Scenario 3 - Validate the wallet settings option while wallet is selected and a dialog is open
Scenario 4 - Validate the wallet settings option while "wallet settings" is visible
Scenario 5 - Validate the wallet settings option when there are no wallets
Scenario 6 - Validate the wallet settings option when no wallet is selected
Scenario 7 - Validate options before initial setup
Review Checklist
Basics
input-output-hk/daedalus-dev
andinput-output-hk/daedalus-qa
assigned as PR reviewersrelease-vNext
,feature
/bug
/chore
,WIP
)yarn manage:translations
produces no changes)yarn storybook
)yarn.lock
file is updatedCode Quality
Testing
After Review