Repository navigation
Labels
Description
This is a parent ticket to align all 'manage' functionality.
IMPORTANT: Additional changes may be asked in the child tickets relevant to that specific item.
Each child ticket should update the relevant Manager's component, composable and other required changes at the same time (May require schema or util changes).
In order to keep our projects maintainable, we should aim to stay consistent across components and composables. There are also some new patterns to help keep things consistent.
Directory structure
- Components to be moved under 'Manage' directory. eg
components/ManageOffices/index.vue->components/Manage/Offices/index.vue - Composables to be moved under 'manage' directory. eg
composables/useManageOffices.ts->composables/manage/useManageOffices.ts
Composable Refactor
See useManageOffices for conventions.
- Add optional
optsparam with optionalcleanupFnproperty - Handle tableState only (not adding or expanded state)
- Clone objects using cloneDeep (not structuredClone or json.parse/stringify)
- this will preserve typing lost by json.parse and prevent unhandled errors cause by vue proxies in structuredClone
- Update table should accept 1 argument and find the row to update via item.new.id
- Rename methods/params/whatever else to use generic
subjectnaming - When applying edited actions, use isEqualOmit to exclude non-editable fields (id, actions, etc)
Component Refactor
See ManageOffices for conventions.
- Expanded state should be handled at the
Managecomponent level - Adding state should be handled at the component level
- Use
useManageCommonfor the variants, allowed actions, setActiveAlerts. label overrides, etc - Update naming to use generic 'subject' suffix where applicable (functions, refs, computeds, etc)
- Update table component get-row-id prop
:get-row-id="(row: TableBusinessState<T>) => row.new.id"(may require schema change) - Update props interface to include preventActions and actionPreventedSignal instead of using TS intersection
- Clone objects using cloneDeep (not structuredClone or json.parse/stringify) for the same reason as the composables
- Pass cleanup function to composable and let composable handle the callback (removes need for wrapper functions in component)
- Remove
requiredfrom defineModel options (active subjects are allowed to be undefined) - activeSubject defineModel should use 'active-subject' key
- 'subject' prop should be optional
Implementation Refactor - IMPORTANT
- Only if necessary - update usage in playground examples and current filings
- May require schema changes (eg parties in corrections should all use the same model ref)
- Ensure all current tests pass, dev to add additional at their discretion
- Dev to ensure they do not introduce new bugs into any current filings (init, save and resume, typecheck, tests, etc should all still work correctly after refactor)
Sub-issues
Collapse Sub-issuesSub-issues
Loading 6 sub-issues
Activity
[-]UI - business-ui: Refactor ManageX components[/-][+]UI - business-ui: Refactor Manager components[/+]