Skip to content

Commit

Permalink
Rename commissioner decision component and Add to commissioner's appl…
Browse files Browse the repository at this point in the history
…ication page
  • Loading branch information
Abradat committed Sep 10, 2024
1 parent 2c47d2e commit d8f8280
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
<div class="application">
<app-details-header [application]="application" heading="Application" days="Business Days"></app-details-header>
<section class="content">
<app-commissioner-decisions
*ngIf="application?.decisions"
[applicationDecisions]="application?.decisions!"
></app-commissioner-decisions>
<app-document
*ngIf="fileNumber"
[fileNumber]="fileNumber"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<div *ngFor="let decision of applicationDecisions; let index = index">
<h4>Decision #{{ applicationDecisions.length - index }}</h4>
<div class="decision-table">
<div>
<div class="subheading2">Decision Date</div>
{{ decision.date | momentFormat }}
</div>

<div>
<div class="subheading2">Resolution Number</div>
#{{ decision.resolutionNumber }}/{{ decision.resolutionYear }}
</div>

<div class="full-width">
<div class="subheading2">Decision Summary</div>
{{ decision.decisionDescription }}
</div>

<div class="full-width">
<div class="subheading2">Decision Document</div>
<div class="document split" *ngFor="let document of decision.documents">
<div>
<a (click)="openFile(decision, document)">{{ document.fileName }}</a>
&nbsp;({{ document.fileSize! | filesize }})
</div>
<button class="center" mat-button (click)="openFile(decision, document)">
<mat-icon>file_download</mat-icon>
Download
</button>
</div>
<div class="document responsive left" *ngFor="let document of decision.documents">
<div class="document-name">
<a (click)="openFile(decision, document)">{{ document.fileName }}</a>
</div>
<div class="split">
<div>{{ document.fileSize! | filesize }}</div>
<button class="center" mat-button (click)="openFile(decision, document)">
<mat-icon>file_download</mat-icon>
Download
</button>
</div>
</div>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
@@ -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);
}
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -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 {}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export interface ApplicationDocumentDto {
uploadedBy: string;
uploadedAt: number;
evidentiaryRecordSorting?: number;
fileSize?: number;
}

export interface UpdateDocumentDto {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export interface CommissionerApplicationDto {
hasRecons: boolean;
hasModifications: boolean;
legacyId?: string;
decisions?: CommissionerDecisionDto[];
}

export interface CommissionerPlanningReviewDto {
Expand Down

0 comments on commit d8f8280

Please sign in to comment.