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

Custom Workqueues #7073

Open
1 of 3 tasks
rikukissa opened this issue May 30, 2024 · 14 comments
Open
1 of 3 tasks

Custom Workqueues #7073

rikukissa opened this issue May 30, 2024 · 14 comments
Labels
Milestone

Comments

@rikukissa
Copy link
Member

rikukissa commented May 30, 2024

Description

This feature provides the ability to create custom views of records for each system user type - available as menu options in the left hand sidebar.

Implements country config configurable workqueues leveraging advanced searches search parameters

Reasoning

We currently have hardcoded workqueues (left hand side menu options eg. In Progress, ready for review...)
Countries want greater control over what each of their custom system users can see and do

Enables:


  • Adds custom workqueues for each custom system user role

  • Each custom view is pre-filtered to support a countries business process flows. eg. event type, record status, time period since last action etc
  • Adds an Assigned to you workqueue - that lists all assigned records
  • Adds Drafts as a workqueue based on a user having a declare scope
  • Adds a Recent workqueue as default in country-config

https://opencrvsworkspace.slack.com/archives/GHCFF9M6X/p1717000313286379

Dev tasks

  • In case you need to work with Redux: familiarize yourself with redux-toolkit and start using it instead of writing the default boilerplate. Before moving state to Redux, consider whether Apollo's cache is sufficient!
  • Cleanup: deprecate and remove everything related to EXTERNAL_VALIDATION_WORKQUEUE and related UI
    • Also remove registrationHome query completely from the frontend
  • Create documentation around how to create / edit / remove workqueues
@naftis
Copy link
Collaborator

naftis commented Jun 14, 2024

@jpye-finch

Currently we fetch all workqueues at the same time when the app is loaded.

Is there value in that or could we load each of them dynamically when that workqueue page is opened? This could simplify the workqueue loading, just an thought at this point though. If you don't have internet you can see the workqueues you have opened earlier.

@jpye-finch
Copy link
Collaborator

Yes it could work. Would the experience not be same as we have to day? When you navigate between workqueues after login and initial load. You see the latest state of the workqueue whilst we check for changes.

As long as you can still see your assigned records so you can work offline. We are good imo

@euanmillar euanmillar added this to the v1.7.0 milestone Jun 17, 2024
@euanmillar
Copy link
Collaborator

This is also functional and based on experiment ascertain estimate.

@rikukissa rikukissa moved this from Backlog to In Development in OpenCRVS Core Jun 19, 2024
@rikukissa rikukissa self-assigned this Jun 19, 2024
@rikukissa rikukissa moved this from In Development to Ready to build in OpenCRVS Core Jul 1, 2024
@rikukissa rikukissa removed their assignment Jul 1, 2024
@rikukissa rikukissa removed the status in OpenCRVS Core Jul 4, 2024
@jpye-finch jpye-finch moved this to In Design in OpenCRVS Core Jul 4, 2024
@naftis
Copy link
Collaborator

naftis commented Sep 12, 2024

@jpye-finch flagging this for ideation and design:

Frontend code logic - partly because of the current UX - around the downloaded records and fetched workqueues is confusing at points, as we want to keep the workqueues updated after a record leaves the outbox. There is no clear way to see which workqueue received the record other than understanding the backend business flow.

Could there be a concept of having a separate workqueue similar to Outbox for "My records". By default the records you've created are also downloaded and saved there? Then the workqueues themselves could be (purely?) online-dependent, while you could still work on your offline-workqueues Outbox and My records.

@jpye-finch
Copy link
Collaborator

@naftis thanks for this.

I did have an 'Assigned to you' workqueue in the current epic description.
https://www.figma.com/board/kbRxrSeitNzGahyojbdLM5/OpenCRVS-Roadmap?node-id=235-3617&t=Q3hnASzRS1WJvdAT-4

@jpye-finch
Copy link
Collaborator

jpye-finch commented Sep 18, 2024

@naftis
Outbox and Assigned to you conditional on the user having at least one of these scopes:

record.declare-{event}
record.declaration-send-for-approval
record.declaration-submit-for-updates
record.review-duplicates
record.register
record.declaration-archive
record.registration-reinstate
record.registration-revoke
record.print&issue-certified-copies
record.registration-correct
record.registration-request-correction

@jpye-finch
Copy link
Collaborator

@naftis I don't see in the dev tasks here to allow the icon of the workqueue to be configurable. Allowing you to set the icon from the Phosphor Icons library

@jpye-finch
Copy link
Collaborator

@naftis
Also in this version will workqueues be based on scopes? Then we refactor so you can specify the custom users who have the workqueue?

users: ["Healthcare Worker", "Police Officer", "Registrar"]
instead of
requiredScopes": ["view-in-progress-records"],

@rikukissa
Copy link
Member Author

rikukissa commented Sep 20, 2024

@naftis Also in this version will workqueues be based on scopes? Then we refactor so you can specify the custom users who have the workqueue?

users: ["Healthcare Worker", "Police Officer", "Registrar"] instead of requiredScopes": ["view-in-progress-records"],

@jpye-finch good question.. My knee jerk reaction is that we should define as much as we can with just raw scopes. "User types" would remain as a very thin light layer for labeling different user scope sets but wouldn't otherwise be referred to anywhere in configuration.
This would make the workqueue driven by "you have access to feature X, thus you see this workqueue" and less "you are a Police officer, so you see this workqueue".

I do see an issue here though as the workqueues are effectively just different types of advanced searches and not fully connected always to a functionality / scope. Makes me think a country should be able to specify a scope for a workqueue like custom:view-childs-with-letter-a which they could then also add to a user type they want.

@rikukissa
Copy link
Member Author

@naftis this starts to look very good! One topic I'd still want you to consider – what's the upgrade story for countries upgrading from 1.6? In the custom scopes PR you might remember I had this script.

Is it necessary as we know every country just has the basic set? Maybe we just add the code to CC and countries get it when they pull?

Feel free to mark as Ready to build after @jpye-finch signs it off. @Zangetsu101 I think someone can start working on this even before the scopes PR is merged, right? Just using the scopes we have today. Might require some ingenuity but still :)

@naftis naftis self-assigned this Sep 25, 2024
@naftis
Copy link
Collaborator

naftis commented Sep 25, 2024

@rikukissa I'd say we add the code to CC and the countries get it when they pull. I know there are custom workqueues implemented in some countries: we need documentation over how the workqueues can be configured after the technical work is done.

@rikukissa
Copy link
Member Author

@naftis btw, I remember you started doing some exploration for this task – if you have any branches etc open, good to link them to the task description

@naftis
Copy link
Collaborator

naftis commented Sep 25, 2024

Not really - the design became different as we decided to load all of the work queues' first pages simultaneously.

@naftis naftis moved this from In Design to Ready to build in OpenCRVS Core Sep 25, 2024
@jpye-finch jpye-finch changed the title Configurable workqueues Custom workqueues Oct 7, 2024
@jpye-finch jpye-finch changed the title Custom workqueues Custom Workqueues Oct 9, 2024
@naftis naftis removed their assignment Oct 23, 2024
@rikukissa rikukissa removed the Tech label Nov 6, 2024
@Zangetsu101 Zangetsu101 moved this from Ready to build to In Design in OpenCRVS Core Nov 6, 2024
@anninawersun
Copy link

Uganda requirement: #6270 Senior Registration Officer user required

A Registrar plus:

Can review correction requests (if senior approval required)
Can review revoke and reinstatement requests (after review from the ED and Legal)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: In Design
Development

No branches or pull requests

5 participants