Skip to content

Commit

Permalink
Merge pull request #2192 from bcgov/bugfix/ALCS-2549-2
Browse files Browse the repository at this point in the history
Remove interaction from tag chips in commissioner view
  • Loading branch information
Abradat authored Mar 4, 2025
2 parents 011a425 + 64920f1 commit 97bbfca
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div class="tag-container">
<app-tag-chip *ngFor="let tag of tags" [tag]="tag" [removable]="false"></app-tag-chip>
<app-tag-chip *ngFor="let tag of tags" [tag]="tag" [removable]="false" [isCommissioner]="true"></app-tag-chip>
</div>
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<mat-chip (removed)="onRemove()" [ngClass]="{ removable: !removable }" (click)="handleClick($event)">
<mat-chip
(removed)="onRemove()"
[ngClass]="{
removable: !removable,
commissioner: isCommissioner,
}"
(click)="handleClickOrKeyPress($event)"
(keypress)="handleClickOrKeyPress($event)"
>
{{ tag.name }}
<button matChipRemove [attr.aria-label]="'remove ' + tag" *ngIf="removable">
<mat-icon svgIcon="cancel_filled"></mat-icon>
Expand Down
28 changes: 28 additions & 0 deletions alcs-frontend/src/app/shared/tags/tag-chip/tag-chip.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,31 @@ mat-chip {
.removable {
margin: 4px;
}

.commissioner {
pointer-events: none !important;

&,
&:hover,
&:active,
&:focus {
border-color: #929292 !important;
background-color: #f3f3f3 !important;
box-shadow: none !important;
cursor: default !important;
}

&::before,
&::after {
display: none !important;
}

::ng-deep .mat-mdc-chip-action,
::ng-deep .mdc-evolution-chip__action {
pointer-events: none !important;
}

* {
transition: none !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import { TagDto } from '../../../services/tag/tag.dto';
export class TagChipComponent {
@Input() tag!: TagDto;
@Input() removable: boolean = true;
@Input() isCommissioner: boolean = false;
@Output() removeClicked = new EventEmitter<TagDto>();

onRemove() {
this.removeClicked.emit(this.tag);
}

handleClick(event: MouseEvent) {
handleClickOrKeyPress(event: MouseEvent | KeyboardEvent) {
event.preventDefault();
event.stopPropagation();
}
Expand Down

0 comments on commit 97bbfca

Please sign in to comment.