diff --git a/.github/environments/values.dev.yaml b/.github/environments/values.dev.yaml index 6c7f94eb..e99a1d8b 100644 --- a/.github/environments/values.dev.yaml +++ b/.github/environments/values.dev.yaml @@ -3,6 +3,7 @@ config: enabled: true configMap: FRONTEND_APIPATH: api/v1 + # FRONTEND_CHES_BCC: ~ FRONTEND_COMS_APIPATH: https://coms-dev.api.gov.bc.ca/api/v1 FRONTEND_COMS_BUCKETID: 1f9e1451-c130-4804-aeb0-b78b5b109c47 FRONTEND_OIDC_AUTHORITY: https://dev.loginproxy.gov.bc.ca/auth/realms/standard diff --git a/.github/environments/values.prod.yaml b/.github/environments/values.prod.yaml index e2452148..8d395a00 100644 --- a/.github/environments/values.prod.yaml +++ b/.github/environments/values.prod.yaml @@ -3,6 +3,7 @@ config: enabled: true configMap: FRONTEND_APIPATH: api/v1 + FRONTEND_CHES_BCC: Housing.Authorizations@gov.bc.ca FRONTEND_COMS_APIPATH: https://coms.api.gov.bc.ca/api/v1 FRONTEND_COMS_BUCKETID: 0089d041-5aab-485e-842d-8875475d0ed6 FRONTEND_OIDC_AUTHORITY: https://loginproxy.gov.bc.ca/auth/realms/standard diff --git a/.github/environments/values.test.yaml b/.github/environments/values.test.yaml index 37ce8cfd..183af524 100644 --- a/.github/environments/values.test.yaml +++ b/.github/environments/values.test.yaml @@ -3,6 +3,7 @@ config: enabled: true configMap: FRONTEND_APIPATH: api/v1 + # FRONTEND_CHES_BCC: ~ FRONTEND_COMS_APIPATH: https://coms-test.api.gov.bc.ca/api/v1 FRONTEND_COMS_BUCKETID: a9eabd1d-5f77-4c60-bf6b-83ffa0e21c59 FRONTEND_OIDC_AUTHORITY: https://test.loginproxy.gov.bc.ca/auth/realms/standard diff --git a/app/config/custom-environment-variables.json b/app/config/custom-environment-variables.json index f69b0f7a..4e5dd9e0 100644 --- a/app/config/custom-environment-variables.json +++ b/app/config/custom-environment-variables.json @@ -1,6 +1,9 @@ { "frontend": { "apiPath": "FRONTEND_APIPATH", + "ches": { + "bcc": "FRONTEND_CHES_BCC" + }, "coms": { "apiPath": "FRONTEND_COMS_APIPATH", "bucketId": "FRONTEND_COMS_BUCKETID" diff --git a/app/src/controllers/roadmap.ts b/app/src/controllers/roadmap.ts index 624d1240..c3555b71 100644 --- a/app/src/controllers/roadmap.ts +++ b/app/src/controllers/roadmap.ts @@ -1,21 +1,20 @@ -import type { NextFunction, Request, Response } from '../interfaces/IExpress'; import { emailService } from '../services'; +import type { NextFunction, Request, Response } from '../interfaces/IExpress'; import type { Email } from '../types'; const controller = { /** - * @function update - * update roadmap + * @function send + * Send an email with the roadmap data */ - update: async (req: Request, res: Response, next: NextFunction) => { + send: async ( + req: Request, + res: Response, + next: NextFunction + ) => { try { - // do other stuff related to roadmap items - // eg: update note where id = req.body.activityId; - - const body = req.body as { activityId: string; emailData: Email }; - // send email - const { data, status } = await emailService.email(body.emailData); + const { data, status } = await emailService.email(req.body.emailData); res.status(status).json(data); } catch (e: unknown) { next(e); diff --git a/app/src/routes/v1/roadmap.ts b/app/src/routes/v1/roadmap.ts index ac073578..4522b09d 100644 --- a/app/src/routes/v1/roadmap.ts +++ b/app/src/routes/v1/roadmap.ts @@ -8,9 +8,9 @@ import type { NextFunction, Request, Response } from '../../interfaces/IExpress' const router = express.Router(); router.use(requireSomeAuth); -// update roadmap -router.put('/', roadmapValidator.update, (req: Request, res: Response, next: NextFunction): void => { - roadmapController.update(req, res, next); +// Send an email with the roadmap data +router.put('/', roadmapValidator.send, (req: Request, res: Response, next: NextFunction): void => { + roadmapController.send(req, res, next); }); export default router; diff --git a/app/src/services/email.ts b/app/src/services/email.ts index 43168d18..1e09dfa0 100644 --- a/app/src/services/email.ts +++ b/app/src/services/email.ts @@ -32,12 +32,12 @@ async function getToken() { * @returns {AxiosInstance} An axios instance */ function chesAxios(): AxiosInstance { - // create axios instance + // Create axios instance const chesAxios = axios.create({ baseURL: config.get('server.ches.apiPath'), timeout: 10000 }); - // add bearer token + // Add bearer token chesAxios.interceptors.request.use(async (config) => { const token = await getToken(); const auth = token ? `Bearer ${token}` : ''; @@ -50,7 +50,7 @@ function chesAxios(): AxiosInstance { const service = { /** * @function email - * sends an email with CHES service + * Sends an email with CHES service * @param emailData * @returns Axios response status and data */ @@ -67,7 +67,7 @@ const service = { /** * @function health - * checks CHES service health + * Checks CHES service health * @returns Axios response status and data */ health: async () => { diff --git a/app/src/validators/roadmap.ts b/app/src/validators/roadmap.ts index 451be01c..967bda6e 100644 --- a/app/src/validators/roadmap.ts +++ b/app/src/validators/roadmap.ts @@ -4,7 +4,7 @@ import { validate } from '../middleware/validation'; const schema = { - update: { + send: { // params: Joi.object({ // activityId: activityId // }) @@ -13,5 +13,5 @@ const schema = { }; export default { - update: validate(schema.update) + send: validate(schema.send) }; diff --git a/charts/pcns/templates/secret.yaml b/charts/pcns/templates/secret.yaml index 5e3c1db7..51f63360 100644 --- a/charts/pcns/templates/secret.yaml +++ b/charts/pcns/templates/secret.yaml @@ -15,10 +15,10 @@ {{- $f1Secret := (lookup "v1" "Secret" .Release.Namespace $f1SecretName ) }} {{- $f2SecretName := printf "%s-%s" (include "pcns.configname" .) "form2" }} {{- $f2Secret := (lookup "v1" "Secret" .Release.Namespace $f2SecretName ) }} -{{- $oSecretName := printf "%s-%s" (include "pcns.configname" .) "oidc" }} -{{- $oSecret := (lookup "v1" "Secret" .Release.Namespace $oSecretName ) }} {{- $chesSecretName := printf "%s-%s" "ches-service-account" }} {{- $chesSecret := (lookup "v1" "Secret" .Release.Namespace $chesSecretName ) }} +{{- $oSecretName := printf "%s-%s" (include "pcns.configname" .) "oidc" }} +{{- $oSecret := (lookup "v1" "Secret" .Release.Namespace $oSecretName ) }} {{- if and (not $dbSecret) (not .Values.patroni.enabled) }} --- diff --git a/charts/pcns/values.yaml b/charts/pcns/values.yaml index 29ebbeb3..e693f262 100644 --- a/charts/pcns/values.yaml +++ b/charts/pcns/values.yaml @@ -132,6 +132,7 @@ config: # to string value "true". configMap: FRONTEND_APIPATH: api/v1 + FRONTEND_CHES_BCC: ~ FRONTEND_COMS_APIPATH: ~ FRONTEND_COMS_BUCKETID: ~ FRONTEND_OIDC_AUTHORITY: ~ diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 9a090168..fcc16b50 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -5,6 +5,7 @@ import { RouterView } from 'vue-router'; import { AppLayout, Navbar, ProgressLoader } from '@/components/layout'; import { ConfirmDialog, Message, Toast, useToast } from '@/lib/primevue'; import { useAppStore, useAuthStore, useConfigStore } from '@/store'; +import { ToastTimeout } from './utils/constants'; import type { Ref } from 'vue'; @@ -25,7 +26,7 @@ onBeforeMount(async () => { // Top level error handler onErrorCaptured((e: Error) => { const toast = useToast(); - toast.error('Error', e.message); + toast.error('Error', e.message, { life: ToastTimeout.STICKY }); }); diff --git a/frontend/src/components/form/TextArea.vue b/frontend/src/components/form/TextArea.vue index 4095db5b..27a465c6 100644 --- a/frontend/src/components/form/TextArea.vue +++ b/frontend/src/components/form/TextArea.vue @@ -12,6 +12,7 @@ type Props = { placeholder?: string; disabled?: boolean; bold?: boolean; + rows?: number; }; const props = withDefaults(defineProps(), { @@ -20,7 +21,8 @@ const props = withDefaults(defineProps(), { label: '', placeholder: '', disabled: false, - bold: true + bold: true, + rows: 5 }); const { errorMessage, value } = useField(toRef(props, 'name')); @@ -42,7 +44,7 @@ const { errorMessage, value } = useField(toRef(props, 'name')); class="w-full" :class="{ 'p-invalid': errorMessage }" :disabled="disabled" - :rows="5" + :rows="rows" /> {{ helpText }}
diff --git a/frontend/src/components/roadmap/Roadmap.vue b/frontend/src/components/roadmap/Roadmap.vue new file mode 100644 index 00000000..a910e229 --- /dev/null +++ b/frontend/src/components/roadmap/Roadmap.vue @@ -0,0 +1,165 @@ + + +