-
Notifications
You must be signed in to change notification settings - Fork 8
Frontend/social work search updates #1844
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
Open
jsandoval81
wants to merge
9
commits into
csg-org:main
Choose a base branch
from
InspiringApps:frontend/sw-search-updates
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
a8bf292
WIP: SW search updates
jsandoval81 274348f
WIP: SW search updates
jsandoval81 d1bb26d
Merge branch 'main' into frontend/sw-search-updates
jsandoval81 c2c29e5
WIP: SW search updates
jsandoval81 3e71de6
WIP: SW search updates
jsandoval81 ca51526
WIP: SW search updates
jsandoval81 5c963c4
PR review feedback
jsandoval81 cb031a6
PR review feedback
jsandoval81 2240b32
PR review feedback
jsandoval81 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| # Adding a new compact (new AppMode) | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Backend API hosts and staff Cognito app exist (or are being added in parallel) | ||
| - Cognito callback URLs for the new staff auth servers; and if practitioners are allowed to register, a URL for that as well | ||
| - Choose an existing `AppGroupMode`: | ||
| - `PRIVILEGE_PURCHASE` (JCC-style) | ||
| - `MULTI_STATE` (cosmetology / social work–style) | ||
| - One new compact usually maps to one `AppModes` value | ||
|
|
||
| ## Naming | ||
|
|
||
| | Concept | Example | Notes | | ||
| |---------|---------|--------| | ||
| | `CompactType` value | `socialwork` | API / locale key (`compacts[].key`, license `compactKey`) | | ||
| | `AppModes` value | `socialwork` | **Must** equal the auth callback path segment | | ||
|
|
||
| Auth callback path is built as: | ||
|
|
||
| `/auth/callback/staff/{AppModes value}` | ||
|
|
||
| Example: `AppModes.SOCIAL_WORK = 'socialwork'` → `/auth/callback/staff/socialwork` | ||
|
|
||
| ## Already automatic | ||
|
|
||
| Once the config and infra wiring below are in place, these do **not** need per-compact UI lists or interceptor edits: | ||
|
|
||
| - PublicDashboard staff login cards (`$compactsEnabled`) | ||
| - CompactSelector (public + permission-based options) | ||
| - Logout, token refresh, and token revoke (`getCognitoConfig`) | ||
| - Auth callback path string (`getAuthCallbackPath`) | ||
| - Network request base URLs (`getApiBaseUrl` + API interceptors) | ||
| - `setAppMode` → `appGroupMode` (`getAppGroupModeForAppMode`) | ||
| - Router compact param → app mode (`getAppModeForCompact`) | ||
|
|
||
| ## Steps | ||
|
|
||
| ### 1. Core enums and compact config | ||
|
|
||
| **`src/app.config.ts`** | ||
|
|
||
| - [ ] Add `AppModes.YOUR_MODE = 'yourmode'` | ||
|
|
||
| **`src/utils/compactConfig.ts`** | ||
|
|
||
| - [ ] Add `CompactType.YOUR_COMPACT = 'abbr'` | ||
| - [ ] Add `compactSetups` entry (`type`, `appMode`, `isEnabled`) | ||
| - [ ] Add `appModeGroups[AppModes.YOUR_MODE]` → existing `PRIVILEGE_PURCHASE` or `MULTI_STATE` | ||
| - [ ] Add `appModeEncumberConfigs[AppModes.YOUR_MODE]` (license + privilege discipline / NPDB lists; reuse shared helpers when possible) | ||
|
|
||
| ### 2. Environment | ||
|
|
||
| **`.env` / `.env.example`** | ||
|
|
||
| - [ ] Add the four API roots for the new mode: state, license, search, user | ||
| - [ ] Add the Staff Cognito auth domain + client id | ||
| - [ ] Add the Practitioner / Licensee Cognito auth domain + client id (if needed) | ||
|
|
||
| **`src/plugins/EnvConfig/envConfig.plugin.ts`** | ||
|
|
||
| - [ ] Add fields on `EnvConfig` | ||
| - [ ] Map them from `VUE_APP_*` keys | ||
|
|
||
| **`tests/mocks/mockEnvConfig.ts`** | ||
|
|
||
| - [ ] Add matching mock fields | ||
|
|
||
| ### 3. Wire mode → infra tables | ||
|
|
||
| **`src/network/apiUrls.ts`** | ||
|
|
||
| - [ ] Add a row to `appModeApiUrls` for all four API families (`state`, `license`, `search`, `user`) | ||
| (`Record<AppModes, …>` will fail to compile until this is done.) | ||
|
|
||
| **`src/utils/auth.ts` → `getCognitoConfig`** | ||
|
|
||
| - [ ] Add a staff branch for the new `AppModes` that reads the new env Cognito fields | ||
|
|
||
| ### 4. Auth callback route and page | ||
|
|
||
| **`src/router/routes.ts`** | ||
|
|
||
| - [ ] Add route `/auth/callback/staff/{yoursegment}` | ||
| Path must equal `getAuthCallbackPath(AppModes.YOUR_MODE, AuthTypes.STAFF)` | ||
|
|
||
| **`src/pages/AuthCallback/StaffYourMode/`** | ||
|
|
||
| - [ ] Add a thin page (copy `StaffCosmo` / `StaffSocialWork` pattern) | ||
| - [ ] Set `appMode = AppModes.YOUR_MODE` and `authType = AuthTypes.STAFF` only | ||
| - [ ] Add a mount spec (optional; matches existing AuthCallback pages) | ||
|
|
||
| **`src/router/router.spec.ts`** | ||
|
|
||
| - [ ] Add `{ name, path: getAuthCallbackPath(...) }` for the new staff callback route | ||
|
|
||
| ### 5. Store and Compacts plugin flags | ||
|
|
||
| **`src/store/global/global.getters.ts`** | ||
|
|
||
| - [ ] Add `isAppModeYourMode: (state) => state.appMode === AppModes.YOUR_MODE` | ||
|
|
||
| **`src/plugins/Compacts/compacts.plugin.ts`** | ||
|
|
||
| - [ ] Add `'isAppModeYourMode'` to `appModeFlags` | ||
|
|
||
| **`src/plugins/Compacts/compacts.d.ts`** | ||
|
|
||
| - [ ] Declare `$isAppModeYourMode: boolean` | ||
|
|
||
| ### 6. i18n / product copy | ||
|
|
||
| **`src/locales/en.json` and `src/locales/es.json`** | ||
|
|
||
| - [ ] Add `compacts[]` entry (`key` = `CompactType` value, `name`, `abbrev`) | ||
| - [ ] Add `licensing.licenseTypes` entries with matching `compactKey` as needed | ||
|
|
||
| ### 7. Mock data | ||
|
|
||
| **`src/network/mocks/mock.data.ts`** | ||
|
|
||
| Needed when exercising the new compact under the mock API: | ||
|
|
||
| - [ ] Add a `staffAccount.permissions` entry keyed by the new `CompactType` value (mirror `aslp` / `cosm` / `socw`) | ||
| - [ ] Add the same key on any other mock staff permission blobs in this file that list every compact | ||
| - [ ] If the compact **allows licensee registration**, add it to `compactStatesForRegistration` | ||
| (Cosmetology and social work are omitted there on purpose because they do not allow registration.) | ||
| - [ ] Add or extend licensee / search fixtures only if you need mock flows for that compact (many fixtures stay on `octp` by default) | ||
|
|
||
| ### 8. Optional / situational UI | ||
|
|
||
| Only if the new compact should participate in these flows: | ||
|
|
||
| **`src/pages/PublicDashboard/PublicDashboard.ts` → `bypassRedirect`** | ||
|
|
||
| - [ ] Add a `?bypass=login-staff-…` case if emails or deep links need it (see cosmo / social work) | ||
|
|
||
| **`RegisterLicensee` / `MfaResetStartLicensee`** | ||
|
|
||
| - [ ] These still use hard-coded compact allow-lists — add the new `CompactType` only if those pages should offer it | ||
|
|
||
| **Mode-specific UI audit** | ||
|
|
||
| Decide whether behavior should follow JCC-like or multi-state-like patterns. Prefer `$isAppGroupMode*` when the behavior is really group-scoped. Audit existing `$isAppModeJcc` / `$isAppModeCosmetology` / `$isAppModeSocialWork` usages, for example: | ||
|
|
||
| - LicenseCard / PrivilegeCard | ||
| - LicensingDetail (e.g. military affiliation) | ||
| - LicenseeSearchLegacy | ||
| - UserInvite / UserRowEdit | ||
|
|
||
| ### 9. Tests to extend | ||
|
|
||
| - [ ] `src/utils/compactConfig.spec.ts` — setup, app group, encumbrance, enablement gating | ||
| - [ ] `src/network/apiUrls.spec.ts` — all four families for the new mode | ||
| - [ ] `src/plugins/Compacts/compacts.spec.ts` — list membership / globals if asserted | ||
| - [ ] `src/pages/PublicDashboard/PublicDashboard.spec.ts` — staff login URI for the new mode (optional) | ||
| - [ ] LicenseCard / PrivilegeCard encumber specs if per-mode assertions are kept there | ||
| - [ ] AuthCallback mount + router path consistency |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.