-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[CRITICAL] [Advanced Approval Workflows] Add new routes & rename existing workflow routes #45995
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
Changes from all commits
82da97f
7f255e9
cbd0955
f77a1be
8e490b9
51eb4c4
40eb51b
2dfeb08
ee8eeaf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,52 @@ | ||||||
| import type {StackScreenProps} from '@react-navigation/stack'; | ||||||
| import React from 'react'; | ||||||
| import FullPageNotFoundView from '@components/BlockingViews/FullPageNotFoundView'; | ||||||
| import HeaderWithBackButton from '@components/HeaderWithBackButton'; | ||||||
| import ScreenWrapper from '@components/ScreenWrapper'; | ||||||
| import useLocalize from '@hooks/useLocalize'; | ||||||
| import Navigation from '@libs/Navigation/Navigation'; | ||||||
| import type {FullScreenNavigatorParamList} from '@libs/Navigation/types'; | ||||||
| import * as PolicyUtils from '@libs/PolicyUtils'; | ||||||
| import AccessOrNotFoundWrapper from '@pages/workspace/AccessOrNotFoundWrapper'; | ||||||
| import withPolicyAndFullscreenLoading from '@pages/workspace/withPolicyAndFullscreenLoading'; | ||||||
| import type {WithPolicyAndFullscreenLoadingProps} from '@pages/workspace/withPolicyAndFullscreenLoading'; | ||||||
| import CONST from '@src/CONST'; | ||||||
| import type SCREENS from '@src/SCREENS'; | ||||||
| import {isEmptyObject} from '@src/types/utils/EmptyObject'; | ||||||
|
|
||||||
| type WorkspaceWorkflowsApprovalsCreatePageProps = WithPolicyAndFullscreenLoadingProps & StackScreenProps<FullScreenNavigatorParamList, typeof SCREENS.WORKSPACE.WORKFLOWS_APPROVALS_NEW>; | ||||||
|
|
||||||
| function WorkspaceWorkflowsApprovalsCreatePage({policy, isLoadingReportData = true, route}: WorkspaceWorkflowsApprovalsCreatePageProps) { | ||||||
| const {translate} = useLocalize(); | ||||||
|
|
||||||
| // eslint-disable-next-line rulesdir/no-negated-variables | ||||||
| const shouldShowNotFoundView = (isEmptyObject(policy) && !isLoadingReportData) || !PolicyUtils.isPolicyAdmin(policy) || PolicyUtils.isPendingDeletePolicy(policy); | ||||||
|
|
||||||
| return ( | ||||||
| <AccessOrNotFoundWrapper | ||||||
| policyID={route.params.policyID} | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do you suggest that @DylanDylann? |
||||||
| featureName={CONST.POLICY.MORE_FEATURES.ARE_WORKFLOWS_ENABLED} | ||||||
| > | ||||||
| <ScreenWrapper | ||||||
| includeSafeAreaPaddingBottom={false} | ||||||
| testID={WorkspaceWorkflowsApprovalsCreatePage.displayName} | ||||||
| > | ||||||
| <FullPageNotFoundView | ||||||
| shouldShow={shouldShowNotFoundView} | ||||||
| subtitleKey={isEmptyObject(policy) ? undefined : 'workspace.common.notAuthorized'} | ||||||
| onBackButtonPress={PolicyUtils.goBackFromInvalidPolicy} | ||||||
| onLinkPress={PolicyUtils.goBackFromInvalidPolicy} | ||||||
| > | ||||||
| <HeaderWithBackButton | ||||||
| title={translate('workflowsCreateApprovalsPage.title')} | ||||||
| onBackButtonPress={Navigation.goBack} | ||||||
| /> | ||||||
| </FullPageNotFoundView> | ||||||
| </ScreenWrapper> | ||||||
| </AccessOrNotFoundWrapper> | ||||||
| ); | ||||||
| } | ||||||
|
|
||||||
| WorkspaceWorkflowsApprovalsCreatePage.displayName = 'WorkspaceWorkflowsApprovalsCreatePage'; | ||||||
|
|
||||||
| export default withPolicyAndFullscreenLoading(WorkspaceWorkflowsApprovalsCreatePage); | ||||||
Uh oh!
There was an error while loading. Please reload this page.