diff --git a/src/frontend/README.md b/src/frontend/README.md new file mode 100644 index 000000000..08dfcb047 --- /dev/null +++ b/src/frontend/README.md @@ -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]?.` where `` 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` > `` > `Pages` > ``, where `` is the role such as MPO, CPO, or Drafter, and `` is the page from Typescript type `Page`. + +--- + +## Autosave + +TBD