Skip to content

Commit

Permalink
Merge pull request #87 from bcgov/feature/orgbook-address-lookup
Browse files Browse the repository at this point in the history
Add BC OrgBook and BC Geocoder Lookups to SHAS Intake Form
  • Loading branch information
kyle1morel authored Jun 4, 2024
2 parents c176006 + d36213e commit 0e60cd8
Show file tree
Hide file tree
Showing 18 changed files with 364 additions and 23 deletions.
2 changes: 2 additions & 0 deletions .github/environments/values.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ config:
FRONTEND_CHES_BCC: [email protected]
FRONTEND_COMS_APIPATH: https://coms-dev.api.gov.bc.ca/api/v1
FRONTEND_COMS_BUCKETID: 1f9e1451-c130-4804-aeb0-b78b5b109c47
FRONTEND_GEOCODER_APIPATH: https://geocoder.api.gov.bc.ca
FRONTEND_OIDC_AUTHORITY: https://dev.loginproxy.gov.bc.ca/auth/realms/standard
FRONTEND_OIDC_CLIENTID: nr-permit-connect-navigator-service-5188
FRONTEND_ORGBOOK_APIPATH: https://orgbook.gov.bc.ca/api/v4
SERVER_APIPATH: /api/v1
SERVER_BODYLIMIT: 30mb
SERVER_CHEFS_APIPATH: https://submit.digital.gov.bc.ca/app/api/v1
Expand Down
2 changes: 2 additions & 0 deletions .github/environments/values.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ config:
FRONTEND_CHES_BCC: [email protected]
FRONTEND_COMS_APIPATH: https://coms.api.gov.bc.ca/api/v1
FRONTEND_COMS_BUCKETID: 0089d041-5aab-485e-842d-8875475d0ed6
FRONTEND_GEOCODER_APIPATH: https://geocoder.api.gov.bc.ca
FRONTEND_OIDC_AUTHORITY: https://loginproxy.gov.bc.ca/auth/realms/standard
FRONTEND_OIDC_CLIENTID: nr-permit-connect-navigator-service-5188
FRONTEND_ORGBOOK_APIPATH: https://orgbook.gov.bc.ca/api/v4
SERVER_APIPATH: /api/v1
SERVER_BODYLIMIT: 30mb
SERVER_CHEFS_APIPATH: https://submit.digital.gov.bc.ca/app/api/v1
Expand Down
2 changes: 2 additions & 0 deletions .github/environments/values.test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ config:
FRONTEND_CHES_BCC: [email protected]
FRONTEND_COMS_APIPATH: https://coms-test.api.gov.bc.ca/api/v1
FRONTEND_COMS_BUCKETID: a9eabd1d-5f77-4c60-bf6b-83ffa0e21c59
FRONTEND_GEOCODER_APIPATH: https://geocoder.api.gov.bc.ca
FRONTEND_OIDC_AUTHORITY: https://test.loginproxy.gov.bc.ca/auth/realms/standard
FRONTEND_OIDC_CLIENTID: nr-permit-connect-navigator-service-5188
FRONTEND_ORGBOOK_APIPATH: https://orgbook.gov.bc.ca/api/v4
SERVER_APIPATH: /api/v1
SERVER_BODYLIMIT: 30mb
SERVER_CHEFS_APIPATH: https://submit.digital.gov.bc.ca/app/api/v1
Expand Down
4 changes: 3 additions & 1 deletion app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ app.use(
'default-src': [
"'self'", // eslint-disable-line
new URL(config.get('frontend.oidc.authority')).origin,
new URL(config.get('frontend.coms.apiPath')).origin
new URL(config.get('frontend.coms.apiPath')).origin,
new URL(config.get('frontend.geocoder.apiPath')).origin,
new URL(config.get('frontend.orgbook.apiPath')).origin
]
}
}
Expand Down
6 changes: 6 additions & 0 deletions app/config/custom-environment-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
"apiPath": "FRONTEND_COMS_APIPATH",
"bucketId": "FRONTEND_COMS_BUCKETID"
},
"geocoder": {
"apiPath": "FRONTEND_GEOCODER_APIPATH"
},
"notificationBanner": "FRONTEND_NOTIFICATION_BANNER",
"oidc": {
"authority": "FRONTEND_OIDC_AUTHORITY",
"clientId": "FRONTEND_OIDC_CLIENTID"
},
"orgbook": {
"apiPath": "FRONTEND_ORGBOOK_APIPATH"
}
},
"server": {
Expand Down
2 changes: 1 addition & 1 deletion app/src/routes/v1/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ router.get(
);

// Submission create draft endpoint
router.put('/draft', submissionValidator.createDraft, (req: Request, res: Response, next: NextFunction): void => {
router.put('/draft', (req: Request, res: Response, next: NextFunction): void => {
submissionController.createDraft(req, res, next);
});

Expand Down
2 changes: 1 addition & 1 deletion charts/pcns/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: nr-permitconnect-navigator-service
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.0.6
version: 0.0.7
kubeVersion: ">= 1.13.0"
description: PermitConnect Navigator Service
# A chart can be either an 'application' or a 'library' chart.
Expand Down
4 changes: 2 additions & 2 deletions charts/pcns/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# nr-permitconnect-navigator-service

![Version: 0.0.6](https://img.shields.io/badge/Version-0.0.6-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)
![Version: 0.0.7](https://img.shields.io/badge/Version-0.0.7-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.1.0](https://img.shields.io/badge/AppVersion-0.1.0-informational?style=flat-square)

PermitConnect Navigator Service

Expand Down Expand Up @@ -35,7 +35,7 @@ Kubernetes: `>= 1.13.0`
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
| chesSecretOverride.password | string | `nil` | |
| chesSecretOverride.username | string | `nil` | |
| config.configMap | object | `{"FRONTEND_APIPATH":"api/v1","FRONTEND_CHES_BCC":null,"FRONTEND_COMS_APIPATH":null,"FRONTEND_COMS_BUCKETID":null,"FRONTEND_OIDC_AUTHORITY":null,"FRONTEND_OIDC_CLIENTID":null,"SERVER_APIPATH":"/api/v1","SERVER_BODYLIMIT":"30mb","SERVER_CHEFS_APIPATH":null,"SERVER_CHES_APIPATH":null,"SERVER_CHES_TOKENURL":null,"SERVER_DB_HOST":null,"SERVER_DB_POOL_MAX":"10","SERVER_DB_POOL_MIN":"2","SERVER_DB_PORT":"5432","SERVER_LOGLEVEL":"http","SERVER_OIDC_AUTHORITY":null,"SERVER_OIDC_IDENTITYKEY":null,"SERVER_OIDC_PUBLICKEY":null,"SERVER_PORT":"8080"}` | These values will be wholesale added to the configmap as is; refer to the pcns documentation for what each of these values mean and whether you need them defined. Ensure that all values are represented explicitly as strings, as non-string values will not translate over as expected into container environment variables. For configuration keys named `*_ENABLED`, either leave them commented/undefined, or set them to string value "true". |
| config.configMap | object | `{"FRONTEND_APIPATH":"api/v1","FRONTEND_CHES_BCC":null,"FRONTEND_COMS_APIPATH":null,"FRONTEND_COMS_BUCKETID":null,"FRONTEND_GEOCODER_APIPATH":null,"FRONTEND_OIDC_AUTHORITY":null,"FRONTEND_OIDC_CLIENTID":null,"FRONTEND_ORGBOOK_APIPATH":null,"SERVER_APIPATH":"/api/v1","SERVER_BODYLIMIT":"30mb","SERVER_CHEFS_APIPATH":null,"SERVER_CHES_APIPATH":null,"SERVER_CHES_TOKENURL":null,"SERVER_DB_HOST":null,"SERVER_DB_POOL_MAX":"10","SERVER_DB_POOL_MIN":"2","SERVER_DB_PORT":"5432","SERVER_LOGLEVEL":"http","SERVER_OIDC_AUTHORITY":null,"SERVER_OIDC_IDENTITYKEY":null,"SERVER_OIDC_PUBLICKEY":null,"SERVER_PORT":"8080"}` | These values will be wholesale added to the configmap as is; refer to the pcns documentation for what each of these values mean and whether you need them defined. Ensure that all values are represented explicitly as strings, as non-string values will not translate over as expected into container environment variables. For configuration keys named `*_ENABLED`, either leave them commented/undefined, or set them to string value "true". |
| config.enabled | bool | `false` | Set to true if you want to let Helm manage and overwrite your configmaps. |
| config.releaseScoped | bool | `false` | This should be set to true if and only if you require configmaps and secrets to be release scoped. In the event you want all instances in the same namespace to share a similar configuration, this should be set to false |
| dbSecretOverride.password | string | `nil` | |
Expand Down
2 changes: 2 additions & 0 deletions charts/pcns/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,10 @@ config:
FRONTEND_CHES_BCC: ~
FRONTEND_COMS_APIPATH: ~
FRONTEND_COMS_BUCKETID: ~
FRONTEND_GEOCODER_APIPATH: ~
FRONTEND_OIDC_AUTHORITY: ~
FRONTEND_OIDC_CLIENTID: ~
FRONTEND_ORGBOOK_APIPATH: ~

SERVER_APIPATH: /api/v1
SERVER_BODYLIMIT: 30mb
Expand Down
80 changes: 80 additions & 0 deletions frontend/src/components/form/AutoComplete.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<script setup lang="ts">
import { toRef } from 'vue';
import { useField, ErrorMessage } from 'vee-validate';
import { AutoComplete } from '@/lib/primevue';
import type { IInputEvent } from '@/interfaces';
import type { AutoCompleteChangeEvent, AutoCompleteCompleteEvent } from 'primevue/autocomplete';
// Props
type Props = {
helpText?: string;
label?: string;
name: string;
placeholder?: string;
disabled?: boolean;
suggestions: Array<unknown>;
getOptionLabel?: Function;
bold?: boolean;
forceSelection?: boolean;
loading?: boolean;
editable?: boolean;
delay?: number;
};
const props = withDefaults(defineProps<Props>(), {
helpText: '',
type: 'text',
label: '',
placeholder: '',
disabled: false,
getOptionLabel: (e: string) => e,
bold: true,
forceSelection: false,
loading: false,
editable: false,
delay: 300
});
// Emits
const emit = defineEmits(['onChange', 'onComplete', 'onInput']);
const { errorMessage, value } = useField<string>(toRef(props, 'name'));
</script>

<template>
<div class="field">
<label
:class="{ 'font-bold': bold }"
:for="name"
>
{{ label }}
</label>
<AutoComplete
v-model="value"
:aria-describedby="`${name}-help`"
class="w-full"
:class="{ 'p-invalid': errorMessage }"
:delay="delay"
:disabled="disabled"
:editable="editable"
:force-selection="forceSelection"
input-class="w-full"
:loading="false"
:name="name"
:option-label="(option: any) => props.getOptionLabel(option)"
:placeholder="placeholder"
:suggestions="props.suggestions"
@input="(e: IInputEvent) => emit('onInput', e)"
@change="(e: AutoCompleteChangeEvent) => emit('onChange', e)"
@complete="(e: AutoCompleteCompleteEvent) => emit('onComplete', e)"
/>
<small :id="`${name}-help`">{{ helpText }}</small>
<div class="mt-2">
<ErrorMessage
:name="name"
class="app-error-message"
/>
</div>
</div>
</template>
1 change: 1 addition & 0 deletions frontend/src/components/form/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { default as AutoComplete } from './AutoComplete.vue';
export { default as Calendar } from './Calendar.vue';
export { default as Checkbox } from './Checkbox.vue';
export { default as CopyToClipboard } from './CopyToClipboard.vue';
Expand Down
Loading

0 comments on commit 0e60cd8

Please sign in to comment.