Skip to content

Commit 6cf08fe

Browse files
authored
Merge pull request #2389 from bcgov/feature/2367
Add new docs sources, define lists, make upload dialog configurable
2 parents 461c2fb + 4de7d8c commit 6cf08fe

File tree

5 files changed

+54
-7
lines changed

5 files changed

+54
-7
lines changed

alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Component, EventEmitter, Inject, OnDestroy, OnInit, Output } from '@ang
33
import { FormControl, FormGroup, Validators } from '@angular/forms';
44
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
55
import { ToastService } from '../../services/toast/toast.service';
6-
import { DOCUMENT_SOURCE, DOCUMENT_TYPE, DocumentTypeDto } from '../document/document.dto';
6+
import { DEFAULT_DOCUMENT_SOURCES, DOCUMENT_SOURCE, DOCUMENT_TYPE, DocumentTypeDto } from '../document/document.dto';
77
import { FileHandle } from '../drag-drop-file/drag-drop-file.directive';
88
import { splitExtension } from '../utils/file';
99
import {
@@ -47,7 +47,7 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy {
4747
visibleToPublic = new FormControl<boolean>(false, [Validators.required]);
4848

4949
documentTypes: DocumentTypeDto[] = [];
50-
documentSources = Object.values(DOCUMENT_SOURCE);
50+
documentSources: DOCUMENT_SOURCE[] = [];
5151

5252
form = new FormGroup({
5353
name: this.name,
@@ -83,6 +83,8 @@ export class DocumentUploadDialogComponent implements OnInit, OnDestroy {
8383

8484
this.internalVisibilityLabel = this.buildInternalVisibilityLabel();
8585

86+
this.documentSources = this.data.allowedDocumentSources ?? DEFAULT_DOCUMENT_SOURCES;
87+
8688
if (this.data.existingDocument) {
8789
const document = this.data.existingDocument;
8890
this.title = 'Edit';

alcs-frontend/src/app/shared/document-upload-dialog/document-upload-dialog.interface.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { DOCUMENT_TYPE, DocumentTypeDto } from '../document/document.dto';
1+
import { DOCUMENT_SOURCE, DOCUMENT_TYPE, DocumentTypeDto } from '../document/document.dto';
22
import { VisibilityGroup } from './document-upload-dialog.component';
33
import {
44
CreateDocumentDto,
@@ -17,6 +17,7 @@ export interface DocumentUploadDialogOptions {
1717
allowedVisibilityFlags?: ('A' | 'C' | 'G' | 'P')[];
1818
allowsFileEdit?: boolean;
1919
documentTypeOverrides?: Partial<Record<DOCUMENT_TYPE, DocumentTypeConfig>>;
20+
allowedDocumentSources?: DOCUMENT_SOURCE[];
2021
}
2122

2223
export interface DocumentUploadDialogData extends DocumentUploadDialogOptions {

alcs-frontend/src/app/shared/document/document.dto.ts

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,13 +37,44 @@ export enum DOCUMENT_TYPE {
3737
}
3838

3939
export enum DOCUMENT_SOURCE {
40-
APPLICANT = 'Applicant',
40+
// All types
4141
ALC = 'ALC',
4242
LFNG = 'L/FNG',
43-
AFFECTED_PARTY = 'Affected Party',
4443
PUBLIC = 'Public',
44+
BC_GOVERNMENT = 'BC Government',
45+
OTHER_AGENCY = 'Other Agency',
46+
47+
// app, NOI, noti, inquiry, planning review only
48+
APPLICANT = 'Applicant',
49+
AFFECTED_PARTY = 'Affected Party',
50+
51+
// C&E only
52+
AGENT = 'Agent',
53+
COMPLAINANT = 'Complainant',
54+
PROPERTY_OWNER = 'Property Owner',
55+
TENANT = 'Tenant',
4556
}
4657

58+
export const DEFAULT_DOCUMENT_SOURCES = [
59+
DOCUMENT_SOURCE.ALC,
60+
DOCUMENT_SOURCE.LFNG,
61+
DOCUMENT_SOURCE.PUBLIC,
62+
DOCUMENT_SOURCE.BC_GOVERNMENT,
63+
DOCUMENT_SOURCE.OTHER_AGENCY,
64+
DOCUMENT_SOURCE.APPLICANT,
65+
DOCUMENT_SOURCE.AFFECTED_PARTY,
66+
];
67+
68+
export const C_AND_E_DOCUMENT_SOURCES = [
69+
DOCUMENT_SOURCE.ALC,
70+
DOCUMENT_SOURCE.LFNG,
71+
DOCUMENT_SOURCE.PUBLIC,
72+
DOCUMENT_SOURCE.BC_GOVERNMENT,
73+
DOCUMENT_SOURCE.OTHER_AGENCY,
74+
DOCUMENT_SOURCE.APPLICANT,
75+
DOCUMENT_SOURCE.AFFECTED_PARTY,
76+
];
77+
4778
export enum DOCUMENT_SYSTEM {
4879
ALCS = 'ALCS',
4980
PORTAL = 'Portal',

portal-frontend/src/app/shared/dto/document.dto.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export enum DOCUMENT_SOURCE {
4141
LFNG = 'L/FNG',
4242
AFFECTED_PARTY = 'Affected Party',
4343
PUBLIC = 'Public',
44+
BC_GOVERNMENT = 'BC Government',
45+
OTHER_AGENCY = 'Other Agency',
4446
}
4547

4648
export interface DocumentTypeDto extends BaseCodeDto {

services/apps/alcs/src/document/document.dto.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,22 @@ import { BaseCodeDto } from '../common/dtos/base.dto';
33
import { User } from '../user/user.entity';
44

55
export enum DOCUMENT_SOURCE {
6-
APPLICANT = 'Applicant',
6+
// All types
77
ALC = 'ALC',
88
LFNG = 'L/FNG',
9-
AFFECTED_PARTY = 'Affected Party',
109
PUBLIC = 'Public',
10+
BC_GOVERNMENT = 'BC Government',
11+
OTHER_AGENCY = 'Other Agency',
12+
13+
// app, NOI, noti, inquiry, planning review only
14+
APPLICANT = 'Applicant',
15+
AFFECTED_PARTY = 'Affected Party',
16+
17+
// C&E only
18+
AGENT = 'Agent',
19+
COMPLAINANT = 'Complainant',
20+
PROPERTY_OWNER = 'Property Owner',
21+
TENANT = 'Tenant',
1122
}
1223

1324
export enum DOCUMENT_SYSTEM {

0 commit comments

Comments
 (0)