-
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
[No QA] Create new Edit Card Limit page #45397
[No QA] Create new Edit Card Limit page #45397
Conversation
@DylanDylann 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] |
Resolving conflicts... |
# Conflicts: # src/ROUTES.ts # src/SCREENS.ts # src/languages/en.ts # src/languages/es.ts # src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx # src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts # src/libs/Navigation/types.ts
@DylanDylann kind bump 🙂 |
@DylanDylann are you able to get to this one now, or should we switch in @allgandalf while you work on reviewing #45452? |
I am reviewing this PR |
src/pages/workspace/expensifyCard/WorkspaceEditCardLimitPage.tsx
Outdated
Show resolved
Hide resolved
@DylanDylann kind bump 🙂 |
Sure, I am on it |
inputID={INPUT_IDS.LIMIT} | ||
ref={inputCallbackRef} | ||
/> | ||
<ConfirmModal |
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.
NAB, It is better to move ConfirmModal
outside the form. But the current code also works well
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.
@DylanDylann It was easier to pass form values to ConfirmModal
this way
const errors = ValidationUtils.getFieldRequiredErrors(values, [INPUT_IDS.LIMIT]); | ||
|
||
// We only want integers to be sent as the limit | ||
if (!Number(values.limit) || !Number.isInteger(Number(values.limit))) { |
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.
NAB: I think we shouldn't allow users type decimal (can't type "." character). It would be better
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 same approach is used on the LimitStep page, see the explanation. So let's keep it this way for now
const updateCardLimit = (newLimit: string) => { | ||
setIsConfirmModalVisible(false); | ||
|
||
// TODO: add API call when it's supported https://github.com/Expensify/Expensify/issues/407831 |
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 API endpoint UpdateExpensifyCardLimit
is live on staging, can we integrate it as part of this PR? :)
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.
Sure, I will fo it!
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.
@MariaHCD Is it possible for me to test this endpoint over the realistic card in the E/App?
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, no, not yet. The backend PR to configure a workspace for the Expensify Card is still WIP so we can't test any issuing cards or updating cards at this point.
We can do full E2E tests once more of the backend pieces are implemented.
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.
@MariaHCD I've made a call for non-existing card and it returned 200
response. Is it okay?
I expected something with 404
😅
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.
Integrated UpdateExpensifyCardLimit
API call: 5e31125
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, thanks for catching that. Looking at our backend logs, we did throw a 404
but the API didn't rethrow the exception. cc: @nkuoch
# Conflicts: # src/libs/API/parameters/index.ts
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.
Changes look good to me, I wonder if we need to however add the real api in this PR for now if its not possible to create the real card yet, hence the entire flow is not testable yet.
@MariaHCD I think we should just let this go with mocked data and come back to integration once the card creation flow is integrated, what do you think?
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.
Ooops, we've got conflicts.
I think we can keep the integration code here for now so it saves us a bit of work later. Is there a benefit to having mocked data here instead? |
# Conflicts: # src/ONYXKEYS.ts # src/ROUTES.ts # src/libs/Navigation/AppNavigator/ModalStackNavigators/index.tsx # src/libs/Navigation/linkingConfig/FULL_SCREEN_TO_RHP_MAPPING.ts # src/libs/Navigation/types.ts
@VickyStash Detail page is ready. Please add logic to navigate to the edit card limit page Screen.Recording.2024-07-19.at.15.08.41.mov |
@DylanDylann This PR includes this update, link Are you sure you have checked on the right branch? |
@VickyStash Whoops... Let's me check again |
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 lets do this https://github.com/Expensify/App/pull/45397/files
✋ 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/mountiny in version: 9.0.10-2 🚀
|
🚀 Cherry-picked to staging by https://github.com/mountiny in version: 9.0.10-3 🚀
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.0.10-7 🚀
|
🚀 Deployed to production by https://github.com/francoisl in version: 9.0.11-5 🚀
|
Coming from the server error, I noticed that you can enter to the view to edit the limit even if there is not card setup: https://staging.new.expensify/settings/workspaces/YOUR_POLICY_ID/expensify-card/1/edit/limit if the form is submitted then, it causes a server error. Should we have implemented something that disables the button or closes the modal if the card with cardID=1 doesn't exist? |
Or the standard "NotFound" page when you try to access a page that you can't access or doesn't exist? |
That sounds like a good option too |
I think it should be relevant not only for this route but for similar as well:
I can implement it during BE integration, WDYT? |
Makes sense to me! CC: @mountiny |
Details
Creates new Edit Card Limit page.
Fixed Issues
$ #44326
PROPOSAL: N/A
Tests
Pre-step:
Comment out the feature check in the WorkspaceEditCardLimitPage file, so you can access the screen.
Steps:
/expensify-card/1/edit/limit
, for example:https://dev.new.expensify.com:8082/settings/workspaces/YOUR_POLICY_ID/expensify-card/1/edit/limit
.Make sure the Card limit page looks as expected.
Offline tests
N/A
QA Steps
N/A
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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop