-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[TS Migration] Migrate WorkspaceProfilePage and WorkspaceProfileCurrencyPage #34897
[TS Migration] Migrate WorkspaceProfilePage and WorkspaceProfileCurrencyPage #34897
Conversation
import withPolicyAndFullscreenLoading from './withPolicyAndFullscreenLoading'; | ||
|
||
const propTypes = { | ||
type WorkspaceSettingsCurrentPageWithOnyxProps = { |
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.
type WorkspaceSettingsCurrentPageWithOnyxProps = { | |
type WorkspaceSettingsCurrentPageOnyxProps = { |
), | ||
isLoadingReportData: PropTypes.bool, | ||
...policyPropTypes, | ||
currencyList: OnyxEntry<Record<string, Currency>>; |
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.
currencyList: OnyxEntry<Record<string, Currency>>; | |
currencyList: OnyxEntry<CurrencyList>; |
Could you create a CurrencyList
type in src/types/onyx/Currency.ts
and use it here and here?
type CurrencyList = Record<string, OnyxTypes.Currency | null>;
|
||
function WorkspaceSettingsCurrencyPage({currencyList, policy, isLoadingReportData}) { | ||
function WorkspaceSettingsCurrencyPage({currencyList, policy, isLoadingReportData}: WorkspaceSettingsCurrentPageProps) { |
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.
function WorkspaceSettingsCurrencyPage({currencyList, policy, isLoadingReportData}: WorkspaceSettingsCurrentPageProps) { | |
function WorkspaceSettingsCurrencyPage({currencyList = {}, policy, isLoadingReportData = true}: WorkspaceSettingsCurrentPageProps) { |
symbol: PropTypes.string.isRequired, | ||
}), | ||
), | ||
currencyList: OnyxEntry<Record<string, Currency>>; |
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.
Same
|
||
function WorkspaceSettingsPage({policy, currencyList, windowWidth, route}) { | ||
function WorkspaceSettingsPage({policy, currencyList, route}: WorkSpaceSettingsPageProps) { |
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.
function WorkspaceSettingsPage({policy, currencyList, route}: WorkSpaceSettingsPageProps) { | |
function WorkspaceSettingsPage({policy, currencyList = {}, route}: WorkSpaceSettingsPageProps) { |
|
||
Policy.updateGeneralSettings(policy.id, values.name.trim(), policy.outputCurrency); | ||
(values: WorkSpaceSettingsPageValues) => { | ||
Policy.updateGeneralSettings(policy?.id ?? '', values.name.trim(), policy?.outputCurrency ?? ''); |
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.
Why was this logic removed?
if (policy.isPolicyUpdating) {
return;
}
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.
isPolicyUpdating doesn't exist on withPolicy hook, this was always coming undefined, I've tested this on web and mobile.
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!
@rushatgabhane Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
# Conflicts: # src/pages/workspace/WorkspaceSettingsPage.tsx
8725ab0
to
4f20d01
Compare
@ruben-rebelo could you please resolve the conflicts, thanks 🙇 |
# Conflicts: # src/ONYXKEYS.ts # src/pages/workspace/WorkspaceOverviewCurrencyPage.js # src/pages/workspace/WorkspaceOverviewPage.js # src/pages/workspace/WorkspaceSettingsCurrencyPage.js # src/pages/workspace/WorkspaceSettingsCurrencyPage.tsx # src/types/onyx/Form.ts # src/types/onyx/index.ts
Hello @rushatgabhane, thank you for the review, I've resolved the conflits! |
Reviewer Checklist
Screenshots/Videos |
We did not find an internal engineer to review this PR, trying to assign a random engineer to #25191 as well as to this PR... Please reach out for help on Slack if no one gets assigned! |
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 looks like the WorkspaceSettingsPage and WorkspaceSettingsCurrencyPage are no longer on main
... did they get removed/refactored with our new navigation? We may not need those components anymore. @ruben-rebelo @rushatgabhane
# Conflicts: # src/ONYXKEYS.ts # src/pages/workspace/WorkspaceOverviewCurrencyPage.js # src/pages/workspace/WorkspaceOverviewCurrencyPage.tsx # src/pages/workspace/WorkspaceProfileCurrencyPage.js
…me to WorkspaceProfile
# Conflicts: # src/libs/UserUtils.ts
Hello @arosiclair and @rushatgabhane It seems that were some file refactoring and renaming happening on WorkspaceSettingsPage and WorkspaceSettingsCurrencyPage. |
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.
@ruben-rebelo can you also update the title and description to match the new files we're migrating? Thanks
# Conflicts: # src/pages/workspace/WorkspaceProfilePage.tsx
@arosiclair I've updated the PR with the suggestions and resolved the conflicts |
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
🚀 Deployed to staging by https://github.com/arosiclair in version: 1.4.44-0 🚀
|
<View> | ||
<MenuItemWithTopDescription | ||
title={formattedCurrency} | ||
description={translate('workspace.editor.currencyInputLabel')} | ||
shouldShowRightIcon={!readOnly} | ||
disabled={hasVBA || readOnly} | ||
disabled={hasVBA ?? readOnly} |
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.
This caused deploy blocker - #37288
During TS migration, please be careful of using nullish coalescing.
🚀 Deployed to production by https://github.com/puneetlath in version: 1.4.44-13 🚀
|
Details
[TS migration] Migrate WorkspaceSettingsPage and WorkspaceSettingsCurrencyPage to TypeScript
Fixed Issues
$ #25191
PROPOSAL: N/A
Tests
Test WorkspaceSettingsPage:
Test WorkspaceSettingsCurrencyPage:
Offline tests
N/A
QA Steps
Same as in the Tests section.
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Android: Native
android-native.mov
Android: mWeb Chrome
android-web.mov
iOS: Native
ios-native.mov
iOS: mWeb Safari
ios-web.mov
MacOS: Chrome / Safari
macos-web.mov
MacOS: Desktop
macos-desktop.mov