-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[Free trial] Implement Restricted Action screen #43855
[Free trial] Implement Restricted Action screen #43855
Conversation
@hoangzinh 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] |
src/pages/RestrictedAction/Workspace/WorkspaceRestrictedActionPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceUserRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceRestrictedActionPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceAdminRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
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.
left comments
src/languages/es.ts
Outdated
@@ -2721,6 +2721,18 @@ export default { | |||
errorDescriptionPartTwo: 'contacta con el conserje', | |||
errorDescriptionPartThree: 'por ayuda.', | |||
}, | |||
restrictedAction: { | |||
restricted: 'Restringido', | |||
actionsAreCurrentlyRestricted: ({ workspaceName }) => `Los gastos para ${workspaceName} están actualmente restringidos`, |
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.
@pac-guerreiro Please resolve this comment once you update the spanish translation with the correct text.
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.
Los gastos para el espacio de trabajo {workspace_name} están actualmente restringidos
😁
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.
@Gonals Muchas gracias! 🙏
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 coming back here - the copy for this has an additional change that was made in the design doc reviews --
Instead of "Los gastos para el espacio de trabajo {workspace_name} están actualmente restringidos", we want to change the copy to "Las acciones en el espacio de trabajo {workspace_name} están actualmente restringidas"
@Gonals - are you able to confirm if that is the correct formatting to say, "Actions on the {workspace_name} workspace are currently restricted" ? I think we'd also need to change the English file for this as well? As initially the design doc had "Expenses to {workspace_name} are currently restricted."
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.
Ah coming back here - the copy for this has an additional change that was made in the design doc reviews --
Instead of "Los gastos para el espacio de trabajo {workspace_name} están actualmente restringidos", we want to change the copy to "Las acciones en el espacio de trabajo {workspace_name} están actualmente restringidas"
@Gonals - are you able to confirm if that is the correct formatting to say, "Actions on the {workspace_name} workspace are currently restricted" ? I think we'd also need to change the English file for this as well? As initially the design doc had "Expenses to {workspace_name} are currently restricted."
Yep! All good!
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceUserRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
assets/images/simple-illustrations/simple-illustration__lockclosed_orange.svg
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction.tsx
Outdated
Show resolved
Hide resolved
Can you make sure all of the green buttons are using our |
This comment has been minimized.
This comment has been minimized.
@pac-guerreiro We got merge conflicts |
src/pages/RestrictedAction/Workspace/WorkspaceRestrictedActionPage.tsx
Outdated
Show resolved
Hide resolved
src/pages/RestrictedAction/Workspace/WorkspaceRestrictedActionPage.tsx
Outdated
Show resolved
Hide resolved
# Conflicts: # src/libs/ReportUtils.ts
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2024-06-20.at.18.18.10.android.movAndroid: mWeb ChromeScreen.Recording.2024-06-20.at.18.14.15.android.chrome.moviOS: NativeScreen.Recording.2024-06-20.at.18.23.02.ios.moviOS: mWeb SafariScreen.Recording.2024-06-20.at.18.21.52.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2024-06-20.at.17.55.47.web.movMacOS: DesktopScreen.Recording.2024-06-20.at.18.11.00.desktop.mov |
@shawnborton any suggestion on how to handle the situation reported above? |
^ Addressed that comment via Slack. |
@pac-guerreiro Your turn. We nearly done |
@hoangzinh sorry for the delay, it's is done! 😄 |
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.
Very nice, thank you for the changes. Code LGTM. I just left a minor comment update.
Not a blocker so I'll proceed and merge. If possible can you address the comment in a follow up.
@@ -153,6 +153,12 @@ function isExpensifyTeam(email: string | undefined): boolean { | |||
const isPolicyAdmin = (policy: OnyxInputOrEntry<Policy> | EmptyObject, currentUserLogin?: string): boolean => | |||
(policy?.role ?? (currentUserLogin && policy?.employeeList?.[currentUserLogin]?.role)) === CONST.POLICY.ROLE.ADMIN; | |||
|
|||
/** | |||
* Checks if the current user is an user of the policy. |
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 find this weird to read current user is an user
. Maybe making it more verbose like so would be easier to read,
* Checks if the current user is an user of the policy. | |
* Checks if the current user is of the role "user" on the policy. |
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.
Thank you for the suggestion!
I applied it here - https://github.com/Expensify/App/pull/44371/files#diff-89601c1d4ab7d6fb789ea45b8f8e16ead0f925cf0db25d9b5c3561816d7a94c1R157
✋ 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/chiragsalian in version: 9.0.2-0 🚀
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.0.3-7 🚀
|
🚀 Deployed to production by https://github.com/Julesssss in version: 9.0.5-13 🚀
|
Details
Fixed Issues
$#43673
PROPOSAL: N/A
Tests
Since there are three variants of the restricted action screen, which are shown to the user depending on his workspace role, you'll need to test each of the following scenarios:
Scenario A - Workspace User
/restricted-action/workspace/<policyID>
passing the policy ID you got from previous stepChat with your admin
button, ensure you were navigated to the workspace chat.Scenario B - Workspace Admin
/restricted-action/workspace/<policyID>
passing the policy ID you got from previous stepChat in #admins
button, ensure you were navigated to the workspace admins chat.Scenario C - Workspace Owner
/restricted-action/workspace/<policyID>
passing the policy ID you got from previous stepAdd payment card
button, ensure you were navigated to theSubscription
screen.Offline tests
Same as above
QA Steps
Same as above
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodSTYLE.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 and/or tagged@Expensify/design
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
Workspace User
Android.-.Native.-.User.mp4
Workspace Admin
Android.-.Native.-.Admin.mp4
Workspace Owner
Android.-.Native.-.Owner.mp4
Android: mWeb Chrome
Workspace User
Android.-.Chrome.-.User.mp4
Workspace Admin
Android.-.Chrome.-.Admin.mp4
Workspace Owner
Android.-.Chrome.-.Owner.mp4
iOS: Native
Workspace User
iOS.-.Native.-.User.mp4
Workspace Admin
iOS.-.Native.-.Admin.mp4
Workspace Owner
iOS.-.Native.-.Owner.mp4
iOS: mWeb Safari
Workspace User
iOS.-.Safari.-.User.mp4
Workspace Admin
iOS.-.Safari.-.Admin.mp4
Workspace Owner
iOS.-.Safari.-.Owner.mp4
MacOS: Chrome / Safari
Workspace User
MacOS.-.Chrome.-.User.mp4
Workspace Admin
MacOS.-.Chrome.-.Admin.mp4
Workspace Owner
MacOS.-.Chrome.-.Owner.mp4
MacOS: Desktop
Workspace User
MacOS.-.Native.-.User.mp4
Workspace Admin
MacOS.-.Native.-.Admin.mp4
Workspace Owner
MacOS.-.Native.-.Owner.mp4