Skip to content

Commit 3064c81

Browse files
Merge branch 'main' into CCP-4294-Package-Email-Submission
2 parents f120c10 + 632b0fc commit 3064c81

13 files changed

Lines changed: 102 additions & 21 deletions

File tree

.devcontainer/chefs_local/local.sample.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"frontend": {
3535
"apiPath": "api/v1",
3636
"basePath": "/app",
37-
"cstarBaseUrl": "https://cstar-dev.apps.gold.devops.gov.bc.ca",
37+
"cstarBaseUrl": "https://dev.connect.digital.gov.bc.ca",
3838
"tenantFeatureEnabled": false,
3939
"oidc": {
4040
"clientId": "chefs-frontend-localhost-5300",
@@ -109,7 +109,7 @@
109109
},
110110
"cstar": {
111111
"tenantFeatureEnabled": false,
112-
"endpoint": "https://cstar-dev.apps.gold.devops.gov.bc.ca/api/v1/",
112+
"endpoint": "https://dev.connect.digital.gov.bc.ca/api/v1/",
113113
"listUserTenantsPath": "users/{userId}/tenants",
114114
"listGroupsForUserForTenantPath": "tenants/{tenantId}/users/{userId}/groups/shared-service-roles",
115115
"listGroupsForTenant": "tenants/{tenantId}/groups",

.devcontainer/chefs_local/test.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
},
100100
"cstar": {
101101
"tenantFeatureEnabled": true,
102-
"endpoint": "https://cstar-dev.apps.gold.devops.gov.bc.ca/api/v1/",
102+
"endpoint": "https://dev.connect.digital.gov.bc.ca/api/v1/",
103103
"listUserTenantsPath": "users/{userId}/tenants",
104104
"listGroupsForUserForTenantPath": "tenants/{tenantId}/users/{userId}/groups/shared-service-roles",
105105
"listGroupsForTenant": "tenants/{tenantId}/groups",

app/config/default.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"adminDashboardUrl": "",
3535
"apiPath": "api/v1",
3636
"basePath": "/app",
37-
"cstarBaseUrl": "https://cstar-dev.apps.gold.devops.gov.bc.ca",
37+
"cstarBaseUrl": "https://dev.connect.digital.gov.bc.ca",
3838
"tenantFeatureEnabled": false,
3939
"oidc": {
4040
"clientId": "chefs-frontend-localhost-5300",
@@ -109,7 +109,7 @@
109109
},
110110
"cstar": {
111111
"tenantFeatureEnabled": false,
112-
"endpoint": "https://cstar-dev.apps.gold.devops.gov.bc.ca/api/v1/",
112+
"endpoint": "https://dev.connect.digital.gov.bc.ca/api/v1/",
113113
"listUserTenantsPath": "users/{userId}/tenants",
114114
"listGroupsForUserForTenantPath": "tenants/{tenantId}/users/{userId}/groups/shared-service-roles",
115115
"listGroupsForTenant": "tenants/{tenantId}/groups",

app/frontend/src/components/designer/FormDesigner.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ async function schemaCreateNew() {
404404
enableSubmitterDraft: form.value.enableSubmitterDraft,
405405
submissionCompletionTemplateId: form.value.submissionCompletionTemplateId,
406406
enableSubmissionPackageEmail: form.value.enableSubmissionPackageEmail,
407+
enableTeamMemberDraftShare: form.value.enableTeamMemberDraftShare,
407408
allowSubmitterToUploadFile: form.value.allowSubmitterToUploadFile,
408409
enableCopyExistingSubmission: form.value.enableCopyExistingSubmission,
409410
wideFormLayout: form.value.wideFormLayout,

app/frontend/src/components/designer/FormViewer.vue

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,6 @@ onMounted(async () => {
238238
await getFormSchema();
239239
}
240240
window.addEventListener('beforeunload', beforeWindowUnload);
241-
242241
reRenderFormIo.value += 1;
243242
});
244243
@@ -921,15 +920,15 @@ async function uploadFile(file, config = {}) {
921920
</v-alert>
922921
</div>
923922
924-
<div v-else-if="isFormScheduleExpired">
923+
<div v-else-if="isFormScheduleExpired && !properties.readOnly">
925924
<v-alert
926925
:text="
927926
isLateSubmissionAllowed
928927
? $t('trans.formViewer.lateFormSubmissions')
929928
: formScheduleExpireMessage
930929
"
931930
prominent
932-
type="error"
931+
type="info"
933932
:class="{ 'dir-rtl': isRTL }"
934933
:lang="locale"
935934
>

app/frontend/tests/unit/components/designer/FormViewer.spec.js

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1912,6 +1912,58 @@ describe('FormViewer.vue', () => {
19121912
expect(errMsg).toBeUndefined();
19131913
expect(updateSubmissionSpy).toBeCalledTimes(1);
19141914
});
1915+
1916+
it('renders FormViewerActions when expired and read-only', async () => {
1917+
const wrapper = shallowMount(FormViewer, {
1918+
props: {
1919+
formId,
1920+
submissionId: '123',
1921+
readOnly: true,
1922+
},
1923+
global: {
1924+
provide: {
1925+
setWideLayout: vi.fn(),
1926+
},
1927+
plugins: [pinia],
1928+
stubs: STUBS,
1929+
},
1930+
});
1931+
1932+
await flushPromises();
1933+
1934+
wrapper.vm.isFormScheduleExpired = true;
1935+
wrapper.vm.isLateSubmissionAllowed = false;
1936+
1937+
await wrapper.vm.$nextTick();
1938+
1939+
expect(wrapper.findComponent({ name: 'Form' }).exists()).toBe(true);
1940+
});
1941+
1942+
it('does not render FormViewerActions when expired and editable', async () => {
1943+
const wrapper = shallowMount(FormViewer, {
1944+
props: {
1945+
formId,
1946+
submissionId: '123',
1947+
readOnly: false,
1948+
},
1949+
global: {
1950+
provide: {
1951+
setWideLayout: vi.fn(),
1952+
},
1953+
plugins: [pinia],
1954+
stubs: STUBS,
1955+
},
1956+
});
1957+
1958+
await flushPromises();
1959+
1960+
wrapper.vm.isFormScheduleExpired = true;
1961+
wrapper.vm.isLateSubmissionAllowed = false;
1962+
1963+
await wrapper.vm.$nextTick();
1964+
1965+
expect(wrapper.findComponent({ name: 'Form' }).exists()).toBe(false);
1966+
});
19151967
});
19161968

19171969
it('extractSubmissionData returns response.data when submissionId exists and isDuplicate is true', async () => {

app/src/forms/form/service.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ const service = {
272272
obj.enableStatusUpdates = data.enableStatusUpdates;
273273
obj.enableSubmitterRevision = data.enableSubmitterRevision;
274274
obj.enableSubmitterDraft = data.enableSubmitterDraft;
275+
obj.enableTeamMemberDraftShare = data.enableTeamMemberDraftShare;
275276
obj.createdBy = currentUser?.usernameIdp || 'public';
276277
obj.allowSubmitterToUploadFile = service._setAllowSubmitterToUploadFile(data);
277278
obj.schedule = data.schedule;

app/tests/unit/forms/form/service.spec.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,6 +1163,36 @@ describe('createForm', () => {
11631163
);
11641164
});
11651165

1166+
it('should properly handle enableTeamMemberDraftShare in createForm', async () => {
1167+
service.validateScheduleObject = jest.fn().mockReturnValueOnce({ status: 'success' });
1168+
service.readForm = jest.fn().mockReturnValueOnce({});
1169+
formMetadataService.upsert = jest.fn().mockResolvedValueOnce();
1170+
eventStreamConfigService.upsert = jest.fn().mockResolvedValueOnce();
1171+
1172+
const data = {
1173+
name: 'Test Form',
1174+
identityProviders: [{ code: 'idir' }],
1175+
enableSubmitterDraft: true,
1176+
enableTeamMemberDraftShare: true,
1177+
};
1178+
1179+
// Mock the Form.insert to capture what's being inserted
1180+
const mockInsert = jest.fn().mockResolvedValue({ id: formId });
1181+
Form.query = jest.fn().mockReturnValue({
1182+
insert: mockInsert,
1183+
});
1184+
1185+
await service.createForm(data, currentUser);
1186+
1187+
// Verify that enableTeamMemberDraftShare was passed to the insert
1188+
expect(mockInsert).toHaveBeenCalledWith(
1189+
expect.objectContaining({
1190+
enableSubmitterDraft: true,
1191+
enableTeamMemberDraftShare: true,
1192+
})
1193+
);
1194+
});
1195+
11661196
it('should throw when tenant form creation is attempted without headers', async () => {
11671197
service.validateScheduleObject = jest.fn().mockReturnValueOnce({ status: 'success' });
11681198
service.readForm = jest.fn().mockResolvedValueOnce({});

openshift/cstar.dev.param

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
TENANT_FEATURE_ENABLED=true
2-
CSTAR_BASE_URL=https://cstar-dev.apps.gold.devops.gov.bc.ca
3-
CSTAR_ENDPOINT=https://cstar-dev.apps.gold.devops.gov.bc.ca/api/v1/
2+
CSTAR_BASE_URL=https://dev.connect.digital.gov.bc.ca
3+
CSTAR_ENDPOINT=https://dev.connect.digital.gov.bc.ca/api/v1/

openshift/cstar.pr.param

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
TENANT_FEATURE_ENABLED=true
2-
CSTAR_BASE_URL=https://cstar-dev.apps.gold.devops.gov.bc.ca
3-
CSTAR_ENDPOINT=https://cstar-dev.apps.gold.devops.gov.bc.ca/api/v1/
2+
CSTAR_BASE_URL=https://dev.connect.digital.gov.bc.ca
3+
CSTAR_ENDPOINT=https://dev.connect.digital.gov.bc.ca/api/v1/

0 commit comments

Comments
 (0)