Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pidp 1002/1098 add user notification for reasons cards are inaccessible #611

Open
wants to merge 20 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
495a6fe
windows scroll console error fix
AdityaMantripragada Sep 25, 2024
5f9e416
multiple dialog box fix
AdityaMantripragada Sep 25, 2024
0285780
toastservice added to access request cards
AdityaMantripragada Oct 4, 2024
ca89ab5
disabled card modified
AdityaMantripragada Oct 8, 2024
2a0a3a9
closeToast service added
AdityaMantripragada Oct 10, 2024
0d61db2
remove unrelated commits from 1002
AdityaMantripragada Oct 10, 2024
6a7f09d
removed unused import
AdityaMantripragada Oct 10, 2024
3872a7e
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Oct 11, 2024
d697977
moved to constants
AdityaMantripragada Oct 21, 2024
50d3d0f
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Oct 22, 2024
ae04a22
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Nov 14, 2024
240b14f
resasons added to profilestatus
AdityaMantripragada Nov 15, 2024
b4ee1e5
Merge branch 'Pidp-1002-Add-user-notification-for-reasons-cards-are-i…
AdityaMantripragada Nov 15, 2024
2494271
updated the constants
AdityaMantripragada Nov 18, 2024
e74a413
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Nov 18, 2024
3d8563d
Merge branch 'develop' of https://github.com/bcgov/moh-pidp into Pidp…
AdityaMantripragada Nov 21, 2024
ad44b4b
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Dec 2, 2024
c48c64b
added constants file
AdityaMantripragada Dec 4, 2024
e732bdd
Merge branch 'Pidp-1002-Add-user-notification-for-reasons-cards-are-i…
AdityaMantripragada Dec 4, 2024
debc6a7
Merge branch 'develop' into Pidp-1002-Add-user-notification-for-reaso…
AdityaMantripragada Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions workspace/apps/pidp/src/app/core/services/toast.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,8 @@ export class ToastService {
): void {
this.snackBar.open(message, action, config);
}

public closeToast(): void {
this.snackBar.dismiss();
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
<div class="container" uiPidpInjectViewportCss>
<div
class="card-container"
[ngClass]="{ 'cursor-default': actionDisabled }"
(click)="actionDisabled ? '' : onAction()"
(keyup)="actionDisabled ? '' : onAction()">
<div class="card-container" (click)="onAction()" (keyup)="onAction()">
<div class="card-header">
<div class="card-header-icon">
<fa-icon
Expand All @@ -16,7 +12,7 @@
<div class="card-body">
{{ description }}
<div>
<button class="learn-more" uiTextButton [disabled]="actionDisabled">
<button class="learn-more" uiTextButton>
<span [ngClass]="{ 'grey-out': actionDisabled }"
><u>Learn more</u><span class="arrow-right">></span></span
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Component, EventEmitter, Input, Output } from '@angular/core';
import { FaIconComponent } from '@fortawesome/angular-fontawesome';
import { IconProp } from '@fortawesome/fontawesome-svg-core';
import { faFileLines } from '@fortawesome/free-solid-svg-icons';
import { ToastService } from '@app/core/services/toast.service';

import {
InjectViewportCssClassDirective,
Expand Down Expand Up @@ -31,12 +32,30 @@ export class AccessRequestCardComponent {
@Input() public completed?: boolean;
public faFileLines = faFileLines;

public constructor() {
public constructor(private toastService: ToastService) {
this.icon = faFileLines;
this.action = new EventEmitter<void>();
}

public onAction(): void {
this.action.emit();
if (
this.actionDisabled &&
this.heading === 'Driver Fitness Practitioner Portal'
) {
this.toastService.openInfoToast(
'Insufficient college licensing to request enrolment.',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can keep these error messages in constants and use them here.

'close',
{ duration: 100000, panelClass: 'close-icon' },
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as previous. duration can be kept in constants.

);
} else if (this.actionDisabled) {
this.toastService.openInfoToast(
'Incorrect credential type being used to request enrolment.',
'close',
{ duration: 100000, panelClass: 'close-icon' },
);
} else {
this.toastService.closeToast();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In which case it will be called ?

this.action.emit();
}
}
}
Loading