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

Added frontend readme #1920

Merged
merged 1 commit into from
Dec 13, 2023
Merged
Changes from all commits
Commits
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
21 changes: 21 additions & 0 deletions src/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## State Machine

The state macine can be found under `src/utils/statusList`.

This state controls what actions can be taken at each status in a pia form based on your Keycloak role.

The most common ways to interact with the state machine is by checking privileges using the functions in `src\utils\statusList\common.ts`. One function requires the pia as input and the other just goes by status.

The other way of checking a property of the status list is by using `statusList(pia)?.[pia.status]?.<property>` where `<property>` is the property you want to grab.

### Page Parameters

Some properties of each page in a pia form are controlled by the status list. These will need to be added as Typescript types to `src\utils\statusList\types.ts` such as `ReviewPageParams` and then added to the type `PageParamProperties`.

These can then be set under each status > `Privileges` > `<Role>` > `Pages` > `<Page>`, where `<Role>` is the role such as MPO, CPO, or Drafter, and `<Page>` is the page from Typescript type `Page`.

---

## Autosave

TBD
Loading