Skip to content
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

feat: Action Menu #7633

Merged
merged 106 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
97cc9d9
feat: implement action menu
jamil314 Sep 19, 2024
6853f29
chore: export `IProps`
jamil314 Sep 19, 2024
6e39150
feat: enable keyboard navigation
jamil314 Sep 20, 2024
29b3a8d
Merge branch 'develop' into action-menu
jamil314 Sep 20, 2024
d7cc771
feat: implement `Dropdown` component
jamil314 Sep 23, 2024
6dea8e3
feat: make dropdownMenu keyboard accessible
jamil314 Sep 24, 2024
bd37024
feat: make dropdownMenu close on click outside and esc
jamil314 Sep 24, 2024
3bd63c2
fix: make some props optional
jamil314 Sep 24, 2024
95e9b10
fix: close menu on ouside click
jamil314 Sep 24, 2024
60e3bfe
feat: create actionMenu
jamil314 Sep 24, 2024
e46dc94
feat: add `Update`, `Print`, `Issue`, `Delete` items
jamil314 Sep 25, 2024
48a0c3b
feat: implement delete declaration
jamil314 Sep 25, 2024
b326939
Merge branch 'develop' into action-menu
jamil314 Sep 25, 2024
c872344
feat: redirect to home after deleting draft
jamil314 Sep 25, 2024
a6ff234
feat: add label for assigned to someone else
jamil314 Sep 25, 2024
0071b8f
refactor: move actionItems
jamil314 Sep 25, 2024
be12ad6
Merge branch 'develop' into action-menu
jamil314 Sep 26, 2024
1820f6f
amend: add missing props
jamil314 Sep 26, 2024
92f2b28
feat: add scope and other checks for: correct record
jamil314 Sep 26, 2024
40f3d6e
Merge branch 'develop' into action-menu
jamil314 Sep 26, 2024
07ecc4e
feat: add scope and other checks for: archive declaration
jamil314 Sep 26, 2024
e1730ff
Merge branch 'action-menu' of https://github.com/opencrvs/opencrvs-co…
jamil314 Sep 26, 2024
ec229b0
feat: add scope and other checks for: reinstate declaration
jamil314 Sep 26, 2024
bca7d50
refactor: restructure types
jamil314 Sep 26, 2024
371b26b
feat: add scope and other checks for: review
jamil314 Sep 26, 2024
aeb2c98
chore: add todo
jamil314 Sep 26, 2024
e774d62
feat: add scope and other checks for: update declaration
jamil314 Sep 26, 2024
6f60039
feat: add scope and other checks for: print declaration
jamil314 Sep 26, 2024
7a81c01
chore: remove console.log
jamil314 Sep 26, 2024
0cb3f3f
feat: add scope and other checks for: issue certificate
jamil314 Sep 26, 2024
8cdc58a
feat: add scope and other checks for: delete declaration
jamil314 Sep 26, 2024
fd6de09
refactor: change order of items
jamil314 Sep 26, 2024
b25bfa1
wip
jamil314 Sep 27, 2024
5377129
Revert "wip"
jamil314 Sep 27, 2024
79915be
feat: implement unassign button
jamil314 Sep 27, 2024
70fafcd
fix: font and color
jamil314 Sep 27, 2024
fc9dd17
fix: keyDown behaviour
jamil314 Sep 27, 2024
6349d18
chore: remove record audit buttons
jamil314 Sep 27, 2024
1ccc233
refactor: use dropdownMenu to refactor toggleMenu
jamil314 Sep 27, 2024
12a0b2e
chore: remove action from component
jamil314 Sep 27, 2024
916febb
chore: deprecate toggleMenu
jamil314 Sep 27, 2024
3d953f7
Merge branch 'develop' into action-menu
jamil314 Sep 27, 2024
2fb782e
feat: move self unassign to actionMenu
jamil314 Sep 27, 2024
d5a37c6
chore: dont unassign from download button
jamil314 Sep 27, 2024
aa1b022
chore: remove unused imports
jamil314 Sep 27, 2024
ee1cc11
chore: update changelog
jamil314 Sep 27, 2024
610a702
fix: RA will see "correct record" button
jamil314 Sep 30, 2024
3046577
fix: add id in dropdown menu
jamil314 Sep 30, 2024
9db81b2
Merge branch 'develop' into action-menu
rikukissa Sep 30, 2024
3fb579c
refactor: `isDownloadable` logic
jamil314 Oct 8, 2024
fe52196
refactor: remove types from actionMessages
jamil314 Oct 8, 2024
2bb9fe4
refactor: use `useIntl` and `useDispatch` hooks instead of props dril…
jamil314 Oct 8, 2024
08f1213
refactor: dont pass assignment to unassign comp
jamil314 Oct 8, 2024
3d700d3
refactor: use `offsetX` and `offsetY` instead of `offset_x` and `offs…
jamil314 Oct 8, 2024
4dccf00
Merge branch 'develop' into action-menu
jamil314 Oct 8, 2024
33ef0bf
refactor: use `<Button>` instead of `<PrimaryButton>`
jamil314 Oct 8, 2024
539318c
Merge branch 'action-menu' of https://github.com/opencrvs/opencrvs-co…
jamil314 Oct 8, 2024
62836f6
refactor: remove unnecessary `<div>`s
jamil314 Oct 8, 2024
80671a0
feat: use `anchor` and `popover` api to toggle the dropdown visivility
jamil314 Oct 11, 2024
8773dc8
fix: focus
jamil314 Oct 11, 2024
c5453f6
chore: remove as string
jamil314 Oct 11, 2024
ce74d44
refactor: early return if condition fails
jamil314 Oct 11, 2024
fbff2c4
refactor: move declaration status logic into declarations/utils
jamil314 Oct 11, 2024
ab244ae
refactor: change type of status to `SUBMISSION_STATUS`
jamil314 Oct 11, 2024
f393b16
fix: handle multiple dropdown
jamil314 Oct 11, 2024
916eb6d
fix: styles
jamil314 Oct 11, 2024
f308a59
fix: position options and story
jamil314 Oct 11, 2024
8ee686b
Merge branch 'develop' into action-menu
jamil314 Oct 11, 2024
42b38df
fix: close dropdown on action click
jamil314 Oct 14, 2024
5049e56
Merge branch 'develop' into action-menu
jamil314 Oct 14, 2024
0b77313
refactor: align EVENT in common with Event in client
jamil314 Oct 14, 2024
b41b5f6
refactor: pass id directly to provider
jamil314 Oct 15, 2024
2b31875
Merge branch 'develop' into action-menu
jamil314 Oct 15, 2024
855989d
Merge branch 'develop' into action-menu
jamil314 Oct 16, 2024
a103589
test: add unit test for view action
jamil314 Oct 16, 2024
d9c53a4
test: cover all statuses for view action
jamil314 Oct 16, 2024
a7391bb
test: add tests for review action
jamil314 Oct 16, 2024
8a346de
test: add tests for update action
jamil314 Oct 16, 2024
4c190bf
test: add tests for archive action
jamil314 Oct 16, 2024
173ca9d
test: add tests for reinstate action
jamil314 Oct 17, 2024
3c7ed13
test: add tests for print action
jamil314 Oct 17, 2024
9627f7e
test: add tests for issue action
jamil314 Oct 17, 2024
5d11be2
test: refactor: centralize scoeps
jamil314 Oct 17, 2024
efad86c
test: add test for not having scope
jamil314 Oct 17, 2024
0463d3c
test: add tests for correct action
jamil314 Oct 17, 2024
4943521
test: add tests for delete action
jamil314 Oct 17, 2024
417ccca
test: add tests for unassign action
jamil314 Oct 17, 2024
e4403eb
test: add tests for assignment text
jamil314 Oct 17, 2024
2ad81cf
fix: unhandled errors
jamil314 Oct 17, 2024
6a77319
chore: remove old tests
jamil314 Oct 17, 2024
3c055bb
fix: use EVENT.Birth instead of "Birth"
jamil314 Oct 17, 2024
0df9bf2
fix: use EVENT.Birth instead of "Birth"
jamil314 Oct 17, 2024
1561680
fix: eventToggle id in test
jamil314 Oct 17, 2024
3c75d6c
fix: eventToggle id in test
jamil314 Oct 17, 2024
4db832d
fix: ids in UserList.test
jamil314 Oct 17, 2024
2ad338c
fix: ids in UserAudit.test
jamil314 Oct 17, 2024
07c6d12
fix: import Event
jamil314 Oct 17, 2024
fa209e9
fix: remove unassign test from download button
jamil314 Oct 17, 2024
1769f0e
fix: ids in ProfileMenu.test
jamil314 Oct 17, 2024
feaf386
fix: import Event
jamil314 Oct 17, 2024
dff7eb0
fix: import Event
jamil314 Oct 17, 2024
731b1ea
Merge branch 'develop' into action-menu
jamil314 Oct 17, 2024
340b5b0
Merge branch 'develop' into action-menu
jamil314 Oct 17, 2024
90b94ae
Merge branch 'develop' into action-menu
jamil314 Oct 24, 2024
1b602dc
Merge branch 'develop' into action-menu
jamil314 Oct 28, 2024
7fd7127
Merge branch 'develop' into action-menu
jamil314 Oct 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
- Two new statuses of record are added: `Validated` and `Correction Requested` for advanced search parameters [#6365](https://github.com/opencrvs/opencrvs-core/issues/6365)
- A new field: `Time Period` is added to advanced search [#6365](https://github.com/opencrvs/opencrvs-core/issues/6365)
- Deploy UI-Kit Storybook to [opencrvs.pages.dev](https://opencrvs.pages.dev) to allow extending OpenCRVS using the component library
- Record audit action buttons are moved into action menu [#7390](https://github.com/opencrvs/opencrvs-core/issues/7390)

## Bug fixes

Expand Down
7 changes: 6 additions & 1 deletion packages/client/src/components/interface/DownloadButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,12 @@ function DownloadButtonComponent(props: DownloadButtonProps & HOCProps) {
<DownloadAction
type="icon"
id={`${id}-icon${isFailed ? `-failed` : ``}`}
onClick={onClickDownload}
onClick={
status === DOWNLOAD_STATUS.DOWNLOADED ||
(assignment && assignment.practitionerId !== practitionerId)
? () => {}
: onClickDownload
}
jamil314 marked this conversation as resolved.
Show resolved Hide resolved
className={className}
aria-label={intl.formatMessage(constantsMessages.assignRecord)}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/i18n/messages/buttons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ interface IButtonsMessages
const messagesToDefine: IButtonsMessages = {
archive: {
id: 'buttons.archive',
defaultMessage: 'Archive',
defaultMessage: 'Archive declaration',
description: 'Archive button text'
},
approve: {
Expand Down
86 changes: 86 additions & 0 deletions packages/client/src/i18n/messages/views/action.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* OpenCRVS is also distributed under the terms of the Civil Registration
* & Healthcare Disclaimer located at http://opencrvs.org/license.
*
* Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS.
*/
import { defineMessages, MessageDescriptor } from 'react-intl'

interface IActionMessages
extends Record<string | number | symbol, MessageDescriptor> {
action: MessageDescriptor
assignedTo: MessageDescriptor
view: MessageDescriptor
correctRecord: MessageDescriptor
archiveRecord: MessageDescriptor
reinstateRecord: MessageDescriptor
reviewCorrection: MessageDescriptor
reviewDeclaration: MessageDescriptor
updateDeclaration: MessageDescriptor
printDeclaration: MessageDescriptor
issueCertificate: MessageDescriptor
}
jamil314 marked this conversation as resolved.
Show resolved Hide resolved

const messagesToDefine: IActionMessages = {
action: {
defaultMessage: 'Action',
description: 'Label for action button in dropdown menu',
id: 'action.action'
},
assignedTo: {
defaultMessage: 'Assigned to {name} at {officeName}',
description: 'Label for assignee',
id: 'action.assignee'
},
view: {
defaultMessage: 'View {recordOrDeclaration}',
description: 'Label for view button in dropdown menu',
id: 'action.view'
},
correctRecord: {
defaultMessage: 'Correct Record',
description: 'Label for correct record button in dropdown menu',
id: 'action.correct'
},
archiveRecord: {
defaultMessage: 'Archive Record',
description: 'Label for archive record button in dropdown menu',
id: 'action.archive'
},
reinstateRecord: {
defaultMessage: 'Reinstate Record',
description: 'Label for reinstate record button in dropdown menu',
id: 'action.reinstate'
},
reviewCorrection: {
defaultMessage: 'Review correction request',
description: 'Label for review correction request button in dropdown menu',
id: 'action.review.correction'
},
reviewDeclaration: {
defaultMessage:
'Review {isDuplicate, select, true{potential duplicate} other{declaration}}',
description: 'Label for review record button in dropdown menu',
id: 'action.review.declaration'
},
updateDeclaration: {
defaultMessage: 'Update declaration',
description: 'Label for update record button in dropdown menu',
id: 'action.update'
},
printDeclaration: {
defaultMessage: 'Print certified copy',
description: 'Label for print certified copy in dropdown menu',
id: 'action.print'
},
issueCertificate: {
defaultMessage: 'Issue certificate',
description: 'Label for issue certificate in dropdown menu',
id: 'action.issue'
}
}
export const messages: IActionMessages = defineMessages(messagesToDefine)
Loading
Loading