Skip to content

Commit f1f2be1

Browse files
Merge branch 'main' into CCP-4294-Package-Email-Submission
2 parents 5bc7e5c + 2541c5b commit f1f2be1

46 files changed

Lines changed: 1147 additions & 314 deletions

Some content is hidden

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

.devcontainer/chefs_local/local.sample.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
"clientId": "CDOGS_CLIENT_ID",
9999
"clientSecret": "CDOGS_CLIENT_SECRET"
100100
},
101+
"cdogsV3": {
102+
"endpoint": "https://chefs-cdogs.apps.silver.devops.gov.bc.ca/api"
103+
},
101104
"css": {
102105
"endpoint": "https://api.loginproxy.gov.bc.ca/api",
103106
"tokenEndpoint": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token",

.devcontainer/chefs_local/test.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
"tokenEndpoint": "https://dev.loginproxy.gov.bc.ca/auth/realms/comsvcauth/protocol/openid-connect/token",
9595
"clientId": "CDOGS_CLIENT_ID",
9696
"clientSecret": "CDOGS_CLIENT_SECRET"
97+
},
98+
"cdogsV3": {
99+
"endpoint": "https://chefs-cdogs.apps.silver.devops.gov.bc.ca"
97100
}
98101
}
99102
},

app/config/custom-environment-variables.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@
9494
"clientId": "SC_CS_CDOGS_CLIENT_ID",
9595
"clientSecret": "SC_CS_CDOGS_CLIENT_SECRET"
9696
},
97+
"cdogsV3": {
98+
"endpoint": "SC_CS_CDOGS_V3_ENDPOINT"
99+
},
97100
"css": {
98101
"endpoint": "SC_CS_CSS_ENDPOINT",
99102
"tokenEndpoint": "SC_CS_CSS_TOKEN_ENDPOINT",

app/config/default.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@
9898
"clientId": "CDOGS_CLIENT_ID",
9999
"clientSecret": "CDOGS_CLIENT_SECRET"
100100
},
101+
"cdogsV3": {
102+
"endpoint": "http://common-document-generation-service-master.a12c97-prod:3000/api"
103+
},
101104
"css": {
102105
"endpoint": "https://api.loginproxy.gov.bc.ca/api",
103106
"tokenEndpoint": "https://loginproxy.gov.bc.ca/auth/realms/standard/protocol/openid-connect/token",

app/frontend/src/components/forms/DirectPrintButton.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
44
import { computed, ref } from 'vue';
55
66
import { createDownload } from '~/composables/printOptions';
7-
import { formService, utilsService } from '~/services';
7+
import { formService } from '~/services';
88
import { useFormStore } from '~/store/form';
99
import { useNotificationStore } from '~/store/notification';
1010
import { NotificationTypes } from '~/utils/constants';
@@ -76,7 +76,7 @@ async function generateDocument(submissionId, body, submission) {
7676
if (submissionId?.length > 0) {
7777
return await formService.docGen(submissionId, body);
7878
}
79-
return await utilsService.draftDocGen({
79+
return await formService.draftDocGen(formId.value, {
8080
template: body,
8181
submission: submission,
8282
});

app/frontend/src/components/forms/PrintOptions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n';
44
import { onBeforeUnmount, computed, ref, watch, nextTick } from 'vue';
55
66
import { createDownload } from '~/composables/printOptions';
7-
import { formService, utilsService } from '~/services';
7+
import { formService } from '~/services';
88
import { useFormStore } from '~/store/form';
99
import { useNotificationStore } from '~/store/notification';
1010
import { NotificationTypes } from '~/utils/constants';
@@ -187,7 +187,7 @@ async function generate() {
187187
template: body,
188188
submission: properties.submission,
189189
};
190-
response = await utilsService.draftDocGen(draftData);
190+
response = await formService.draftDocGen(formId.value, draftData);
191191
}
192192
// create file to download
193193
const filename = getDisposition(response.headers['content-disposition']);

app/frontend/src/services/formService.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,25 @@ export default {
542542
);
543543
},
544544

545+
/**
546+
* @function draftDocGen
547+
* Upload a template and ad-hoc (draft) submission data to render a document for a
548+
* form, before any submission has been saved.
549+
* @param {string} formId The form identifier
550+
* @param {Object} body The request body containing the template and submission data
551+
* @returns {Promise} An axios response
552+
*/
553+
draftDocGen(formId, body) {
554+
return appAxios().post(
555+
`${ApiRoutes.FORMS}/${formId}/template/render`,
556+
body,
557+
{
558+
responseType: 'arraybuffer', // Needed for binaries unless you want pain
559+
timeout: 30000, // Override default timeout as this call could take a while
560+
}
561+
);
562+
},
563+
545564
/**
546565
* @function updateSubmissionStatus
547566
* Add a new status entry to the submission

app/frontend/src/services/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ export { default as rbacService } from './rbacService';
55
export { default as roleService } from './roleService';
66
export { default as userService } from './userService';
77
export { default as fileService } from './fileService';
8-
export { default as utilsService } from './utilsService';
98
export { default as encryptionKeyService } from './encryptionKeyService';
109
export { default as eventStreamConfigService } from './eventStreamConfigService';
1110
export { default as recordsManagementService } from './recordsManagementService';

app/frontend/src/services/utilsService.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

app/frontend/src/utils/constants.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const ApiRoutes = Object.freeze({
1313
SUBMISSION: '/submissions',
1414
USERS: '/users',
1515
FILES: '/files',
16-
UTILS: '/utils',
1716
FILES_API_ACCESS: '/filesApiAccess',
1817
PROXY: '/proxy',
1918
EXTERNAL_APIS: '/externalAPIs',

0 commit comments

Comments
 (0)