-
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
Implement WorkspaceMoreFeaturesPage #37441
Implement WorkspaceMoreFeaturesPage #37441
Conversation
@Expensify/design Could you help @rezkiy37 with the icons for the more features page? |
…ture/37373-WorkspaceMoreFeaturesPage
Let me know if these work: MoreFeatureIcons.zip |
Yes, these icons work. Thank you! |
@shawnborton, please provide me subtitles for "Report fields" and "Connections". |
@rezkiy37 Looking in Figma for them. This is what I found: We need to get some clarification on if what you have for "Connections" needs to be moved to it's own card like in the above screenshot. @trjExpensify @JmillsExpensify can you help clarify that? |
Yep, your screenie is correct Danny. Should we hold off on adding the "Integrate" card now and do it in the QBO doc implementation though, @mountiny? From the detailed of QBO:
|
@trjExpensify Ah! Sounds like we should but I'll wait for @mountiny to weigh in. |
…ture/37373-WorkspaceMoreFeaturesPage
@rezkiy37 hmm I don't think we discussed that and right now, that setting lives outside of the policy. I think for now you can continue this PR temporarily using User.isUsingExpensifyCard. We'll probably have to change this later, but I think that should unblock you for now |
@rezkiy37 just chatted with the team and the |
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.
Nice start!
We also only need to show the features that are already implemented with their own page, which might be workflows and categories only at the moment @luacmartins |
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.
@rezkiy37 great job, requested couple of changes!
src/libs/actions/Policy.ts
Outdated
API.write(WRITE_COMMANDS.ENABLE_POLICY_CATEGORIES, parameters, onyxData); | ||
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES.getRoute(policyID)); |
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 think the backTo
is not the best solution here. If user deeplinks to the more features page on mobile from a helpsite for example then enabling a feature will take them to wrong page.
I think we need to use the Navigation.navigate with FORCED_UP style to replace the page with workspace settings page
App/src/libs/actions/Report.ts
Line 1128 in 2c5d6c5
Navigation.navigate(ROUTES.REPORT_WITH_ID.getRoute(report.preexistingReportID), CONST.NAVIGATION.TYPE.FORCED_UP); |
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.
Oh that's a good catch!
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.
Done - 1ec0295.
src/libs/actions/Policy.ts
Outdated
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_CATEGORIES.getRoute(policyID)); | ||
|
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.
src/libs/actions/Policy.ts
Outdated
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_TAGS.getRoute(policyID)); | ||
|
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.
src/libs/actions/Policy.ts
Outdated
API.write(WRITE_COMMANDS.ENABLE_POLICY_TAGS, parameters, onyxData); | ||
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_TAGS.getRoute(policyID)); |
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 comment as above
src/libs/actions/Policy.ts
Outdated
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)); | ||
|
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.
src/libs/actions/Policy.ts
Outdated
API.write(WRITE_COMMANDS.ENABLE_POLICY_WORKFLOWS, parameters, onyxData); | ||
|
||
if (isEnabled) { | ||
const navigationAction = getIsNarrowLayout() ? Navigation.goBack : () => Navigation.navigate(ROUTES.WORKSPACE_WORKFLOWS.getRoute(policyID)); |
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 comment as above
subtitleTranslationKey: TranslationPaths; | ||
isActive: boolean; | ||
action: (isEnabled: boolean) => void; | ||
pendingAction: PendingAction | undefined; |
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 see this is resolved but pendingAction
is still used
{ | ||
icon: Illustrations.Pencil, | ||
titleTranslationKey: 'workspace.moreFeatures.reportFields.title', | ||
subtitleTranslationKey: 'workspace.moreFeatures.reportFields.subtitle', | ||
isActive: policy?.areReportFieldsEnabled ?? false, | ||
pendingAction: policy?.pendingFields?.areReportFieldsEnabled, | ||
action: (isEnabled: boolean) => { | ||
Policy.enablePolicyReportFields(policy?.id ?? '', isEnabled); | ||
}, | ||
}, |
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.
Let's remove these until the report fields are implemented
{ | |
icon: Illustrations.Pencil, | |
titleTranslationKey: 'workspace.moreFeatures.reportFields.title', | |
subtitleTranslationKey: 'workspace.moreFeatures.reportFields.subtitle', | |
isActive: policy?.areReportFieldsEnabled ?? false, | |
pendingAction: policy?.pendingFields?.areReportFieldsEnabled, | |
action: (isEnabled: boolean) => { | |
Policy.enablePolicyReportFields(policy?.id ?? '', isEnabled); | |
}, | |
}, |
const integrateItems: Item[] = [ | ||
{ | ||
icon: Illustrations.Accounting, | ||
titleTranslationKey: 'workspace.moreFeatures.connections.title', | ||
subtitleTranslationKey: 'workspace.moreFeatures.connections.subtitle', | ||
isActive: policy?.areConnectionsEnabled ?? false, | ||
pendingAction: policy?.pendingFields?.areConnectionsEnabled, | ||
action: (isEnabled: boolean) => { | ||
Policy.enablePolicyConnections(policy?.id ?? '', isEnabled); | ||
}, | ||
}, | ||
]; |
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.
Let's remove these until the connections settings is implemented
const integrateItems: Item[] = [ | |
{ | |
icon: Illustrations.Accounting, | |
titleTranslationKey: 'workspace.moreFeatures.connections.title', | |
subtitleTranslationKey: 'workspace.moreFeatures.connections.subtitle', | |
isActive: policy?.areConnectionsEnabled ?? false, | |
pendingAction: policy?.pendingFields?.areConnectionsEnabled, | |
action: (isEnabled: boolean) => { | |
Policy.enablePolicyConnections(policy?.id ?? '', isEnabled); | |
}, | |
}, | |
]; | |
const integrateItems: Item[] = []; |
src/libs/actions/Policy.ts
Outdated
], | ||
}; | ||
|
||
const parameters: EnablePolicyCategoriesParams = {policyID, isEnabled}; |
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 correct API param name is enabled
. We should change it for this and all other commands
const parameters: EnablePolicyCategoriesParams = {policyID, isEnabled}; | |
const parameters: EnablePolicyCategoriesParams = {policyID, enabled}; |
…ture/37373-WorkspaceMoreFeaturesPage
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 think we're just missing using pendingField instead of pendingAction
…ture/37373-WorkspaceMoreFeaturesPage
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.
All looking good now, thank you!
if (policy?.areDistanceRatesEnabled) { | ||
protectedCollectPolicyMenuItems.push({ | ||
translationKey: 'workspace.common.distanceRates', | ||
icon: Expensicons.Car, | ||
action: singleExecution(waitForNavigate(() => Navigation.navigate(ROUTES.WORKSPACE_DISTANCE_RATES.getRoute(policyID)))), | ||
routeName: SCREENS.WORKSPACE.DISTANCE_RATES, | ||
}); | ||
} | ||
|
||
if (policy?.areWorkflowsEnabled) { | ||
protectedCollectPolicyMenuItems.push({ | ||
translationKey: 'workspace.common.workflows', | ||
icon: Expensicons.Workflows, |
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 guess this dictates the order of the buttons if the features are enabled, we might want to update this a bit in future as we will use it in product
subtitleTranslationKey: TranslationPaths; | ||
isActive: boolean; | ||
action: (isEnabled: boolean) => void; | ||
pendingAction: PendingAction | undefined; |
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.
@rezkiy37 updated the pendingAction to pendingFields in onyx, this property is for the component, where pendingAction
makes more sense
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
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 working on this!
🚀 Deployed to staging by https://github.com/mountiny in version: 1.4.51-0 🚀
|
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.
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.
We have a PR handling this #38215
🚀 Deployed to production by https://github.com/luacmartins in version: 1.4.51-3 🚀
|
Details
The PR introduces a new "More features" page of policy settings. It allows the user to manipulate (enable/disable) with features of paid workspaces like categories, tags, report fields and so on. There is a doc and thread about the feature.
Fixed Issues
$ #37373
PROPOSAL: N/A
Tests
Have access to the page
Do not have access to the page
Enable a feature
Disable a feature
Offline tests
Same as "Tests", but verify that a pending effect is applied for a feature that was enabled/disabled.
QA Steps
Same as "Tests" and "Offline tests".
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.mp4
Android: mWeb Chrome
Android.Chrome.mp4
iOS: Native
IOS.mp4
iOS: mWeb Safari
IOS.Safari.mp4
MacOS: Chrome / Safari
Chrome.mp4
Chrome.Offline.mp4
MacOS: Desktop
Desktop.mp4