-
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
Update RequestStepCategory to add Empty and Loading states for category list #41344
Update RequestStepCategory to add Empty and Loading states for category list #41344
Conversation
@mananjadhav 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] |
Hello ) @dannymcclain @shawnborton @dubielzyk-expensify The only thing that needs to be clarified is designs |
I like that, though I'd suggest we should use the label |
I agree with you ) |
Nice, I like it! And agree about making it |
I'm into it as well! |
@mananjadhav |
Thanks @ZhenjaHorbach. Will finish the review by tomorrow. |
@@ -28,9 +28,12 @@ type CategoryFormProps = { | |||
|
|||
/** Function to validate the edited values of the form */ | |||
validateEdit?: (values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM>) => FormInputErrors<typeof ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM>; | |||
|
|||
/** Should go back after submitting the form */ | |||
isShouldGoBackOnSubmit?: boolean; |
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.
Prefixing should
is enough to understand it's a boolean.
isShouldGoBackOnSubmit?: boolean; | |
shouldGoBackOnSubmit?: boolean; |
@@ -60,9 +63,13 @@ function CategoryForm({onSubmit, policyCategories, categoryName, validateEdit}: | |||
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_CATEGORY_FORM>) => { | |||
onSubmit(values); | |||
Keyboard.dismiss(); | |||
if (isShouldGoBackOnSubmit) { |
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.
in which scenarios would we not go back?
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.
Actually these changes are not necessary
I added other changes related to navigation
Because categories are tied to workspace screen
And after reloading the page with open categories we always navigate to workspace screen
[SCREENS.WORKSPACE.CATEGORIES]: [SCREENS.WORKSPACE.CATEGORY_CREATE, SCREENS.WORKSPACE.CATEGORY_SETTINGS, SCREENS.WORKSPACE.CATEGORIES_SETTINGS, SCREENS.WORKSPACE.CATEGORY_EDIT], |
@@ -39,6 +39,7 @@ function CategorySettingsPage({route, policyCategories}: CategorySettingsPagePro | |||
const {translate} = useLocalize(); | |||
const {windowWidth} = useWindowDimensions(); | |||
const [deleteCategoryConfirmModalVisible, setDeleteCategoryConfirmModalVisible] = useState(false); | |||
const backTo = route.params?.backTo ?? ''; |
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.
do we need a fallback string?
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 doesn't really affect anything
So I think not)
I'll remove it now
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.
Just finished with the review, overall code changes look fine. I'll need a day to test this.
@ZhenjaHorbach Can you please resolve conflicts? I'll get started on the checklist right after. |
Hello ) |
@ZhenjaHorbach thanks for pulling main, can 1 or both of y'all please confirm this is still looking good after pulling main? 🙏 We should be able to get this merged early this week if so! (since the |
Just checked |
@ZhenjaHorbach do you mind letting us know what the bug was & making sure it's in the test steps? 🙏 @mananjadhav can you please re-review? We're ready to merge this once it's all approved, no more freeze for this PR! |
If we create category with non-Latin characters(ЙЦУКЕ) or special symbols and then we'll try to edit the category name we get not found page 475d2bd#diff-d959b56c2ea536627740ef206f2a473588b85ea215fa5ebf1b5ae628e9ce722aR542 Like here App/src/libs/Navigation/linkingConfig/config.ts Lines 397 to 402 in 96425fa
|
I'll do another round of review + testing today. |
@mananjadhav |
I could only test on Web yesterday. I need to test on mobile atleast once. Please give me a few hours, I'll post an update once done. |
Apologies for the delay. Tested in Web, 1 mWeb and 1 native. Attached videos for Web and Android. android-categories.movweb-categories-1.movweb-categories-2.mov |
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! Merging cuz this has been pending for too long, but i think we should clean up the small comment i mentioned
if (backTo) { | ||
Navigation.navigate(ROUTES.SETTINGS_CATEGORY_SETTINGS.getRoute(policyId, category.keyForList, backTo)); | ||
return; | ||
} | ||
Navigation.navigate(ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute(policyId, category.keyForList)); |
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 - maybe in a follow-up we can clean this up by passing backTo
always? so we don't have so many "if backTo exists, pass it, otherwise don't" checks? I also think it looks like ROUTES.WORKSPACE_CATEGORY_SETTINGS.getRoute
already handles backTo existing or not, right?
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.
WORKSPACE_CATEGORY_SETTINGS
does not handle backTo
Because it doesn't make sense
Since in the case of WORKSPACE_CATEGORY_SETTINGS
the previous screen (WORKSPACE_CATEGORIES) will take up fullScreen
And it will be always previous (even when we copy link and open in new tab)
[SCREENS.WORKSPACE.CATEGORIES]: [SCREENS.WORKSPACE.CATEGORY_CREATE, SCREENS.WORKSPACE.CATEGORY_SETTINGS, SCREENS.WORKSPACE.CATEGORIES_SETTINGS, SCREENS.WORKSPACE.CATEGORY_EDIT], |
But the idea behind my changes was
What if we have backTo
This means that we opened CATEGORY_SETTINGS
not from Workspace Screen
And from another place
What does it mean to use new routes and save history using backTo
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 geez i missed that one is SETTINGS_CATEGORY_SETTINGS, one is WORKSPACE_CATEGORY_SETTINGS. Please forgive me 😅
✋ 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 production by https://github.com/Julesssss in version: 1.4.79-11 🚀
|
<View style={[styles.flex1]}> | ||
<BlockingView | ||
icon={Illustrations.EmptyStateExpenses} | ||
iconWidth={variables.modalTopIconWidth} |
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.
Coming from #43064. This caused a regression where the empty folder icon was not centred. This is because the width and height values used here are incorrect for the icon used.
/> | ||
</View> | ||
); | ||
}; | ||
|
||
const isLoading = !isOffline && policyCategories === undefined; | ||
const isLoading = !isOffline && policyCategories === null; |
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.
@ZhenjaHorbach why did you change it? Right now loading state is not working properly. See here. Reverting this change fixes the issue
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 is a known issue
But yes, I may have tested some functionality
But then I forgot to remove these changes 😅
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.
Coming from #44224. This caused a regression that a loader is not displayed
To fix this we need to use undefined in case of an empty onyx state as in other places
Details
Not here page is briefly displayed when selecting a workspace
Fixed Issues
$ #40999
$ #41143
PROPOSAL: #40999 (comment)
Tests
Not here
Offline tests
Not here
QA Steps
Not here
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
2024-05-08.21.25.42.mov
Android: mWeb Chrome
2024-05-08.21.25.42.mov
iOS: Native
2024-05-08.21.22.23.mov
iOS: mWeb Safari
ios.mov
MacOS: Chrome / Safari
2024-05-08.21.26.17.mov
MacOS: Desktop
2024-05-08.21.35.23.mov