diff --git a/package-lock.json b/package-lock.json index 1b9531a..3402388 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2349,6 +2349,22 @@ } } }, + "@progress/kendo-angular-pager": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@progress/kendo-angular-pager/-/kendo-angular-pager-2.0.0.tgz", + "integrity": "sha512-Q6ZyK8Xvk77rc2PhvRyRS53G/gN0GA9zzBs++KNs3MmOaKQNNggtvgne+fstEhNrY1R9nO53CzMlqYs8i+dH7w==", + "requires": { + "@progress/kendo-schematics": "^1.2.0", + "tslib": "^1.9.0" + }, + "dependencies": { + "tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + } + } + }, "@progress/kendo-angular-pdf-export": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/@progress/kendo-angular-pdf-export/-/kendo-angular-pdf-export-3.0.0.tgz", diff --git a/package.json b/package.json index 7216649..87b1c93 100644 --- a/package.json +++ b/package.json @@ -29,28 +29,29 @@ "@progress/kendo-angular-common": "^2.0.0", "@progress/kendo-angular-dateinputs": "^5.1.0", "@progress/kendo-angular-dialog": "^5.0.0", - "@progress/kendo-angular-dropdowns": "^5.1.0", + "@progress/kendo-angular-dropdowns": "^5.0.0", "@progress/kendo-angular-editor": "^2.0.1", "@progress/kendo-angular-excel-export": "^4.0.0", "@progress/kendo-angular-grid": "^5.0.3", "@progress/kendo-angular-icons": "^0.4.2", "@progress/kendo-angular-indicators": "^1.0.0", - "@progress/kendo-angular-inputs": "^7.1.2", - "@progress/kendo-angular-intl": "^3.1.0", + "@progress/kendo-angular-inputs": "^7.0.0", + "@progress/kendo-angular-intl": "^3.0.0", "@progress/kendo-angular-l10n": "^3.0.0", "@progress/kendo-angular-label": "^3.0.1", "@progress/kendo-angular-layout": "6", "@progress/kendo-angular-menu": "^3.0.0", "@progress/kendo-angular-navigation": "^1.0.0", "@progress/kendo-angular-notification": "^3.0.0", + "@progress/kendo-angular-pager": "^2.0.0", "@progress/kendo-angular-pdf-export": "^3.0.0", "@progress/kendo-angular-popup": "^4.0.0", "@progress/kendo-angular-progressbar": "^2.0.0", "@progress/kendo-angular-toolbar": "^4.0.0", - "@progress/kendo-angular-treeview": "^5.1.0", + "@progress/kendo-angular-treeview": "^5.0.0", "@progress/kendo-angular-upload": "^7.1.0", "@progress/kendo-data-query": "^1.5.4", - "@progress/kendo-drawing": "^1.9.4", + "@progress/kendo-drawing": "^1.5.12", "@progress/kendo-licensing": "^1.0.2", "@progress/kendo-svg-icons": "^0.1.2", "@progress/kendo-theme-default": "latest", diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 0795602..5f59f22 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -23,6 +23,7 @@ import {PayInComponent} from './pay-in/pay-in.component'; import {PeopleAddComponent} from './people-add/people-add.component'; import {SettingsComponent} from './settings/settings.component'; import {ProfileComponent} from './profile/profile.component'; +import {ListAllPeopleComponent} from './list-all-people/list-all-people.component'; const routes: Routes = [ @@ -49,7 +50,7 @@ const routes: Routes = [ {path : 'reward-unpaid', component: RewardUnpaidComponent, canActivate: [AuthGuard] }, {path : 'pay-in', component: PayInComponent, canActivate: [AuthGuard] }, {path : 'lender-uploads', component: LenderUploadsComponent, canActivate: [AuthGuard] }, - {path : 'list-all-people', component: LenderUploadsComponent, canActivate: [AuthGuard] }, + {path : 'list-all-people', component: ListAllPeopleComponent, canActivate: [AuthGuard] }, {path : 'people-add', component: PeopleAddComponent, canActivate: [AuthGuard] }, {path : 'profile', component: ProfileComponent, canActivate: [AuthGuard] }, {path : 'profile/:id', component: ProfileComponent, canActivate: [AuthGuard] }, diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 9b144fb..1ede24a 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -86,6 +86,10 @@ import { MessageBoxComponent } from './message-box/message-box.component'; import { UserProfileComponent } from './profile/user-profile/user-profile.component'; import { AdminProfileComponent } from './profile/admin-profile/admin-profile.component'; import { ChangePasswordComponent } from './profile/change-password/change-password.component'; +import { ProgressBarModule } from '@progress/kendo-angular-progressbar'; +import { PagerModule } from '@progress/kendo-angular-pager'; + + @@ -174,7 +178,9 @@ import { ChangePasswordComponent } from './profile/change-password/change-passwo ExcelExportModule, EditorModule, UploadModule, - FileSelectModule + FileSelectModule, + ProgressBarModule, + PagerModule ], providers: [ MenuService, diff --git a/src/app/list-all-loans/list-all-loans.component.ts b/src/app/list-all-loans/list-all-loans.component.ts index 52b410f..d2fe131 100644 --- a/src/app/list-all-loans/list-all-loans.component.ts +++ b/src/app/list-all-loans/list-all-loans.component.ts @@ -73,4 +73,5 @@ export class ListAllLoansComponent implements OnInit { this.router.navigate(['/edit-loan/' + event.dataItem.Id]); } + } diff --git a/src/app/list-all-people/list-all-people.component.html b/src/app/list-all-people/list-all-people.component.html index 3647e3b..14b0707 100644 --- a/src/app/list-all-people/list-all-people.component.html +++ b/src/app/list-all-people/list-all-people.component.html @@ -1 +1,33 @@ -

list-all-people works!

+
+ + + + +
+
+
+ +
+
+
+
+ +
+
+
+
+ + + +
diff --git a/src/app/list-all-people/list-all-people.component.scss b/src/app/list-all-people/list-all-people.component.scss index e69de29..a51a349 100644 --- a/src/app/list-all-people/list-all-people.component.scss +++ b/src/app/list-all-people/list-all-people.component.scss @@ -0,0 +1,30 @@ +div.workarea{ + height: calc(100vh - 48px); + position:relative; +} + +kendo-multicolumncombobox{ + width:600px; +} + +.contact-image { + width: 22px; + height: 22px; + margin-right: 8px; + border-radius: 50%; +} + +.search-people{ + width: 600px; + margin-bottom: 2px; +} + +.bottom-pager { + position: fixed; + bottom: 0px; +} + + +.vertical-spacer{ + height: 150px; +} diff --git a/src/app/list-all-people/list-all-people.component.ts b/src/app/list-all-people/list-all-people.component.ts index 0c58b62..e5dd2e5 100644 --- a/src/app/list-all-people/list-all-people.component.ts +++ b/src/app/list-all-people/list-all-people.component.ts @@ -1,4 +1,10 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; +import {PeopleModel, RelevantPeopleModel} from '../models/people.model'; +import {PeopleService} from '../service/people.service'; +import {AuthService} from '../service/auth.service'; +import {ClonerService} from '../service/clone.service'; +import {ComboBoxComponent, PopupSettings, VirtualizationSettings} from '@progress/kendo-angular-dropdowns'; +import { PageChangeEvent } from '@progress/kendo-angular-pager'; @Component({ selector: 'app-list-all-people', @@ -7,9 +13,63 @@ import { Component, OnInit } from '@angular/core'; }) export class ListAllPeopleComponent implements OnInit { - constructor() { } + private AllPeople: PeopleModel[] = []; + public filteredPeople: PeopleModel[] = []; + public displayedPeople: PeopleModel[] = []; + public personSelected: PeopleModel; + + public skip = 0; + public pageSize = 12; + public total = 0; + + constructor(private ps: PeopleService, private auth: AuthService, private dcs: ClonerService) { } ngOnInit(): void { + this.ps.getPeopleList('').subscribe( + resp => { + this.AllPeople = resp.List; + this.onFilterPeople(''); + + } + ); + } + + public onFilterPeople(hint: string): void { + if ( hint === undefined || hint.length === 0 ) { + this.filteredPeople = this.AllPeople.slice(0); + }else { + this.filteredPeople = this.AllPeople.filter( + v => v.Display.toLowerCase().includes(hint.toLowerCase()) + ); + } + this.skip = 0 ; + this.total = this.filteredPeople.length; + this.loadDisplayedPeople(); + } + + public onPeopleSelected(people: PeopleModel): void { + if ( people !== undefined ) { + this.filteredPeople = []; + this.filteredPeople.push(people); + }else{ + this.filteredPeople = this.AllPeople.slice(0); + } + this.loadDisplayedPeople(); } + + public getContactImageUrl(contactId: string): string { + return this.auth.getUrl('avatar/' + contactId); + } + + public onPageChange(e: PageChangeEvent): void { + this.skip = e.skip; + this.pageSize = e.take; + this.loadDisplayedPeople(); + } + + private loadDisplayedPeople(): void { + this.displayedPeople = this.filteredPeople.slice(this.skip, this.skip + this.pageSize); + this.total = this.filteredPeople.length; + } } diff --git a/src/app/loan-edit-people/loan-edit-people.component.html b/src/app/loan-edit-people/loan-edit-people.component.html index 6e425ae..3b0103b 100644 --- a/src/app/loan-edit-people/loan-edit-people.component.html +++ b/src/app/loan-edit-people/loan-edit-people.component.html @@ -13,14 +13,14 @@ (close)="rebuildPeopleMap($event)"> - {{ dataItem.First +' ' + dataItem.Last}} + {{ dataItem.Display}}
- +
@@ -40,7 +40,7 @@
- +
@@ -62,7 +62,7 @@
- +
diff --git a/src/app/main-menu-items.ts b/src/app/main-menu-items.ts index 51d2393..27fe433 100644 --- a/src/app/main-menu-items.ts +++ b/src/app/main-menu-items.ts @@ -42,7 +42,7 @@ export const mainMenuItems: any[] = [ text: 'People', icon: 'user', items: [ - { text: 'Add ', icon: 'plus', url: './#profile/start-new-people' }, + { text: 'Add ', icon: 'plus', url: './#people-add' }, { text: 'List All', fa: faIdCard , url: './#list-all-people'}, ] }, diff --git a/src/app/models/broker.model.ts b/src/app/models/broker.model.ts index 2058dc0..16fe4e5 100644 --- a/src/app/models/broker.model.ts +++ b/src/app/models/broker.model.ts @@ -18,9 +18,7 @@ export class BrokerModel{ public Organization: string ){} - public toPeopleModel(): PeopleModel{ - return new PeopleModel( this.Id, this.First, this.Last, this.Middle, this.Title, this.Display, this.Nick ); - } + public static EmptyNew(): BrokerModel { return new BrokerModel('', '', '', '', '', '', '', @@ -29,7 +27,11 @@ export class BrokerModel{ public static getFromUserAndExtra(u: PeopleModel, ex: UserExtraModel): BrokerModel { return new BrokerModel( - u.Id, u.First, u.Last, u.Middle, u.Title, u.Display, u.Nick, ex.Login, ex.Enabled, ex.BSB, ex.ACC, ex.License, ex.Organization + u.Id, u.First, u.Last, u.Middle, u.Title, u.Display, u.Nick, ex.Login, u.Enabled, ex.BSB, ex.ACC, ex.License, ex.Organization ); } + + public toPeopleModel(): PeopleModel{ + return new PeopleModel( this.Id, this.First, this.Last, this.Middle, this.Title, this.Display, this.Nick, this.Enabled ); + } } diff --git a/src/app/models/loan.model.ts b/src/app/models/loan.model.ts index 8169fba..8c8fa03 100644 --- a/src/app/models/loan.model.ts +++ b/src/app/models/loan.model.ts @@ -133,7 +133,7 @@ export class LoanModel { this.Client = []; v.forEach((c) => { this.Client.push( - new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick) + new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick, c.Enabled) ); }); } @@ -142,7 +142,7 @@ export class LoanModel { this.OtherRewarder = []; v.forEach((c) => { this.OtherRewarder.push( - new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick) + new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick, c.Enabled) ); }); } @@ -151,7 +151,7 @@ export class LoanModel { this.Broker = []; v.forEach((b => { this.Broker.push(new BrokerModel( - b.Id, b.First, b.Last, b.Middle, b.Title, b.Display, b.Nick, b.Login, b.Enaabled, b.BSB, b.ACC, b.License, b.Organization + b.Id, b.First, b.Last, b.Middle, b.Title, b.Display, b.Nick, b.Login, b.Enabled, b.BSB, b.ACC, b.License, b.Organization ) ); })); @@ -161,7 +161,7 @@ export class LoanModel { this.RewardPeople = []; v.forEach((c) => { this.RewardPeople.push( - new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick) + new PeopleModel(c.Id, c.First, c.Last, c.Middle, c.Title, c.Display, c.Nick, c.Enabled) ); }); } diff --git a/src/app/models/people.model.ts b/src/app/models/people.model.ts index e707ae2..996c0f6 100644 --- a/src/app/models/people.model.ts +++ b/src/app/models/people.model.ts @@ -10,6 +10,7 @@ export class PeopleModel{ public Title: string, public Display: string, public Nick: string, + public Enabled: boolean, ){} get FullName(): string { @@ -21,7 +22,7 @@ export class PeopleModel{ } public static EmptyNew(): PeopleModel { - return new PeopleModel('', '', '', '', '', '', '' ); + return new PeopleModel('', '', '', '', '', '', '', false ); } public Copy(ppl: PeopleModel): void { @@ -32,6 +33,7 @@ export class PeopleModel{ this.Title = ppl.Title; this.Display = ppl.Display; this.Nick = ppl.Nick; + this.Enabled = ppl.Enabled; } public Clear(): void { @@ -42,6 +44,7 @@ export class PeopleModel{ this.Title = ''; this.Display = ''; this.Nick = ''; + this.Enabled = false; } } diff --git a/src/app/models/user-extra.model.ts b/src/app/models/user-extra.model.ts index 6e58a92..8b182cf 100644 --- a/src/app/models/user-extra.model.ts +++ b/src/app/models/user-extra.model.ts @@ -4,7 +4,6 @@ export class UserExtraModel { public ACC: string; public License: string; public Organization: string; - public Enabled: boolean; public Login: string; public Role?: string; @@ -18,7 +17,6 @@ export class UserExtraModel { rt.ACC = ''; rt.License = ''; rt.Organization = ''; - rt.Enabled = false; rt.Login = ''; rt.Role = ''; return rt; @@ -29,9 +27,17 @@ export class UserExtraModel { this.ACC = ''; this.License = ''; this.Organization = ''; - this.Enabled = false; this.Login = ''; this.Role = ''; } + + public Copy(payload: Partial): void { + this.BSB = payload.BSB; + this.ACC = payload.ACC; + this.License = payload.License; + this.Organization = payload.Organization; + this.Login = payload.Login; + this.Role = payload.Role; + } } diff --git a/src/app/people-add/people-add.component.html b/src/app/people-add/people-add.component.html index 02f3335..f79eb1b 100644 --- a/src/app/people-add/people-add.component.html +++ b/src/app/people-add/people-add.component.html @@ -1 +1 @@ -

people-add works!

+ diff --git a/src/app/people-card/people-card.component.html b/src/app/people-card/people-card.component.html index 467ec9a..7cc82d2 100644 --- a/src/app/people-card/people-card.component.html +++ b/src/app/people-card/people-card.component.html @@ -1,9 +1,24 @@ -
-
- -
-
{{ contact.Nick }}
-

{{ contact.Title }} {{ contact.First}} {{ contact.Last}}

+
+
+
+
+
+
+
+

{{contact.Display}}

+

{{UserExtra.Role}} + + +

+
+
+
+
diff --git a/src/app/people-card/people-card.component.scss b/src/app/people-card/people-card.component.scss index 125fd34..9138c5a 100644 --- a/src/app/people-card/people-card.component.scss +++ b/src/app/people-card/people-card.component.scss @@ -11,3 +11,245 @@ div.contact { div.contact:hover { box-shadow: rgba(149, 157, 165, 0.2) 0px 8px 24px; } + +app-people-card{ + border-radius: 10px; + margin: 10px 10px; +} + + +$black: #071011; +$backcolor: #ecdfaf; +$white: #fff; +$red: tomato; +$standard: 10px; +$card-height: 200px; +$card-width: 330px; + +.background { + position: absolute; + top: 0; + left: 0; + height: 100vh; + width: 100vw; + + background: url("https://images.unsplash.com/photo-1447433589675-4aaa569f3e05?ixlib=rb-0.3.5&s=4222852e25e0f57d9485f7889957e99a&auto=format&fit=crop&w=2000&q=80"); + background-size: cover; + background: #ccc; + background-position: 0 50%; + background: #DEB493; + + &:after { + content: ""; + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + background: rgba(0, 0, 0, 0); + } +} + +.outer-div, +.inner-div { + height: $card-height; + max-width: $card-width; + margin: 0 auto; + position: relative; +} + +.outer-div { + perspective: 900px; + perspective-origin: 50% calc(50% - 18em); +} + +.inner-div { + margin: $standard * 5 auto; + + border-radius: 5px; + font-weight: 400; + color: $black; + font-size: 1rem; + text-align: center; + transition: all 0.6s cubic-bezier(0.8, -0.4, 0.2, 1.7); + transform-style: preserve-3d; + + + &:hover .social-icon { + opacity: 1; + top: 0; + } + + &:hover .front__face-photo, + &:hover .front__footer { + opacity: 0; + } +} + +.outer-div:hover .inner-div { + transform: rotateY(180deg); +} + +.front, +.back { + position: relative; + top: 0; + left: 0; + overflow:hidden; + backface-visibility: hidden; +} + +.front { + cursor: pointer; + height: 100%; + background: $white; + backface-visibility: hidden; + border-radius: 5px; + box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), + 0 0 40px rgba(0, 0, 0, 0.1) inset; +} + +.front__bkg-photo { + position: relative; + height: 80px; + width: $card-width; + background-size: cover; + backface-visibility: hidden; + overflow: hidden; + border-top-right-radius: 5px; + border-top-left-radius: 5px; + + &:after { + content: ""; + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + } +} + +.front__face-photo { + position: relative; + top: -60px; + height: 120px; + width: 120px; + margin: 0 auto; + border-radius: 50%; + border: 5px solid $white; + background-size: contain; + backface-visibility: hidden; + overflow: hidden; + transition: all 0.6s cubic-bezier(0.8, -0.4, 0.2, 1.7); + z-index: 3; +} + +.front__text { + position: relative; + top: -55px; + margin: 0 auto; + font-family: "Montserrat"; + font-size: 18px; + backface-visibility: hidden; + + .front__text-header { + font-weight: 700; + font-family: "Oswald"; + text-transform: uppercase; + font-size: 20px; + } + + .front__text-para { + position: relative; + top: -5px; + + color: #000; + font-size: 14px; + letter-spacing: 0.4px; + font-weight: 400; + font-family: "Montserrat", sans-serif; + } + + .front-icons { + position: relative; + top: 0; + font-size: 14px; + margin-right: 6px; + color: gray; + } + + .front__text-hover { + position: relative; + top: 10px; + font-size: 10px; + color: $red; + backface-visibility: hidden; + + font-weight: 700; + text-transform: uppercase; + letter-spacing: .4px; + + border: 2px solid $red; + padding: 8px 15px; + border-radius: 30px; + + background: $red; + color: $white; + } +} + +.back { + transform: rotateY(180deg); + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + background-color: $backcolor; + border-radius: 5px; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.social-media-wrapper { + font-size: 36px; + + .social-icon { + position: relative; + top: 20px; + margin-left: 5px; + margin-right: 5px; + opacity: 0; + color: #fff; + transition: all 0.4s cubic-bezier(0.3, 0.7, 0.1, 1.9); + } + + .social-icon:nth-child(1) { + transition-delay: 0.6s; + } + + .social-icon:nth-child(2) { + transition-delay: 0.7s; + } + + .social-icon:nth-child(3) { + transition-delay: 0.8s; + } + + .social-icon:nth-child(4) { + transition-delay: 0.9s; + } +} + +.fab { + position: relative; + top: 0; + left: 0; + transition: all 200ms ease-in-out; +} + +.fab:hover { + top: -5px; +} diff --git a/src/app/people-card/people-card.component.ts b/src/app/people-card/people-card.component.ts index 84e7bbb..30da821 100644 --- a/src/app/people-card/people-card.component.ts +++ b/src/app/people-card/people-card.component.ts @@ -1,7 +1,11 @@ -import {Component, Input, OnInit} from '@angular/core'; +import {Component, Input, OnInit, ViewChild} from '@angular/core'; import {PeopleModel} from '../models/people.model'; import {PeopleService} from '../service/people.service'; import {AuthService} from '../service/auth.service'; +import {Button} from '@progress/kendo-angular-buttons'; +import {Router} from '@angular/router'; +import {UserExtraModel} from '../models/user-extra.model'; +import {BadgeAlign} from '@progress/kendo-angular-indicators'; @Component({ selector: 'app-people-card', @@ -10,22 +14,62 @@ import {AuthService} from '../service/auth.service'; }) export class PeopleCardComponent implements OnInit { - @Input() peopleId: string; - public contact: PeopleModel = new PeopleModel('', '', '', '', '', '', ''); - constructor(private ps: PeopleService, private auth: AuthService) { } + @Input() PeopleId: string; + @ViewChild('enabled', {static: true}) enabled: Button; + public contact: PeopleModel = new PeopleModel('', '', '', '', '', '', '' , false); + public UserExtra: UserExtraModel = UserExtraModel.EmptyNew(); + + public badgeAlign: BadgeAlign = { vertical: 'bottom', horizontal: 'end' }; + + constructor(private ps: PeopleService, private auth: AuthService, private router: Router) { } ngOnInit(): void { - this.ps.getPeopleById(this.peopleId).subscribe( + this.ps.getPeopleById(this.PeopleId).subscribe( + resp => { + this.contact = new PeopleModel(resp.Id, resp.First, resp.Last, resp.Middle, resp.Title, resp.Display, resp.Nick, resp.Enabled); + } + ); + + this.ps.getPeopleExtraById(this.PeopleId).subscribe( resp => { - this.contact = new PeopleModel(resp.Id, resp.First, resp.Last, resp.Middle, resp.Title, resp.Display, resp.Nick); - // console.log(this.contact); + this.UserExtra.Copy(resp); } ); + + } photoURL(): string { if (this.contact === undefined ) { return ''; } - const url = this.auth.getUrl('avatar/') + this.contact.Id; + const url = 'url(' + this.auth.getUrl('avatar/') + this.contact.Id + ')'; return url; } + + public bgPhoto(): string { + if ( !this.contact.Enabled ){ + return 'url("../../assets/img/bg-disabled-card.jpg")'; + } + switch (this.UserExtra.Role) { + case 'broker': + return 'url("../../assets/img/bg-client-card.jpg")'; + case 'user': + return 'url("../../assets/img/bg-user-card.jpg")'; + case 'people': + return 'url("../../assets/img/bg-broker-card.jpg")'; + case 'admin': + return 'url("../../assets/img/bg-admin-card.jpg")'; + } + + } + + public onButtonClick(): void { + this.router.navigate(['/profile/' + this.contact.Id]); + } + + public onSelectedChange(e: boolean): void { + this.ps.enableUser(e, this.PeopleId).subscribe( + resp => { + this.contact.Enabled = resp; + }); + } } diff --git a/src/app/people-select/people-select.component.ts b/src/app/people-select/people-select.component.ts index bd3dd38..3dd6b3a 100644 --- a/src/app/people-select/people-select.component.ts +++ b/src/app/people-select/people-select.component.ts @@ -138,7 +138,8 @@ export class PeopleSelectComponent implements OnInit, ControlValueAccessor { ppl.Middle, ppl.Title, ppl.Display, - ppl.Nick + ppl.Nick, + ppl.Enabled ); console.log('got search result ', person); this.searchResult.push(person); // make sure it's available for selection, thus proper display diff --git a/src/app/profile/people-profile/people-profile.component.html b/src/app/profile/people-profile/people-profile.component.html index 1bfa60c..a21f7c8 100644 --- a/src/app/profile/people-profile/people-profile.component.html +++ b/src/app/profile/people-profile/people-profile.component.html @@ -46,7 +46,7 @@
- + First name is required @@ -54,7 +54,7 @@
- + Last Name is required @@ -70,6 +70,13 @@
+ + Enable     Disable + + +
+
diff --git a/src/app/profile/profile.component.html b/src/app/profile/profile.component.html index 1407c6b..5b34b05 100644 --- a/src/app/profile/profile.component.html +++ b/src/app/profile/profile.component.html @@ -46,15 +46,19 @@

- -
+
+
+
-   Remove this person + >   Remove this person +
+ You confirm to delete EVERY-thing related to this person