Skip to content

Commit

Permalink
Merge pull request #8273 from opencrvs/ocrvs-7421
Browse files Browse the repository at this point in the history
ocrvs-7421: misc bugs
  • Loading branch information
Zangetsu101 authored Jan 1, 2025
2 parents eef358e + d8d0627 commit 16fa42c
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 16 deletions.
32 changes: 18 additions & 14 deletions packages/client/src/components/form/ReviewActionComponent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,29 +388,33 @@ const ReviewActionComponent = ({
{intl.formatMessage(buttonMessages.sendForApproval)}
</Button>
</ProtectedComponent>
) : completeDeclaration ? (
<>
<ProtectedComponent scopes={[SCOPES.RECORD_SUBMIT_FOR_REVIEW]}>
<Button
type="primary"
size="large"
id={'submit_for_review'}
onClick={toggleSubmitModalOpen}
disabled={totalFileSizeExceeded}
>
<Upload />
{intl.formatMessage(buttonMessages.sendForReview)}
</Button>
</ProtectedComponent>
</>
) : (
<>
<ProtectedComponent
scopes={[
SCOPES.RECORD_SUBMIT_FOR_REVIEW,
SCOPES.RECORD_SUBMIT_INCOMPLETE
]}
>
<ProtectedComponent scopes={[SCOPES.RECORD_SUBMIT_INCOMPLETE]}>
<Button
type="primary"
size="large"
id={
completeDeclaration
? 'submit_for_review'
: 'submit_incomplete'
}
id={'submit_incomplete'}
onClick={toggleSubmitModalOpen}
disabled={hasErrorsOnFields || totalFileSizeExceeded}
>
<Upload />
{completeDeclaration
? intl.formatMessage(buttonMessages.sendForReview)
: intl.formatMessage(buttonMessages.sendIncomplete)}
{intl.formatMessage(buttonMessages.sendIncomplete)}
</Button>
</ProtectedComponent>
</>
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/components/interface/Navigation.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ describe('Given a user with scopes views Navigation', () => {

const requiredScopes = [
SCOPES.RECORD_SUBMIT_FOR_APPROVAL,
SCOPES.RECORD_SUBMIT_FOR_UPDATES
SCOPES.RECORD_SUBMIT_FOR_UPDATES,
SCOPES.RECORD_REGISTER
] as Scope[]

const allOtherScopes = allScopes.filter(
Expand Down
3 changes: 2 additions & 1 deletion packages/client/src/hooks/useNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ const routeAccess: NavigationConfig[] = [
name: WORKQUEUE_TABS.readyForReview,
scopes: [
SCOPES.RECORD_SUBMIT_FOR_APPROVAL,
SCOPES.RECORD_SUBMIT_FOR_UPDATES
SCOPES.RECORD_SUBMIT_FOR_UPDATES,
SCOPES.RECORD_REGISTER
]
},
{
Expand Down

0 comments on commit 16fa42c

Please sign in to comment.