-
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 #2045 from bcgov/feature/ALCS-2351
Add Tags and File Status to Commissioner View
- Loading branch information
Showing
16 changed files
with
137 additions
and
11 deletions.
There are no files selected for viewing
9 changes: 8 additions & 1 deletion
9
...rontend/src/app/features/commissioner/application/commissioner-application.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
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
8 changes: 8 additions & 0 deletions
8
...tend/src/app/shared/tags/commissioner-tags-header/commissioner-tags-header.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,8 @@ | ||
<div | ||
class="tag-container" | ||
[ngClass]="{ hovered: hovered, clicked: clicked }" | ||
(mouseleave)="hovered = false" | ||
(mouseenter)="hovered = true" | ||
> | ||
<app-tag-chip *ngFor="let tag of tags" [tag]="tag" [removable]="false"></app-tag-chip> | ||
</div> |
20 changes: 20 additions & 0 deletions
20
...tend/src/app/shared/tags/commissioner-tags-header/commissioner-tags-header.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,20 @@ | ||
.tag-container { | ||
width: 100%; | ||
margin-left: -10px; | ||
margin-top: -5px; | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
padding: 5px; | ||
|
||
&.hovered { | ||
border: 1px solid #aaaaaa; | ||
} | ||
|
||
&.clicked { | ||
border: 1px solid #929292; | ||
} | ||
} | ||
|
||
.category { | ||
color: #a0a0a0; | ||
} |
33 changes: 33 additions & 0 deletions
33
...d/src/app/shared/tags/commissioner-tags-header/commissioner-tags-header.component.spec.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,33 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CommissionerTagsHeaderComponent } from './commissioner-tags-header.component'; | ||
import { createMock, DeepMocked } from '@golevelup/ts-jest'; | ||
import { FileTagService } from '../../../services/common/file-tag.service'; | ||
|
||
describe('CommissionerTagsHeaderComponent', () => { | ||
let component: CommissionerTagsHeaderComponent; | ||
let fixture: ComponentFixture<CommissionerTagsHeaderComponent>; | ||
let mockFileTagService: DeepMocked<FileTagService>; | ||
|
||
beforeEach(async () => { | ||
mockFileTagService = createMock(); | ||
|
||
await TestBed.configureTestingModule({ | ||
declarations: [CommissionerTagsHeaderComponent], | ||
providers: [ | ||
{ | ||
provide: FileTagService, | ||
useValue: mockFileTagService, | ||
}, | ||
], | ||
}).compileComponents(); | ||
|
||
fixture = TestBed.createComponent(CommissionerTagsHeaderComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
36 changes: 36 additions & 0 deletions
36
...ontend/src/app/shared/tags/commissioner-tags-header/commissioner-tags-header.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,36 @@ | ||
import { Component, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core'; | ||
import { TagDto } from '../../../services/tag/tag.dto'; | ||
import { FileTagService } from '../../../services/common/file-tag.service'; | ||
import { ApplicationDto } from '../../../services/application/application.dto'; | ||
import { CommissionerApplicationDto } from '../../../services/commissioner/commissioner.dto'; | ||
import { NoticeOfIntentDto } from '../../../services/notice-of-intent/notice-of-intent.dto'; | ||
import { NotificationDto } from '../../../services/notification/notification.dto'; | ||
|
||
@Component({ | ||
selector: 'app-commissioner-tags-header', | ||
templateUrl: './commissioner-tags-header.component.html', | ||
styleUrl: './commissioner-tags-header.component.scss', | ||
}) | ||
export class CommissionerTagsHeaderComponent implements OnInit, OnChanges { | ||
tags: TagDto[] = []; | ||
|
||
hovered = false; | ||
clicked = false; | ||
|
||
@Input() application: ApplicationDto | CommissionerApplicationDto | NoticeOfIntentDto | NotificationDto | undefined; | ||
@Input() isHidden: boolean = false; | ||
|
||
constructor(private fileTagService: FileTagService) {} | ||
|
||
ngOnInit(): void {} | ||
|
||
ngOnChanges(changes: SimpleChanges): void { | ||
if (changes['application'] && changes['application'].currentValue !== undefined) { | ||
this.initFileTags(); | ||
} | ||
} | ||
async initFileTags() { | ||
const res = await this.fileTagService.getTags(this.application?.fileNumber!); | ||
this.tags = res!; | ||
} | ||
} |
4 changes: 2 additions & 2 deletions
4
alcs-frontend/src/app/shared/tags/tag-chip/tag-chip.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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<mat-chip-row (removed)="onRemove()" | ||
<mat-chip-row (removed)="onRemove()" [ngClass]="{ removable: !removable }" | ||
>{{ tag.name }} | ||
<button matChipRemove [attr.aria-label]="'remove ' + tag"> | ||
<button matChipRemove [attr.aria-label]="'remove ' + tag" *ngIf="removable"> | ||
<mat-icon svgIcon="cancel_filled"></mat-icon> | ||
</button> | ||
</mat-chip-row> |
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 |
---|---|---|
|
@@ -4,3 +4,7 @@ mat-chip-row { | |
border: 1px solid; | ||
background-color: #f3f3f3 !important; | ||
} | ||
|
||
.removable { | ||
margin: 4px; | ||
} |
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
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