@cleavelandprice/ngx-lib 3.1.30 → 3.1.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,34 @@
1
1
  import { Component, Input } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- import * as i1 from "@angular/common";
4
- import * as i2 from "../../pipes/employee-photo-url.pipe";
3
+ import * as i1 from "@cleavelandprice/ngx-lib/active-directory";
4
+ import * as i2 from "@angular/common";
5
+ import * as i3 from "../../pipes/employee-photo-url.pipe";
5
6
  export class EmployeePhotoComponent {
6
- constructor() {
7
+ constructor(activeDirectoryService) {
8
+ this.activeDirectoryService = activeDirectoryService;
9
+ this.employee = null;
10
+ // Or...
11
+ this.accountName = null;
7
12
  this.size = "2em";
8
13
  this.notRound = false;
9
14
  }
15
+ ngOnInit() {
16
+ if (this.accountName && !this.employee) {
17
+ // Developer passed in an account name instead of a user object
18
+ // We need to do the work of getting the user object ourselves
19
+ this.activeDirectoryService.getUser(this.accountName)
20
+ .subscribe(user => this.employee = user);
21
+ }
22
+ }
10
23
  }
11
- EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
12
- EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
24
+ EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [{ token: i1.ActiveDirectoryService }], target: i0.ɵɵFactoryTarget.Component });
25
+ EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", accountName: "accountName", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
13
26
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, decorators: [{
14
27
  type: Component,
15
- args: [{ selector: 'employee-photo', template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">" }]
16
- }], propDecorators: { employee: [{
28
+ args: [{ selector: 'employee-photo', template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>" }]
29
+ }], ctorParameters: function () { return [{ type: i1.ActiveDirectoryService }]; }, propDecorators: { employee: [{
30
+ type: Input
31
+ }], accountName: [{
17
32
  type: Input
18
33
  }], employeePhotos: [{
19
34
  type: Input
@@ -22,4 +37,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
22
37
  }], notRound: [{
23
38
  type: Input
24
39
  }] } });
25
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW1wbG95ZWUtcGhvdG8uY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY2xlYXZlbGFuZHByaWNlL25neC1saWIvc2hhcmVwb2ludC9zcmMvY29tcG9uZW50cy9lbXBsb3llZS1waG90by9lbXBsb3llZS1waG90by5jb21wb25lbnQudHMiLCIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9jbGVhdmVsYW5kcHJpY2Uvbmd4LWxpYi9zaGFyZXBvaW50L3NyYy9jb21wb25lbnRzL2VtcGxveWVlLXBob3RvL2VtcGxveWVlLXBob3RvLmNvbXBvbmVudC5odG1sIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sZUFBZSxDQUFDOzs7O0FBU2pELE1BQU0sT0FBTyxzQkFBc0I7SUFMbkM7UUFRVyxTQUFJLEdBQUcsS0FBSyxDQUFDO1FBQ2IsYUFBUSxHQUFHLEtBQUssQ0FBQztLQUMzQjs7bUhBTFksc0JBQXNCO3VHQUF0QixzQkFBc0IsOEpDVG5DLDhQQUkwRDsyRkRLN0Msc0JBQXNCO2tCQUxsQyxTQUFTOytCQUNFLGdCQUFnQjs4QkFLakIsUUFBUTtzQkFBaEIs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cbiAgICAgICAgW3N0eWxlLmJvcmRlci1yYWRpdXNdPVwibm90Um91bmQgPyAnZGVmYXVsdCcgOiAnMTAwJSdcIj5cbjwvbmctY29udGFpbmVyPiJdfQ==
@@ -4,7 +4,8 @@ import { Injectable, Optional, Pipe, Component, Input, NgModule, SkipSelf } from
4
4
  import { of, map } from 'rxjs';
5
5
  import moment from 'moment';
6
6
  import * as i2 from '@angular/common/http';
7
- import * as i1 from '@angular/common';
7
+ import * as i1 from '@cleavelandprice/ngx-lib/active-directory';
8
+ import * as i2$1 from '@angular/common';
8
9
  import { CommonModule } from '@angular/common';
9
10
 
10
11
  const defaultConfig = {
@@ -227,17 +228,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
227
228
  }], ctorParameters: function () { return [{ type: SharePointService }]; } });
228
229
 
229
230
  class EmployeePhotoComponent {
230
- constructor() {
231
+ constructor(activeDirectoryService) {
232
+ this.activeDirectoryService = activeDirectoryService;
233
+ this.employee = null;
234
+ // Or...
235
+ this.accountName = null;
231
236
  this.size = "2em";
232
237
  this.notRound = false;
233
238
  }
239
+ ngOnInit() {
240
+ if (this.accountName && !this.employee) {
241
+ // Developer passed in an account name instead of a user object
242
+ // We need to do the work of getting the user object ourselves
243
+ this.activeDirectoryService.getUser(this.accountName)
244
+ .subscribe(user => this.employee = user);
245
+ }
246
+ }
234
247
  }
235
- EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
236
- EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
248
+ EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [{ token: i1.ActiveDirectoryService }], target: i0.ɵɵFactoryTarget.Component });
249
+ EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", accountName: "accountName", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
237
250
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, decorators: [{
238
251
  type: Component,
239
- args: [{ selector: 'employee-photo', template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">" }]
240
- }], propDecorators: { employee: [{
252
+ args: [{ selector: 'employee-photo', template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>" }]
253
+ }], ctorParameters: function () { return [{ type: i1.ActiveDirectoryService }]; }, propDecorators: { employee: [{
254
+ type: Input
255
+ }], accountName: [{
241
256
  type: Input
242
257
  }], employeePhotos: [{
243
258
  type: Input
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\n\r\n// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n constructor (private sharePointService: SharePointService) { }\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, Input } from '@angular/core';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent {\n @Input() employee!: CleavelandPriceUser;\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n}","<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibDefaultConfig","i1.ServiceConfig","i1.SharePointService","i2.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;AAKa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,8BAA8B,EAAE;YAC5B,eAAe;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,GAAG;AACnB,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,kBAAkB,EAA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EAAE,MAAM,EAAE;AAC7C,aAAA;SACF,CAAC;KACH;;6GATU,gBAAgB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,gBAAA,EAAA,QAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAhB,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,iBAXzB,oBAAoB;QACpB,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAGtB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,oBAAoB;QACpB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;iBACF,CAAA;;;8BAYc,QAAQ;;8BAAI,QAAQ;;;;AChCnC;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\n\r\n// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n constructor (private sharePointService: SharePointService) { }\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, Input, OnInit } from '@angular/core';\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent implements OnInit {\n @Input() employee: CleavelandPriceUser | null = null;\n // Or...\n @Input() accountName: string | null = null;\n\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n\n constructor(private activeDirectoryService: ActiveDirectoryService) { }\n\n ngOnInit(): void {\n if (this.accountName && !this.employee) {\n // Developer passed in an account name instead of a user object\n // We need to do the work of getting the user object ourselves\n this.activeDirectoryService.getUser(this.accountName)\n .subscribe(user => this.employee = user);\n }\n }\n}","<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibDefaultConfig","i1.ServiceConfig","i1.SharePointService","i2","i3.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;;AAKa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,8BAA8B,EAAE;YAC5B,eAAe;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,GAAG;AACnB,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,iBAAiB,EAAE,IAAI;AACvB,QAAA,YAAY,EAAE,IAAI;AACrB,KAAA;;;MCxBQ,aAAa,CAAA;AAazB;;MCEY,iBAAiB,CAAA;;;;IAwB5B,WAAgC,CAAA,MAAqB,EACjC,IAAgB,EAAA;AADJ,QAAA,IAAM,CAAA,MAAA,GAAN,MAAM,CAAe;AACjC,QAAA,IAAI,CAAA,IAA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;wBACpB,sBAAsB;AACvB,qBAAA;iBACF,CAAA;;;8BAYc,QAAQ;;8BAAI,QAAQ;;;;AChCnC;;AAEG;;;;"}
@@ -4,7 +4,8 @@ import { Injectable, Optional, Pipe, Component, Input, NgModule, SkipSelf } from
4
4
  import { of, map } from 'rxjs';
5
5
  import moment from 'moment';
6
6
  import * as i2 from '@angular/common/http';
7
- import * as i1 from '@angular/common';
7
+ import * as i1 from '@cleavelandprice/ngx-lib/active-directory';
8
+ import * as i2$1 from '@angular/common';
8
9
  import { CommonModule } from '@angular/common';
9
10
 
10
11
  const defaultConfig = {
@@ -216,17 +217,31 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImpor
216
217
  }], ctorParameters: function () { return [{ type: SharePointService }]; } });
217
218
 
218
219
  class EmployeePhotoComponent {
219
- constructor() {
220
+ constructor(activeDirectoryService) {
221
+ this.activeDirectoryService = activeDirectoryService;
222
+ this.employee = null;
223
+ // Or...
224
+ this.accountName = null;
220
225
  this.size = "2em";
221
226
  this.notRound = false;
222
227
  }
228
+ ngOnInit() {
229
+ if (this.accountName && !this.employee) {
230
+ // Developer passed in an account name instead of a user object
231
+ // We need to do the work of getting the user object ourselves
232
+ this.activeDirectoryService.getUser(this.accountName)
233
+ .subscribe(user => this.employee = user);
234
+ }
235
+ }
223
236
  }
224
- EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
225
- EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">", styles: [""], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
237
+ EmployeePhotoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, deps: [{ token: i1.ActiveDirectoryService }], target: i0.ɵɵFactoryTarget.Component });
238
+ EmployeePhotoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.1", type: EmployeePhotoComponent, selector: "employee-photo", inputs: { employee: "employee", accountName: "accountName", employeePhotos: "employeePhotos", size: "size", notRound: "notRound" }, ngImport: i0, template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>", styles: [""], dependencies: [{ kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i2$1.AsyncPipe, name: "async" }, { kind: "pipe", type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" }] });
226
239
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: EmployeePhotoComponent, decorators: [{
227
240
  type: Component,
228
- args: [{ selector: 'employee-photo', template: "<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">" }]
229
- }], propDecorators: { employee: [{
241
+ args: [{ selector: 'employee-photo', template: "<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>" }]
242
+ }], ctorParameters: function () { return [{ type: i1.ActiveDirectoryService }]; }, propDecorators: { employee: [{
243
+ type: Input
244
+ }], accountName: [{
230
245
  type: Input
231
246
  }], employeePhotos: [{
232
247
  type: Input
@@ -1 +1 @@
1
- {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\n\r\n// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n constructor (private sharePointService: SharePointService) { }\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, Input } from '@angular/core';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent {\n @Input() employee!: CleavelandPriceUser;\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n}","<img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibDefaultConfig","i1.ServiceConfig","i1.SharePointService","i2.EmployeePhotoUrlPipe"],"mappings":";;;;;;;;;AAKa,MAAA,aAAa,GAAkB;IACxC,MAAM,EAAEA,eAAmB,CAAC,MAAM;AAClC,IAAA,aAAa,EAAE,mBAAmB;AAClC,IAAA,iBAAiB,EAAE,uBAAuB;AAC1C,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,QAAQ,EAAE,QAAQ;AAClB,IAAA,MAAM,EAAE;AACJ,QAAA,IAAI,EAAE,uDAAuD;AAC7D,QAAA,IAAI,EAAE,2BAA2B;AACjC,QAAA,8BAA8B,EAAE;YAC5B,eAAe;AAClB,SAAA;AACJ,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,OAAO,EAAE,IAAI;AACb,QAAA,WAAW,EAAE,GAAG;AACnB,KAAA;AACD,IAAA,OAAO,EAAE;AACL,QAAA,UAAU,EAAE,IAAI;AAChB,QAAA,kBAAkB,EAAE,IAAI;AACxB,QAAA,iBAAiB,EA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B,oBAAoB;QACpB,sBAAsB,CAAA,EAAA,OAAA,EAAA,CAGtB,YAAY,CAAA,EAAA,OAAA,EAAA,CAGZ,oBAAoB;QACpB,sBAAsB,CAAA,EAAA,CAAA,CAAA;AAGb,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;0BAYc,QAAQ;;0BAAI,QAAQ;;;AChCnC;;AAEG;;;;"}
1
+ {"version":3,"file":"cleavelandprice-ngx-lib-sharepoint.mjs","sources":["../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/default-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/model/service-config.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/services/sharepoint.service.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/pipes/employee-photo-url.pipe.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/components/employee-photo/employee-photo.component.html","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/sharepoint.module.ts","../../../../projects/cleavelandprice/ngx-lib/sharepoint/src/cleavelandprice-ngx-lib-sharepoint.ts"],"sourcesContent":["import { defaultConfig as NgxLibDefaultConfig } from '@cleavelandprice/ngx-lib';\r\n\r\n// This is the default configuration, which can be overridden by providing a ServiceConfig object to the module\r\nimport { ServiceConfig } from './service-config';\r\n\r\nexport const defaultConfig: ServiceConfig = {\r\n apiUrl: NgxLibDefaultConfig.apiUrl,\r\n usersEndpoint: '/sharepoint/users',\r\n listItemsEndpoint: '/sharepoint/listitems',\r\n username: 'viewer',\r\n password: 'viewer',\r\n photos: {\r\n site: 'https://sharepoint.cleavelandprice.com/digitaldisplay',\r\n list: 'Employee Thumbnail Photos',\r\n additionalPropertiesToRetrieve: [\r\n 'EncodedAbsUrl'\r\n ]\r\n },\r\n caching: {\r\n enabled: true,\r\n lifeMinutes: 720\r\n },\r\n logging: {\r\n dataCached: true,\r\n cachedDataReturned: true,\r\n freshDataReturned: true,\r\n cacheCleared: true\r\n }\r\n};\r\n","import { CachingConfig } from \"./caching-config\";\r\nimport { LoggingConfig } from './logging-config';\r\n\r\nexport class ServiceConfig {\r\n apiUrl!: string;\r\n usersEndpoint!: string;\r\n listItemsEndpoint!: string;\r\n username!: string;\r\n password!: string;\r\n photos!: {\r\n site: string;\r\n list: string;\r\n additionalPropertiesToRetrieve?: string[];\r\n };\r\n caching?: CachingConfig;\r\n logging?: LoggingConfig;\r\n}\r\n","import { Injectable, Optional } from '@angular/core';\r\nimport { HttpClient } from '@angular/common/http';\r\nimport { Observable, of } from 'rxjs';\r\nimport moment from 'moment';\r\n\r\nimport { defaultConfig } from '../model/default-config';\r\n\r\nimport { CacheObject } from '../model/cache-object';\r\nimport { ListItem } from '../model/list-item';\r\nimport { ListItemsRequest } from '../model/list-items-request';\r\nimport { PhotoItem } from '../model/photo-item';\r\nimport { ServiceConfig } from '../model/service-config';\r\nimport { UserRequest } from '../model/user-request';\r\nimport { User } from '../model/user';\r\n\r\n@Injectable({\r\n providedIn: 'root'\r\n})\r\nexport class SharePointService {\r\n private cache: {\r\n users: CacheObject<User> | null,\r\n photos: CacheObject<PhotoItem> | null\r\n } | null = null;\r\n\r\n private defaultCacheLifeMinutes = 720;\r\n\r\n //#region Utilities\r\n private cacheExpired<T>(cache: CacheObject<T>): boolean {\r\n if (!cache) {\r\n return true;\r\n }\r\n\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n const expiration = moment(cache.lastUpdate)\r\n .add(lifeMinutes, 'minutes');\r\n\r\n return moment().isAfter(expiration);\r\n }\r\n //#endregion\r\n\r\n //#region Initialization\r\n // If a ServiceConfig object is not provided when the module is imported, then default values are pulled in from default-config.ts.\r\n constructor(@Optional() private config: ServiceConfig,\r\n private http: HttpClient) {\r\n\r\n this.config = {\r\n ...defaultConfig,\r\n ...this.config\r\n };\r\n\r\n this.configureCaching();\r\n this.configureLogging();\r\n }\r\n\r\n private configureCaching(): void {\r\n // If caching config is missing entirely, give it a default\r\n this.config.caching = this.config.caching ?? {\r\n enabled: false,\r\n lifeMinutes: this.defaultCacheLifeMinutes\r\n };\r\n\r\n this.cache = {\r\n photos: null,\r\n users: null\r\n };\r\n }\r\n\r\n private configureLogging(): void {\r\n // If logging config is missing entirely, give it a default\r\n this.config.logging = this.config.logging ?? {\r\n dataCached: false,\r\n cachedDataReturned: false,\r\n freshDataReturned: false,\r\n cacheCleared: false\r\n }\r\n }\r\n //#endregion\r\n\r\n getListItems(request: ListItemsRequest): Observable<ListItem[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.listItemsEndpoint ?? defaultConfig.listItemsEndpoint;\r\n\r\n return this.http.post<ListItem[]>(`${apiUrl}${endpoint}`, request);\r\n }\r\n\r\n getPhotos(): Observable<PhotoItem[]> {\r\n const request: ListItemsRequest = {\r\n username: this.config?.username ?? defaultConfig.username,\r\n password: this.config?.password ?? defaultConfig.password,\r\n site: this.config?.photos.site ?? defaultConfig.photos.site,\r\n list: this.config?.photos.list ?? defaultConfig.photos.list,\r\n additionalPropertiesToRetrieve: defaultConfig.photos.additionalPropertiesToRetrieve\r\n };\r\n\r\n const observable$ = this.getListItems(request) as Observable<PhotoItem[]>;\r\n\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<PhotoItem>(this.cache?.photos!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.photos = {\r\n data,\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Photos cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached photos');\r\n }\r\n\r\n return of(this.cache!.photos!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh photos');\r\n }\r\n\r\n return observable$;\r\n }\r\n\r\n getUsers(request: UserRequest, id?: number): Observable<User | User[]> {\r\n const apiUrl = this.config?.apiUrl ?? defaultConfig.apiUrl;\r\n const endpoint = this.config?.usersEndpoint ?? defaultConfig.usersEndpoint;\r\n \r\n const observable$ = this.http.post<User | User[]>(`${apiUrl}${endpoint}/${id ?? ''}`, request);\r\n\r\n //#region Single user\r\n if (id) {\r\n return observable$;\r\n }\r\n //#endregion\r\n\r\n //#region Multiple users\r\n if (this.config.caching?.enabled) {\r\n if (this.cacheExpired<User>(this.cache!.users!)) {\r\n // Get the data and cache it\r\n observable$.subscribe(data => {\r\n this.cache!.users = {\r\n data: data as User[],\r\n lastUpdate: moment()\r\n };\r\n\r\n if (this.config.logging?.dataCached) {\r\n const lifeMinutes = this.config.caching?.lifeMinutes ?? this.defaultCacheLifeMinutes;\r\n console.log(`Users cached for ${lifeMinutes} minutes`);\r\n }\r\n });\r\n } else {\r\n // Cache exists and hasn't expired yet\r\n if (this.config.logging?.cachedDataReturned) {\r\n console.log('Returning cached users');\r\n }\r\n\r\n return of(this.cache!.users!.data);\r\n }\r\n }\r\n\r\n // Cache is either disabled or expired, return data from API\r\n if (this.config.logging?.freshDataReturned) {\r\n console.log('Returning fresh users');\r\n }\r\n\r\n return observable$;\r\n //#endregion\r\n }\r\n\r\n clearCache(): void {\r\n this.cache = null;\r\n\r\n if (this.config.logging?.cacheCleared) {\r\n console.log('Cache cleared');\r\n }\r\n }\r\n}","import { Pipe, PipeTransform } from '@angular/core';\nimport { of, map } from 'rxjs';\nimport { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../model/photo-item';\nimport { SharePointService } from '../services/sharepoint.service';\n\n@Pipe({\n name: 'employeePhotoUrl'\n})\nexport class EmployeePhotoUrlPipe implements PipeTransform {\n constructor (private sharePointService: SharePointService) { }\n\n transform(user: CleavelandPriceUser, userPhotos?: PhotoItem[]): any {\n const observable$ = userPhotos ? of(userPhotos) : this.sharePointService.getPhotos();\n\n return observable$\n .pipe(\n map(photos =>\n photos.find(pic =>\n // Try to match by employeeNumber, accountName, or title\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase())\n )?.encodedAbsUrl\n )\n );\n\n /*const photo = photos\n .find(pic =>\n (pic.employeeNumber && user.employeeNumber && +pic.employeeNumber === +user.employeeNumber) ||\n (pic.accountName && pic.accountName.toLowerCase() === user.sAMAccountName.toLowerCase()) ||\n (pic.title && pic.title.toLowerCase() === user.displayName.toLowerCase()));\n\n if (!photo) {\n console.log(`No photo match for ${user.displayName}`);\n }\n\n return photo ? photo.encodedAbsUrl : null;*/\n }\n}","import { Component, Input, OnInit } from '@angular/core';\nimport { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';\nimport { PhotoItem } from '../../model/photo-item';\n\n@Component({\n selector: 'employee-photo',\n templateUrl: './employee-photo.component.html',\n styleUrls: ['./employee-photo.component.css']\n})\nexport class EmployeePhotoComponent implements OnInit {\n @Input() employee: CleavelandPriceUser | null = null;\n // Or...\n @Input() accountName: string | null = null;\n\n @Input() employeePhotos?: PhotoItem[];\n @Input() size = \"2em\";\n @Input() notRound = false;\n\n constructor(private activeDirectoryService: ActiveDirectoryService) { }\n\n ngOnInit(): void {\n if (this.accountName && !this.employee) {\n // Developer passed in an account name instead of a user object\n // We need to do the work of getting the user object ourselves\n this.activeDirectoryService.getUser(this.accountName)\n .subscribe(user => this.employee = user);\n }\n }\n}","<ng-container *ngIf=\"employee\">\n <img *ngIf=\"(employee | employeePhotoUrl:employeePhotos | async)\"\n [src]=\"employee | employeePhotoUrl:employeePhotos | async\"\n [style.width]=\"size\"\n [style.height]=\"size\"\n [style.border-radius]=\"notRound ? 'default' : '100%'\">\n</ng-container>","import { ModuleWithProviders, NgModule, Optional, SkipSelf } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\n\r\nimport { ServiceConfig } from './model/service-config';\r\nimport { SharePointService } from './services/sharepoint.service';\r\nimport { EmployeePhotoUrlPipe } from './pipes/employee-photo-url.pipe';\r\nimport { EmployeePhotoComponent } from './components/employee-photo/employee-photo.component';\r\n\r\n@NgModule({\r\n declarations: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ],\r\n imports: [\r\n CommonModule\r\n ],\r\n exports: [\r\n EmployeePhotoUrlPipe,\r\n EmployeePhotoComponent\r\n ]\r\n})\r\nexport class SharePointModule {\r\n static forRoot(config: ServiceConfig): ModuleWithProviders<SharePointModule> {\r\n return {\r\n ngModule: SharePointModule,\r\n providers: [\r\n SharePointService,\r\n { provide: ServiceConfig, useValue: config }\r\n ]\r\n };\r\n }\r\n\r\n constructor(@Optional() @SkipSelf() parentModule: SharePointModule) {\r\n if (parentModule) {\r\n throw new Error(\r\n 'SharePointModule is already loaded. Import it in the AppModule only');\r\n }\r\n }\r\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["NgxLibDefaultConfig","i1.ServiceConfig","i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AA,CAAA;AAGb,gBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,gBAAgB,YAPzB,YAAY,CAAA,EAAA,CAAA,CAAA;2FAOH,gBAAgB,EAAA,UAAA,EAAA,CAAA;kBAb5B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;wBACpB,sBAAsB;AACvB,qBAAA;AACF,iBAAA,CAAA;;0BAYc,QAAQ;;0BAAI,QAAQ;;;AChCnC;;AAEG;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "comment": "NGX-LIB primary entry point package.json",
3
3
  "name": "@cleavelandprice/ngx-lib",
4
- "version": "3.1.30",
4
+ "version": "3.1.31",
5
5
  "description": "Angular 14+ library providing foundational functionality to Cleaveland-Price applications",
6
6
  "peerDependencies": {
7
7
  "@angular/common": "^14.2.1",
@@ -1,11 +1,16 @@
1
- import { CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';
1
+ import { OnInit } from '@angular/core';
2
+ import { ActiveDirectoryService, CleavelandPriceUser } from '@cleavelandprice/ngx-lib/active-directory';
2
3
  import { PhotoItem } from '../../model/photo-item';
3
4
  import * as i0 from "@angular/core";
4
- export declare class EmployeePhotoComponent {
5
- employee: CleavelandPriceUser;
5
+ export declare class EmployeePhotoComponent implements OnInit {
6
+ private activeDirectoryService;
7
+ employee: CleavelandPriceUser | null;
8
+ accountName: string | null;
6
9
  employeePhotos?: PhotoItem[];
7
10
  size: string;
8
11
  notRound: boolean;
12
+ constructor(activeDirectoryService: ActiveDirectoryService);
13
+ ngOnInit(): void;
9
14
  static ɵfac: i0.ɵɵFactoryDeclaration<EmployeePhotoComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<EmployeePhotoComponent, "employee-photo", never, { "employee": "employee"; "employeePhotos": "employeePhotos"; "size": "size"; "notRound": "notRound"; }, {}, never, never, false>;
15
+ static ɵcmp: i0.ɵɵComponentDeclaration<EmployeePhotoComponent, "employee-photo", never, { "employee": "employee"; "accountName": "accountName"; "employeePhotos": "employeePhotos"; "size": "size"; "notRound": "notRound"; }, {}, never, never, false>;
11
16
  }