@cleavelandprice/ngx-lib 2.2.2 → 2.3.8
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.
- package/README.md +6 -616
- package/active-directory/active-directory.module.d.ts +11 -0
- package/active-directory/index.d.ts +5 -0
- package/active-directory/model/ad-object.d.ts +13 -0
- package/active-directory/model/cache-object.d.ts +4 -0
- package/active-directory/model/caching-config.d.ts +4 -0
- package/active-directory/model/default-caching-config.d.ts +2 -0
- package/active-directory/model/default-config.d.ts +2 -0
- package/active-directory/model/default-logging-config.d.ts +2 -0
- package/active-directory/model/logging-config.d.ts +6 -0
- package/active-directory/model/service-config.d.ts +7 -0
- package/active-directory/model/user-or-group.d.ts +7 -0
- package/active-directory/model/user.d.ts +23 -0
- package/active-directory/public_api.d.ts +8 -0
- package/active-directory/services/active-directory.service.d.ts +18 -0
- package/authentication/authentication.module.d.ts +20 -0
- package/authentication/components/login/login.component.d.ts +13 -0
- package/authentication/components/login-form/login-form.component.d.ts +23 -0
- package/authentication/index.d.ts +5 -0
- package/authentication/model/authenticated-user.d.ts +9 -0
- package/authentication/model/authentication-request.d.ts +6 -0
- package/{src/authentication → authentication}/model/authentication-token.d.ts +0 -0
- package/authentication/model/default-config.d.ts +2 -0
- package/authentication/model/login-form-data.d.ts +3 -0
- package/authentication/model/service-config.d.ts +3 -0
- package/authentication/public_api.d.ts +9 -0
- package/authentication/services/authentication.service.d.ts +25 -0
- package/dialog/components/base/base.component.d.ts +20 -0
- package/dialog/components/confirmation/confirmation.component.d.ts +12 -0
- package/dialog/components/input/input.component.d.ts +12 -0
- package/dialog/components/message/message.component.d.ts +12 -0
- package/dialog/dialog.module.d.ts +17 -0
- package/dialog/index.d.ts +5 -0
- package/{src/dialog/model/confirmation-dialog-mode.enum.d.ts → dialog/model/confirmation-dialog-mode.d.ts} +0 -0
- package/dialog/model/dialog-base-data.d.ts +10 -0
- package/dialog/model/dialog-type.d.ts +5 -0
- package/dialog/public_api.d.ts +8 -0
- package/esm2020/active-directory/active-directory.module.mjs +38 -0
- package/esm2020/active-directory/cleavelandprice-ngx-lib-active-directory.mjs +5 -0
- package/esm2020/active-directory/model/ad-object.mjs +2 -0
- package/esm2020/active-directory/model/cache-object.mjs +3 -0
- package/esm2020/active-directory/model/caching-config.mjs +2 -0
- package/esm2020/active-directory/model/default-caching-config.mjs +5 -0
- package/esm2020/active-directory/model/default-config.mjs +8 -0
- package/esm2020/active-directory/model/default-logging-config.mjs +7 -0
- package/esm2020/active-directory/model/logging-config.mjs +2 -0
- package/esm2020/active-directory/model/service-config.mjs +3 -0
- package/esm2020/active-directory/model/user-or-group.mjs +2 -0
- package/esm2020/active-directory/model/user.mjs +2 -0
- package/esm2020/active-directory/public_api.mjs +9 -0
- package/esm2020/active-directory/services/active-directory.service.mjs +89 -0
- package/esm2020/authentication/authentication.module.mjs +77 -0
- package/esm2020/authentication/cleavelandprice-ngx-lib-authentication.mjs +5 -0
- package/esm2020/authentication/components/login/login.component.mjs +39 -0
- package/esm2020/authentication/components/login-form/login-form.component.mjs +60 -0
- package/esm2020/authentication/model/authenticated-user.mjs +2 -0
- package/esm2020/authentication/model/authentication-request.mjs +2 -0
- package/esm2020/authentication/model/authentication-token.mjs +2 -0
- package/esm2020/authentication/model/default-config.mjs +4 -0
- package/esm2020/authentication/model/login-form-data.mjs +2 -0
- package/esm2020/authentication/model/service-config.mjs +3 -0
- package/esm2020/authentication/public_api.mjs +11 -0
- package/esm2020/authentication/services/authentication.service.mjs +120 -0
- package/esm2020/cleavelandprice-ngx-lib.mjs +1 -1
- package/esm2020/dialog/cleavelandprice-ngx-lib-dialog.mjs +5 -0
- package/esm2020/dialog/components/base/base.component.mjs +84 -0
- package/esm2020/dialog/components/confirmation/confirmation.component.mjs +23 -0
- package/esm2020/dialog/components/input/input.component.mjs +23 -0
- package/esm2020/dialog/components/message/message.component.mjs +23 -0
- package/esm2020/dialog/dialog.module.mjs +63 -0
- package/esm2020/dialog/model/confirmation-dialog-mode.mjs +8 -0
- package/esm2020/dialog/model/dialog-base-data.mjs +2 -0
- package/esm2020/dialog/model/dialog-type.mjs +7 -0
- package/esm2020/dialog/public_api.mjs +9 -0
- package/esm2020/lib/ngx-lib.module.mjs +16 -0
- package/esm2020/public_api.mjs +5 -8
- package/esm2020/sharepoint/cleavelandprice-ngx-lib-sharepoint.mjs +5 -0
- package/esm2020/sharepoint/model/base-item.mjs +2 -0
- package/esm2020/sharepoint/model/base-request-credential.mjs +2 -0
- package/esm2020/sharepoint/model/base-request.mjs +2 -0
- package/esm2020/sharepoint/model/cache-object.mjs +3 -0
- package/esm2020/sharepoint/model/caching-config.mjs +2 -0
- package/esm2020/sharepoint/model/default-config.mjs +25 -0
- package/esm2020/sharepoint/model/file-request.mjs +2 -0
- package/esm2020/sharepoint/model/folder-request.mjs +2 -0
- package/esm2020/sharepoint/model/list-item.mjs +2 -0
- package/esm2020/sharepoint/model/list-items-request.mjs +2 -0
- package/esm2020/sharepoint/model/logging-config.mjs +2 -0
- package/esm2020/sharepoint/model/photo-item.mjs +2 -0
- package/esm2020/sharepoint/model/service-config.mjs +3 -0
- package/esm2020/sharepoint/model/uri-request.mjs +2 -0
- package/esm2020/sharepoint/model/user-request.mjs +2 -0
- package/esm2020/sharepoint/model/user.mjs +2 -0
- package/esm2020/sharepoint/public_api.mjs +18 -0
- package/esm2020/sharepoint/services/sharepoint.service.mjs +152 -0
- package/esm2020/sharepoint/sharepoint.module.mjs +38 -0
- package/esm2020/upload/cleavelandprice-ngx-lib-upload.mjs +5 -0
- package/esm2020/upload/components/upload/upload.component.mjs +33 -0
- package/esm2020/upload/components/upload-dialog/upload-dialog.component.mjs +92 -0
- package/esm2020/upload/model/database-file-info.mjs +2 -0
- package/esm2020/upload/model/file-upload-request.mjs +2 -0
- package/esm2020/upload/model/filesystem-file-info.mjs +2 -0
- package/esm2020/upload/model/service-config.mjs +3 -0
- package/esm2020/upload/public_api.mjs +9 -0
- package/esm2020/upload/services/upload.service.mjs +93 -0
- package/esm2020/upload/upload.module.mjs +61 -0
- package/esm2020/url-utilities/cleavelandprice-ngx-lib-url-utilities.mjs +5 -0
- package/esm2020/url-utilities/pipes/safe-resource-url.pipe.mjs +20 -0
- package/esm2020/url-utilities/pipes/safe-url.pipe.mjs +20 -0
- package/esm2020/url-utilities/pipes/uri-scheme.pipe.mjs +105 -0
- package/esm2020/url-utilities/public_api.mjs +5 -0
- package/esm2020/url-utilities/url-utilities.module.mjs +34 -0
- package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs +156 -0
- package/fesm2015/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs +299 -0
- package/fesm2015/cleavelandprice-ngx-lib-authentication.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs +218 -0
- package/fesm2015/cleavelandprice-ngx-lib-dialog.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs +233 -0
- package/fesm2015/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib-upload.mjs +280 -0
- package/fesm2015/cleavelandprice-ngx-lib-upload.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs +176 -0
- package/fesm2015/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -0
- package/fesm2015/cleavelandprice-ngx-lib.mjs +11 -1398
- package/fesm2015/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs +147 -0
- package/fesm2020/cleavelandprice-ngx-lib-active-directory.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs +290 -0
- package/fesm2020/cleavelandprice-ngx-lib-authentication.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs +212 -0
- package/fesm2020/cleavelandprice-ngx-lib-dialog.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs +219 -0
- package/fesm2020/cleavelandprice-ngx-lib-sharepoint.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib-upload.mjs +273 -0
- package/fesm2020/cleavelandprice-ngx-lib-upload.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs +176 -0
- package/fesm2020/cleavelandprice-ngx-lib-url-utilities.mjs.map +1 -0
- package/fesm2020/cleavelandprice-ngx-lib.mjs +11 -1370
- package/fesm2020/cleavelandprice-ngx-lib.mjs.map +1 -1
- package/lib/ngx-lib.module.d.ts +6 -0
- package/package.json +57 -12
- package/public_api.d.ts +1 -7
- package/sharepoint/index.d.ts +5 -0
- package/sharepoint/model/base-item.d.ts +4 -0
- package/sharepoint/model/base-request-credential.d.ts +4 -0
- package/sharepoint/model/base-request.d.ts +8 -0
- package/sharepoint/model/cache-object.d.ts +4 -0
- package/sharepoint/model/caching-config.d.ts +4 -0
- package/sharepoint/model/default-config.d.ts +2 -0
- package/sharepoint/model/file-request.d.ts +4 -0
- package/sharepoint/model/folder-request.d.ts +4 -0
- package/sharepoint/model/list-item.d.ts +10 -0
- package/sharepoint/model/list-items-request.d.ts +5 -0
- package/sharepoint/model/logging-config.d.ts +6 -0
- package/sharepoint/model/photo-item.d.ts +11 -0
- package/sharepoint/model/service-config.d.ts +16 -0
- package/sharepoint/model/uri-request.d.ts +4 -0
- package/sharepoint/model/user-request.d.ts +4 -0
- package/sharepoint/model/user.d.ts +12 -0
- package/sharepoint/public_api.d.ts +16 -0
- package/sharepoint/services/sharepoint.service.d.ts +25 -0
- package/sharepoint/sharepoint.module.d.ts +11 -0
- package/{src/file-upload → upload}/components/upload/upload.component.d.ts +0 -0
- package/{src/file-upload → upload}/components/upload-dialog/upload-dialog.component.d.ts +3 -3
- package/upload/index.d.ts +5 -0
- package/{src/file-upload → upload}/model/database-file-info.d.ts +0 -0
- package/{src/file-upload → upload}/model/file-upload-request.d.ts +0 -0
- package/{src/file-upload → upload}/model/filesystem-file-info.d.ts +0 -0
- package/{src/file-upload/model/upload.service.config.d.ts → upload/model/service-config.d.ts} +1 -1
- package/upload/public_api.d.ts +8 -0
- package/{src/file-upload → upload}/services/upload.service.d.ts +6 -8
- package/upload/upload.module.d.ts +16 -0
- package/url-utilities/index.d.ts +5 -0
- package/url-utilities/pipes/safe-resource-url.pipe.d.ts +10 -0
- package/{src/url → url-utilities}/pipes/safe-url.pipe.d.ts +0 -0
- package/{src/url → url-utilities}/pipes/uri-scheme.pipe.d.ts +1 -1
- package/url-utilities/public_api.d.ts +4 -0
- package/url-utilities/url-utilities.module.d.ts +10 -0
- package/esm2020/src/authentication/authentication.module.mjs +0 -112
- package/esm2020/src/authentication/components/login/login.component.mjs +0 -40
- package/esm2020/src/authentication/components/login-form/login-form.component.mjs +0 -45
- package/esm2020/src/authentication/model/authentication-token.mjs +0 -2
- package/esm2020/src/authentication/model/authentication.service.config.mjs +0 -3
- package/esm2020/src/authentication/services/authentication.service.mjs +0 -138
- package/esm2020/src/dialog/components/_dialog/dialog.component.mjs +0 -83
- package/esm2020/src/dialog/components/confirmation-dialog/confirmation-dialog.component.mjs +0 -21
- package/esm2020/src/dialog/components/input-dialog/input-dialog.component.mjs +0 -21
- package/esm2020/src/dialog/components/message-dialog/message-dialog.component.mjs +0 -21
- package/esm2020/src/dialog/dialog.module.mjs +0 -74
- package/esm2020/src/dialog/model/confirmation-dialog-mode.enum.mjs +0 -8
- package/esm2020/src/email/email.module.mjs +0 -47
- package/esm2020/src/email/model/email-dto.mjs +0 -2
- package/esm2020/src/email/model/email-sender.mjs +0 -2
- package/esm2020/src/email/model/email.mjs +0 -2
- package/esm2020/src/email/model/email.service.config.mjs +0 -3
- package/esm2020/src/email/services/email.service.mjs +0 -31
- package/esm2020/src/employee/employee.module.mjs +0 -91
- package/esm2020/src/employee/model/employee.mjs +0 -2
- package/esm2020/src/employee/model/employee.service.config.mjs +0 -3
- package/esm2020/src/employee/pipes/departments.pipe.mjs +0 -24
- package/esm2020/src/employee/pipes/employee-by-dn.pipe.mjs +0 -17
- package/esm2020/src/employee/pipes/employee-photo-url.pipe.mjs +0 -27
- package/esm2020/src/employee/pipes/employees-with-property-value.pipe.mjs +0 -17
- package/esm2020/src/employee/pipes/filter-employees.pipe.mjs +0 -22
- package/esm2020/src/employee/pipes/is-member-of.pipe.mjs +0 -17
- package/esm2020/src/employee/pipes/sort-employees.pipe.mjs +0 -44
- package/esm2020/src/employee/services/employee.service.mjs +0 -41
- package/esm2020/src/file-upload/components/upload/upload.component.mjs +0 -34
- package/esm2020/src/file-upload/components/upload-dialog/upload-dialog.component.mjs +0 -102
- package/esm2020/src/file-upload/model/database-file-info.mjs +0 -2
- package/esm2020/src/file-upload/model/file-upload-request.mjs +0 -2
- package/esm2020/src/file-upload/model/filesystem-file-info.mjs +0 -2
- package/esm2020/src/file-upload/model/upload.service.config.mjs +0 -3
- package/esm2020/src/file-upload/services/upload.service.mjs +0 -93
- package/esm2020/src/file-upload/upload.module.mjs +0 -93
- package/esm2020/src/sharepoint/model/sharepoint-calendar-event.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-customer-visit.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-employee-picture.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-list-item.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-list.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-person.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint-picture.mjs +0 -2
- package/esm2020/src/sharepoint/model/sharepoint.service.config.mjs +0 -3
- package/esm2020/src/sharepoint/pipes/sharepoint-photo-url.pipe.mjs +0 -16
- package/esm2020/src/sharepoint/pipes/sharepoint-url.pipe.mjs +0 -16
- package/esm2020/src/sharepoint/services/sharepoint.service.mjs +0 -77
- package/esm2020/src/sharepoint/sharepoint.module.mjs +0 -69
- package/esm2020/src/url/pipes/safe-url.pipe.mjs +0 -21
- package/esm2020/src/url/pipes/uri-scheme.pipe.mjs +0 -103
- package/esm2020/src/url/url.module.mjs +0 -38
- package/src/authentication/authentication.module.d.ts +0 -31
- package/src/authentication/components/login/login.component.d.ts +0 -15
- package/src/authentication/components/login-form/login-form.component.d.ts +0 -20
- package/src/authentication/model/authentication.service.config.d.ts +0 -3
- package/src/authentication/services/authentication.service.d.ts +0 -68
- package/src/dialog/components/_dialog/dialog.component.d.ts +0 -22
- package/src/dialog/components/confirmation-dialog/confirmation-dialog.component.d.ts +0 -9
- package/src/dialog/components/input-dialog/input-dialog.component.d.ts +0 -9
- package/src/dialog/components/message-dialog/message-dialog.component.d.ts +0 -9
- package/src/dialog/dialog.module.d.ts +0 -20
- package/src/email/email.module.d.ts +0 -14
- package/src/email/model/email-dto.d.ts +0 -13
- package/src/email/model/email-sender.d.ts +0 -6
- package/src/email/model/email.d.ts +0 -9
- package/src/email/model/email.service.config.d.ts +0 -7
- package/src/email/services/email.service.d.ts +0 -13
- package/src/employee/employee.module.d.ts +0 -28
- package/src/employee/model/employee.d.ts +0 -35
- package/src/employee/model/employee.service.config.d.ts +0 -3
- package/src/employee/pipes/departments.pipe.d.ts +0 -8
- package/src/employee/pipes/employee-by-dn.pipe.d.ts +0 -8
- package/src/employee/pipes/employee-photo-url.pipe.d.ts +0 -9
- package/src/employee/pipes/employees-with-property-value.pipe.d.ts +0 -8
- package/src/employee/pipes/filter-employees.pipe.d.ts +0 -8
- package/src/employee/pipes/is-member-of.pipe.d.ts +0 -8
- package/src/employee/pipes/sort-employees.pipe.d.ts +0 -9
- package/src/employee/services/employee.service.d.ts +0 -15
- package/src/file-upload/upload.module.d.ts +0 -26
- package/src/sharepoint/model/sharepoint-calendar-event.d.ts +0 -6
- package/src/sharepoint/model/sharepoint-customer-visit.d.ts +0 -8
- package/src/sharepoint/model/sharepoint-employee-picture.d.ts +0 -5
- package/src/sharepoint/model/sharepoint-list-item.d.ts +0 -11
- package/src/sharepoint/model/sharepoint-list.d.ts +0 -8
- package/src/sharepoint/model/sharepoint-person.d.ts +0 -9
- package/src/sharepoint/model/sharepoint-picture.d.ts +0 -14
- package/src/sharepoint/model/sharepoint.service.config.d.ts +0 -5
- package/src/sharepoint/pipes/sharepoint-photo-url.pipe.d.ts +0 -8
- package/src/sharepoint/pipes/sharepoint-url.pipe.d.ts +0 -7
- package/src/sharepoint/services/sharepoint.service.d.ts +0 -23
- package/src/sharepoint/sharepoint.module.d.ts +0 -24
- package/src/url/url.module.d.ts +0 -11
|
@@ -1,1386 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
3
|
-
import * as i1 from '@angular/common';
|
|
4
|
-
import { CommonModule } from '@angular/common';
|
|
5
|
-
import * as i5 from '@angular/forms';
|
|
6
|
-
import { FormsModule } from '@angular/forms';
|
|
7
|
-
import * as i3 from '@angular/material/button';
|
|
8
|
-
import { MatButtonModule } from '@angular/material/button';
|
|
9
|
-
import * as i4 from '@angular/material/checkbox';
|
|
10
|
-
import { MatCheckboxModule } from '@angular/material/checkbox';
|
|
11
|
-
import * as i1$1 from '@angular/material/dialog';
|
|
12
|
-
import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
|
|
13
|
-
import * as i6 from '@angular/material/input';
|
|
14
|
-
import { MatInputModule } from '@angular/material/input';
|
|
15
|
-
import * as i7 from '@angular/material/progress-bar';
|
|
16
|
-
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
17
|
-
import * as i9 from '@angular/material/progress-spinner';
|
|
18
|
-
import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
|
|
19
|
-
import { MatSelectModule } from '@angular/material/select';
|
|
20
|
-
import * as i4$1 from '@angular/material/tooltip';
|
|
21
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
22
|
-
import * as i5$1 from '@angular/material/form-field';
|
|
23
|
-
import { JwtHelperService } from '@auth0/angular-jwt';
|
|
24
|
-
import * as i2 from '@angular/common/http';
|
|
25
|
-
import { HttpRequest, HttpHeaders, HttpEventType, HttpResponse, HttpClientModule } from '@angular/common/http';
|
|
26
|
-
import { of, Subject, forkJoin } from 'rxjs';
|
|
27
|
-
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
28
|
-
import * as i5$2 from '@angular/material/list';
|
|
29
|
-
import { MatListModule } from '@angular/material/list';
|
|
30
|
-
import * as i6$1 from '@angular/material/core';
|
|
31
|
-
import * as i1$2 from '@angular/platform-browser';
|
|
2
|
+
import { NgModule } from '@angular/core';
|
|
32
3
|
|
|
33
|
-
|
|
34
|
-
(function (ConfirmationDialogMode) {
|
|
35
|
-
ConfirmationDialogMode[ConfirmationDialogMode["OkCancel"] = 0] = "OkCancel";
|
|
36
|
-
ConfirmationDialogMode[ConfirmationDialogMode["YesNo"] = 1] = "YesNo";
|
|
37
|
-
ConfirmationDialogMode[ConfirmationDialogMode["TrueFalse"] = 2] = "TrueFalse";
|
|
38
|
-
ConfirmationDialogMode[ConfirmationDialogMode["Custom"] = 3] = "Custom";
|
|
39
|
-
})(ConfirmationDialogMode || (ConfirmationDialogMode = {}));
|
|
40
|
-
|
|
41
|
-
class DialogComponent {
|
|
42
|
-
constructor() {
|
|
43
|
-
this.closed = new EventEmitter();
|
|
44
|
-
this.ConfirmationDialogMode = ConfirmationDialogMode;
|
|
45
|
-
this.mode = ConfirmationDialogMode.OkCancel;
|
|
46
|
-
this.customTrueFalseText = null;
|
|
47
|
-
}
|
|
48
|
-
ngOnInit() {
|
|
49
|
-
if (this.data) {
|
|
50
|
-
this.title = this.data.title || null;
|
|
51
|
-
this.message = this.data.message || null;
|
|
52
|
-
this.checkboxMessage = this.data.checkboxMessage || null;
|
|
53
|
-
this.placeholder = this.data.placeholder || null;
|
|
54
|
-
this.userInput = this.data.value || null;
|
|
55
|
-
this.mode = this.data.mode || ConfirmationDialogMode.OkCancel;
|
|
56
|
-
this.customTrueFalseText = this.data.customTrueFalseText;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
close() {
|
|
60
|
-
let data;
|
|
61
|
-
switch (this.dialogType) {
|
|
62
|
-
case 'message':
|
|
63
|
-
data = this.checkboxMessage ?
|
|
64
|
-
{
|
|
65
|
-
checkbox: this.checkboxValue || false
|
|
66
|
-
} :
|
|
67
|
-
null;
|
|
68
|
-
break;
|
|
69
|
-
case 'input':
|
|
70
|
-
data = this.checkboxMessage ?
|
|
71
|
-
{
|
|
72
|
-
response: this.userInput,
|
|
73
|
-
checkbox: this.checkboxValue || false
|
|
74
|
-
} :
|
|
75
|
-
this.userInput;
|
|
76
|
-
break;
|
|
77
|
-
case 'confirmation':
|
|
78
|
-
data = this.checkboxMessage ?
|
|
79
|
-
{
|
|
80
|
-
response: true,
|
|
81
|
-
checkbox: this.checkboxValue || false
|
|
82
|
-
} :
|
|
83
|
-
true;
|
|
84
|
-
break;
|
|
85
|
-
}
|
|
86
|
-
this.closed.emit(data);
|
|
87
|
-
}
|
|
88
|
-
cancel() {
|
|
89
|
-
let data;
|
|
90
|
-
if (this.dialogType === 'confirmation') {
|
|
91
|
-
data = this.checkboxMessage ?
|
|
92
|
-
{
|
|
93
|
-
response: false,
|
|
94
|
-
checkbox: this.checkboxValue || false
|
|
95
|
-
} :
|
|
96
|
-
false;
|
|
97
|
-
}
|
|
98
|
-
this.closed.emit(data);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
DialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
102
|
-
DialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: DialogComponent, selector: "cp-dialog", inputs: { dialogType: "dialogType", data: "data" }, outputs: { closed: "closed" }, ngImport: i0, template: "<h2 *ngIf=\"title\" mat-dialog-title [innerHTML]=\"title\"></h2>\r\n\r\n<mat-dialog-content>\r\n <div *ngIf=\"message\" [innerHTML]=\"message\"></div>\r\n\r\n <mat-form-field *ngIf=\"dialogType === 'input'\">\r\n <textarea matInput [placeholder]=\"placeholder\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n\r\n <div id=\"checkbox\" *ngIf=\"checkboxMessage\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType === 'input' && !userInput\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">Yes</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">True</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[0] }}</span>\r\n <span *ngSwitchDefault>OK</span>\r\n </span>\r\n </button>\r\n <button *ngIf=\"dialogType !== 'message'\" mat-raised-button (click)=\"cancel()\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">No</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">False</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[1] }}</span>\r\n <span *ngSwitchDefault>Cancel</span>\r\n </span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { kind: "directive", type: i1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { kind: "directive", type: i1.NgSwitchDefault, selector: "[ngSwitchDefault]" }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatCheckbox, selector: "mat-checkbox", inputs: ["disableRipple", "color", "tabIndex"], exportAs: ["matCheckbox"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
|
|
103
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogComponent, decorators: [{
|
|
104
|
-
type: Component,
|
|
105
|
-
args: [{ selector: 'cp-dialog', template: "<h2 *ngIf=\"title\" mat-dialog-title [innerHTML]=\"title\"></h2>\r\n\r\n<mat-dialog-content>\r\n <div *ngIf=\"message\" [innerHTML]=\"message\"></div>\r\n\r\n <mat-form-field *ngIf=\"dialogType === 'input'\">\r\n <textarea matInput [placeholder]=\"placeholder\" [(ngModel)]=\"userInput\"></textarea>\r\n </mat-form-field>\r\n\r\n <div id=\"checkbox\" *ngIf=\"checkboxMessage\">\r\n <mat-checkbox [(ngModel)]=\"checkboxValue\">\r\n <span [innerHTML]=\"checkboxMessage\"></span>\r\n </mat-checkbox>\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions>\r\n <button mat-raised-button (click)=\"close()\" [disabled]=\"dialogType === 'input' && !userInput\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">Yes</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">True</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[0] }}</span>\r\n <span *ngSwitchDefault>OK</span>\r\n </span>\r\n </button>\r\n <button *ngIf=\"dialogType !== 'message'\" mat-raised-button (click)=\"cancel()\">\r\n <span [ngSwitch]=\"mode\">\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.YesNo\">No</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.TrueFalse\">False</span>\r\n <span *ngSwitchCase=\"ConfirmationDialogMode.Custom\">{{ customTrueFalseText[1] }}</span>\r\n <span *ngSwitchDefault>Cancel</span>\r\n </span>\r\n </button>\r\n</mat-dialog-actions>", styles: ["mat-form-field{margin-top:2em;width:100%}#checkbox{margin:2em 0}\n"] }]
|
|
106
|
-
}], propDecorators: { dialogType: [{
|
|
107
|
-
type: Input
|
|
108
|
-
}], data: [{
|
|
109
|
-
type: Input
|
|
110
|
-
}], closed: [{
|
|
111
|
-
type: Output
|
|
112
|
-
}] } });
|
|
113
|
-
|
|
114
|
-
class ConfirmationDialogComponent {
|
|
115
|
-
constructor(dialogRef, data) {
|
|
116
|
-
this.dialogRef = dialogRef;
|
|
117
|
-
this.data = data;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
ConfirmationDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ConfirmationDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
121
|
-
ConfirmationDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: ConfirmationDialogComponent, selector: "cp-confirmation-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'confirmation'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
|
|
122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: ConfirmationDialogComponent, decorators: [{
|
|
123
|
-
type: Component,
|
|
124
|
-
args: [{ selector: 'cp-confirmation-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'confirmation'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
|
|
125
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
126
|
-
type: Inject,
|
|
127
|
-
args: [MAT_DIALOG_DATA]
|
|
128
|
-
}] }]; } });
|
|
129
|
-
|
|
130
|
-
class InputDialogComponent {
|
|
131
|
-
constructor(dialogRef, data) {
|
|
132
|
-
this.dialogRef = dialogRef;
|
|
133
|
-
this.data = data;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
InputDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: InputDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
137
|
-
InputDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: InputDialogComponent, selector: "cp-input-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'input'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
|
|
138
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: InputDialogComponent, decorators: [{
|
|
139
|
-
type: Component,
|
|
140
|
-
args: [{ selector: 'cp-input-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'input'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
|
|
141
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
142
|
-
type: Inject,
|
|
143
|
-
args: [MAT_DIALOG_DATA]
|
|
144
|
-
}] }]; } });
|
|
145
|
-
|
|
146
|
-
class MessageDialogComponent {
|
|
147
|
-
constructor(dialogRef, data) {
|
|
148
|
-
this.dialogRef = dialogRef;
|
|
149
|
-
this.data = data;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
MessageDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MessageDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
153
|
-
MessageDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: MessageDialogComponent, selector: "cp-message-dialog", ngImport: i0, template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'message'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>", dependencies: [{ kind: "component", type: DialogComponent, selector: "cp-dialog", inputs: ["dialogType", "data"], outputs: ["closed"] }] });
|
|
154
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: MessageDialogComponent, decorators: [{
|
|
155
|
-
type: Component,
|
|
156
|
-
args: [{ selector: 'cp-message-dialog', template: "<cp-dialog\r\n [data]=\"data\"\r\n [dialogType]=\"'message'\"\r\n (closed)=\"dialogRef.close($event)\">\r\n</cp-dialog>" }]
|
|
157
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
|
|
158
|
-
type: Inject,
|
|
159
|
-
args: [MAT_DIALOG_DATA]
|
|
160
|
-
}] }]; } });
|
|
161
|
-
|
|
162
|
-
//#region Imports
|
|
163
|
-
//#endregion
|
|
164
|
-
class DialogModule {
|
|
4
|
+
class NgxLibModule {
|
|
165
5
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
MessageDialogComponent], imports: [CommonModule,
|
|
171
|
-
FormsModule,
|
|
172
|
-
MatButtonModule,
|
|
173
|
-
MatCheckboxModule,
|
|
174
|
-
MatInputModule,
|
|
175
|
-
MatDialogModule], exports: [ConfirmationDialogComponent,
|
|
176
|
-
InputDialogComponent,
|
|
177
|
-
MessageDialogComponent] });
|
|
178
|
-
DialogModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, imports: [CommonModule,
|
|
179
|
-
FormsModule,
|
|
180
|
-
MatButtonModule,
|
|
181
|
-
MatCheckboxModule,
|
|
182
|
-
MatInputModule,
|
|
183
|
-
MatDialogModule] });
|
|
184
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DialogModule, decorators: [{
|
|
6
|
+
NgxLibModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgxLibModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
7
|
+
NgxLibModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.0", ngImport: i0, type: NgxLibModule });
|
|
8
|
+
NgxLibModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgxLibModule });
|
|
9
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.0", ngImport: i0, type: NgxLibModule, decorators: [{
|
|
185
10
|
type: NgModule,
|
|
186
11
|
args: [{
|
|
187
|
-
imports: [
|
|
188
|
-
CommonModule,
|
|
189
|
-
FormsModule,
|
|
190
|
-
MatButtonModule,
|
|
191
|
-
MatCheckboxModule,
|
|
192
|
-
MatInputModule,
|
|
193
|
-
MatDialogModule
|
|
194
|
-
],
|
|
195
|
-
declarations: [
|
|
196
|
-
DialogComponent,
|
|
197
|
-
ConfirmationDialogComponent,
|
|
198
|
-
InputDialogComponent,
|
|
199
|
-
MessageDialogComponent
|
|
200
|
-
],
|
|
201
|
-
exports: [
|
|
202
|
-
ConfirmationDialogComponent,
|
|
203
|
-
InputDialogComponent,
|
|
204
|
-
MessageDialogComponent
|
|
205
|
-
],
|
|
206
|
-
entryComponents: [
|
|
207
|
-
ConfirmationDialogComponent,
|
|
208
|
-
InputDialogComponent,
|
|
209
|
-
MessageDialogComponent
|
|
210
|
-
]
|
|
211
|
-
}]
|
|
212
|
-
}] });
|
|
213
|
-
|
|
214
|
-
class AuthenticationServiceConfig {
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
class SharePointServiceConfig {
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
//#region Imports
|
|
221
|
-
//#endregion
|
|
222
|
-
class SharePointService {
|
|
223
|
-
//#endregion
|
|
224
|
-
constructor(config, http) {
|
|
225
|
-
this.config = config;
|
|
226
|
-
this.http = http;
|
|
227
|
-
}
|
|
228
|
-
//#region Utilities
|
|
229
|
-
getListItems(list) {
|
|
230
|
-
return this.http.post(this.config.sharePointApiUrl, list);
|
|
231
|
-
}
|
|
232
|
-
getListItemsSimple(list, view, site, limit) {
|
|
233
|
-
return this.http.get(`${this.config.sharePointApiUrl}/${list}/${view}/${site}/${limit}`);
|
|
234
|
-
}
|
|
235
|
-
getPeople(storePeople) {
|
|
236
|
-
// Do we already have people stored locally?
|
|
237
|
-
if (this.people) {
|
|
238
|
-
return of(this.people);
|
|
239
|
-
// return Observable.of(this.people);
|
|
240
|
-
}
|
|
241
|
-
// Should we store people locally for subsequent calls?
|
|
242
|
-
if (storePeople) {
|
|
243
|
-
this.http.get(`${this.config.sharePointApiUrl}/people`)
|
|
244
|
-
.subscribe(peeps => this.people = peeps);
|
|
245
|
-
}
|
|
246
|
-
return this.http.get(`${this.config.sharePointApiUrl}/people`);
|
|
247
|
-
}
|
|
248
|
-
getPhotos(storePhotos) {
|
|
249
|
-
// Do we already have photos stored locally?
|
|
250
|
-
if (this.photos) {
|
|
251
|
-
return of(this.photos);
|
|
252
|
-
// return Observable.of(this.photos);
|
|
253
|
-
}
|
|
254
|
-
/*const spList: SharePointList = {
|
|
255
|
-
list: 'Employee Thumbnail Photos',
|
|
256
|
-
view: 'All Pictures',
|
|
257
|
-
site: 'https://sharepoint.cleavelandprice.com/DigitalDisplay',
|
|
258
|
-
userName: this.config.userName,
|
|
259
|
-
password: this.config.password
|
|
260
|
-
};*/
|
|
261
|
-
const request = {
|
|
262
|
-
list: 'Employee Thumbnail Photos',
|
|
263
|
-
site: 'https://sharepoint.cleavelandprice.com/DigitalDisplay',
|
|
264
|
-
username: this.config.userName,
|
|
265
|
-
password: this.config.password
|
|
266
|
-
};
|
|
267
|
-
// Should we store photos locally for subsequent calls?
|
|
268
|
-
if (storePhotos) {
|
|
269
|
-
this.http.post(`${this.config.sharePointApiUrl}/listitems`, request)
|
|
270
|
-
.subscribe(photos => this.photos = photos);
|
|
271
|
-
}
|
|
272
|
-
return this.http.post(`${this.config.sharePointApiUrl}/listitems`, request);
|
|
273
|
-
}
|
|
274
|
-
getCustomerVisits() {
|
|
275
|
-
const list = {
|
|
276
|
-
list: 'Customer Visits',
|
|
277
|
-
view: 'All Events',
|
|
278
|
-
userName: this.config.userName,
|
|
279
|
-
password: this.config.password
|
|
280
|
-
};
|
|
281
|
-
return this.http.post(this.config.sharePointApiUrl, list);
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
SharePointService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService, deps: [{ token: SharePointServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
285
|
-
SharePointService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService });
|
|
286
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointService, decorators: [{
|
|
287
|
-
type: Injectable
|
|
288
|
-
}], ctorParameters: function () { return [{ type: SharePointServiceConfig, decorators: [{
|
|
289
|
-
type: Optional
|
|
290
|
-
}] }, { type: i2.HttpClient }]; } });
|
|
291
|
-
|
|
292
|
-
//#region Imports
|
|
293
|
-
//#endregion
|
|
294
|
-
/**
|
|
295
|
-
* Authenticate Active Directory user
|
|
296
|
-
*/
|
|
297
|
-
class AuthenticationService {
|
|
298
|
-
//#endregion
|
|
299
|
-
//#region Lifecycle
|
|
300
|
-
/**
|
|
301
|
-
* @ignore
|
|
302
|
-
*/
|
|
303
|
-
constructor(config, http, sharePointService) {
|
|
304
|
-
this.http = http;
|
|
305
|
-
this.sharePointService = sharePointService;
|
|
306
|
-
this.authenticatedChanged = new EventEmitter();
|
|
307
|
-
this.authenticatingChanged = new EventEmitter();
|
|
308
|
-
/**
|
|
309
|
-
* Flag set to true while the service is attempting to authenticate the user
|
|
310
|
-
*/
|
|
311
|
-
this.authenticating = false;
|
|
312
|
-
/**
|
|
313
|
-
* Flag set to true when the user is successfully authenticated
|
|
314
|
-
*/
|
|
315
|
-
this.authenticated = false;
|
|
316
|
-
this.authenticationApiUrl = config.authenticationApiUrl;
|
|
317
|
-
this.checkForExistingToken();
|
|
318
|
-
}
|
|
319
|
-
//#endregion
|
|
320
|
-
//#region Utilities
|
|
321
|
-
/**
|
|
322
|
-
* Authenticate the user and store the token in Local Storage
|
|
323
|
-
*
|
|
324
|
-
* @param username AD sAMAccountName
|
|
325
|
-
* @param password
|
|
326
|
-
* @param adminGroup AD group that determines if authenticated user is considered an administrator of the app
|
|
327
|
-
*/
|
|
328
|
-
login(username, password, adminGroup) {
|
|
329
|
-
const today = new Date();
|
|
330
|
-
const expiration = new Date().setFullYear(today.getFullYear() + 10);
|
|
331
|
-
const request = {
|
|
332
|
-
username: username,
|
|
333
|
-
password: password,
|
|
334
|
-
adminGroup: adminGroup,
|
|
335
|
-
//expirationDate: expiration // moment().add(10, 'years').toDate()
|
|
336
|
-
includeThumbnail: false
|
|
337
|
-
};
|
|
338
|
-
this.authenticating = true;
|
|
339
|
-
this.authenticatingChanged.emit(this.authenticating);
|
|
340
|
-
this.http.post(this.authenticationApiUrl, request)
|
|
341
|
-
.subscribe(token => this.validateUser(token), err => {
|
|
342
|
-
console.log(err);
|
|
343
|
-
this.authenticating = false;
|
|
344
|
-
this.authenticatingChanged.emit(this.authenticating);
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
/**
|
|
348
|
-
* Logout the user and delete the token from Local Storage
|
|
349
|
-
*/
|
|
350
|
-
logout() {
|
|
351
|
-
if (localStorage.getItem('token')) {
|
|
352
|
-
localStorage.removeItem('token');
|
|
353
|
-
}
|
|
354
|
-
this.authenticatedUser = null;
|
|
355
|
-
this.authenticated = false;
|
|
356
|
-
this.authenticatedChanged.emit(false);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* @ignore
|
|
360
|
-
*/
|
|
361
|
-
validateUser(token) {
|
|
362
|
-
if (!token) {
|
|
363
|
-
return;
|
|
364
|
-
}
|
|
365
|
-
const jwtHelper = new JwtHelperService();
|
|
366
|
-
const decoded = jwtHelper.decodeToken(token);
|
|
367
|
-
if (jwtHelper.isTokenExpired(token)) {
|
|
368
|
-
this.logout();
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
this.authenticatedUser = {
|
|
372
|
-
admin: decoded.role === 'Admin',
|
|
373
|
-
displayName: decoded.displayName,
|
|
374
|
-
accountName: decoded.winaccountname,
|
|
375
|
-
distinguishedName: decoded.distinguishedName,
|
|
376
|
-
employeeNumber: decoded.employeeNumber,
|
|
377
|
-
memberOf: decoded.memberOf
|
|
378
|
-
};
|
|
379
|
-
localStorage.setItem('token', token);
|
|
380
|
-
this.getPhoto();
|
|
381
|
-
this.authenticated = true;
|
|
382
|
-
this.authenticatedChanged.emit(this.authenticated);
|
|
383
|
-
this.authenticating = false;
|
|
384
|
-
this.authenticatingChanged.emit(this.authenticating);
|
|
385
|
-
}
|
|
386
|
-
/**
|
|
387
|
-
* @ignore
|
|
388
|
-
*/
|
|
389
|
-
getPhoto() {
|
|
390
|
-
this.sharePointService.getPhotos()
|
|
391
|
-
.subscribe(photos => {
|
|
392
|
-
// The user may have been logged out by the time the photos came back
|
|
393
|
-
if (!this.authenticatedUser || !this.authenticatedUser.employeeNumber) {
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
const photo = photos.find(pic => +pic.ows_EmployeeNumber === +this.authenticatedUser.employeeNumber);
|
|
397
|
-
if (photo) {
|
|
398
|
-
this.authenticatedUser.photoUrl = photo.ows_EncodedAbsUrl;
|
|
399
|
-
}
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* @ignore
|
|
404
|
-
*/
|
|
405
|
-
checkForExistingToken() {
|
|
406
|
-
if (localStorage.getItem('token')) {
|
|
407
|
-
this.validateUser(localStorage.getItem('token'));
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
AuthenticationService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService, deps: [{ token: AuthenticationServiceConfig, optional: true }, { token: i2.HttpClient }, { token: SharePointService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
412
|
-
AuthenticationService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService });
|
|
413
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationService, decorators: [{
|
|
414
|
-
type: Injectable
|
|
415
|
-
}], ctorParameters: function () { return [{ type: AuthenticationServiceConfig, decorators: [{
|
|
416
|
-
type: Optional
|
|
417
|
-
}] }, { type: i2.HttpClient }, { type: SharePointService }]; }, propDecorators: { authenticatedChanged: [{
|
|
418
|
-
type: Output
|
|
419
|
-
}], authenticatingChanged: [{
|
|
420
|
-
type: Output
|
|
421
|
-
}] } });
|
|
422
|
-
|
|
423
|
-
class LoginFormComponent {
|
|
424
|
-
constructor(dialogRef, sharePointService, authenticationService, data) {
|
|
425
|
-
this.dialogRef = dialogRef;
|
|
426
|
-
this.sharePointService = sharePointService;
|
|
427
|
-
this.authenticationService = authenticationService;
|
|
428
|
-
this.data = data;
|
|
429
|
-
this.adminGroup = data.adminGroup;
|
|
430
|
-
}
|
|
431
|
-
ngOnInit() {
|
|
432
|
-
this.authenticationService.authenticatedChanged
|
|
433
|
-
.subscribe(authenticated => {
|
|
434
|
-
if (authenticated) {
|
|
435
|
-
this.dialogRef.close();
|
|
436
|
-
}
|
|
437
|
-
});
|
|
438
|
-
}
|
|
439
|
-
authenticate() {
|
|
440
|
-
if (!this.sharePointService || !this.username || !this.password) {
|
|
441
|
-
return;
|
|
442
|
-
}
|
|
443
|
-
this.authenticationService.login(this.username, this.password, this.adminGroup);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
LoginFormComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginFormComponent, deps: [{ token: i1$1.MatDialogRef }, { token: SharePointService }, { token: AuthenticationService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
|
|
447
|
-
LoginFormComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: LoginFormComponent, selector: "cp-login-form", ngImport: i0, template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content [class.loginError]=\"loginError\">\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating\">\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Username\" [(ngModel)]=\"username\" name=\"username\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <input matInput type=\"password\" placeholder=\"Password\" [(ngModel)]=\"password\" name=\"password\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && loginError\" class=\"alert alert-danger\">\r\n Bad username or password\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button type=\"button\" mat-raised-button (click)=\"authenticate()\">OK</button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">Cancel</button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}mat-dialog-content{height:150px}mat-dialog-content.loginError{height:200px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i5.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i5.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i5.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$1.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i9.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "diameter", "strokeWidth", "mode", "value"], exportAs: ["matProgressSpinner"] }] });
|
|
448
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginFormComponent, decorators: [{
|
|
449
|
-
type: Component,
|
|
450
|
-
args: [{ selector: 'cp-login-form', template: "<h2 mat-dialog-title>\r\n <span *ngIf=\"!authenticationService.authenticating\">Login</span>\r\n <span *ngIf=\"authenticationService.authenticating\">Authenticating...</span>\r\n</h2>\r\n\r\n<mat-dialog-content [class.loginError]=\"loginError\">\r\n <div id=\"spinner\" *ngIf=\"authenticationService.authenticating\">\r\n <mat-progress-spinner color=\"primary\" mode=\"indeterminate\"></mat-progress-spinner>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating\">\r\n <div>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Username\" [(ngModel)]=\"username\" name=\"username\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <input matInput type=\"password\" placeholder=\"Password\" [(ngModel)]=\"password\" name=\"password\" required (keyup.enter)=\"authenticate()\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"!authenticationService.authenticating && loginError\" class=\"alert alert-danger\">\r\n Bad username or password\r\n </div>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions *ngIf=\"!authenticationService.authenticating\">\r\n <button type=\"button\" mat-raised-button (click)=\"authenticate()\">OK</button>\r\n <button type=\"button\" mat-button (click)=\"dialogRef.close()\">Cancel</button>\r\n</mat-dialog-actions>", styles: ["#spinner{width:100%;height:100%;display:flex;justify-content:center;align-items:center}mat-dialog-content{height:150px}mat-dialog-content.loginError{height:200px}\n"] }]
|
|
451
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: SharePointService }, { type: AuthenticationService }, { type: undefined, decorators: [{
|
|
452
|
-
type: Inject,
|
|
453
|
-
args: [MAT_DIALOG_DATA]
|
|
454
|
-
}] }]; } });
|
|
455
|
-
|
|
456
|
-
class LoginComponent {
|
|
457
|
-
constructor(dialog, authenticationService) {
|
|
458
|
-
this.dialog = dialog;
|
|
459
|
-
this.authenticationService = authenticationService;
|
|
460
|
-
}
|
|
461
|
-
ngOnInit() {
|
|
462
|
-
}
|
|
463
|
-
login() {
|
|
464
|
-
this.dialog.open(LoginFormComponent, {
|
|
465
|
-
data: { adminGroup: this.adminGroup }
|
|
466
|
-
});
|
|
467
|
-
}
|
|
468
|
-
confirmLogout() {
|
|
469
|
-
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
|
470
|
-
data: { message: `Are you sure you want to logout?` }
|
|
471
|
-
});
|
|
472
|
-
dialogRef.afterClosed().subscribe(result => {
|
|
473
|
-
if (result) {
|
|
474
|
-
this.authenticationService.logout();
|
|
475
|
-
}
|
|
476
|
-
});
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginComponent, deps: [{ token: i1$1.MatDialog }, { token: AuthenticationService }], target: i0.ɵɵFactoryTarget.Component });
|
|
480
|
-
LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: LoginComponent, selector: "cp-login", inputs: { adminGroup: "adminGroup" }, ngImport: i0, template: "<div id=\"user-id\">\r\n <i id=\"unauthenticated-user-image\" *ngIf=\"!authenticationService.authenticated\"\r\n class=\"fa fa-user-circle\"\r\n [class.fa-spin]=\"authenticationService.authenticating\"\r\n aria-hidden=\"true\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\"></i>\r\n\r\n <img id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && authenticationService.authenticatedUser.photoUrl\"\r\n [src]=\"authenticationService.authenticatedUser.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n\r\n <i id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && !authenticationService.authenticatedUser.photoUrl\"\r\n class=\"fa fa-user-circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"></i>\r\n\r\n <div id=\"user-name\" *ngIf=\"authenticationService.authenticated\">\r\n {{ authenticationService.authenticatedUser.displayName }}\r\n </div>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}.fa{font-size:2em}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
|
|
481
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: LoginComponent, decorators: [{
|
|
482
|
-
type: Component,
|
|
483
|
-
args: [{ selector: 'cp-login', template: "<div id=\"user-id\">\r\n <i id=\"unauthenticated-user-image\" *ngIf=\"!authenticationService.authenticated\"\r\n class=\"fa fa-user-circle\"\r\n [class.fa-spin]=\"authenticationService.authenticating\"\r\n aria-hidden=\"true\"\r\n matTooltip=\"Login\"\r\n (click)=\"login()\"></i>\r\n\r\n <img id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && authenticationService.authenticatedUser.photoUrl\"\r\n [src]=\"authenticationService.authenticatedUser.photoUrl\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\" />\r\n\r\n <i id=\"authenticated-user-image\"\r\n *ngIf=\"authenticationService.authenticated && !authenticationService.authenticatedUser.photoUrl\"\r\n class=\"fa fa-user-circle\"\r\n matTooltip=\"Logout\"\r\n (click)=\"confirmLogout()\"></i>\r\n\r\n <div id=\"user-name\" *ngIf=\"authenticationService.authenticated\">\r\n {{ authenticationService.authenticatedUser.displayName }}\r\n </div>\r\n</div>", styles: ["#user-id{display:flex;height:2em;padding:.3em;font-family:Verdana,Geneva,Tahoma,sans-serif}.fa{font-size:2em}img{border-radius:100%;width:2em;height:2em}#user-id>div{display:flex;align-items:center;height:100%;margin-left:.75em;font-size:1.15em}\n"] }]
|
|
484
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: AuthenticationService }]; }, propDecorators: { adminGroup: [{
|
|
485
|
-
type: Input
|
|
486
|
-
}] } });
|
|
487
|
-
|
|
488
|
-
//#region Imports
|
|
489
|
-
//#endregion
|
|
490
|
-
/**
|
|
491
|
-
* Provides a component and a service that allows you to perform Active/Directory authentication
|
|
492
|
-
*/
|
|
493
|
-
class AuthenticationModule {
|
|
494
|
-
constructor(parentModule) {
|
|
495
|
-
if (parentModule) {
|
|
496
|
-
throw new Error('AuthenticationModule is already loaded. Import it in the AppModule only');
|
|
497
|
-
}
|
|
498
|
-
}
|
|
499
|
-
static forRoot(authenticationConfig) {
|
|
500
|
-
return {
|
|
501
|
-
ngModule: AuthenticationModule,
|
|
502
|
-
providers: [
|
|
503
|
-
AuthenticationService,
|
|
504
|
-
{ provide: AuthenticationServiceConfig, useValue: authenticationConfig }
|
|
505
|
-
]
|
|
506
|
-
};
|
|
507
|
-
}
|
|
508
|
-
}
|
|
509
|
-
AuthenticationModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, deps: [{ token: AuthenticationModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
510
|
-
AuthenticationModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, declarations: [LoginComponent,
|
|
511
|
-
LoginFormComponent], imports: [CommonModule,
|
|
512
|
-
FormsModule,
|
|
513
|
-
MatButtonModule,
|
|
514
|
-
MatCheckboxModule,
|
|
515
|
-
MatDialogModule,
|
|
516
|
-
MatInputModule,
|
|
517
|
-
MatProgressBarModule,
|
|
518
|
-
MatProgressSpinnerModule,
|
|
519
|
-
MatTooltipModule,
|
|
520
|
-
MatSelectModule,
|
|
521
|
-
DialogModule], exports: [LoginComponent,
|
|
522
|
-
LoginFormComponent] });
|
|
523
|
-
AuthenticationModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, imports: [CommonModule,
|
|
524
|
-
FormsModule,
|
|
525
|
-
MatButtonModule,
|
|
526
|
-
MatCheckboxModule,
|
|
527
|
-
MatDialogModule,
|
|
528
|
-
MatInputModule,
|
|
529
|
-
MatProgressBarModule,
|
|
530
|
-
MatProgressSpinnerModule,
|
|
531
|
-
MatTooltipModule,
|
|
532
|
-
MatSelectModule,
|
|
533
|
-
DialogModule] });
|
|
534
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: AuthenticationModule, decorators: [{
|
|
535
|
-
type: NgModule,
|
|
536
|
-
args: [{
|
|
537
|
-
imports: [
|
|
538
|
-
CommonModule,
|
|
539
|
-
FormsModule,
|
|
540
|
-
MatButtonModule,
|
|
541
|
-
MatCheckboxModule,
|
|
542
|
-
MatDialogModule,
|
|
543
|
-
MatInputModule,
|
|
544
|
-
MatProgressBarModule,
|
|
545
|
-
MatProgressSpinnerModule,
|
|
546
|
-
MatTooltipModule,
|
|
547
|
-
MatSelectModule,
|
|
548
|
-
DialogModule
|
|
549
|
-
],
|
|
550
|
-
declarations: [
|
|
551
|
-
LoginComponent,
|
|
552
|
-
LoginFormComponent
|
|
553
|
-
],
|
|
554
|
-
exports: [
|
|
555
|
-
LoginComponent,
|
|
556
|
-
LoginFormComponent
|
|
557
|
-
],
|
|
558
|
-
providers: [],
|
|
559
|
-
entryComponents: [
|
|
560
|
-
LoginFormComponent
|
|
561
|
-
]
|
|
562
|
-
}]
|
|
563
|
-
}], ctorParameters: function () { return [{ type: AuthenticationModule, decorators: [{
|
|
564
|
-
type: Optional
|
|
565
|
-
}, {
|
|
566
|
-
type: SkipSelf
|
|
567
|
-
}] }]; } });
|
|
568
|
-
|
|
569
|
-
class EmailServiceConfig {
|
|
570
|
-
}
|
|
571
|
-
|
|
572
|
-
//#region Imports
|
|
573
|
-
//#endregion
|
|
574
|
-
class EmailService {
|
|
575
|
-
constructor(config, http) {
|
|
576
|
-
this.http = http;
|
|
577
|
-
this.emailServiceConfig = config;
|
|
578
|
-
}
|
|
579
|
-
send(email) {
|
|
580
|
-
const dto = {
|
|
581
|
-
server: this.emailServiceConfig.server,
|
|
582
|
-
smtpPort: this.emailServiceConfig.smtpPort,
|
|
583
|
-
sender: this.emailServiceConfig.sender,
|
|
584
|
-
subject: email.subject,
|
|
585
|
-
content: email.content,
|
|
586
|
-
recipients: email.recipients
|
|
587
|
-
};
|
|
588
|
-
return this.http.post(this.emailServiceConfig.emailApiUrl, dto);
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
EmailService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService, deps: [{ token: EmailServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
592
|
-
EmailService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService });
|
|
593
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailService, decorators: [{
|
|
594
|
-
type: Injectable
|
|
595
|
-
}], ctorParameters: function () { return [{ type: EmailServiceConfig, decorators: [{
|
|
596
|
-
type: Optional
|
|
597
|
-
}] }, { type: i2.HttpClient }]; } });
|
|
598
|
-
|
|
599
|
-
//#region Imports
|
|
600
|
-
//#endregion
|
|
601
|
-
class EmailModule {
|
|
602
|
-
constructor(parentModule) {
|
|
603
|
-
if (parentModule) {
|
|
604
|
-
throw new Error('EmailModule is already loaded. Import it in the AppModule only');
|
|
605
|
-
}
|
|
606
|
-
}
|
|
607
|
-
static forRoot(emailConfig) {
|
|
608
|
-
return {
|
|
609
|
-
ngModule: EmailModule,
|
|
610
|
-
providers: [
|
|
611
|
-
EmailService,
|
|
612
|
-
{ provide: EmailServiceConfig, useValue: emailConfig }
|
|
613
|
-
]
|
|
614
|
-
};
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
EmailModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, deps: [{ token: EmailModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
618
|
-
EmailModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, imports: [CommonModule] });
|
|
619
|
-
EmailModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, imports: [CommonModule] });
|
|
620
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmailModule, decorators: [{
|
|
621
|
-
type: NgModule,
|
|
622
|
-
args: [{
|
|
623
|
-
imports: [CommonModule],
|
|
624
12
|
declarations: [],
|
|
13
|
+
imports: [],
|
|
625
14
|
exports: []
|
|
626
15
|
}]
|
|
627
|
-
}], ctorParameters: function () { return [{ type: EmailModule, decorators: [{
|
|
628
|
-
type: Optional
|
|
629
|
-
}, {
|
|
630
|
-
type: SkipSelf
|
|
631
|
-
}] }]; } });
|
|
632
|
-
|
|
633
|
-
class EmployeeServiceConfig {
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
//#region Imports
|
|
637
|
-
//#endregion
|
|
638
|
-
class EmployeeService {
|
|
639
|
-
//#endregion
|
|
640
|
-
//#region Lifecycle
|
|
641
|
-
constructor(config, http) {
|
|
642
|
-
this.http = http;
|
|
643
|
-
this.employeeApiUrl = config.employeeApiUrl;
|
|
644
|
-
}
|
|
645
|
-
//#endregion
|
|
646
|
-
//#region Utilities
|
|
647
|
-
getEmployees(storeEmployees = false, includeDisabled = false) {
|
|
648
|
-
// Do we already have employees stored locally?
|
|
649
|
-
if (this.employees) {
|
|
650
|
-
return of(this.employees);
|
|
651
|
-
// return Observable.of(this.employees);
|
|
652
|
-
}
|
|
653
|
-
// Should we store employees locally for subsequent calls?
|
|
654
|
-
if (storeEmployees) {
|
|
655
|
-
this.http.get(`${this.employeeApiUrl}/false/${includeDisabled}`)
|
|
656
|
-
.subscribe(emps => this.employees = emps);
|
|
657
|
-
}
|
|
658
|
-
return this.http.get(`${this.employeeApiUrl}/false/${includeDisabled}`);
|
|
659
|
-
}
|
|
660
|
-
getEmployee(sAMAccountName) {
|
|
661
|
-
return this.http.get(`${this.employeeApiUrl}/name/${sAMAccountName}`);
|
|
662
|
-
}
|
|
663
|
-
}
|
|
664
|
-
EmployeeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService, deps: [{ token: EmployeeServiceConfig, optional: true }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
665
|
-
EmployeeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService });
|
|
666
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeService, decorators: [{
|
|
667
|
-
type: Injectable
|
|
668
|
-
}], ctorParameters: function () { return [{ type: EmployeeServiceConfig, decorators: [{
|
|
669
|
-
type: Optional
|
|
670
|
-
}] }, { type: i2.HttpClient }]; } });
|
|
671
|
-
|
|
672
|
-
class DepartmentsPipe {
|
|
673
|
-
transform(employees, args) {
|
|
674
|
-
const departments = [];
|
|
675
|
-
employees
|
|
676
|
-
.filter(emp => emp.department)
|
|
677
|
-
.forEach(emp => {
|
|
678
|
-
if (departments.indexOf(emp.department) === -1) {
|
|
679
|
-
departments.push(emp.department);
|
|
680
|
-
}
|
|
681
|
-
});
|
|
682
|
-
return departments.sort();
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
DepartmentsPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
686
|
-
DepartmentsPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, name: "departments" });
|
|
687
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: DepartmentsPipe, decorators: [{
|
|
688
|
-
type: Pipe,
|
|
689
|
-
args: [{
|
|
690
|
-
name: 'departments'
|
|
691
|
-
}]
|
|
692
|
-
}] });
|
|
693
|
-
|
|
694
|
-
class EmployeeByDnPipe {
|
|
695
|
-
transform(employees, dn) {
|
|
696
|
-
return employees
|
|
697
|
-
.find(emp => emp.distinguishedName.toLowerCase() === dn.toLowerCase());
|
|
698
|
-
}
|
|
699
|
-
}
|
|
700
|
-
EmployeeByDnPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
701
|
-
EmployeeByDnPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, name: "employeeByDn" });
|
|
702
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeByDnPipe, decorators: [{
|
|
703
|
-
type: Pipe,
|
|
704
|
-
args: [{
|
|
705
|
-
name: 'employeeByDn'
|
|
706
|
-
}]
|
|
707
|
-
}] });
|
|
708
|
-
|
|
709
|
-
class EmployeePhotoUrlPipe {
|
|
710
|
-
transform(employee, photos) {
|
|
711
|
-
if (!photos) {
|
|
712
|
-
return null;
|
|
713
|
-
}
|
|
714
|
-
// Try to match by employeeNumber, accountName, or title
|
|
715
|
-
const photo = photos
|
|
716
|
-
.find(pic => (pic.ows_EmployeeNumber && employee.employeeNumber && +pic.ows_EmployeeNumber === +employee.employeeNumber) ||
|
|
717
|
-
(pic.ows_AccountName && pic.ows_AccountName.toLowerCase() === employee.sAMAccountName.toLowerCase()) ||
|
|
718
|
-
(pic.ows_Title && pic.ows_Title.toLowerCase() === employee.displayName.toLowerCase()));
|
|
719
|
-
if (!photo) {
|
|
720
|
-
console.log(`No photo match for ${employee.displayName}`);
|
|
721
|
-
}
|
|
722
|
-
return photo ? photo.ows_EncodedAbsUrl : null;
|
|
723
|
-
}
|
|
724
|
-
}
|
|
725
|
-
EmployeePhotoUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
726
|
-
EmployeePhotoUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, name: "employeePhotoUrl" });
|
|
727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeePhotoUrlPipe, decorators: [{
|
|
728
|
-
type: Pipe,
|
|
729
|
-
args: [{
|
|
730
|
-
name: 'employeePhotoUrl'
|
|
731
|
-
}]
|
|
732
16
|
}] });
|
|
733
17
|
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
.filter(emp => emp[propertyName] && emp[propertyName] === propertyValue);
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
EmployeesWithPropertyValuePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
741
|
-
EmployeesWithPropertyValuePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, name: "employeesWithPropertyValue" });
|
|
742
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeesWithPropertyValuePipe, decorators: [{
|
|
743
|
-
type: Pipe,
|
|
744
|
-
args: [{
|
|
745
|
-
name: 'employeesWithPropertyValue'
|
|
746
|
-
}]
|
|
747
|
-
}] });
|
|
748
|
-
|
|
749
|
-
class FilterEmployeesPipe {
|
|
750
|
-
transform(employees, filter) {
|
|
751
|
-
return filter ?
|
|
752
|
-
employees
|
|
753
|
-
.filter(emp => emp.displayName.toLowerCase().indexOf(filter.toLowerCase()) !== -1 ||
|
|
754
|
-
(emp.department && emp.department.toLowerCase().indexOf(filter.toLowerCase()) !== -1) ||
|
|
755
|
-
(emp.title && emp.title.toLowerCase().indexOf(filter.toLowerCase()) !== -1) ||
|
|
756
|
-
emp.sAMAccountName.toLowerCase().indexOf(filter.toLowerCase()) !== -1) :
|
|
757
|
-
employees;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
FilterEmployeesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
761
|
-
FilterEmployeesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, name: "filterEmployees" });
|
|
762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: FilterEmployeesPipe, decorators: [{
|
|
763
|
-
type: Pipe,
|
|
764
|
-
args: [{
|
|
765
|
-
name: 'filterEmployees'
|
|
766
|
-
}]
|
|
767
|
-
}] });
|
|
768
|
-
|
|
769
|
-
class IsMemberOfPipe {
|
|
770
|
-
transform(employee, groupName) {
|
|
771
|
-
return employee.memberOf &&
|
|
772
|
-
(employee.memberOf.find(m => m.toLowerCase().indexOf(groupName.toLowerCase()) !== -1) !== undefined);
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
IsMemberOfPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
776
|
-
IsMemberOfPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, name: "isMemberOf" });
|
|
777
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: IsMemberOfPipe, decorators: [{
|
|
778
|
-
type: Pipe,
|
|
779
|
-
args: [{
|
|
780
|
-
name: 'isMemberOf'
|
|
781
|
-
}]
|
|
782
|
-
}] });
|
|
783
|
-
|
|
784
|
-
class SortEmployeesPipe {
|
|
785
|
-
transform(employees, sortBy, dataType, reverse) {
|
|
786
|
-
return this.getSorted(employees, sortBy ? sortBy : 'displayName', dataType ? dataType : 'string', reverse ? reverse : false);
|
|
787
|
-
}
|
|
788
|
-
getSorted(employees, sortBy, dataType, reverse) {
|
|
789
|
-
const sorted = employees
|
|
790
|
-
.sort((a, b) => {
|
|
791
|
-
let valA, valB;
|
|
792
|
-
switch (dataType.toLowerCase()) {
|
|
793
|
-
case 'string':
|
|
794
|
-
valA = a[sortBy] ? a[sortBy].toString().toLowerCase() : null;
|
|
795
|
-
valB = b[sortBy] ? b[sortBy].toString().toLowerCase() : null;
|
|
796
|
-
break;
|
|
797
|
-
case 'number':
|
|
798
|
-
valA = a[sortBy] ? +a[sortBy] : null;
|
|
799
|
-
valB = b[sortBy] ? +b[sortBy] : null;
|
|
800
|
-
break;
|
|
801
|
-
case 'date':
|
|
802
|
-
valA = a[sortBy] ? a[sortBy] : null;
|
|
803
|
-
valB = b[sortBy] ? b[sortBy] : null;
|
|
804
|
-
break;
|
|
805
|
-
}
|
|
806
|
-
if (valA < valB) {
|
|
807
|
-
return -1;
|
|
808
|
-
}
|
|
809
|
-
if (valA > valB) {
|
|
810
|
-
return 1;
|
|
811
|
-
}
|
|
812
|
-
return 0;
|
|
813
|
-
});
|
|
814
|
-
return reverse ? sorted.reverse() : sorted;
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
SortEmployeesPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
818
|
-
SortEmployeesPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, name: "sortEmployees" });
|
|
819
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SortEmployeesPipe, decorators: [{
|
|
820
|
-
type: Pipe,
|
|
821
|
-
args: [{
|
|
822
|
-
name: 'sortEmployees'
|
|
823
|
-
}]
|
|
824
|
-
}] });
|
|
825
|
-
|
|
826
|
-
//#region Imports
|
|
827
|
-
//#endregion
|
|
828
|
-
class EmployeeModule {
|
|
829
|
-
constructor(parentModule) {
|
|
830
|
-
if (parentModule) {
|
|
831
|
-
throw new Error('EmployeeModule is already loaded. Import it in the AppModule only');
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
static forRoot(employeeConfig) {
|
|
835
|
-
return {
|
|
836
|
-
ngModule: EmployeeModule,
|
|
837
|
-
providers: [
|
|
838
|
-
EmployeeService,
|
|
839
|
-
{ provide: EmployeeServiceConfig, useValue: employeeConfig }
|
|
840
|
-
]
|
|
841
|
-
};
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
EmployeeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, deps: [{ token: EmployeeModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
845
|
-
EmployeeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, declarations: [DepartmentsPipe,
|
|
846
|
-
EmployeeByDnPipe,
|
|
847
|
-
EmployeesWithPropertyValuePipe,
|
|
848
|
-
FilterEmployeesPipe,
|
|
849
|
-
IsMemberOfPipe,
|
|
850
|
-
EmployeePhotoUrlPipe,
|
|
851
|
-
SortEmployeesPipe], imports: [CommonModule], exports: [DepartmentsPipe,
|
|
852
|
-
EmployeeByDnPipe,
|
|
853
|
-
EmployeesWithPropertyValuePipe,
|
|
854
|
-
FilterEmployeesPipe,
|
|
855
|
-
IsMemberOfPipe,
|
|
856
|
-
EmployeePhotoUrlPipe,
|
|
857
|
-
SortEmployeesPipe] });
|
|
858
|
-
EmployeeModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, imports: [CommonModule] });
|
|
859
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: EmployeeModule, decorators: [{
|
|
860
|
-
type: NgModule,
|
|
861
|
-
args: [{
|
|
862
|
-
imports: [CommonModule],
|
|
863
|
-
declarations: [
|
|
864
|
-
DepartmentsPipe,
|
|
865
|
-
EmployeeByDnPipe,
|
|
866
|
-
EmployeesWithPropertyValuePipe,
|
|
867
|
-
FilterEmployeesPipe,
|
|
868
|
-
IsMemberOfPipe,
|
|
869
|
-
EmployeePhotoUrlPipe,
|
|
870
|
-
SortEmployeesPipe
|
|
871
|
-
],
|
|
872
|
-
exports: [
|
|
873
|
-
DepartmentsPipe,
|
|
874
|
-
EmployeeByDnPipe,
|
|
875
|
-
EmployeesWithPropertyValuePipe,
|
|
876
|
-
FilterEmployeesPipe,
|
|
877
|
-
IsMemberOfPipe,
|
|
878
|
-
EmployeePhotoUrlPipe,
|
|
879
|
-
SortEmployeesPipe
|
|
880
|
-
]
|
|
881
|
-
}]
|
|
882
|
-
}], ctorParameters: function () { return [{ type: EmployeeModule, decorators: [{
|
|
883
|
-
type: Optional
|
|
884
|
-
}, {
|
|
885
|
-
type: SkipSelf
|
|
886
|
-
}] }]; } });
|
|
887
|
-
|
|
888
|
-
class SharePointPhotoUrlPipe {
|
|
889
|
-
transform(photo) {
|
|
890
|
-
return photo.ows_EncodedAbsUrl;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
SharePointPhotoUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
894
|
-
SharePointPhotoUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, name: "sharePointPhotoUrl" });
|
|
895
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointPhotoUrlPipe, decorators: [{
|
|
896
|
-
type: Pipe,
|
|
897
|
-
args: [{
|
|
898
|
-
name: 'sharePointPhotoUrl'
|
|
899
|
-
}]
|
|
900
|
-
}] });
|
|
901
|
-
|
|
902
|
-
class SharePointUrlPipe {
|
|
903
|
-
transform(url) {
|
|
904
|
-
return url !== null ? url.split(',')[0] : null;
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
SharePointUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
908
|
-
SharePointUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, name: "sharePointUrl" });
|
|
909
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointUrlPipe, decorators: [{
|
|
910
|
-
type: Pipe,
|
|
911
|
-
args: [{
|
|
912
|
-
name: 'sharePointUrl'
|
|
913
|
-
}]
|
|
914
|
-
}] });
|
|
915
|
-
|
|
916
|
-
//#region Imports
|
|
917
|
-
//#endregion
|
|
918
|
-
class SharePointModule {
|
|
919
|
-
constructor(parentModule) {
|
|
920
|
-
if (parentModule) {
|
|
921
|
-
throw new Error('SharePointModule is already loaded. Import it in the AppModule only');
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
static forRoot(sharePointConfig) {
|
|
925
|
-
return {
|
|
926
|
-
ngModule: SharePointModule,
|
|
927
|
-
providers: [
|
|
928
|
-
SharePointService,
|
|
929
|
-
{ provide: SharePointServiceConfig, useValue: sharePointConfig }
|
|
930
|
-
]
|
|
931
|
-
};
|
|
932
|
-
}
|
|
933
|
-
}
|
|
934
|
-
SharePointModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, deps: [{ token: SharePointModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
935
|
-
SharePointModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, declarations: [SharePointPhotoUrlPipe,
|
|
936
|
-
SharePointUrlPipe], imports: [CommonModule], exports: [SharePointPhotoUrlPipe,
|
|
937
|
-
SharePointUrlPipe] });
|
|
938
|
-
SharePointModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, imports: [CommonModule] });
|
|
939
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SharePointModule, decorators: [{
|
|
940
|
-
type: NgModule,
|
|
941
|
-
args: [{
|
|
942
|
-
imports: [
|
|
943
|
-
CommonModule
|
|
944
|
-
],
|
|
945
|
-
declarations: [
|
|
946
|
-
SharePointPhotoUrlPipe,
|
|
947
|
-
SharePointUrlPipe
|
|
948
|
-
],
|
|
949
|
-
exports: [
|
|
950
|
-
SharePointPhotoUrlPipe,
|
|
951
|
-
SharePointUrlPipe
|
|
952
|
-
]
|
|
953
|
-
}]
|
|
954
|
-
}], ctorParameters: function () { return [{ type: SharePointModule, decorators: [{
|
|
955
|
-
type: Optional
|
|
956
|
-
}, {
|
|
957
|
-
type: SkipSelf
|
|
958
|
-
}] }]; } });
|
|
959
|
-
|
|
960
|
-
class UploadServiceConfig {
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
// https://malcoded.com/posts/angular-file-upload-component-with-express
|
|
964
|
-
class UploadService {
|
|
965
|
-
constructor(http, config) {
|
|
966
|
-
this.http = http;
|
|
967
|
-
this.uploadApiUrl = config.uploadApiUrl;
|
|
968
|
-
this.uploadPath = config.uploadPath || '';
|
|
969
|
-
this.dbAppId = config.dbAppId || '';
|
|
970
|
-
this.externalReferenceId = config.externalReferenceId || '';
|
|
971
|
-
this.comment = config.comment || '';
|
|
972
|
-
// UI configuration
|
|
973
|
-
this.uploadButtonText = config.uploadButtonText;
|
|
974
|
-
this.uploadDialogTitle = config.uploadDialogTitle;
|
|
975
|
-
this.uploadDialogAddFilesButtonText = config.uploadDialogAddFilesButtonText;
|
|
976
|
-
this.uploadDialogCancelButtonText = config.uploadDialogCancelButtonText;
|
|
977
|
-
this.uploadDialogUploadButtonText = config.uploadDialogUploadButtonText;
|
|
978
|
-
this.uploadDialogFinishButtonText = config.uploadDialogFinishButtonText;
|
|
979
|
-
}
|
|
980
|
-
upload(files) {
|
|
981
|
-
// this will be the our resulting map
|
|
982
|
-
const status = {};
|
|
983
|
-
files.forEach(file => {
|
|
984
|
-
// create a new multipart-form for every file
|
|
985
|
-
const formData = new FormData();
|
|
986
|
-
formData.append('file', file, file.name);
|
|
987
|
-
// create a http-post request and pass the form
|
|
988
|
-
// tell it to report the upload progress
|
|
989
|
-
// A 'Destination' header is used to optionally configure the file upload destination (filesystem)
|
|
990
|
-
// A 'DbAppId' header is used to configure the unique identifier of database uploads
|
|
991
|
-
const req = new HttpRequest('POST', this.uploadApiUrl, formData, {
|
|
992
|
-
reportProgress: true,
|
|
993
|
-
responseType: 'blob',
|
|
994
|
-
headers: new HttpHeaders()
|
|
995
|
-
.set('Destination', this.uploadPath)
|
|
996
|
-
.set('DbAppId', this.dbAppId)
|
|
997
|
-
.set('ExternalReferenceId', this.externalReferenceId)
|
|
998
|
-
.set('Comment', this.comment)
|
|
999
|
-
/*headers: this.uploadPath ?
|
|
1000
|
-
new HttpHeaders({ 'Destination': this.uploadPath }) :
|
|
1001
|
-
this.dbAppId ?
|
|
1002
|
-
new HttpHeaders({ 'DbAppId': this.dbAppId }) :
|
|
1003
|
-
null*/
|
|
1004
|
-
});
|
|
1005
|
-
// create a new progress-subject for every file
|
|
1006
|
-
const progress = new Subject();
|
|
1007
|
-
// send the http-request and subscribe for progress-updates
|
|
1008
|
-
this.http.request(req).subscribe(event => {
|
|
1009
|
-
if (event.type === HttpEventType.UploadProgress) {
|
|
1010
|
-
// calculate the progress percentage
|
|
1011
|
-
const percentDone = Math.round(100 * event.loaded / event.total);
|
|
1012
|
-
// pass the percentage into the progress-stream
|
|
1013
|
-
progress.next(percentDone);
|
|
1014
|
-
}
|
|
1015
|
-
else if (event instanceof HttpResponse) {
|
|
1016
|
-
// Close the progress-stream if we get an answer form the API
|
|
1017
|
-
// The upload is complete
|
|
1018
|
-
progress.complete();
|
|
1019
|
-
}
|
|
1020
|
-
});
|
|
1021
|
-
// Save every progress-observable in a map of all observables
|
|
1022
|
-
status[file.name] = {
|
|
1023
|
-
progress: progress.asObservable()
|
|
1024
|
-
};
|
|
1025
|
-
});
|
|
1026
|
-
// return the map of progress.observables
|
|
1027
|
-
return status;
|
|
1028
|
-
}
|
|
1029
|
-
exists(fileName) {
|
|
1030
|
-
const query = this.uploadApiUrl.toLowerCase().indexOf('filesystem') === -1 ?
|
|
1031
|
-
{ name: fileName, dbAppId: this.dbAppId } :
|
|
1032
|
-
{ name: fileName, destination: this.uploadPath };
|
|
1033
|
-
return this.http.post(`${this.uploadApiUrl}/exists`, query);
|
|
1034
|
-
}
|
|
1035
|
-
download(request) {
|
|
1036
|
-
return this.http.post(`${this.uploadApiUrl}/stream`, request, { responseType: 'blob' });
|
|
1037
|
-
}
|
|
1038
|
-
getUploadInfo(request) {
|
|
1039
|
-
return this.http.post(`${this.uploadApiUrl}/info`, request);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
UploadService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService, deps: [{ token: i2.HttpClient }, { token: UploadServiceConfig, optional: true }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1043
|
-
UploadService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService });
|
|
1044
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadService, decorators: [{
|
|
1045
|
-
type: Injectable
|
|
1046
|
-
}], ctorParameters: function () { return [{ type: i2.HttpClient }, { type: UploadServiceConfig, decorators: [{
|
|
1047
|
-
type: Optional
|
|
1048
|
-
}] }]; } });
|
|
1049
|
-
|
|
1050
|
-
class UploadDialogComponent {
|
|
1051
|
-
constructor(dialogRef, uploadService) {
|
|
1052
|
-
this.dialogRef = dialogRef;
|
|
1053
|
-
this.uploadService = uploadService;
|
|
1054
|
-
this.files = new Set();
|
|
1055
|
-
this.canBeClosed = true;
|
|
1056
|
-
this.showCancelButton = true;
|
|
1057
|
-
this.uploading = false;
|
|
1058
|
-
this.uploadSuccessful = false;
|
|
1059
|
-
}
|
|
1060
|
-
ngOnInit() {
|
|
1061
|
-
this.uploadDialogTitle = this.uploadService.uploadDialogTitle ?
|
|
1062
|
-
this.uploadService.uploadDialogTitle :
|
|
1063
|
-
'Upload Files';
|
|
1064
|
-
this.uploadDialogAddFilesButtonText = this.uploadService.uploadDialogAddFilesButtonText ?
|
|
1065
|
-
this.uploadService.uploadDialogAddFilesButtonText :
|
|
1066
|
-
'Add Files';
|
|
1067
|
-
this.uploadDialogCancelButtonText = this.uploadService.uploadDialogCancelButtonText ?
|
|
1068
|
-
this.uploadService.uploadDialogCancelButtonText :
|
|
1069
|
-
'Cancel';
|
|
1070
|
-
this.uploadDialogUploadButtonText = this.uploadService.uploadDialogUploadButtonText ?
|
|
1071
|
-
this.uploadService.uploadDialogUploadButtonText :
|
|
1072
|
-
'Upload';
|
|
1073
|
-
this.uploadDialogFinishButtonText = this.uploadService.uploadDialogFinishButtonText ?
|
|
1074
|
-
this.uploadService.uploadDialogFinishButtonText :
|
|
1075
|
-
'Finish';
|
|
1076
|
-
this.primaryButtonText = this.uploadDialogUploadButtonText;
|
|
1077
|
-
}
|
|
1078
|
-
addFiles() {
|
|
1079
|
-
this.file.nativeElement.click();
|
|
1080
|
-
}
|
|
1081
|
-
onFilesAdded() {
|
|
1082
|
-
const files = this.file.nativeElement.files;
|
|
1083
|
-
for (const key in files) {
|
|
1084
|
-
if (!isNaN(parseInt(key))) {
|
|
1085
|
-
// See if the file already exists
|
|
1086
|
-
this.uploadService.exists(files[key].name)
|
|
1087
|
-
.subscribe(exists => {
|
|
1088
|
-
if (exists) {
|
|
1089
|
-
this.existingFileConflict = files[key].name;
|
|
1090
|
-
}
|
|
1091
|
-
if (!exists) {
|
|
1092
|
-
this.files.add(files[key]);
|
|
1093
|
-
}
|
|
1094
|
-
});
|
|
1095
|
-
}
|
|
1096
|
-
}
|
|
1097
|
-
}
|
|
1098
|
-
closeDialog() {
|
|
1099
|
-
// if everything was uploaded already, just close the dialog
|
|
1100
|
-
if (this.uploadSuccessful) {
|
|
1101
|
-
return this.dialogRef.close();
|
|
1102
|
-
}
|
|
1103
|
-
// set the component state to "uploading"
|
|
1104
|
-
this.uploading = true;
|
|
1105
|
-
// start the upload and save the progress map
|
|
1106
|
-
this.progress = this.uploadService.upload(this.files);
|
|
1107
|
-
// convert the progress map into an array
|
|
1108
|
-
const allProgressObservables = [];
|
|
1109
|
-
for (let key in this.progress) {
|
|
1110
|
-
allProgressObservables.push(this.progress[key].progress);
|
|
1111
|
-
}
|
|
1112
|
-
// Adjust the state variables
|
|
1113
|
-
// The OK-button should have the text "Finish" now
|
|
1114
|
-
this.primaryButtonText = this.uploadDialogFinishButtonText;
|
|
1115
|
-
// The dialog should not be closed while uploading
|
|
1116
|
-
this.canBeClosed = false;
|
|
1117
|
-
this.dialogRef.disableClose = true;
|
|
1118
|
-
// Hide the cancel-button
|
|
1119
|
-
this.showCancelButton = false;
|
|
1120
|
-
// When all progress-observables are completed...
|
|
1121
|
-
forkJoin(allProgressObservables).subscribe(end => {
|
|
1122
|
-
// ... the dialog can be closed again...
|
|
1123
|
-
this.canBeClosed = true;
|
|
1124
|
-
this.dialogRef.disableClose = false;
|
|
1125
|
-
// ... the upload was successful...
|
|
1126
|
-
this.uploadSuccessful = true;
|
|
1127
|
-
// ... and the component is no longer uploading
|
|
1128
|
-
this.uploading = false;
|
|
1129
|
-
});
|
|
1130
|
-
}
|
|
1131
|
-
}
|
|
1132
|
-
UploadDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadDialogComponent, deps: [{ token: i1$1.MatDialogRef }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1133
|
-
UploadDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: UploadDialogComponent, selector: "cp-upload-dialog", viewQueries: [{ propertyName: "file", first: true, predicate: ["file"], descendants: true, static: true }], ngImport: i0, template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\r\n\r\n<div mat-dialog-title id=\"title\">\r\n <div>{{ uploadDialogTitle }}</div>\r\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\r\n {{ uploadDialogAddFilesButtonText }}\r\n </button>\r\n</div>\r\n\r\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\r\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\r\n</div>\r\n\r\n<mat-dialog-content>\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let file of files\">\r\n <h4 mat-line>{{file.name}}</h4>\r\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\r\n </mat-list-item>\r\n </mat-list>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions id=\"actions\">\r\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\r\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\r\n</mat-dialog-actions>\r\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: i5$2.MatList, selector: "mat-list, mat-action-list", inputs: ["disableRipple", "disabled"], exportAs: ["matList"] }, { kind: "component", type: i5$2.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["disableRipple", "disabled"], exportAs: ["matListItem"] }, { kind: "directive", type: i6$1.MatLine, selector: "[mat-line], [matLine]" }, { kind: "component", type: i7.MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] });
|
|
1134
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadDialogComponent, decorators: [{
|
|
1135
|
-
type: Component,
|
|
1136
|
-
args: [{ selector: 'cp-upload-dialog', template: "<input type=\"file\" #file style=\"display: none\" (change)=\"onFilesAdded()\" multiple />\r\n\r\n<div mat-dialog-title id=\"title\">\r\n <div>{{ uploadDialogTitle }}</div>\r\n <button [disabled]=\"uploading || uploadSuccessful\" mat-raised-button color=\"primary\" class=\"add-files-btn\" (click)=\"addFiles()\">\r\n {{ uploadDialogAddFilesButtonText }}\r\n </button>\r\n</div>\r\n\r\n<div id=\"conflict\" *ngIf=\"existingFileConflict\">\r\n {{ existingFileConflict }} already exists on the server and cannot be overwritten\r\n</div>\r\n\r\n<mat-dialog-content>\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let file of files\">\r\n <h4 mat-line>{{file.name}}</h4>\r\n <mat-progress-bar *ngIf=\"progress\" mode=\"determinate\" [value]=\"progress[file.name].progress | async\"></mat-progress-bar>\r\n </mat-list-item>\r\n </mat-list>\r\n</mat-dialog-content>\r\n\r\n<mat-dialog-actions id=\"actions\">\r\n <button *ngIf=\"showCancelButton\" mat-button mat-dialog-close>{{ uploadDialogCancelButtonText }}</button>\r\n <button *ngIf=\"files.size > 0\" mat-raised-button color=\"primary\" [disabled]=\"!canBeClosed\" (click)=\"closeDialog()\">{{ primaryButtonText }}</button>\r\n</mat-dialog-actions>\r\n", styles: ["#title{display:flex;justify-content:space-between}#actions{display:flex;justify-content:flex-end}#conflict{font-size:.8em;color:red;margin-top:.5em}\n"] }]
|
|
1137
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialogRef }, { type: UploadService }]; }, propDecorators: { file: [{
|
|
1138
|
-
type: ViewChild,
|
|
1139
|
-
args: ['file', { static: true }]
|
|
1140
|
-
}] } });
|
|
1141
|
-
|
|
1142
|
-
class UploadComponent {
|
|
1143
|
-
constructor(dialog, uploadService) {
|
|
1144
|
-
this.dialog = dialog;
|
|
1145
|
-
this.uploadService = uploadService;
|
|
1146
|
-
this.dialogClosed = new EventEmitter();
|
|
1147
|
-
}
|
|
1148
|
-
ngOnInit() {
|
|
1149
|
-
this.uploadButtonText = this.uploadService.uploadButtonText ?
|
|
1150
|
-
this.uploadService.uploadButtonText :
|
|
1151
|
-
'Upload';
|
|
1152
|
-
}
|
|
1153
|
-
openUploadDialog() {
|
|
1154
|
-
this.dialog.open(UploadDialogComponent, { width: '50%' })
|
|
1155
|
-
.afterClosed().subscribe(() => this.dialogClosed.emit());
|
|
1156
|
-
}
|
|
1157
|
-
}
|
|
1158
|
-
UploadComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadComponent, deps: [{ token: i1$1.MatDialog }, { token: UploadService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1159
|
-
UploadComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.1.3", type: UploadComponent, selector: "cp-upload", outputs: { dialogClosed: "dialogClosed" }, ngImport: i0, template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>', isInline: true, dependencies: [{ kind: "component", type: i3.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }] });
|
|
1160
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadComponent, decorators: [{
|
|
1161
|
-
type: Component,
|
|
1162
|
-
args: [{
|
|
1163
|
-
selector: 'cp-upload',
|
|
1164
|
-
template: '<button mat-raised-button (click)="openUploadDialog()">{{ uploadButtonText }}</button>'
|
|
1165
|
-
}]
|
|
1166
|
-
}], ctorParameters: function () { return [{ type: i1$1.MatDialog }, { type: UploadService }]; }, propDecorators: { dialogClosed: [{
|
|
1167
|
-
type: Output
|
|
1168
|
-
}] } });
|
|
1169
|
-
|
|
1170
|
-
//#region Imports
|
|
1171
|
-
//#endregion
|
|
1172
|
-
class UploadModule {
|
|
1173
|
-
constructor(parentModule) {
|
|
1174
|
-
if (parentModule) {
|
|
1175
|
-
throw new Error('UploadModule is already loaded. Import it in the AppModule only');
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
static forRoot(uploadConfig) {
|
|
1179
|
-
return {
|
|
1180
|
-
ngModule: UploadModule,
|
|
1181
|
-
providers: [
|
|
1182
|
-
UploadService,
|
|
1183
|
-
{ provide: UploadServiceConfig, useValue: uploadConfig }
|
|
1184
|
-
]
|
|
1185
|
-
};
|
|
1186
|
-
}
|
|
1187
|
-
}
|
|
1188
|
-
UploadModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, deps: [{ token: UploadModule, optional: true, skipSelf: true }], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1189
|
-
UploadModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, declarations: [UploadComponent,
|
|
1190
|
-
UploadDialogComponent], imports: [CommonModule,
|
|
1191
|
-
BrowserAnimationsModule,
|
|
1192
|
-
HttpClientModule,
|
|
1193
|
-
MatButtonModule,
|
|
1194
|
-
MatDialogModule,
|
|
1195
|
-
MatListModule,
|
|
1196
|
-
MatProgressBarModule], exports: [UploadComponent,
|
|
1197
|
-
UploadDialogComponent] });
|
|
1198
|
-
UploadModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, imports: [CommonModule,
|
|
1199
|
-
BrowserAnimationsModule,
|
|
1200
|
-
HttpClientModule,
|
|
1201
|
-
MatButtonModule,
|
|
1202
|
-
MatDialogModule,
|
|
1203
|
-
MatListModule,
|
|
1204
|
-
MatProgressBarModule] });
|
|
1205
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UploadModule, decorators: [{
|
|
1206
|
-
type: NgModule,
|
|
1207
|
-
args: [{
|
|
1208
|
-
imports: [
|
|
1209
|
-
CommonModule,
|
|
1210
|
-
BrowserAnimationsModule,
|
|
1211
|
-
HttpClientModule,
|
|
1212
|
-
MatButtonModule,
|
|
1213
|
-
MatDialogModule,
|
|
1214
|
-
MatListModule,
|
|
1215
|
-
MatProgressBarModule
|
|
1216
|
-
],
|
|
1217
|
-
declarations: [
|
|
1218
|
-
UploadComponent,
|
|
1219
|
-
UploadDialogComponent
|
|
1220
|
-
],
|
|
1221
|
-
exports: [
|
|
1222
|
-
UploadComponent,
|
|
1223
|
-
UploadDialogComponent
|
|
1224
|
-
],
|
|
1225
|
-
entryComponents: [
|
|
1226
|
-
UploadDialogComponent
|
|
1227
|
-
]
|
|
1228
|
-
}]
|
|
1229
|
-
}], ctorParameters: function () { return [{ type: UploadModule, decorators: [{
|
|
1230
|
-
type: Optional
|
|
1231
|
-
}, {
|
|
1232
|
-
type: SkipSelf
|
|
1233
|
-
}] }]; } });
|
|
1234
|
-
|
|
1235
|
-
// This pipe whitelists URLs so that they aren't prefixed with 'unsafe:' when they render in the DOM
|
|
1236
|
-
class SafeUrlPipe {
|
|
1237
|
-
constructor(domSanitizer) {
|
|
1238
|
-
this.domSanitizer = domSanitizer;
|
|
1239
|
-
}
|
|
1240
|
-
transform(value) {
|
|
1241
|
-
return this.domSanitizer.bypassSecurityTrustUrl(value);
|
|
1242
|
-
}
|
|
1243
|
-
}
|
|
1244
|
-
SafeUrlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, deps: [{ token: i1$2.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1245
|
-
SafeUrlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, name: "safeUrl" });
|
|
1246
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: SafeUrlPipe, decorators: [{
|
|
1247
|
-
type: Pipe,
|
|
1248
|
-
args: [{
|
|
1249
|
-
name: 'safeUrl'
|
|
1250
|
-
}]
|
|
1251
|
-
}], ctorParameters: function () { return [{ type: i1$2.DomSanitizer }]; } });
|
|
1252
|
-
|
|
1253
|
-
class UriSchemePipe {
|
|
1254
|
-
// https://docs.microsoft.com/en-us/office/client-developer/office-uri-schemes
|
|
1255
|
-
transform(value) {
|
|
1256
|
-
if (!localStorage.getItem('useUriScheme')) {
|
|
1257
|
-
return value;
|
|
1258
|
-
}
|
|
1259
|
-
const urlSplit = value.split('.');
|
|
1260
|
-
const extension = urlSplit[urlSplit.length - 1];
|
|
1261
|
-
if (!extension) {
|
|
1262
|
-
return value;
|
|
1263
|
-
}
|
|
1264
|
-
const command = this.command(extension);
|
|
1265
|
-
const app = this.app(extension);
|
|
1266
|
-
return `ms-${app}:${command}|u|${value}`;
|
|
1267
|
-
}
|
|
1268
|
-
app(extension) {
|
|
1269
|
-
switch (extension.toLowerCase()) {
|
|
1270
|
-
// documents
|
|
1271
|
-
case 'doc':
|
|
1272
|
-
case 'docx':
|
|
1273
|
-
case 'docm':
|
|
1274
|
-
case 'docb':
|
|
1275
|
-
case 'dot':
|
|
1276
|
-
case 'dotx':
|
|
1277
|
-
case 'dotm': // templates
|
|
1278
|
-
return 'word';
|
|
1279
|
-
case 'xls':
|
|
1280
|
-
case 'xlsx':
|
|
1281
|
-
case 'xlm':
|
|
1282
|
-
case 'xlsm':
|
|
1283
|
-
case 'xlsb':
|
|
1284
|
-
case 'xlw':
|
|
1285
|
-
case 'xlt':
|
|
1286
|
-
case 'xltx':
|
|
1287
|
-
case 'xltm': // templates
|
|
1288
|
-
return 'excel';
|
|
1289
|
-
case 'ppt':
|
|
1290
|
-
case 'pptx':
|
|
1291
|
-
case 'pps':
|
|
1292
|
-
case 'ppsx':
|
|
1293
|
-
case 'pptm':
|
|
1294
|
-
case 'ppsm':
|
|
1295
|
-
case 'sldx':
|
|
1296
|
-
case 'sldm':
|
|
1297
|
-
case 'pot':
|
|
1298
|
-
case 'potx':
|
|
1299
|
-
case 'potm': // templates
|
|
1300
|
-
return 'powerpoint';
|
|
1301
|
-
case 'vsd':
|
|
1302
|
-
case 'vsdx':
|
|
1303
|
-
case 'vst':
|
|
1304
|
-
case 'vstx': // templates
|
|
1305
|
-
return 'visio';
|
|
1306
|
-
case 'mdb':
|
|
1307
|
-
case 'accdb':
|
|
1308
|
-
case 'accde':
|
|
1309
|
-
case 'accdr':
|
|
1310
|
-
case 'accdt': // templates
|
|
1311
|
-
return 'access';
|
|
1312
|
-
case 'mpp':
|
|
1313
|
-
case 'mppx':
|
|
1314
|
-
case 'mpt': // templates
|
|
1315
|
-
return 'project';
|
|
1316
|
-
case 'pub':
|
|
1317
|
-
return 'publisher';
|
|
1318
|
-
case 'xsn':
|
|
1319
|
-
return 'infopath';
|
|
1320
|
-
}
|
|
1321
|
-
}
|
|
1322
|
-
command(extension) {
|
|
1323
|
-
switch (extension.toLowerCase()) {
|
|
1324
|
-
case 'dot':
|
|
1325
|
-
case 'dotx':
|
|
1326
|
-
case 'dotm':
|
|
1327
|
-
case 'xlt':
|
|
1328
|
-
case 'xltx':
|
|
1329
|
-
case 'xltm':
|
|
1330
|
-
case 'pot':
|
|
1331
|
-
case 'potx':
|
|
1332
|
-
case 'potm':
|
|
1333
|
-
case 'vst':
|
|
1334
|
-
case 'vstx':
|
|
1335
|
-
case 'accdt':
|
|
1336
|
-
case 'mpt':
|
|
1337
|
-
return 'nft'; // new from template
|
|
1338
|
-
default:
|
|
1339
|
-
const openMode = 'v'; // for view, or 'e' or edit
|
|
1340
|
-
return `of${openMode}`; // default: open file as view/edit
|
|
1341
|
-
}
|
|
1342
|
-
}
|
|
1343
|
-
}
|
|
1344
|
-
UriSchemePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
|
|
1345
|
-
UriSchemePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, name: "uriScheme", pure: false });
|
|
1346
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UriSchemePipe, decorators: [{
|
|
1347
|
-
type: Pipe,
|
|
1348
|
-
args: [{
|
|
1349
|
-
name: 'uriScheme',
|
|
1350
|
-
pure: false
|
|
1351
|
-
}]
|
|
1352
|
-
}] });
|
|
1353
|
-
|
|
1354
|
-
//#region Imports
|
|
1355
|
-
//#endregion
|
|
1356
|
-
class UrlModule {
|
|
1357
|
-
}
|
|
1358
|
-
UrlModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1359
|
-
UrlModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, declarations: [SafeUrlPipe,
|
|
1360
|
-
UriSchemePipe], imports: [CommonModule], exports: [SafeUrlPipe,
|
|
1361
|
-
UriSchemePipe] });
|
|
1362
|
-
UrlModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, imports: [CommonModule] });
|
|
1363
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.1.3", ngImport: i0, type: UrlModule, decorators: [{
|
|
1364
|
-
type: NgModule,
|
|
1365
|
-
args: [{
|
|
1366
|
-
imports: [
|
|
1367
|
-
CommonModule
|
|
1368
|
-
],
|
|
1369
|
-
declarations: [
|
|
1370
|
-
SafeUrlPipe,
|
|
1371
|
-
UriSchemePipe
|
|
1372
|
-
],
|
|
1373
|
-
exports: [
|
|
1374
|
-
SafeUrlPipe,
|
|
1375
|
-
UriSchemePipe
|
|
1376
|
-
],
|
|
1377
|
-
entryComponents: []
|
|
1378
|
-
}]
|
|
1379
|
-
}] });
|
|
18
|
+
/*
|
|
19
|
+
* Public API Surface of ngx-lib
|
|
20
|
+
*/
|
|
1380
21
|
|
|
1381
22
|
/**
|
|
1382
23
|
* Generated bundle index. Do not edit.
|
|
1383
24
|
*/
|
|
1384
25
|
|
|
1385
|
-
export {
|
|
26
|
+
export { NgxLibModule };
|
|
1386
27
|
//# sourceMappingURL=cleavelandprice-ngx-lib.mjs.map
|