-
Notifications
You must be signed in to change notification settings - Fork 4k
Fix regressions from [Rules Revamp] Release 2 #95444
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
Open
Krishna2323
wants to merge
16
commits into
Expensify:main
Choose a base branch
from
Krishna2323:krishna2323/issue-95304-rules-revamp-regressions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+265
−79
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
88d9805
Fix Require fields and Flag for review tabs showing when Categories a…
Krishna2323 b620886
Fix Require fields rule row flicker and stale toggles during pending …
Krishna2323 1bfb2f4
Fix Require fields category picker not resetting draft on category ch…
Krishna2323 cb9a0d4
Fix None option appearing in Require fields category picker after sel…
Krishna2323 76ffee7
Fix Require fields rules missing from Copy Settings preview and optim…
Krishna2323 19ee80a
fix knip check.
Krishna2323 483dfea
Address Codex review: preserve None default and defer category tab ga…
Krishna2323 fd45277
Use read-only styling for locked category on category rule edit pages.
Krishna2323 a06adad
remove none option from category picker.
Krishna2323 de32fdb
Merge upstream/main into krishna2323/issue-95304-rules-revamp-regress…
Krishna2323 d1add78
Merge branch 'main' into krishna2323/issue-95304-rules-revamp-regress…
Krishna2323 9ae1fbf
Show enable-categories empty state in rule category RHP
Krishna2323 aeda120
fix: fetch categories after enabling them
Krishna2323 796563f
fix: align category loading with RHP patterns
Krishna2323 fa4b1d1
fix: compose rule category picker states
Krishna2323 a646496
update translations.
Krishna2323 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import Button from '@components/ButtonComposed'; | ||
| import FixedFooter from '@components/FixedFooter'; | ||
| import WorkspaceEmptyStateSection from '@components/WorkspaceEmptyStateSection'; | ||
|
|
||
| import {useMemoizedLazyIllustrations} from '@hooks/useLazyAsset'; | ||
| import useLocalize from '@hooks/useLocalize'; | ||
| import usePolicyData from '@hooks/usePolicyData'; | ||
| import useThemeStyles from '@hooks/useThemeStyles'; | ||
|
|
||
| import {enablePolicyCategories, openPolicyCategoriesPage} from '@libs/actions/Policy/Category'; | ||
|
|
||
| import CONST from '@src/CONST'; | ||
|
|
||
| import React from 'react'; | ||
| import {View} from 'react-native'; | ||
|
|
||
| type RuleCategoriesDisabledEmptyStateProps = { | ||
| /** ID of the policy the rule belongs to */ | ||
| policyID: string; | ||
| }; | ||
|
|
||
| function RuleCategoriesDisabledEmptyState({policyID}: RuleCategoriesDisabledEmptyStateProps) { | ||
| const styles = useThemeStyles(); | ||
| const {translate} = useLocalize(); | ||
| const illustrations = useMemoizedLazyIllustrations(['FolderOpen']); | ||
| const policyData = usePolicyData(policyID); | ||
|
|
||
| const enableCategories = () => { | ||
| enablePolicyCategories(policyData, true, false); | ||
|
|
||
| // The categories collection is empty while the feature is disabled, and enabling it only merges the | ||
| // categories we already know about, so the collection has to be fetched for the picker to have rows. | ||
| openPolicyCategoriesPage(policyID); | ||
| }; | ||
|
|
||
| return ( | ||
| <View style={[styles.flex1]}> | ||
| <WorkspaceEmptyStateSection | ||
| shouldStyleAsCard={false} | ||
| icon={illustrations.FolderOpen} | ||
| title={translate('workspace.rules.categoriesDisabledEmptyState.title')} | ||
| subtitle={translate('workspace.rules.categoriesDisabledEmptyState.subtitle')} | ||
| containerStyle={[styles.flex1, styles.justifyContentCenter]} | ||
| /> | ||
| <FixedFooter style={[styles.mtAuto, styles.pt5]}> | ||
| <Button | ||
| variant={CONST.BUTTON_VARIANT.SUCCESS} | ||
| size={CONST.BUTTON_SIZE.LARGE} | ||
| style={[styles.w100]} | ||
| onPress={enableCategories} | ||
| > | ||
| <Button.KeyboardShortcut /> | ||
| <Button.Text>{translate('workspace.categories.enableCategories')}</Button.Text> | ||
| </Button> | ||
| </FixedFooter> | ||
| </View> | ||
| ); | ||
| } | ||
|
|
||
| export default RuleCategoriesDisabledEmptyState; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.