Skip to content

Commit ad4a3fd

Browse files
authored
Merge pull request #2648 from bcgov/2500-close-chronology-on-ce-file
2500/2606: Close chronology on C&E file
2 parents 1a50139 + d126349 commit ad4a3fd

26 files changed

+1002
-84
lines changed

alcs-frontend/src/app/features/compliance-and-enforcement/details/chronology/chronology.component.html

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,54 @@
11
<div class="actions">
2-
<button *ngIf="entries.length > 0" mat-stroked-button color="primary" type="button" [disabled]="hasDraftEntries()">
3-
Close Chronology
4-
</button>
2+
<ng-container *ngIf="!file?.chronologyClosedAt; else reopenButtonTemplate">
3+
<button
4+
*ngIf="entries.length > 0"
5+
mat-stroked-button
6+
color="primary"
7+
type="button"
8+
(click)="confirmCloseChronology()"
9+
[disabled]="hasDraftEntries()"
10+
>
11+
Close Chronology
12+
</button>
13+
</ng-container>
14+
15+
<ng-template #reopenButtonTemplate>
16+
<button
17+
mat-stroked-button
18+
color="primary"
19+
type="button"
20+
(click)="confirmReopenChronology()"
21+
[disabled]="hasDraftEntries()"
22+
>
23+
Re-open Chronology
24+
</button>
25+
</ng-template>
526

6-
<button mat-flat-button color="primary" type="button" (click)="createDraftEntry()" [disabled]="hasDraftEntries()">
27+
<button
28+
*ngIf="!file?.chronologyClosedAt"
29+
mat-flat-button
30+
color="primary"
31+
type="button"
32+
(click)="createDraftEntry()"
33+
[disabled]="hasDraftEntries()"
34+
>
735
+ Chronology Entry
836
</button>
937
</div>
1038

1139
<div *ngIf="entries.length > 0; else noEntries" class="entries">
40+
<div *ngIf="file?.chronologyClosedAt" class="final-entry">
41+
<div class="final-entry-date">{{ file?.chronologyClosedAt | date: 'yyyy-MMM-dd' }}</div>
42+
<div class="final-entry-main">
43+
<strong>Chronology Closed by {{ file?.chronologyClosedBy?.prettyName }}</strong>
44+
</div>
45+
</div>
1246
<app-compliance-and-enforcement-chronology-entry
1347
*ngFor="let entry of entries"
1448
[entry]="entry"
49+
[authors]="authors"
1550
[datesInUse]="datesInUse(entry.uuid)"
16-
[editDisabled]="hasDraftEntries()"
51+
[editDisabled]="hasDraftEntries() || !!file?.chronologyClosedAt"
1752
(edit)="setDraft($event)"
1853
(complete)="completeDraftEntry($event)"
1954
(delete)="confirmEntryDelete($event)"

alcs-frontend/src/app/features/compliance-and-enforcement/details/chronology/chronology.component.scss

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,33 @@
77
margin-bottom: 24px;
88
}
99

10+
.final-entry {
11+
display: flex;
12+
13+
background-color: colors.$grey-light;
14+
}
15+
16+
.final-entry-date,
17+
.final-entry-main {
18+
display: flex;
19+
flex-direction: column;
20+
align-items: stretch;
21+
padding: 20px;
22+
}
23+
24+
.final-entry-date {
25+
color: colors.$grey-dark;
26+
width: 210px;
27+
flex-shrink: 0;
28+
border-right: 1px solid colors.$grey;
29+
}
30+
31+
.final-entry-main {
32+
flex-grow: 1;
33+
gap: 24px;
34+
position: relative;
35+
}
36+
1037
.entries {
1138
border: 1px solid colors.$grey;
1239
border-radius: 8px;

0 commit comments

Comments
 (0)