-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1791 from bcgov/feature/ALCS-2004
Add Upload Modal for Optional Attachments and Card Views for Mobile
- Loading branch information
Showing
43 changed files
with
1,694 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...submission/other-attachments/other-attachments-card/other-attachments-card.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<mat-card> | ||
<mat-card-header> | ||
<mat-card-title>{{file.type?.label}}</mat-card-title> | ||
<button mat-icon-button [mat-menu-trigger-for]="menu"> | ||
<mat-icon>more_vert</mat-icon> | ||
</button> | ||
<mat-menu #menu="matMenu"> | ||
<button mat-menu-item (click)="onEdit()"> | ||
<span>Edit</span> | ||
</button> | ||
<button mat-menu-item (click)="onRemove()"> | ||
<span>Remove</span> | ||
</button> | ||
</mat-menu> | ||
</mat-card-header> | ||
<mat-card-content> | ||
<a (click)="onClick()">{{file.fileName}}</a> | ||
<p>{{file.description}}</p> | ||
</mat-card-content> | ||
</mat-card> |
21 changes: 21 additions & 0 deletions
21
...submission/other-attachments/other-attachments-card/other-attachments-card.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
mat-card { | ||
width: 100%; | ||
border-bottom: 1px solid #EFEFEF; | ||
} | ||
|
||
mat-card-header { | ||
display: flex; | ||
justify-content: space-between; | ||
align-items: center; | ||
font-weight: bold; | ||
} | ||
|
||
mat-card-content { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 10px; | ||
} | ||
|
||
span { | ||
font-weight: normal; | ||
} |
31 changes: 31 additions & 0 deletions
31
...t-submission/other-attachments/other-attachments-card/other-attachments-card.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { CommonModule } from "@angular/common"; | ||
import { NgModule } from "@angular/core"; | ||
import {MatCardModule} from '@angular/material/card' | ||
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, type OnInit } from '@angular/core'; | ||
import { ApplicationDocumentDto } from "src/app/services/application-document/application-document.dto"; | ||
|
||
@Component({ | ||
selector: 'app-other-attachments-card', | ||
templateUrl: './other-attachments-card.component.html', | ||
styleUrl: './other-attachments-card.component.scss', | ||
}) | ||
export class OtherAttachmentsCardComponent implements OnInit { | ||
@Input() file!: ApplicationDocumentDto; | ||
@Output() editClicked = new EventEmitter<ApplicationDocumentDto>(); | ||
@Output() removeClicked = new EventEmitter<ApplicationDocumentDto>(); | ||
@Output() fileClicked = new EventEmitter<ApplicationDocumentDto>(); | ||
|
||
ngOnInit(): void { } | ||
|
||
onEdit() { | ||
this.editClicked.emit(this.file); | ||
} | ||
|
||
onRemove() { | ||
this.removeClicked.emit(this.file); | ||
} | ||
|
||
onClick() { | ||
this.fileClicked.emit(this.file); | ||
} | ||
} |
81 changes: 81 additions & 0 deletions
81
...ttachments/other-attachments-upload-dialog/other-attachments-upload-dialog.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
<div mat-dialog-title> | ||
<h4>{{title}} optional attachment</h4> | ||
</div> | ||
<div mat-dialog-content> | ||
<div class="uploader"> | ||
<app-file-drag-drop | ||
(uploadFiles)="attachDocument($event)" | ||
[uploadedFiles]="attachment" | ||
(openFile)="openFile()" | ||
(deleteFile)="deleteFile()"> | ||
</app-file-drag-drop> | ||
</div> | ||
<mat-error *ngIf="showVirusError" class="left" style="display: flex"> | ||
<mat-icon>warning</mat-icon> A virus was detected in the file. Choose another file and try again. | ||
</mat-error> | ||
<form [formGroup]="form"> | ||
<div class="form-container"> | ||
<div class="form-field"> | ||
<mat-form-field appearance="outline" > | ||
<mat-select | ||
placeholder="Select a Type" | ||
id="fileType" | ||
formControlName="fileType" | ||
(valueChange)="onChangeType($event)"> | ||
<mat-option *ngFor="let type of selectableTypes" | ||
[value]="type.code"> | ||
{{ type.label }} | ||
</mat-option> | ||
</mat-select> | ||
</mat-form-field> | ||
<div | ||
*ngIf=" | ||
form.controls['fileType']!.invalid && | ||
(form.controls['fileType']!.dirty || | ||
form.controls['fileType']!.touched)" | ||
class="field-error" | ||
> | ||
<mat-icon>warning</mat-icon> | ||
<div *ngIf="form.controls['fileType']!.errors?.['required']"> | ||
This field is required | ||
</div> | ||
</div> | ||
</div> | ||
<div class="form-field"> | ||
<mat-form-field appearance="outline"> | ||
<input matInput | ||
type="text" | ||
placeholder="Type Description" | ||
id="fileDescription" | ||
formControlName="fileDescription" | ||
(input)="onChangeDescription()"> | ||
</mat-form-field> | ||
<div | ||
*ngIf=" | ||
form.controls['fileDescription']!.invalid && | ||
(form.controls['fileDescription']!.dirty || | ||
form.controls['fileDescription']!.touched)" | ||
class="field-error" | ||
> | ||
<mat-icon>warning</mat-icon> | ||
<div *ngIf="form.controls['fileDescription']!.errors?.['required']"> | ||
This field is required | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
<mat-dialog-actions align="end"> | ||
<div class="button-container"> | ||
<button *ngIf="!this.data.existingDocument" mat-flat-button color="primary" (click)="onAdd()" | ||
[disabled]="form.invalid || pendingFile === undefined || !isDirty || !isFileDirty || isSaving"> | ||
ADD | ||
</button> | ||
<button *ngIf="this.data.existingDocument" mat-flat-button color="primary" (click)="onEdit()" | ||
[disabled]="form.invalid || (!isFileDirty && !isDirty) || isSaving"> | ||
SAVE | ||
</button> | ||
<button mat-stroked-button color="primary" [mat-dialog-close]="false">CANCEL</button> | ||
</div> | ||
</mat-dialog-actions> |
55 changes: 55 additions & 0 deletions
55
...ttachments/other-attachments-upload-dialog/other-attachments-upload-dialog.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
@use '../../../../../../styles/functions.scss' as *; | ||
@use '../../../../../../styles/colors'; | ||
|
||
.uploader { | ||
margin: 10px 0 10px 0; | ||
} | ||
|
||
.field-error { | ||
color: colors.$error-color; | ||
font-size: rem(15); | ||
font-weight: 700; | ||
display: flex; | ||
align-items: center; | ||
margin-top: rem(4); | ||
} | ||
|
||
.form-container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: space-between; | ||
margin: 10px 0 0 0; | ||
gap: 20px; | ||
|
||
.form-field { | ||
flex: 1 1 48%; | ||
box-sizing: border-box; | ||
display: grid; | ||
flex-direction: column; | ||
align-items: flex-start; | ||
} | ||
|
||
@media screen and (max-width: $tabletBreakpoint) { | ||
.form-field { | ||
flex: 1 1 100%; | ||
margin: 0 5px; | ||
} | ||
} | ||
} | ||
|
||
.button-container { | ||
display: flex; | ||
flex-direction: row-reverse; | ||
gap: 15px; | ||
margin: 0 15px 10px 0; | ||
button { | ||
flex: 0 0 100px; | ||
padding: 10px 10px; | ||
} | ||
|
||
@media screen and (max-width: $tabletBreakpoint) { | ||
button { | ||
flex: 1 1 48%; | ||
} | ||
} | ||
} |
Oops, something went wrong.