Commit da50c697 by Muhammad Usman

toaster ui changes

parent cb162b4e
...@@ -5,6 +5,7 @@ import { PersonalDetailsService } from '../../services/personal-details.service' ...@@ -5,6 +5,7 @@ import { PersonalDetailsService } from '../../services/personal-details.service'
import { CareerProfileModel } from '../../models/career-profile.model'; import { CareerProfileModel } from '../../models/career-profile.model';
import { UtilsService } from '../../../../oneit/services/utils.service'; import { UtilsService } from '../../../../oneit/services/utils.service';
import { HelperService } from '../../services/helper.service'; import { HelperService } from '../../services/helper.service';
import { ToasterService } from '../../services/toaster.service';
@Component({ @Component({
selector: 'app-home', selector: 'app-home',
...@@ -21,6 +22,7 @@ export class HomeComponent extends BaseComponent implements OnInit { ...@@ -21,6 +22,7 @@ export class HomeComponent extends BaseComponent implements OnInit {
private ps: PersonalDetailsService, private ps: PersonalDetailsService,
private hs: HelperService, private hs: HelperService,
private us: UtilsService, private us: UtilsService,
private ts: ToasterService
) { ) {
super(); super();
} }
...@@ -31,7 +33,8 @@ export class HomeComponent extends BaseComponent implements OnInit { ...@@ -31,7 +33,8 @@ export class HomeComponent extends BaseComponent implements OnInit {
.pipe(takeUntil(this.componentInView)) .pipe(takeUntil(this.componentInView))
.subscribe(profile => { .subscribe(profile => {
this.careerProfile = this.us.cloneObject(profile); this.careerProfile = this.us.cloneObject(profile);
}) });
this.ts.warning('You have completed your Career History, one step closer to done.')
} }
getCareerProfile(): void { getCareerProfile(): void {
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<img src="assets/my-career-web/svgs/avatar.svg" alt=""> <img src="assets/my-career-web/svgs/avatar.svg" alt="">
</div> </div>
</div> </div>
<div class="user-profile-label">Profile {{careerProfile.CompletedPercentage || 0}}% complete <i class="fa fa-trophy" *ngIf="careerProfile.CompletedPercentage"></i></div> <div class="user-profile-label">Profile 0% complete</div>
<hr style="border-bottom: 1px solid #E0E0E0; margin: 24px 0;"> <hr style="border-bottom: 1px solid #E0E0E0; margin: 24px 0;">
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
<div class="user-profile-sections"> <div class="user-profile-sections">
<div class="user-profile-section active"> <div class="user-profile-section active">
<span>Personal Details</span> <span>Personal Details</span>
<span class="section-percentage">0%</span> <span class="section-percentage">{{careerProfile.CompletedPercentage || 0}}%</span>
<button pButton label="Get Started" routerLink="/my-career-web/dashboard/personal-details" class="ui-button-info section-start"> <button pButton label="Get Started" routerLink="/my-career-web/dashboard/personal-details" class="ui-button-info section-start">
</button> </button>
</div> </div>
......
<div class="my-career-app container-fluid" [@routeAnimations]="o.isActivated ? o.activatedRoute : ''"> <div class="my-career-app container-fluid" [@routeAnimations]="o.isActivated ? o.activatedRoute : ''">
<p-toast></p-toast>
<p-toast>
<ng-template let-message pTemplate="message">
<div class="mc-toast-msg">
<div class="mc-toast-icon">
<i class="fa fa-check" *ngIf="message.severity === 'success'"></i>
<i class="fa fa-exclamation" *ngIf="message.severity === 'error' || message.severity === 'warn'"></i>
<i class="fa fa-info" *ngIf="message.severity === 'info'"></i>
</div>
<div class="mc-toast-content">
<span *ngIf="message.severity === 'success'"> Success!</span>
<span *ngIf="message.severity === 'error'"> Error!</span>
<span *ngIf="message.severity === 'warning'"> Attention!</span>
<span *ngIf="message.severity === 'info'"> Update!</span>
{{message.detail}}
</div>
</div>
</ng-template>
</p-toast>
<router-outlet #o="outlet"></router-outlet> <router-outlet #o="outlet"></router-outlet>
</div> </div>
...@@ -17,6 +17,10 @@ export class ToasterService { ...@@ -17,6 +17,10 @@ export class ToasterService {
this.ms.add({severity: 'success', summary: title, detail: txt, life: 3000}); this.ms.add({severity: 'success', summary: title, detail: txt, life: 3000});
} }
warning(txt, title = 'Warning'): void {
this.ms.add({severity: 'warn', summary: title, detail: txt, life: 3000});
}
info(txt, title = 'Notification'): void { info(txt, title = 'Notification'): void {
this.ms.add({severity: 'info', summary: title, detail: txt, life: 3000}); this.ms.add({severity: 'info', summary: title, detail: txt, life: 3000});
} }
......
.ui-toast { .ui-toast {
width: 17em; width: 60%;
top: 20px;
left: 20%;
display: flex;
align-items: center;
&-message { p-toastItem {
width: 100%;
font-family: $bodyFont;
}
.ui-toast-message {
width: 100%;
margin-bottom: 0;
box-shadow: none;
padding: 12px 16px;
border-radius: 3px;
&-success {
border: 2px solid #1DBA3C;
background-color: #BBE6C4;
&-text-content { .mc-toast-icon, .ui-toast-close-icon {
margin-left: 0; color: #1DBA3C;
}
} }
&-error { &-info {
background: #bd2712; border: 2px solid #8cd2f4;
color: #fff; background-color: #d2edfb;
.mc-toast-icon, .ui-toast-close-icon {
color: #86d0f3;
}
} }
&-success { &-warn {
background: #1DBA3C; border: 2px solid #fbab4c;
color: #fff; background-color: #ffdeb5;
.mc-toast-icon, .ui-toast-close-icon {
color: #fbab4c;
} }
} }
&-close-icon { &-error {
color: #fff; border: 2px solid #de1516;
right: 8px; background-color: #ffdad9;
top: 8px;
font-size: 20px; .mc-toast-icon, .ui-toast-close-icon {
color: #de1516;
}
}
&-content {
padding: 0 !important;
} }
&-summary { .mc-toast-icon {
padding: 0 0 0.2em 0; height: 32px;
width: 32px;
background-color: #FFFFFF;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
} }
&-icon { .mc-toast-msg {
display: none; display: flex;
align-items: center;
.mc-toast-content {
margin-left: 16px;
color: $darkColor;
font-size: 15px;
}
}
.ui-toast-close-icon {
font-size: 24px;
top: 14px;
right: 17px;
font-weight: bold;
}
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment