Skip to content

Commit 31cfe07

Browse files
nikhila-aotjaspalsingh-aotanton-bcgovmidhun-aotnupurdixit13
authored
Dev to Main merge - 2 June for TEST deployment (#920)
* review comment fix * CATS: fix FE fonts * define appropriate font-family fallbacks * rename entities, resolver, service and addcustom exception * Renaming in frontend * Add delete person notes * fix review comments * add delete person feature * Add test cases * adding a new ftl and category * Roll back Side bar animation and spacing of content container code * fix css issue * design token color issue fix * frontend test case * Addressing few minor comments * Removing console * env for geocoder * delete .env file * removing the constraints to support data migration * fix errors * fix geocoder issue * remove commented code * fix: docker-compose incorrect indentation * feat: SRS-859 - useAutoSignin hook + auth flow fixes * WIP: vite migration * migrate tests to use vitest instead of jest * fix typo * chore: expose database port for development * SOSC edits to AP section * changes for task assignment * chore: sync lock files with package files. * updating docker-compose * changes to email template & bpm * disabled form content for approving authority users * Updated comments in user controller * removed console logs and hardcoded values * removed commented code * run prettier formatter * prettier check github action * update working dir * try that again * change path * try working_directory again * update prettierignore * set work dir on the job level * remove only_changed * remove only_changed * try a different path * oh no * another try * come on now * pass ignore and config options * new path * put only-changed back * commit test file with busted formatting * test only-changed * display error message * format error message * try gh actions command for message instead * aw yess it worked * test commit * `@bcgov/design-tokens` version upgrade, css variables cleanup * Add UI logic for participants tab * Logic to fetch participants * Add a new column to table * Show the values in table row * Fix CSS and remove console logs * Formatted using prettier * feat: SRS-854 Implement Backend for Application Search * Well that was embarrassing * Add unit tests for backend * Fixed CSS * CATS: apollo client setup, update Participants tab to use it * Changes related to Dto structure * CATS: Application page - set current tab in URL search params * shorten the tabSearchKey * remove redundant styles (d-flex already covers the removed classes) * Updating the Email Assignement ID as its conflicting the existing camunda deployments * change folder sturcture and fix test cases and review comments * run prettier * adding 'users' component to epd-backend (#781) * run prettier to pass PR * update the image tag (#782) * change folder structure and fix test case * bug fix- adding the components (#783) * fix error * error-fix * Replacing Person Entity Reference With ViewPerson DTO to resolve the build error facing in openshift * Fixing API Route Path * Adding Missing Change For Redirection * Fix Dto class * CATS: fix codegen for node v22+ * delete codegen.ts * fix side bar css issue * prettier issue fix * feat: SRS-854 Implement Frontend for Application Search * remove my apollo client that should not be used * Banish redux to the shadow realm and add search debounce delete file I thought I deleted before * Update button divs to be buttons * use bootstrap inline flex class * add BEM style class name for tablecontrols component styling * Implement Apollo Client * Fix some merge errors * Update generated files * Run prettier * chore: CATS - fix codegen when running concurrently with dev build * Srs 870 (#792) * test image update * testing- adding image triggers to deployment * testing image triggers in dev * fixing syntax issues (#794) * rename dto files * Add filters for participants * formatted files * remove logs * Srs 870 fixingenv (#795) * test env variable issue * test deploy * update indentation fix * test * test update syntax error * added config to -updating the image streams * adding the new envs * fixing readiness/liveness probe failure * fixing readiness/liveness probe * fixing the indentaion issue (#798) * Removed the unused files * Added logs and moved files to correct folders * Move the enum file to correct folder * Fix broken dockerfile * chore: skip failing unit tests * skip additional broken test * chore: Clean up broken github workflows. (#805) * chore: Remove github workflow for SITE application. * Disable failing sonarcloud step * feat: SRS-790 - graphql endpoint for fetching application's housing records (#800) * feat: SRS-790 show application housing records (#801) * feat: SRS-790 - graphql endpoint for fetching application's housing records * feat: SRS-790 show application housing records * remove unnecessary fragment * fix subtle navigation bug * chore: CATS - apply commonly used table styles to the base table components (#802) * feat: SRS-790 - graphql endpoint for fetching application's housing records * feat: SRS-790 show application housing records * CATS: extract common table css * don't need important here * chore: Run unit tests on cats frontend in CI/CD pipeline (#806) * chore: Run unit tests on cats frontend in CI/CD pipeline * Revert "chore: Run unit tests on cats frontend in CI/CD pipeline" This reverts commit 36af295. * chore: run unit tests on cats front end for pr open * Skip failing unit test * add cats-frontend to build includes * add jest import * disable jest mock because it's causing issues with vite test * remove cats-frontend from build * replace jest with vi * renaming users to cats folder (#807) * renaming users to cats folder * removing users folder form ci-cd files * remove unit tetss for users * test update * test update * test update * test update * test cats rename * test cats rename * test rename * Fix module spelling (#810) * chore: re-add cats unit tests, disable sonarcloud for the time being (#809) * fix: update dockerfile to no longer reference users. (#812) * fix: update dockerfile to no longer reference users. * revert change to userapi doc, because that folder was not renamed * fix input control label changes and date picker (#813) * Application Search Updates 1. Relocate Application Search into the application folder 2. Update the Application Search response to use the PagedResponseDto base class 3. Update logging 4. Add error handling. * Update SearchApplications GraphQL Query * chore: remove openshift deploy for sites (#808) * remove openshift deploy for sites * empty commit to force ci/cd to run --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * Correct label to cater the actual search keyword * New email templates for SDS forms and updated email-template.dmn (#818) * feat: ci-cd for cats including DB deployment (#821) * feat: Ci-cd pipelines craeted for CATS (includes DB deployment) * fix: Ci-cd pipelines craeted for CATS (includes DB deployment) * fix: removing paths in the cats PR yml * adding local government - changes for SDS workflow & form (#823) * feat: SRS-854 Implement Application Search Table Sort. (#822) * Feat/srs 605 testbranch (#826) * fix: removing dev branch and marking as main * fix: removing dev and main branches as part of TEST deployment in OS * fix: changing the branch name to a different one. The default chaecks are failing * Add few fields to be nullable in AppParticipant table (#829) * BCBox + COMS - Re-enable formsflow (#830) * feat: SRS-790: Graphql mutations to create and update application housing records (#831) * SRS-790: Graphql mutation to create and update application housing records * remove unprotected decorators * feat: SRS-897 - Updating to VITE & VITEST (#828) * updating react scripts to vite for frontend folder * Replace ENV variables with REACT_APP_ to VITE_ & updated JEST to vitest * Removing commented code * Updated vite config file and updated routes * Added vite-env.d.ts file and updated user manger setting * Update Dockerfile : replaced with build with dist folder * adding @vitest/coverage-v8 * Reverting to build folder as vite output to build in vite.config.ts * Updating docker node image * Reverting changes to UserManagerSetting.ts (#834) * remove bad condition from appsearch query (#838) * fix: Application Search: Handle paging properly (#839) * feat: srs 846 - API to create an application when a form is submitted in SRS (#836) * application api - to be called from FF * unit test issue fixes * feat: SRS-790 - Add housing modal (#832) * feat: SRS-790 - Add housing modal * Add disabled states, close modal on mutation complete --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * correcting schema name (#842) * SRS-860 Staff Assigned Widget (#841) - Implement Staff Assigned Widget - Implement View Widget - Implement Date Formatting * feat: SRS -783 : Add App Participant feature (#843) * Add the FE functionality for add app participant * Add CSS for the fields in modal + fix existing FE test cases * Add the logic to amend the form fields * Add logic to populate roles + few API * Add more logic to Add person names * fix search dropdown issue * correct the search query and logic for person data * Fix updating form data to be added for new participant * fix the dropdown selection issue in InputControls * Fix dropdown value for participantName * Fix the search issue for Organization * Add logic for adding the participant in DB * Fixed some issue related to adding app participant * Adding check to avoid duplicate entries * Fixing the case when the result cache could have same results stored for person and org * Added Validations and fixed save functionality * Unit tests for Adding AppParticipant * return data after adding new particpant * Removed console and hardcoded appId * remove console and revert changes made in common component * revert change made to this file * Add applicationId for cases wherein no app participants exists * prettier formatting * Update InputControls.tsx * refresh participants when added * refactor DTO class * Replace axios call with apollo * Addressing few review comments * code formatting * code cleanup and formatting * Refetching data * Change the way form needs to be updated * remove console.logs * Address comment * formatted * address comments --------- Co-authored-by: Jaspal.Singh-AOT <163812444+jaspalsingh-aot@users.noreply.github.com> * fix: Application Search Table shows no results (#846) * fix: SRS-905 - View links lead to invalid URLs (#849) * fix: SRS-905 - View links lead to invalid URLs * justify center * feat: changes to pick app type from db (#853) * changes to pick app type from db * changes based on review comments * changes per review comments * feat: Add bcgovpubcode.yml (#854) * Add bcgovpubcode.yml * remove unused bcgovpubcode.yml files --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: SRS-790: Add Housing Modal - fetch options for housing types and related applications fields (#847) * SRS-790: Add Housing Modal - fetch options for housing types and related applications fields * move related apps field into components folder, add data entry instructions message * add searchApplicationsById resolver and service method tests * fix imports * fix test providers * add logger statements * fix tests perhaps? --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: SRS-790: Add Housing modal checkboxes (#850) * SRS-790: Add Housing Modal - fetch options for housing types and related applications fields * move related apps field into components folder, add data entry instructions message * add searchApplicationsById resolver and service method tests * fix imports * fix test providers * SRS-790: Add Housing modal checkboxes * feat: changes to introduce form id and submission id instead of application id (#855) * changes to pick app type from db * changes based on review comments * changes per review comments * replacing application id with form id and submission id * changed schema name * feat: SRS-790 - Update Application Housing Modal (#851) * SRS-790: Add Housing Modal - fetch options for housing types and related applications fields * move related apps field into components folder, add data entry instructions message * add searchApplicationsById resolver and service method tests * fix imports * fix test providers * SRS-790: Add Housing modal checkboxes * feat: SRS-790 - Update Application Housing modal * Add validation --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: SRS-789 Implement Associated Files (#856) * API to integrate form submission with CATS (#858) * Chanages For Site Owner Task Assignement (#859) * Form Chagnes For SRS-908 (#861) * feat: SRS-908 : Change to validate BCEID account and remove Camunda admin (#863) * Change to validate bceid account and remove camunda admin * Removing Saved Path From Session to avoid unwanted redirects * Removed Console log statement * feat: SRS-782 Application Information panel (#852) * SRS-790: Add Housing Modal - fetch options for housing types and related applications fields * move related apps field into components folder, add data entry instructions message * add searchApplicationsById resolver and service method tests * fix imports * fix test providers * SRS-790: Add Housing modal checkboxes * feat: SRS-790 - Update Application Housing modal * Add validation * feat: SRS-782 - Recactor `PanelWithUpDown` component, display hard-coded data in details page * Fetch data for Application Information panel * determine taxExempt status * update isTaxExempt logic * remove irrelevant comments * rename the query * add logging * Updated Needs More Info validation logic (#868) * resolve peer dependency issues as react-formio, formio is not compatible with react 18 (#871) * Add legacy dependency (#872) * feat: SRS 910 Application: Integrate the forms flow forms to CAT (#869) * Embed formsflow in cats * remove warning because of readonly in Form io * fix package.json issue * integerate backend api to get formid and submission id from application * make component type safe and add error handling * fix prittier issues * fix minor issue and upgrade the formio version * fix format issue and compatibility issue * add --legacy-peer-deps in docker file * fix missing dependency * add loader from reusable components * fix review comments * fix review comments * change formio to latest version available * fix review comments * formatting * fix review comment * remove formio.min.css cdn from index.html and used it from installed package directly in application component * formatting * fix version issue --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: srs-787 implement data model for new invoice application (#867) * feat: SRS 787 Implement getInvoicesByApplicationId (#874) * feat: srs-787 implement data model for new invoice application * feat: srs-787 Implement getInvoicesByApplicationId * feat: SRS-911 (#876) * implement sticky header and fix flickering effect * implement sticky header with dynamic values and matched with current design css * add logic to check if any of siteId, appId and description is not there * formatting * feat: SRS-782 - getSiteDetailsBySiteId query, BE codegen script (#873) * feat: SRS-782 - getSiteDetailsBySiteId query, BE codegen script * remove unused dep * generated files * fix tests * address review comments * feat: SRS-782 - site details panel (#875) * feat: SRS-782 - getSiteDetailsBySiteId query, BE codegen script * remove unused dep * generated files * feat: SRS-782 - site details panel * use the same map marker asset as in Site * better handling of loading state * add external links to Site registry * fix coordinate logic * fix FE test * Use LoadingSpinner for consistent styles * feat: SRS-782 - Details tab: associated sites table (#877) * SRS-782 - Details tab: associated sites table * fix ts warning, add missing css import * change path alias to @cats --------- Co-authored-by: jaspal-aot <163812444+jaspalsingh-aot@users.noreply.github.com> * generated files --------- Co-authored-by: jaspal-aot <163812444+jaspalsingh-aot@users.noreply.github.com> * Add invoice creation endpoint (#880) Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: Implement update invoice API endpoint (#886) * Implement update invoice API endpoint * Update logging messages, and graphql return type * Implement Invoice Delete GraphQL Endpoint (#887) * chore: SRS-917 - add auth mock mode, improve auth error handling (#883) * chore: SRS-917 - add auth mock mode, improve auth error handling * Update backend/cats/src/app/filters/graphql-exception.filter.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * fix copilot's slop --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> Co-authored-by: Brendon O'Laney <102920963+bolny@users.noreply.github.com> * chore: SRS-918 surface operation names in Graphql requests (#884) * chore: SRS-918 surface operation names in Graphql requests * remove redundant comments * Update cats-frontend/src/apollo.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: SRS - 783 - Edit App participant feature (#889) * Edit App Participant logic * BE: Add graphql queries and API for updating app participant * Disabling relevant fields on FE in edit mode * Fix alternate edit and add issue * Add unit tests for BE * Added try-catch block and few more UT's (#891) * feat: SRS-470 - Changes For Staff Assignment (#892) * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Delete backend/cats/G * fixing review comments * Fixing unit test cases * Fixed Reivew Comments * fix: Update invoice service to support LineItems. (#890) Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * SOSC edits (#894) * feat: Srs 941: Staff Assignment Updating Email Template (#895) * Changes For Updating Email Template * Changes For Updating Email Template --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * CATS Deployment and CI/CD - Active dev of SRS-605 and github actions (#879) - DEV AND TEST ENVS * Triggering 605 action and monitoring for cats-pr-open * Fixing issue with dependencing with github event number for concurrency * Trying to get cats PR to work on push, just to simplify things. * Fix docker build issues with cats frontend, fixing capitalization issue and folder path issue * Removing seed data configs and initContainer from yaml for cats backend, checking with team, but believe this is not needed * Reduce timeout, try and fix issue with hanging installs from prev actions * Attempging just deploy step, not deploys_db step, to verify which step helm is hanging on with pending install * Re-enable deploys_db, also setup backend-migration step. * Removing push to branch, as that may be causing issue with db deploy step. * Fix cats pr open build context * Fix spacing * Fixing push to commit * Removing on push, adding the branch to dev to trigger in PR * Focing db deploy, as having issues with it * Re-enable seed data deployment yaml, though it's still disabled in values.yaml for now until we get deployment working. * Disable seed data in values-pr.yaml for now, will re-enable after uploading db dump. * Temporarily hardcoding the host connection as unable to find where it's set in the secret. * Added debug logging * Reverting connection string secret after finding out it's pvc constrainted * SQL upload scripts working and documentation updated * Fix initDb.sh to quote the database name, as it has a '-' which causes issues, trying again. * Re-enable seed data import, after having uploaded file previously * Re-enable lines that lead to issue with missing seed.sh file. * Fix issue with quoting db name in some commands leading to errors, but leaving it in create db command where it's required. * Claimname updated for nr-cats-dbdump-sql * Attempting to fix migrations initDb.sh errors, still having some quoting issues, adding proper logging to help clarify * Attempging to change schema name `site`->`cats` in values.yaml, if fails, will revert to values-pr.yaml * Quoting db username and schema, not just db name, as those two were also giving issues. * Had issue with previous quote attempt, trying quoting inline instead. * Remove unnecessary lines from dockerfile * Updating deployment yaml image name to have `cats-frontend`, as otherwise it's deploying the wrong name. * Hardcoding cats-frontend into deployment.yaml * Attempging to fix helm yaml formatting of line 33, for some reason giving issues only in gha * Update port `3000`-`4005` for deployment yaml, as server listens to 4005. * Loading config.js, same as epp.gov.bc.ca approach * Rename vars in config.js from REACT_APP_ -> VITE_ * Setting up window._env_ vars, updating code to use it, properly typing it. * Fixed typo issue of double underscores vs single underscores * Try and fix issue of duplicate seed data executing, as it was checking wrong db * Attempting to set dynamic redirect uri based on PR number. * Added trailing slash * String quoting the line that's causing issues, same as other lines * Addinv VITE_GEOCODER_API url path to helm charts * Updating KC client * Adding in the rest of values from example.env, like VITE_FORM_FLOW_API, still need to validate all values are correct. * Setting SITE_SERVICE_URL for backend to `epd-backend-applications` * Switching seed data check to cats.app_type * Force db deploy trigger * Trigger db redeploy, re-migrate, re-seed, and capture logs. * Add in debug logging to db deploy step * Setup email test values for dev. Note: Also setup keycloak values as Github Secrets, re-deploying to verify the secret (secret.yaml) is properly configured on deploy. * Remapping KEYCLOAK -> KEYCLOCK in the deployment.yaml * Secrets were not set properly, due to name mismatch, trying again. * Start scaffolding test github action files, update GitHub Secrets for keycloak client, redeploying and testing * Removing secret remapping as it's no longer necessary with secret name. * Remove config we no longer need * Setting CHES values * Update secret with CHES * CHES, fixing passing in id and secret from Github actions to helm * Tweaking logout url * Trying to fix malformed secret.yaml file having issue on github actions about expecing string. * Pasing in CHES config values to deployment; secrets already securely setup in github / ocp secret. * Attempting to also include test deployment openshift yaml * Adding CHES files to test yaml deploy * Conditional nullcheck for window._env_, was affecting unit tests * Fix prettier issues --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * feat: SRS-593 Manage Staff Assignment Dashboard. (#896) * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Delete backend/cats/G * implement staff dashboard * integerate backend to frontend * merge confict fix * fix merge conflict * fix merge conflict * test cases * fix merge conflict and add manager role authentication. * fix merge conflict * run prittier * fix merge conflict --------- Co-authored-by: midhun-aot <midhun.murali@aot-technologies.com> Co-authored-by: midhun-aot <105463561+midhun-aot@users.noreply.github.com> * fix: Added filter logic in Application Search to include only staff users (#897) * Changes For Updating Email Template * Changes For Updating Email Template * changes for including housing priority * Corrected staff filter condition in query * changes for including housing priority * Corrected staff filter condition in query * Fixed unit test case * feat: SRS-593 Manage Staff Assignment Dashboard. (#896) * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Adding graphql file * Changes for Assignment - initial * Changes for staff assignment * Delete backend/cats/G * implement staff dashboard * integerate backend to frontend * merge confict fix * fix merge conflict * fix merge conflict * test cases * fix merge conflict and add manager role authentication. * fix merge conflict * run prittier * fix merge conflict --------- Co-authored-by: midhun-aot <midhun.murali@aot-technologies.com> Co-authored-by: midhun-aot <105463561+midhun-aot@users.noreply.github.com> * changes for including housing priority * Corrected staff filter condition in query * Changes For Updating Email Template * Changes For Updating Email Template * Fixed unit test case --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> Co-authored-by: jaspal-aot <163812444+jaspalsingh-aot@users.noreply.github.com> * feat: changes showing different application status to client users (#902) * changes showing diff status to client users * removed status used for testing * Updated Status for SDS workflow * fix: CATS ENV- UI updates for Navigation and Application Tab (#906) * Fix nav position and error message issue * formatting --------- Co-authored-by: midhun-aot <105463561+midhun-aot@users.noreply.github.com> * Updated users-service to cats-service (#907) Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> * SRS-785: API to create, update and get timesheet days (#908) * feat: SRS-788 - view application notes (#881) * feat: SRS-788 - view application notes * feat: SRS-788 - Create / Update / Delete application notes (#882) * Add create and update actions to application notes * note delete action * change copy * Update cats-frontend/src/app/features/applications/application/applicationTabs/appNotes/components/NoteModal.tsx Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * generated types --------- Co-authored-by: nikhila-aot <38471389+nikhila-aot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: srs-946 (#905) * fix for bug 946 * fix not working, reverting migration * changed to trigger a deployment * Updated VITE_FORM_API FORM_BACKEND_API AND VITE_FORM_FLOW_API --------- Co-authored-by: Adam Coard <adam.coard@aot-technologies.com> * feat: SRS-930 Permissions Manage People (#911) * implement person permissions * Add test cases * add permission which is not exists in db * useEffect issue fix * fix minor issue * formatting * fix test case issue * Revert "formatting" This reverts commit eed4563. * formatting frontend * fix typo * fix review comment * add logger and fix typo * add enum as per review comment * fix test case * feat: srs-787 Implement Front End for Invoices Index (#900) * feat: srs-787 Implement Front End for Invoices Index * Modularized CSS * Import useState * Banish console.log * Rename Enum * fix: SRS-949 (#913) * fix for bug 946 * fix not working, reverting migration * changed to trigger a deployment * fix for application getting created twice in FF * fixed UTC --------- Co-authored-by: midhun-aot <105463561+midhun-aot@users.noreply.github.com> * feat: Feat/srs 949 (#916) * fix for bug 946 * fix not working, reverting migration * changed to trigger a deployment * fix for application getting created twice in FF * fixed UTC * add console to test in DEV --------- Co-authored-by: Jaspal.Singh-AOT <163812444+jaspalsingh-aot@users.noreply.github.com> Co-authored-by: Anton <anton.trublin+bcgov@gmail.com> Co-authored-by: midhun-aot <midhun.murali@aot-technologies.com> Co-authored-by: midhun-aot <105463561+midhun-aot@users.noreply.github.com> Co-authored-by: nupurdixit13 <nupur.dixit@gov.bc.ca> Co-authored-by: Brendon O'Laney <Brendon.O'Laney@gov.bc.ca> Co-authored-by: Brendon O'Laney <102920963+bolny@users.noreply.github.com> Co-authored-by: sakthi-aot <81777282+sakthi-aot@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: acoard-aot <61285798+acoard-aot@users.noreply.github.com> Co-authored-by: Adam Coard <adam.coard@aot-technologies.com>
1 parent f6d55c0 commit 31cfe07

File tree

270 files changed

+62549
-17324
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

270 files changed

+62549
-17324
lines changed

.github/workflows/.dbdeployer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ jobs:
108108
run: |
109109
echo 'Deploying crunchy helm chart'
110110
if [ ${{ inputs.s3_enabled }} == true ]; then
111-
helm upgrade --install --wait --set crunchy.pgBackRest.s3.enabled=true \
111+
helm upgrade --install --wait --set crunchy.pgBackRest.s3.enabled=true --debug \
112112
--set-string crunchy.pgBackRest.s3.accessKey=${{ secrets.s3_access_key }} \
113113
--set-string crunchy.pgBackRest.s3.secretKey=${{ secrets.s3_secret_key }} \
114114
--values ${{ inputs.values }} postgres .

.github/workflows/.deployer.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ on:
5555
default: 'values.yaml'
5656
required: false
5757
type: string
58+
redirect_uri:
59+
description: 'Redirect URI for Keycloak'
60+
required: false
61+
type: string
5862

5963
outputs:
6064
triggered:
@@ -160,6 +164,9 @@ jobs:
160164
--set-string global.secrets.keycloakRealm="${{ secrets.KEYCLOAK_REALM }}" \
161165
--set-string global.secrets.keycloakClientID="${{ secrets.KEYCLOAK_CLIENTID }}" \
162166
--set-string global.secrets.keycloakAuthURL="${{ secrets.KEYCLOAK_AUTH_URL }}" \
167+
--set-string global.secrets.chesClientID="${{ secrets.CHES_CLIENT_ID }}" \
168+
--set-string global.secrets.chesClientSecret="${{ secrets.CHES_CLIENT_SECRET }}" \
169+
--set-string global.config.REACT_APP_AUTH_LOGOUT_REDIRECT_URI="${{ inputs.redirect_uri}}" \
163170
--set-string global.config.dbUser=${{ inputs.db_user }} \
164171
${{ inputs.params }} \
165172
--install --wait --atomic ${{ steps.vars.outputs.release }} --debug \

.github/workflows/_code-cov.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ jobs:
5151
key: coverage-${{ inputs.component }}-${{ github.run_number }}
5252
restore-keys: |
5353
coverage-${{ inputs.component }}-
54-
54+
5555
- name: Tests
5656
run: |
5757
cd ${{ inputs.component }}

.github/workflows/cats-pr-open.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,13 @@ name: CATS PR
22

33
on:
44
pull_request:
5-
types: [opened, synchronize, reopened, ready_for_review] # ready for review is not included by default, More than one activity type triggers this event. For information about each activity type, see "Webhook events and payloads." By default, a workflow only runs when a pull_request event's activity type is opened, synchronize, or reopened. To trigger workflows by different activity types, use the types keyword. For more information, see "Workflow syntax for GitHub Actions."
65
branches:
7-
- srs-605 # this is the default branch and not main
8-
#- srs-605 #test branch
9-
# paths:
10-
# - 'backend/cats/**'
11-
# - 'cats-frontend/**'
12-
6+
- dev
137

148
concurrency:
159
# Cancel in progress for PR open and close
16-
group: ${{ github.event.number }}
10+
# group: ${{ github.event.number }}
11+
group: ${{ github.event.pull_request.number || github.run_id }}
1712
cancel-in-progress: true
1813

1914
jobs:
@@ -23,11 +18,14 @@ jobs:
2318
runs-on: ubuntu-24.04
2419
strategy:
2520
matrix:
26-
package: [backend, cats-frontend ]
21+
package: [backend, backend-migration, cats-frontend]
2722
include:
2823
- package: backend
2924
build_file: ./backend/cats/Dockerfile
3025
build_context: backend/cats
26+
- package: backend-migration
27+
build_file: ./backend/cats/Dockerfile-migrations-openshift
28+
build_context: backend/cats
3129
- package: cats-frontend
3230
build_file: ./cats-frontend/Dockerfile
3331
build_context: cats-frontend
@@ -36,7 +34,8 @@ jobs:
3634
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
3735
with:
3836
package: ${{ matrix.package }}
39-
tag: ${{ github.event.number }}
37+
# tag: ${{ github.event.number }}
38+
tag: ${{ github.event.pull_request.number || github.run_id }}
4039
tag_fallback: latest
4140
triggers: ('${{ matrix.package }}/')
4241
build_file: ${{ matrix.build_file }}
@@ -48,6 +47,8 @@ jobs:
4847
uses: ./.github/workflows/.dbdeployer.yml
4948
secrets: inherit
5049
with:
50+
# Can revert to below trigger, this line just forces db deploy when updating this file, good for active dev.
51+
# triggers: ('charts/crunchy/' '.github/workflows/cats-pr-open.yml')
5152
triggers: ('charts/crunchy/')
5253
values: 'values-dev.yaml'
5354
app_values: 'values-pr.yaml' # PR specific values file.
@@ -61,9 +62,10 @@ jobs:
6162
with:
6263
triggers: ('backend/cats/' 'cats-frontend/' 'charts/' '.github/workflows/')
6364
values: 'values-pr.yaml' # PR specific values file.
65+
redirect_uri: https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-dev.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=https://nr-epd-digital-services-${{ github.event.pull_request.number}}-frontend.apps.silver.devops.gov.bc.ca/
6466
db_user: cats-${{ github.event.number }}
65-
timeout-minutes: 60
66-
67+
timeout-minutes: 20
68+
6769
results:
6870
name: PR Results
6971
needs: [builds, deploys]
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: CATS PR
2+
3+
on:
4+
push:
5+
branches:
6+
- dev
7+
8+
concurrency:
9+
group: test
10+
cancel-in-progress: false
11+
12+
jobs:
13+
# https://github.com/bcgov-nr/action-builder-ghcr
14+
builds:
15+
name: Builds
16+
runs-on: ubuntu-24.04
17+
strategy:
18+
matrix:
19+
package: [backend, backend-migration, cats-frontend]
20+
include:
21+
- package: backend
22+
build_file: ./backend/cats/Dockerfile
23+
build_context: backend/cats
24+
- package: backend-migration
25+
build_file: ./backend/cats/Dockerfile-migrations-openshift
26+
build_context: backend/cats
27+
- package: cats-frontend
28+
build_file: ./cats-frontend/Dockerfile
29+
build_context: cats-frontend
30+
timeout-minutes: 10
31+
steps:
32+
- uses: bcgov-nr/action-builder-ghcr@v2.2.0
33+
with:
34+
package: ${{ matrix.package }}
35+
# tag: ${{ github.event.number }}
36+
tag: test
37+
tag_fallback: latest
38+
triggers: ('${{ matrix.package }}/')
39+
build_file: ${{ matrix.build_file }}
40+
build_context: ${{ matrix.build_context }}
41+
42+
43+
deploy_db:
44+
name: Deploys Database (test)
45+
uses: ./.github/workflows/.dbdeployer.yml
46+
secrets: inherit
47+
with:
48+
# Todo - Can revert to below trigger, this line just forces db deploy when updating this file, good for active dev.
49+
triggers: ('charts/crunchy/' '.github/workflows/cats-pr-open.yml')
50+
# triggers: ('charts/crunchy/')
51+
values: 'values-dev.yaml'
52+
app_values: 'values-test.yaml'
53+
environment: test
54+
# https://github.com/bcgov/quickstart-openshift-helpers
55+
deploys:
56+
name: Deploys (test)
57+
needs: [builds, deploy_db]
58+
# needs: [builds]
59+
uses: ./.github/workflows/.deployer.yml
60+
secrets: inherit
61+
with:
62+
triggers: ('backend/cats/' 'cats-frontend/' 'charts/' '.github/workflows/')
63+
values: 'values-test.yaml'
64+
redirect_uri: https://logontest7.gov.bc.ca/clp-cgi/logoff.cgi?retnow=1&returl=https://epd-keycloak-test.apps.silver.devops.gov.bc.ca/auth/realms/forms-flow-ai/protocol/openid-connect/logout?post_logout_redirect_uri=https://nr-epd-digital-services-${{ github.event.pull_request.number}}-frontend.apps.silver.devops.gov.bc.ca/
65+
db_user: cats-test
66+
timeout-minutes: 20
67+
environment: test
68+
69+
results:
70+
name: PR Results
71+
needs: [builds, deploys]
72+
if: always()
73+
runs-on: ubuntu-24.04
74+
steps:
75+
- if: contains(needs.*.result, 'failure')
76+
run: echo "At least one job has failed." && exit 1
77+
- run: echo "Success!"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ lcov.*
3030

3131
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
3232
.grunt
33+
.DS_STORE
3334

3435
# Bower dependency directory (https://bower.io/)
3536
bower_components
@@ -131,3 +132,4 @@ forms-flow-ai/forms-flow-ai-ee/forms-flow-bpm/id_rsa_epd.pub
131132

132133
.vscode/settings.json
133134
.vscode/launch.json
135+
backups/

backend/applications/src/app.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { AppService } from './app.service';
55
import { Request } from 'express';
66

77
@Controller()
8-
@Resource('user-service')
8+
@Resource('cats-service')
99
export class AppController {
1010
constructor(private readonly appService: AppService) {}
1111

backend/applications/src/app/controllers/form.controller.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,12 @@ describe('FormController', () => {
8282
createdDate: new Date(),
8383
modifiedDate: new Date(),
8484
};
85+
const mockRequest = {
86+
headers: { origin: 'https://example.com' },
87+
} as unknown as Request;
8588

8689
mockFormService.create.mockResolvedValue(savedSubmission);
87-
const result = await controller.save(formId, content);
90+
const result = await controller.save(formId, content, mockRequest);
8891

8992
expect(mockFormService.create).toHaveBeenCalledWith(formId, formData);
9093
expect(mockCatsService.submitToCats).toHaveBeenCalledWith(

backend/applications/src/app/controllers/form.controller.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Body, Controller, Get, Param, Patch, Post, Put } from '@nestjs/common';
1+
import { Body, Controller, Get, Param, Patch, Post, Put, Req } from '@nestjs/common';
22
import { Unprotected } from 'nest-keycloak-connect';
33
import { SubmissionResponse } from '../dto/submissionResponse.dto';
44
import { Form } from '../entities/form.entity';
@@ -66,12 +66,15 @@ export class FormController {
6666
*/
6767
@Post(':formId/submission') async save(
6868
@Param('formId') formId,
69-
@Body() content,
69+
@Body() content, @Req() request,
7070
): Promise<SubmissionResponse> {
71+
console.log('Request headers---', request.headers);
72+
const origin = request.headers.origin;
7173
const savedSubmission = await this.formService.create(formId, content.data);
7274
const submissionResponse: SubmissionResponse =
7375
this.transformResult(savedSubmission);
74-
await this.catsService.submitToCats(content.data, savedSubmission.id, savedSubmission.formId);
76+
if (origin)
77+
await this.catsService.submitToCats(content.data, savedSubmission.id, savedSubmission.formId);
7578
return submissionResponse;
7679
}
7780

backend/cats/codegen.mts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { CodegenConfig } from '@graphql-codegen/cli';
2+
3+
require('dotenv').config();
4+
5+
const config: CodegenConfig = {
6+
overwrite: true,
7+
schema: process.env.SITE_SERVICE_URL_CODEGEN || process.env.SITE_SERVICE_URL,
8+
documents: ['src/**/*.graphql'],
9+
generates: {
10+
'src/generated/types.ts': {
11+
plugins: ['typescript'],
12+
},
13+
'src/': {
14+
preset: 'near-operation-file',
15+
presetConfig: {
16+
extension: '.generated.ts',
17+
baseTypesPath: 'generated/types.ts',
18+
},
19+
plugins: ['typescript-operations', 'typescript-graphql-request'],
20+
},
21+
'graphql.schema.json': {
22+
plugins: ['introspection'],
23+
},
24+
},
25+
};
26+
27+
export default config;

0 commit comments

Comments
 (0)