From d8f8280e29dba3c2a75475cc9323def3af22b476 Mon Sep 17 00:00:00 2001 From: abradat Date: Tue, 10 Sep 2024 16:01:14 -0700 Subject: [PATCH] Rename commissioner decision component and Add to commissioner's application page --- .../commissioner-application.component.html | 4 ++ .../commissioner-decisions.component.html | 45 +++++++++++++++++ .../commissioner-decisions.component.scss | 49 +++++++++++++++++++ .../commissioner-decisions.component.ts | 19 +++++++ .../decisions/decisions.component.html | 1 - .../decisions/decisions.component.scss | 3 -- .../decisions/decisions.component.ts | 14 ------ .../commissioner/commissioner.module.ts | 5 +- .../application-document.dto.ts | 1 + .../services/commissioner/commissioner.dto.ts | 1 + 10 files changed, 122 insertions(+), 20 deletions(-) create mode 100644 alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.html create mode 100644 alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.scss create mode 100644 alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.ts delete mode 100644 alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.html delete mode 100644 alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.scss delete mode 100644 alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.ts diff --git a/alcs-frontend/src/app/features/commissioner/application/commissioner-application.component.html b/alcs-frontend/src/app/features/commissioner/application/commissioner-application.component.html index 8984d0890b..ed29539a60 100644 --- a/alcs-frontend/src/app/features/commissioner/application/commissioner-application.component.html +++ b/alcs-frontend/src/app/features/commissioner/application/commissioner-application.component.html @@ -2,6 +2,10 @@
+ +

Decision #{{ applicationDecisions.length - index }}

+
+
+
Decision Date
+ {{ decision.date | momentFormat }} +
+ +
+
Resolution Number
+ #{{ decision.resolutionNumber }}/{{ decision.resolutionYear }} +
+ +
+
Decision Summary
+ {{ decision.decisionDescription }} +
+ +
+
Decision Document
+
+
+ {{ document.fileName }} +  ({{ document.fileSize! | filesize }}) +
+ +
+
+ +
+
{{ document.fileSize! | filesize }}
+ +
+
+
+
+
diff --git a/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.scss b/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.scss new file mode 100644 index 0000000000..5904a02cb2 --- /dev/null +++ b/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.scss @@ -0,0 +1,49 @@ +@use '../../../../../styles/functions.scss' as *; +@use '../../../../../styles/colors.scss'; + +.decision-table { + padding: rem(8); + margin: rem(12) 0 rem(20) 0; + background-color: colors.$grey-light; + display: grid; + grid-row-gap: rem(24); + grid-column-gap: rem(16); + grid-template-columns: 100%; + word-wrap: break-word; + hyphens: auto; + + @media screen and (min-width: $tabletBreakpoint) { + padding: rem(16); + margin: rem(24) 0 rem(40) 0; + grid-template-columns: 49% 49%; + + .full-width { + grid-column: 1/3; + } + } +} + +.document { + display: none; + padding: rem(9) rem(16); + border-radius: rem(4); + border: rem(1) solid colors.$grey; + background: colors.$white; + margin: rem(8) 0; + + @media screen and (min-width: $tabletBreakpoint) { + display: flex; + } +} + +.responsive { + display: block; + + @media screen and (min-width: $tabletBreakpoint) { + display: none; + } +} + +.document-name { + padding: rem(6) 0; +} diff --git a/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.ts b/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.ts new file mode 100644 index 0000000000..52ba3e23cc --- /dev/null +++ b/alcs-frontend/src/app/features/commissioner/application/commissioner-decisions/commissioner-decisions.component.ts @@ -0,0 +1,19 @@ +import { Component, Input, type OnInit } from '@angular/core'; +import { CommissionerDecisionDto } from '../../../../services/commissioner/commissioner.dto'; +import { ApplicationDocumentService } from '../../../../services/application/application-document/application-document.service'; +import { ApplicationDecisionV2Service } from '../../../../services/application/decision/application-decision-v2/application-decision-v2.service'; +import { ApplicationDocumentDto } from '../../../../services/application/application-document/application-document.dto'; + +@Component({ + selector: 'app-commissioner-decisions', + templateUrl: './commissioner-decisions.component.html', + styleUrl: './commissioner-decisions.component.scss', +}) +export class CommissionerDecisionsComponent { + @Input() applicationDecisions: CommissionerDecisionDto[] = []; + constructor(private decisionService: ApplicationDecisionV2Service) {} + + async openFile(decision: CommissionerDecisionDto, file: ApplicationDocumentDto) { + const res = await this.decisionService.downloadFile(decision.uuid, file.uuid, file.fileName); + } +} diff --git a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.html b/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.html deleted file mode 100644 index f912f779cd..0000000000 --- a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.html +++ /dev/null @@ -1 +0,0 @@ -

decisions works!

, diff --git a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.scss b/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.scss deleted file mode 100644 index 5d4e87f30f..0000000000 --- a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -:host { - display: block; -} diff --git a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.ts b/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.ts deleted file mode 100644 index 3cbdfc84b4..0000000000 --- a/alcs-frontend/src/app/features/commissioner/application/decisions/decisions.component.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { ChangeDetectionStrategy, Component, Input, type OnInit } from '@angular/core'; -import { CommissionerDecisionDto } from '../../../../services/commissioner/commissioner.dto'; -import { ApplicationDocumentService } from '../../../../services/application/application-document/application-document.service'; - -@Component({ - selector: 'app-decisions', - templateUrl: './decisions.component.html', - styleUrl: './decisions.component.scss', -}) -export class DecisionsComponent implements OnInit { - @Input() applicationDecisions: CommissionerDecisionDto[] = []; - constructor(private decisionService: ApplicationDocumentService) {} - ngOnInit(): void {} -} diff --git a/alcs-frontend/src/app/features/commissioner/commissioner.module.ts b/alcs-frontend/src/app/features/commissioner/commissioner.module.ts index eb94ab63d7..3908837f2b 100644 --- a/alcs-frontend/src/app/features/commissioner/commissioner.module.ts +++ b/alcs-frontend/src/app/features/commissioner/commissioner.module.ts @@ -5,6 +5,7 @@ import { SharedModule } from '../../shared/shared.module'; import { PlanningReviewModule } from '../planning-review/planning-review.module'; import { CommissionerApplicationComponent } from './application/commissioner-application.component'; import { CommissionerPlanningReviewComponent } from './planning-review/commissioner-planning-review.component'; +import { CommissionerDecisionsComponent } from './application/commissioner-decisions/commissioner-decisions.component'; const routes: Routes = [ { @@ -18,7 +19,7 @@ const routes: Routes = [ ]; @NgModule({ - declarations: [CommissionerApplicationComponent, CommissionerPlanningReviewComponent], - imports: [CommonModule, SharedModule, PlanningReviewModule, RouterModule.forChild(routes)], + declarations: [CommissionerApplicationComponent, CommissionerPlanningReviewComponent, CommissionerDecisionsComponent], + imports: [CommonModule, SharedModule, PlanningReviewModule, RouterModule.forChild(routes), SharedModule], }) export class CommissionerModule {} diff --git a/alcs-frontend/src/app/services/application/application-document/application-document.dto.ts b/alcs-frontend/src/app/services/application/application-document/application-document.dto.ts index 5a72d5ed32..a84c1ef82f 100644 --- a/alcs-frontend/src/app/services/application/application-document/application-document.dto.ts +++ b/alcs-frontend/src/app/services/application/application-document/application-document.dto.ts @@ -18,6 +18,7 @@ export interface ApplicationDocumentDto { uploadedBy: string; uploadedAt: number; evidentiaryRecordSorting?: number; + fileSize?: number; } export interface UpdateDocumentDto { diff --git a/alcs-frontend/src/app/services/commissioner/commissioner.dto.ts b/alcs-frontend/src/app/services/commissioner/commissioner.dto.ts index a21ff826c4..07f52d7e00 100644 --- a/alcs-frontend/src/app/services/commissioner/commissioner.dto.ts +++ b/alcs-frontend/src/app/services/commissioner/commissioner.dto.ts @@ -16,6 +16,7 @@ export interface CommissionerApplicationDto { hasRecons: boolean; hasModifications: boolean; legacyId?: string; + decisions?: CommissionerDecisionDto[]; } export interface CommissionerPlanningReviewDto {