@memberjunction/ng-explorer-core 0.9.2
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/dist/lib/ask-skip/ask-skip.component.d.ts +83 -0
- package/dist/lib/ask-skip/ask-skip.component.js +591 -0
- package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +12 -0
- package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +49 -0
- package/dist/lib/auth-button/auth-button.component.d.ts +12 -0
- package/dist/lib/auth-button/auth-button.component.js +43 -0
- package/dist/lib/dashboard-browser-component/dashboard-browser.component.d.ts +14 -0
- package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +55 -0
- package/dist/lib/data-browser-component/data-browser.component.d.ts +14 -0
- package/dist/lib/data-browser-component/data-browser.component.js +91 -0
- package/dist/lib/favorites/favorites.component.d.ts +13 -0
- package/dist/lib/favorites/favorites.component.js +100 -0
- package/dist/lib/generic/base-form-component.d.ts +76 -0
- package/dist/lib/generic/base-form-component.js +436 -0
- package/dist/lib/generic/base-form-section-component.d.ts +6 -0
- package/dist/lib/generic/base-form-section-component.js +10 -0
- package/dist/lib/generic/base-record-component.d.ts +6 -0
- package/dist/lib/generic/base-record-component.js +13 -0
- package/dist/lib/generic/base-resource-component.d.ts +34 -0
- package/dist/lib/generic/base-resource-component.js +75 -0
- package/dist/lib/generic/dynamic-chart.d.ts +26 -0
- package/dist/lib/generic/dynamic-chart.js +180 -0
- package/dist/lib/generic/dynamic-grid.d.ts +24 -0
- package/dist/lib/generic/dynamic-grid.js +135 -0
- package/dist/lib/generic/dynamic-report.d.ts +38 -0
- package/dist/lib/generic/dynamic-report.js +399 -0
- package/dist/lib/generic/form-toolbar.d.ts +7 -0
- package/dist/lib/generic/form-toolbar.js +98 -0
- package/dist/lib/generic/resource-container-component.d.ts +25 -0
- package/dist/lib/generic/resource-container-component.js +103 -0
- package/dist/lib/generic/section-loader-component.d.ts +17 -0
- package/dist/lib/generic/section-loader-component.js +65 -0
- package/dist/lib/generic-browse-list/generic-browse-list.component.d.ts +16 -0
- package/dist/lib/generic-browse-list/generic-browse-list.component.js +91 -0
- package/dist/lib/guards/auth-guard.service.d.ts +11 -0
- package/dist/lib/guards/auth-guard.service.js +24 -0
- package/dist/lib/guards/entities.guard.d.ts +3 -0
- package/dist/lib/guards/entities.guard.js +38 -0
- package/dist/lib/header/MSFT_UserImageService.d.ts +11 -0
- package/dist/lib/header/MSFT_UserImageService.js +23 -0
- package/dist/lib/header/header.component.d.ts +51 -0
- package/dist/lib/header/header.component.js +208 -0
- package/dist/lib/home-component/home.component.d.ts +9 -0
- package/dist/lib/home-component/home.component.js +54 -0
- package/dist/lib/join-grid/join-grid.component.d.ts +30 -0
- package/dist/lib/join-grid/join-grid.component.js +225 -0
- package/dist/lib/navigation/navigation.component.d.ts +102 -0
- package/dist/lib/navigation/navigation.component.js +970 -0
- package/dist/lib/report-browser-component/report-browser.component.d.ts +14 -0
- package/dist/lib/report-browser-component/report-browser.component.js +55 -0
- package/dist/lib/resource-wrappers/dashboard-resource.component.d.ts +8 -0
- package/dist/lib/resource-wrappers/dashboard-resource.component.js +49 -0
- package/dist/lib/resource-wrappers/record-resource.component.d.ts +8 -0
- package/dist/lib/resource-wrappers/record-resource.component.js +55 -0
- package/dist/lib/resource-wrappers/report-resource.component.d.ts +10 -0
- package/dist/lib/resource-wrappers/report-resource.component.js +53 -0
- package/dist/lib/resource-wrappers/resource-wrappers-loader.d.ts +1 -0
- package/dist/lib/resource-wrappers/resource-wrappers-loader.js +12 -0
- package/dist/lib/resource-wrappers/search-results-resource.component.d.ts +10 -0
- package/dist/lib/resource-wrappers/search-results-resource.component.js +50 -0
- package/dist/lib/resource-wrappers/view-resource.component.d.ts +8 -0
- package/dist/lib/resource-wrappers/view-resource.component.js +51 -0
- package/dist/lib/settings/settings.component.d.ts +5 -0
- package/dist/lib/settings/settings.component.js +14 -0
- package/dist/lib/shared/shared.service.d.ts +87 -0
- package/dist/lib/shared/shared.service.js +302 -0
- package/dist/lib/shared/urlPipe.d.ts +7 -0
- package/dist/lib/shared/urlPipe.js +16 -0
- package/dist/lib/single-application/single-application.component.d.ts +21 -0
- package/dist/lib/single-application/single-application.component.js +132 -0
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.d.ts +28 -0
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +212 -0
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +26 -0
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +169 -0
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts +55 -0
- package/dist/lib/single-dashboard/single-dashboard.component.js +266 -0
- package/dist/lib/single-entity/single-entity.component.d.ts +33 -0
- package/dist/lib/single-entity/single-entity.component.js +252 -0
- package/dist/lib/single-record/single-record.component.d.ts +20 -0
- package/dist/lib/single-record/single-record.component.js +95 -0
- package/dist/lib/single-report/single-report.component.d.ts +22 -0
- package/dist/lib/single-report/single-report.component.js +87 -0
- package/dist/lib/single-search-result/single-search-result.component.d.ts +15 -0
- package/dist/lib/single-search-result/single-search-result.component.js +60 -0
- package/dist/lib/single-view/single-view.component.d.ts +34 -0
- package/dist/lib/single-view/single-view.component.js +154 -0
- package/dist/lib/user-notifications/user-notifications.component.d.ts +32 -0
- package/dist/lib/user-notifications/user-notifications.component.js +282 -0
- package/dist/lib/user-profile/user-profile.component.d.ts +10 -0
- package/dist/lib/user-profile/user-profile.component.js +41 -0
- package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +70 -0
- package/dist/lib/user-view-properties/view-properties-dialog.component.js +568 -0
- package/dist/module.d.ts +64 -0
- package/dist/module.js +332 -0
- package/dist/public-api.d.ts +47 -0
- package/dist/public-api.js +50 -0
- package/package.json +39 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Component, Input, ViewChild, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
3
|
+
import { BaseFormSectionComponent } from './base-form-section-component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
const _c0 = ["container"];
|
|
6
|
+
function SectionLoaderComponent_ng_template_0_Template(rf, ctx) { }
|
|
7
|
+
export class SectionLoaderComponent {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.EditMode = false;
|
|
10
|
+
this._sectionObj = null;
|
|
11
|
+
}
|
|
12
|
+
ngOnChanges(changes) {
|
|
13
|
+
// react to EditMode change
|
|
14
|
+
if (changes['EditMode'] && !changes['EditMode'].firstChange && this._sectionObj) {
|
|
15
|
+
this._sectionObj.EditMode = this.EditMode;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
ngAfterViewInit() {
|
|
19
|
+
// do this via a promise in order to defer the load by one pass of the event loop
|
|
20
|
+
// because that results in Angular not complaining about change detection due to dynamic
|
|
21
|
+
// nature of the inner component
|
|
22
|
+
Promise.resolve().then(() => this.loadComponent());
|
|
23
|
+
}
|
|
24
|
+
loadComponent() {
|
|
25
|
+
const sectionInfo = MJGlobal.Instance.ClassFactory.GetRegistration(BaseFormSectionComponent, `${this.Entity}.${this.Section}`);
|
|
26
|
+
if (sectionInfo) {
|
|
27
|
+
const componentRef = this.container.createComponent(sectionInfo.SubClass);
|
|
28
|
+
// pass in record and edit mode
|
|
29
|
+
this._sectionObj = componentRef.instance;
|
|
30
|
+
this._sectionObj.record = this.record;
|
|
31
|
+
this._sectionObj.EditMode = this.EditMode;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
ngOnDestroy() {
|
|
35
|
+
// Don't forget to cleanup dynamically created components
|
|
36
|
+
this.container.clear();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
SectionLoaderComponent.ɵfac = function SectionLoaderComponent_Factory(t) { return new (t || SectionLoaderComponent)(); };
|
|
40
|
+
SectionLoaderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SectionLoaderComponent, selectors: [["mj-form-section"]], viewQuery: function SectionLoaderComponent_Query(rf, ctx) { if (rf & 1) {
|
|
41
|
+
i0.ɵɵviewQuery(_c0, 5, ViewContainerRef);
|
|
42
|
+
} if (rf & 2) {
|
|
43
|
+
let _t;
|
|
44
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.container = _t.first);
|
|
45
|
+
} }, inputs: { Entity: "Entity", Section: "Section", record: "record", EditMode: "EditMode" }, features: [i0.ɵɵNgOnChangesFeature], decls: 2, vars: 0, consts: [["container", ""]], template: function SectionLoaderComponent_Template(rf, ctx) { if (rf & 1) {
|
|
46
|
+
i0.ɵɵtemplate(0, SectionLoaderComponent_ng_template_0_Template, 0, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
|
|
47
|
+
} }, encapsulation: 2 });
|
|
48
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SectionLoaderComponent, [{
|
|
49
|
+
type: Component,
|
|
50
|
+
args: [{
|
|
51
|
+
selector: 'mj-form-section',
|
|
52
|
+
template: `<ng-template #container></ng-template>`
|
|
53
|
+
}]
|
|
54
|
+
}], null, { Entity: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], Section: [{
|
|
57
|
+
type: Input
|
|
58
|
+
}], record: [{
|
|
59
|
+
type: Input
|
|
60
|
+
}], EditMode: [{
|
|
61
|
+
type: Input
|
|
62
|
+
}], container: [{
|
|
63
|
+
type: ViewChild,
|
|
64
|
+
args: ['container', { read: ViewContainerRef }]
|
|
65
|
+
}] }); })();
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class GenericBrowseListComponent {
|
|
5
|
+
private router;
|
|
6
|
+
showLoader: boolean;
|
|
7
|
+
itemType: string;
|
|
8
|
+
title: string;
|
|
9
|
+
items: any[];
|
|
10
|
+
iconName: string;
|
|
11
|
+
itemClickEvent: EventEmitter<any>;
|
|
12
|
+
constructor(router: Router);
|
|
13
|
+
itemClick(item: any): void;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<GenericBrowseListComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<GenericBrowseListComponent, "app-generic-browse-list", never, { "showLoader": "showLoader"; "itemType": "itemType"; "title": "title"; "items": "items"; "iconName": "iconName"; }, { "itemClickEvent": "itemClickEvent"; }, never, never, false, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { Component, EventEmitter, Input, Output } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@angular/router";
|
|
4
|
+
import * as i2 from "@angular/common";
|
|
5
|
+
import * as i3 from "@progress/kendo-angular-indicators";
|
|
6
|
+
import * as i4 from "@progress/kendo-angular-icons";
|
|
7
|
+
import * as i5 from "@progress/kendo-angular-layout";
|
|
8
|
+
function GenericBrowseListComponent_kendo_loader_6_Template(rf, ctx) { if (rf & 1) {
|
|
9
|
+
i0.ɵɵelement(0, "kendo-loader", 6);
|
|
10
|
+
} }
|
|
11
|
+
function GenericBrowseListComponent_div_7_div_1_Template(rf, ctx) { if (rf & 1) {
|
|
12
|
+
const _r5 = i0.ɵɵgetCurrentView();
|
|
13
|
+
i0.ɵɵelementStart(0, "div")(1, "kendo-card", 9)(2, "kendo-card-header", 10);
|
|
14
|
+
i0.ɵɵelement(3, "kendo-icon", 11);
|
|
15
|
+
i0.ɵɵelementEnd();
|
|
16
|
+
i0.ɵɵelementStart(4, "kendo-card-body", 12);
|
|
17
|
+
i0.ɵɵlistener("click", function GenericBrowseListComponent_div_7_div_1_Template_kendo_card_body_click_4_listener() { const restoredCtx = i0.ɵɵrestoreView(_r5); const d_r3 = restoredCtx.$implicit; const ctx_r4 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r4.itemClick(d_r3)); });
|
|
18
|
+
i0.ɵɵelementStart(5, "div", 13)(6, "h5", 14);
|
|
19
|
+
i0.ɵɵtext(7);
|
|
20
|
+
i0.ɵɵelementEnd();
|
|
21
|
+
i0.ɵɵelementStart(8, "p", 15);
|
|
22
|
+
i0.ɵɵtext(9);
|
|
23
|
+
i0.ɵɵelementEnd()()()()();
|
|
24
|
+
} if (rf & 2) {
|
|
25
|
+
const d_r3 = ctx.$implicit;
|
|
26
|
+
const ctx_r2 = i0.ɵɵnextContext(2);
|
|
27
|
+
i0.ɵɵadvance(3);
|
|
28
|
+
i0.ɵɵclassMap(ctx_r2.iconName);
|
|
29
|
+
i0.ɵɵadvance(4);
|
|
30
|
+
i0.ɵɵtextInterpolate(d_r3.Name);
|
|
31
|
+
i0.ɵɵadvance(2);
|
|
32
|
+
i0.ɵɵtextInterpolate(d_r3.Description);
|
|
33
|
+
} }
|
|
34
|
+
function GenericBrowseListComponent_div_7_Template(rf, ctx) { if (rf & 1) {
|
|
35
|
+
i0.ɵɵelementStart(0, "div", 7);
|
|
36
|
+
i0.ɵɵtemplate(1, GenericBrowseListComponent_div_7_div_1_Template, 10, 4, "div", 8);
|
|
37
|
+
i0.ɵɵelementEnd();
|
|
38
|
+
} if (rf & 2) {
|
|
39
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
40
|
+
i0.ɵɵadvance(1);
|
|
41
|
+
i0.ɵɵproperty("ngForOf", ctx_r1.items);
|
|
42
|
+
} }
|
|
43
|
+
export class GenericBrowseListComponent {
|
|
44
|
+
constructor(router) {
|
|
45
|
+
this.router = router;
|
|
46
|
+
this.showLoader = true;
|
|
47
|
+
this.itemType = '';
|
|
48
|
+
this.title = '';
|
|
49
|
+
this.items = [];
|
|
50
|
+
this.iconName = 'view-icon';
|
|
51
|
+
this.itemClickEvent = new EventEmitter();
|
|
52
|
+
}
|
|
53
|
+
itemClick(item) {
|
|
54
|
+
if (item) {
|
|
55
|
+
this.itemClickEvent.emit(item);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
GenericBrowseListComponent.ɵfac = function GenericBrowseListComponent_Factory(t) { return new (t || GenericBrowseListComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
|
|
60
|
+
GenericBrowseListComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: GenericBrowseListComponent, selectors: [["app-generic-browse-list"]], inputs: { showLoader: "showLoader", itemType: "itemType", title: "title", items: "items", iconName: "iconName" }, outputs: { itemClickEvent: "itemClickEvent" }, decls: 8, vars: 3, consts: [[1, "card-container"], [1, "card-header-entity"], [1, "title-wrap"], [1, "main-area"], ["type", "converging-spinner", 4, "ngIf"], ["class", "card-list k-d-flex k-flex-row k-h-full k-flex-wrap", 4, "ngIf"], ["type", "converging-spinner"], [1, "card-list", "k-d-flex", "k-flex-row", "k-h-full", "k-flex-wrap"], [4, "ngFor", "ngForOf"], [1, "card-wrapper"], [1, "k-hstack", "view-card"], ["name", "table"], [3, "click"], [1, "view-card-content", "k-cursor-pointer"], ["kendoCardTitle", ""], ["kendoCardSubtitle", ""]], template: function GenericBrowseListComponent_Template(rf, ctx) { if (rf & 1) {
|
|
61
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h1");
|
|
62
|
+
i0.ɵɵtext(4);
|
|
63
|
+
i0.ɵɵelementEnd()()();
|
|
64
|
+
i0.ɵɵelementStart(5, "div", 3);
|
|
65
|
+
i0.ɵɵtemplate(6, GenericBrowseListComponent_kendo_loader_6_Template, 1, 0, "kendo-loader", 4);
|
|
66
|
+
i0.ɵɵtemplate(7, GenericBrowseListComponent_div_7_Template, 2, 1, "div", 5);
|
|
67
|
+
i0.ɵɵelementEnd()();
|
|
68
|
+
} if (rf & 2) {
|
|
69
|
+
i0.ɵɵadvance(4);
|
|
70
|
+
i0.ɵɵtextInterpolate(ctx.title);
|
|
71
|
+
i0.ɵɵadvance(2);
|
|
72
|
+
i0.ɵɵproperty("ngIf", ctx.showLoader);
|
|
73
|
+
i0.ɵɵadvance(1);
|
|
74
|
+
i0.ɵɵproperty("ngIf", !ctx.showLoader);
|
|
75
|
+
} }, dependencies: [i2.NgForOf, i2.NgIf, i3.LoaderComponent, i4.IconComponent, i5.CardComponent, i5.CardHeaderComponent, i5.CardBodyComponent, i5.CardTitleDirective, i5.CardSubtitleDirective], styles: [".main-area[_ngcontent-%COMP%] {\r\n display: flex;\r\n height: 100%;\r\n width: 100%;\r\n gap: 24px;\r\n padding: 24px 0;\r\n}\r\n.list-view[_ngcontent-%COMP%] {\r\n padding: 16px;\r\n min-width: 300px;\r\n border-radius: 4px;\r\n background: #FAFAFA;\r\n border: none;\r\n}\r\n .list-view .k-listview-header, .list-view .k-listview-footer {\r\n border: none;\r\n}\r\n .list-view .k-listview-content {\r\n border: 1px solid rgba(0, 0, 0, 0.08);\r\n border-radius: 4px;\r\n background: #fff;\r\n padding: 16px;\r\n}\r\n\r\n.header[_ngcontent-%COMP%], .footer[_ngcontent-%COMP%] {\r\n color: #424242;\r\n font-size: 16px;\r\n height: auto;\r\n margin:0;\r\n}\r\n\r\n.header[_ngcontent-%COMP%] {\r\n color: #424242;\r\n margin-bottom: 16px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.header[_ngcontent-%COMP%] .head-tag[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\nfont-size: 16px;\r\nfont-style: normal;\r\nfont-weight: 400;\r\nline-height: 20px;\r\n}\r\n\r\n.header[_ngcontent-%COMP%] .count[_ngcontent-%COMP%] {\r\n width: 24px;\r\n height: 24px;\r\n min-width: 24px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n font-size: 10px;\r\n background: rgba(0, 0, 0, 0.08);\r\n border-radius: 50%;\r\n}\r\n.footer[_ngcontent-%COMP%] {\r\n font-size: 14px;\r\n margin-top: 16px;\r\n}\r\n\r\n.list-item[_ngcontent-%COMP%] {\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 30px;\r\n cursor: pointer;\r\n margin: 4px;\r\n}\r\n.card-container[_ngcontent-%COMP%] {\r\n margin: 0;\r\n padding: 0;\r\n box-shadow: none;\r\n}\r\n.card-header-entity[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n.card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] h1[_ngcontent-%COMP%] {\r\n color: #424242;\r\n font-size: 28px;\r\n font-style: normal;\r\n font-weight: 300;\r\n line-height: 28px;\r\n margin-bottom: 15px;\r\n }\r\n .card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\n margin: 0;\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n }\r\n\r\n \r\n\r\n\r\n \r\n .view-card[_ngcontent-%COMP%] .view-icon[_ngcontent-%COMP%] {\r\n color: #ff6358;\r\n }\r\n .card-wrapper[_ngcontent-%COMP%] {\r\n border: 1px solid rgba(0, 0, 0, 0.08);\r\n border-radius: 6px;\r\n }\r\n .card-wrapper[_ngcontent-%COMP%] .k-card-body[_ngcontent-%COMP%] {\r\n background: #fff;\r\n padding: 12px 20px;\r\n }\r\n .card-wrapper[_ngcontent-%COMP%] .view-card[_ngcontent-%COMP%] {\r\n overflow: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n background: #fafafa;\r\n padding: 4px 15px;\r\n }\r\n .view-card[_ngcontent-%COMP%] .btn-wrapper[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n }\r\n \r\n .k-card-body[_ngcontent-%COMP%] .view-card-content[_ngcontent-%COMP%] h5[_ngcontent-%COMP%] {\r\n color: #424242;\r\n font-size: 16px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n margin-bottom: 0;\r\n letter-spacing: 0.18px;\r\n }\r\n .k-card-body[_ngcontent-%COMP%] .view-card-content[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\n color: #666;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n height: 48px;\r\n margin-bottom: 0;\r\n }\r\n .card-container[_ngcontent-%COMP%] {\r\n padding: 0;\r\n margin: 0;\r\n box-shadow: none;\r\n }\r\n .card-header-entity[_ngcontent-%COMP%] {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n }\r\n \r\n .card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] h1[_ngcontent-%COMP%] {\r\n color: #424242;\r\n font-size: 28px;\r\n font-style: normal;\r\n font-weight: 300;\r\n line-height: 28px;\r\n margin-bottom: 15px;\r\n }\r\n .card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .card-header-entity[_ngcontent-%COMP%] .title-wrap[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\r\n margin: 0;\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n }\r\n .main-area[_ngcontent-%COMP%] .card-list[_ngcontent-%COMP%] {\r\n display: flex;\r\n gap: 20px;\r\n }"] });
|
|
76
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(GenericBrowseListComponent, [{
|
|
77
|
+
type: Component,
|
|
78
|
+
args: [{ selector: 'app-generic-browse-list', template: "<div class=\"card-container\">\n <div class=\"card-header-entity\">\n <div class=\"title-wrap\">\n <h1>{{title}}</h1>\n </div>\n </div>\n <div class=\"main-area\"> \n <kendo-loader *ngIf=\"showLoader\" type=\"converging-spinner\" ></kendo-loader>\n <div class=\"card-list k-d-flex k-flex-row k-h-full k-flex-wrap\" *ngIf=\"!showLoader\">\n <div *ngFor=\"let d of items\">\n <kendo-card class=\"card-wrapper\">\n <kendo-card-header class=\"k-hstack view-card\">\n <kendo-icon name=\"table\" [class]=\"iconName\"></kendo-icon>\n </kendo-card-header>\n \n <kendo-card-body (click)=\"itemClick(d)\">\n <div class=\"view-card-content k-cursor-pointer\">\n <h5 kendoCardTitle>{{ d.Name }}</h5>\n <p kendoCardSubtitle>{{ d.Description }}</p>\n </div>\n </kendo-card-body>\n </kendo-card>\n </div>\n </div>\n </div>\n</div>", styles: ["\r\n.main-area {\r\n display: flex;\r\n height: 100%;\r\n width: 100%;\r\n gap: 24px;\r\n padding: 24px 0;\r\n}\r\n.list-view {\r\n padding: 16px;\r\n min-width: 300px;\r\n border-radius: 4px;\r\n background: #FAFAFA;\r\n border: none;\r\n}\r\n::ng-deep .list-view .k-listview-header, \r\n::ng-deep .list-view .k-listview-footer {\r\n border: none;\r\n}\r\n::ng-deep .list-view .k-listview-content {\r\n border: 1px solid rgba(0, 0, 0, 0.08);\r\n border-radius: 4px;\r\n background: #fff;\r\n padding: 16px;\r\n}\r\n\r\n.header,\r\n.footer {\r\n color: #424242;\r\n font-size: 16px;\r\n height: auto;\r\n margin:0;\r\n}\r\n\r\n.header {\r\n color: #424242;\r\n margin-bottom: 16px;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n}\r\n.header .head-tag {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\nfont-size: 16px;\r\nfont-style: normal;\r\nfont-weight: 400;\r\nline-height: 20px;\r\n}\r\n\r\n.header .count {\r\n width: 24px;\r\n height: 24px;\r\n min-width: 24px;\r\n display: flex;\r\n justify-content: center;\r\n align-items: center;\r\n font-size: 10px;\r\n background: rgba(0, 0, 0, 0.08);\r\n border-radius: 50%;\r\n}\r\n.footer {\r\n font-size: 14px;\r\n margin-top: 16px;\r\n}\r\n\r\n.list-item {\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 30px;\r\n cursor: pointer;\r\n margin: 4px;\r\n}\r\n.card-container {\r\n margin: 0;\r\n padding: 0;\r\n box-shadow: none;\r\n}\r\n.card-header-entity {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n}\r\n.card-header-entity .title-wrap h1 {\r\n color: #424242;\r\n font-size: 28px;\r\n font-style: normal;\r\n font-weight: 300;\r\n line-height: 28px;\r\n margin-bottom: 15px;\r\n }\r\n .card-header-entity .title-wrap {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .card-header-entity .title-wrap p {\r\n margin: 0;\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n }\r\n\r\n \r\n\r\n\r\n \r\n .view-card .view-icon {\r\n color: #ff6358;\r\n }\r\n .card-wrapper {\r\n border: 1px solid rgba(0, 0, 0, 0.08);\r\n border-radius: 6px;\r\n }\r\n .card-wrapper .k-card-body {\r\n background: #fff;\r\n padding: 12px 20px;\r\n }\r\n .card-wrapper .view-card {\r\n overflow: auto;\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: center;\r\n background: #fafafa;\r\n padding: 4px 15px;\r\n }\r\n .view-card .btn-wrapper {\r\n display: flex;\r\n align-items: center;\r\n }\r\n \r\n .k-card-body .view-card-content h5 {\r\n color: #424242;\r\n font-size: 16px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n margin-bottom: 0;\r\n letter-spacing: 0.18px;\r\n }\r\n .k-card-body .view-card-content p {\r\n color: #666;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n height: 48px;\r\n margin-bottom: 0;\r\n }\r\n .card-container {\r\n padding: 0;\r\n margin: 0;\r\n box-shadow: none;\r\n }\r\n .card-header-entity {\r\n display: flex;\r\n justify-content: space-between;\r\n align-items: flex-start;\r\n padding-bottom: 20px;\r\n border-bottom: 1px solid rgba(0, 0, 0, 0.08);\r\n }\r\n \r\n .card-header-entity .title-wrap h1 {\r\n color: #424242;\r\n font-size: 28px;\r\n font-style: normal;\r\n font-weight: 300;\r\n line-height: 28px;\r\n margin-bottom: 15px;\r\n }\r\n .card-header-entity .title-wrap {\r\n display: flex;\r\n flex-direction: column;\r\n }\r\n .card-header-entity .title-wrap p {\r\n margin: 0;\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n color: #424242;\r\n font-size: 14px;\r\n font-style: normal;\r\n font-weight: 400;\r\n line-height: 20px;\r\n }\r\n .main-area .card-list {\r\n display: flex;\r\n gap: 20px;\r\n }\r\n "] }]
|
|
79
|
+
}], function () { return [{ type: i1.Router }]; }, { showLoader: [{
|
|
80
|
+
type: Input
|
|
81
|
+
}], itemType: [{
|
|
82
|
+
type: Input
|
|
83
|
+
}], title: [{
|
|
84
|
+
type: Input
|
|
85
|
+
}], items: [{
|
|
86
|
+
type: Input
|
|
87
|
+
}], iconName: [{
|
|
88
|
+
type: Input
|
|
89
|
+
}], itemClickEvent: [{
|
|
90
|
+
type: Output
|
|
91
|
+
}] }); })();
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Router, CanActivate } from '@angular/router';
|
|
2
|
+
import { MJAuthBase } from '@memberjunction/ng-auth-services';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class AuthGuardService implements CanActivate {
|
|
5
|
+
private authBase;
|
|
6
|
+
router: Router;
|
|
7
|
+
constructor(authBase: MJAuthBase, router: Router);
|
|
8
|
+
canActivate(): boolean;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthGuardService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthGuardService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import * as i1 from "@memberjunction/ng-auth-services";
|
|
4
|
+
import * as i2 from "@angular/router";
|
|
5
|
+
export class AuthGuardService {
|
|
6
|
+
constructor(authBase, router) {
|
|
7
|
+
this.authBase = authBase;
|
|
8
|
+
this.router = router;
|
|
9
|
+
}
|
|
10
|
+
canActivate() {
|
|
11
|
+
if (!this.authBase.authenticated) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
return true;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
AuthGuardService.ɵfac = function AuthGuardService_Factory(t) { return new (t || AuthGuardService)(i0.ɵɵinject(i1.MJAuthBase), i0.ɵɵinject(i2.Router)); };
|
|
18
|
+
AuthGuardService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: AuthGuardService, factory: AuthGuardService.ɵfac, providedIn: 'root' });
|
|
19
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AuthGuardService, [{
|
|
20
|
+
type: Injectable,
|
|
21
|
+
args: [{
|
|
22
|
+
providedIn: 'root',
|
|
23
|
+
}]
|
|
24
|
+
}], function () { return [{ type: i1.MJAuthBase }, { type: i2.Router }]; }, null); })();
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';
|
|
2
|
+
import { EntityPermissionType } from "@memberjunction/core";
|
|
3
|
+
export declare function checkUserEntityPermissions(type: EntityPermissionType): (route: ActivatedRouteSnapshot, state: RouterStateSnapshot) => any;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { EntityPermissionType, Metadata } from "@memberjunction/core";
|
|
2
|
+
export function checkUserEntityPermissions(type) {
|
|
3
|
+
return (route, state) => {
|
|
4
|
+
const md = new Metadata();
|
|
5
|
+
const appName = route.params['appName'];
|
|
6
|
+
const entityName = route.params['entityName'];
|
|
7
|
+
if (md && md.Entities) {
|
|
8
|
+
const entity = md.Entities.find(e => {
|
|
9
|
+
return e.Name === entityName;
|
|
10
|
+
});
|
|
11
|
+
const permissions = entity === null || entity === void 0 ? void 0 : entity.GetUserPermisions(md.CurrentUser);
|
|
12
|
+
if (permissions) {
|
|
13
|
+
let bAllowed = false;
|
|
14
|
+
switch (type) {
|
|
15
|
+
case EntityPermissionType.Create:
|
|
16
|
+
bAllowed = permissions.CanCreate;
|
|
17
|
+
break;
|
|
18
|
+
case EntityPermissionType.Read:
|
|
19
|
+
bAllowed = permissions.CanRead;
|
|
20
|
+
break;
|
|
21
|
+
case EntityPermissionType.Update:
|
|
22
|
+
bAllowed = permissions.CanUpdate;
|
|
23
|
+
break;
|
|
24
|
+
case EntityPermissionType.Delete:
|
|
25
|
+
bAllowed = permissions.CanDelete;
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
return bAllowed;
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
return false; // entity metadata not loaded yet
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class MSFTUserImageService {
|
|
5
|
+
private http;
|
|
6
|
+
private url;
|
|
7
|
+
constructor(http: HttpClient);
|
|
8
|
+
getPhoto(token: string): Observable<Blob>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MSFTUserImageService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MSFTUserImageService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpHeaders } from '@angular/common/http';
|
|
2
|
+
import { Injectable } from '@angular/core';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/common/http";
|
|
5
|
+
export class MSFTUserImageService {
|
|
6
|
+
constructor(http) {
|
|
7
|
+
this.http = http;
|
|
8
|
+
this.url = 'https://graph.microsoft.com/v1.0/me/photo/$value';
|
|
9
|
+
}
|
|
10
|
+
getPhoto(token) {
|
|
11
|
+
const headers = new HttpHeaders().set('Authorization', `Bearer ${token}`);
|
|
12
|
+
const val = this.http.get(this.url, { headers, responseType: 'blob' });
|
|
13
|
+
return val;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
MSFTUserImageService.ɵfac = function MSFTUserImageService_Factory(t) { return new (t || MSFTUserImageService)(i0.ɵɵinject(i1.HttpClient)); };
|
|
17
|
+
MSFTUserImageService.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: MSFTUserImageService, factory: MSFTUserImageService.ɵfac, providedIn: 'root' });
|
|
18
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MSFTUserImageService, [{
|
|
19
|
+
type: Injectable,
|
|
20
|
+
args: [{
|
|
21
|
+
providedIn: 'root',
|
|
22
|
+
}]
|
|
23
|
+
}], function () { return [{ type: i1.HttpClient }]; }, null); })();
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { Router } from '@angular/router';
|
|
3
|
+
import { MJAuthBase } from '@memberjunction/ng-auth-services';
|
|
4
|
+
import { SharedService } from '../shared/shared.service';
|
|
5
|
+
import { DropDownListComponent } from '@progress/kendo-angular-dropdowns';
|
|
6
|
+
import { MSFTUserImageService } from './MSFT_UserImageService';
|
|
7
|
+
import { UserNotificationEntity } from '@memberjunction/core-entities';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export declare class HeaderComponent implements OnInit {
|
|
10
|
+
authBase: MJAuthBase;
|
|
11
|
+
private sharedService;
|
|
12
|
+
private msftUserImageService;
|
|
13
|
+
private router;
|
|
14
|
+
applicationName: string;
|
|
15
|
+
applicationInstance: string;
|
|
16
|
+
menuItems: Array<string>;
|
|
17
|
+
selectedMenuItem: string;
|
|
18
|
+
userImageURL: string;
|
|
19
|
+
toggle: EventEmitter<any>;
|
|
20
|
+
searchInput: ElementRef<HTMLInputElement>;
|
|
21
|
+
entityDropdown: DropDownListComponent;
|
|
22
|
+
appName: string;
|
|
23
|
+
selectedLanguage: {
|
|
24
|
+
locale: string;
|
|
25
|
+
localeId: string;
|
|
26
|
+
};
|
|
27
|
+
popupSettings: {
|
|
28
|
+
width: string;
|
|
29
|
+
};
|
|
30
|
+
themes: any;
|
|
31
|
+
selectedTheme: any;
|
|
32
|
+
get UserNotifications(): UserNotificationEntity[];
|
|
33
|
+
get UnreadNotificationCount(): number;
|
|
34
|
+
constructor(authBase: MJAuthBase, sharedService: SharedService, msftUserImageService: MSFTUserImageService, router: Router);
|
|
35
|
+
changeTheme(theme: {
|
|
36
|
+
href: string;
|
|
37
|
+
text: string;
|
|
38
|
+
}): void;
|
|
39
|
+
onButtonClick(): void;
|
|
40
|
+
logout(): Promise<void>;
|
|
41
|
+
valueChange(event: any): Promise<void>;
|
|
42
|
+
showNotifications(event: any): Promise<void>;
|
|
43
|
+
searchableEntities: any[];
|
|
44
|
+
selectedEntity: any;
|
|
45
|
+
ngOnInit(): Promise<void>;
|
|
46
|
+
private loadSearchableEntities;
|
|
47
|
+
private isMicrosoft;
|
|
48
|
+
onSearch(event: any): void;
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HeaderComponent, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HeaderComponent, "app-header-component", never, { "applicationName": "applicationName"; "applicationInstance": "applicationInstance"; }, { "toggle": "toggle"; }, never, never, false, never>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Component, EventEmitter, Output, ViewChild, Input } from '@angular/core';
|
|
11
|
+
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
12
|
+
import { EventCodes, SharedService } from '../shared/shared.service';
|
|
13
|
+
import { Metadata, RunView } from '@memberjunction/core';
|
|
14
|
+
import { DropDownListComponent } from '@progress/kendo-angular-dropdowns';
|
|
15
|
+
import * as i0 from "@angular/core";
|
|
16
|
+
import * as i1 from "@memberjunction/ng-auth-services";
|
|
17
|
+
import * as i2 from "../shared/shared.service";
|
|
18
|
+
import * as i3 from "./MSFT_UserImageService";
|
|
19
|
+
import * as i4 from "@angular/router";
|
|
20
|
+
import * as i5 from "@angular/common";
|
|
21
|
+
import * as i6 from "@angular/forms";
|
|
22
|
+
import * as i7 from "@progress/kendo-angular-inputs";
|
|
23
|
+
import * as i8 from "@progress/kendo-angular-layout";
|
|
24
|
+
import * as i9 from "@progress/kendo-angular-dropdowns";
|
|
25
|
+
const _c0 = ["searchInput"];
|
|
26
|
+
function HeaderComponent_span_17_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
+
i0.ɵɵelementStart(0, "span", 21);
|
|
28
|
+
i0.ɵɵtext(1);
|
|
29
|
+
i0.ɵɵelementEnd();
|
|
30
|
+
} if (rf & 2) {
|
|
31
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
32
|
+
i0.ɵɵadvance(1);
|
|
33
|
+
i0.ɵɵtextInterpolate(ctx_r1.UnreadNotificationCount);
|
|
34
|
+
} }
|
|
35
|
+
export class HeaderComponent {
|
|
36
|
+
get UserNotifications() {
|
|
37
|
+
return SharedService.UserNotifications;
|
|
38
|
+
}
|
|
39
|
+
get UnreadNotificationCount() {
|
|
40
|
+
return SharedService.UnreadUserNotificationCount;
|
|
41
|
+
}
|
|
42
|
+
constructor(authBase, sharedService, msftUserImageService, router) {
|
|
43
|
+
this.authBase = authBase;
|
|
44
|
+
this.sharedService = sharedService;
|
|
45
|
+
this.msftUserImageService = msftUserImageService;
|
|
46
|
+
this.router = router;
|
|
47
|
+
this.menuItems = [
|
|
48
|
+
'User Name', 'Logout'
|
|
49
|
+
];
|
|
50
|
+
this.selectedMenuItem = 'User Name';
|
|
51
|
+
this.userImageURL = 'assets/user.png';
|
|
52
|
+
this.toggle = new EventEmitter();
|
|
53
|
+
this.appName = '';
|
|
54
|
+
this.selectedLanguage = { locale: 'English', localeId: 'en-US' };
|
|
55
|
+
this.popupSettings = { width: '150' };
|
|
56
|
+
this.themes = [
|
|
57
|
+
{
|
|
58
|
+
href: 'assets/kendo-theme-default/dist/all.css',
|
|
59
|
+
text: 'Default'
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
this.selectedTheme = this.themes[0];
|
|
63
|
+
this.searchableEntities = [];
|
|
64
|
+
}
|
|
65
|
+
changeTheme(theme) {
|
|
66
|
+
this.selectedTheme = theme;
|
|
67
|
+
const themeEl = document.getElementById('theme');
|
|
68
|
+
themeEl.href = theme.href;
|
|
69
|
+
}
|
|
70
|
+
onButtonClick() {
|
|
71
|
+
this.toggle.emit();
|
|
72
|
+
}
|
|
73
|
+
logout() {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
this.authBase.logout();
|
|
76
|
+
localStorage.removeItem('auth');
|
|
77
|
+
localStorage.removeItem('claims');
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
valueChange(event) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
if (event === 'Logout') {
|
|
83
|
+
this.logout();
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
showNotifications(event) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
MJGlobal.Instance.RaiseEvent({
|
|
90
|
+
event: MJEventType.ComponentEvent,
|
|
91
|
+
component: this,
|
|
92
|
+
eventCode: EventCodes.ViewNotifications,
|
|
93
|
+
args: {}
|
|
94
|
+
});
|
|
95
|
+
this.router.navigate(['notifications']);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
ngOnInit() {
|
|
99
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
this.appName = `${this.applicationName} - ${this.applicationInstance}`;
|
|
101
|
+
MJGlobal.Instance.GetEventListener(true).subscribe((event) => __awaiter(this, void 0, void 0, function* () {
|
|
102
|
+
if (event.event === MJEventType.LoggedIn) {
|
|
103
|
+
yield this.loadSearchableEntities();
|
|
104
|
+
const md = new Metadata();
|
|
105
|
+
this.menuItems[0] = md.CurrentUser.FirstLast;
|
|
106
|
+
this.selectedMenuItem = this.menuItems[0];
|
|
107
|
+
if (this.isMicrosoft(event.args))
|
|
108
|
+
this.msftUserImageService.getPhoto(event.args.accessToken).subscribe((blob) => {
|
|
109
|
+
this.userImageURL = URL.createObjectURL(blob);
|
|
110
|
+
this.sharedService.CurrentUserImage = this.userImageURL;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
loadSearchableEntities() {
|
|
117
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
118
|
+
const rv = new RunView();
|
|
119
|
+
const result = yield rv.RunView({
|
|
120
|
+
EntityName: 'Entities',
|
|
121
|
+
ExtraFilter: 'AllowUserSearchAPI = 1'
|
|
122
|
+
});
|
|
123
|
+
if (result && result.Success) {
|
|
124
|
+
this.searchableEntities = result.Results;
|
|
125
|
+
if (this.searchableEntities.length > 0) {
|
|
126
|
+
this.selectedEntity = this.searchableEntities[0];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
isMicrosoft(claims) {
|
|
132
|
+
return claims && claims.authority && (claims.authority.includes('microsoftonline.com') ||
|
|
133
|
+
claims.authority.includes('microsoft.com'));
|
|
134
|
+
}
|
|
135
|
+
onSearch(event) {
|
|
136
|
+
const inputValue = this.searchInput.nativeElement.value;
|
|
137
|
+
if (inputValue && inputValue.length > 0 && inputValue.trim().length > 2 /* at least 3 characters to search*/) {
|
|
138
|
+
this.searchInput.nativeElement.value = ''; // blank it out
|
|
139
|
+
this.router.navigate(['resource', 'search', inputValue], { queryParams: { Entity: this.selectedEntity.Name } });
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
this.sharedService.CreateSimpleNotification('Please enter at least 3 characters to search', 'warning', 1500);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
HeaderComponent.ɵfac = function HeaderComponent_Factory(t) { return new (t || HeaderComponent)(i0.ɵɵdirectiveInject(i1.MJAuthBase), i0.ɵɵdirectiveInject(i2.SharedService), i0.ɵɵdirectiveInject(i3.MSFTUserImageService), i0.ɵɵdirectiveInject(i4.Router)); };
|
|
147
|
+
HeaderComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: HeaderComponent, selectors: [["app-header-component"]], viewQuery: function HeaderComponent_Query(rf, ctx) { if (rf & 1) {
|
|
148
|
+
i0.ɵɵviewQuery(_c0, 5);
|
|
149
|
+
i0.ɵɵviewQuery(DropDownListComponent, 5);
|
|
150
|
+
} if (rf & 2) {
|
|
151
|
+
let _t;
|
|
152
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.searchInput = _t.first);
|
|
153
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.entityDropdown = _t.first);
|
|
154
|
+
} }, inputs: { applicationName: "applicationName", applicationInstance: "applicationInstance" }, outputs: { toggle: "toggle" }, decls: 22, vars: 7, consts: [[1, "header-wrap"], [1, "header", "header-bg"], [1, "nav-container"], [1, "menu-button"], [1, "k-icon", "hamburger-icon", 3, "click"], [1, "title"], ["kendoCardMedia", "", "src", "assets/MJ-Logo.png", "height", "45px", 1, "app-logo"], [1, "k-ml-2.5"], [1, "user-info-wrapper"], [1, "search-wrapper"], ["textField", "Name", "valueField", "ID", 1, "search-entity-list", 3, "data", "ngModel", "ngModelChange"], ["type", "text", "id", "txtSearch", "placeholder", "Search", "kendoTextBox", "", 3, "keydown.enter"], ["searchInput", ""], [1, "k-icon", "k-i-zoom", 3, "click"], [1, "icon-inbox", 3, "click"], [1, "k-icon", "k-i-inbox", 2, "cursor", "pointer"], ["class", "notification", 4, "ngIf"], ["shape", "circle", 1, "k-m-0", 2, "margin", "0", 3, "imageSrc"], [1, "user-info"], [1, "example-col"], [3, "data", "value", "valueChange"], [1, "notification"]], template: function HeaderComponent_Template(rf, ctx) { if (rf & 1) {
|
|
155
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "div", 3)(4, "span", 4);
|
|
156
|
+
i0.ɵɵlistener("click", function HeaderComponent_Template_span_click_4_listener() { return ctx.onButtonClick(); });
|
|
157
|
+
i0.ɵɵelementEnd()();
|
|
158
|
+
i0.ɵɵelementStart(5, "div", 5);
|
|
159
|
+
i0.ɵɵelement(6, "img", 6);
|
|
160
|
+
i0.ɵɵelementStart(7, "h1", 7);
|
|
161
|
+
i0.ɵɵtext(8);
|
|
162
|
+
i0.ɵɵelementEnd()();
|
|
163
|
+
i0.ɵɵelementStart(9, "div", 8)(10, "div", 9)(11, "kendo-dropdownlist", 10);
|
|
164
|
+
i0.ɵɵlistener("ngModelChange", function HeaderComponent_Template_kendo_dropdownlist_ngModelChange_11_listener($event) { return ctx.selectedEntity = $event; });
|
|
165
|
+
i0.ɵɵelementEnd();
|
|
166
|
+
i0.ɵɵelementStart(12, "input", 11, 12);
|
|
167
|
+
i0.ɵɵlistener("keydown.enter", function HeaderComponent_Template_input_keydown_enter_12_listener($event) { return ctx.onSearch($event); });
|
|
168
|
+
i0.ɵɵelementEnd();
|
|
169
|
+
i0.ɵɵelementStart(14, "span", 13);
|
|
170
|
+
i0.ɵɵlistener("click", function HeaderComponent_Template_span_click_14_listener($event) { return ctx.onSearch($event); });
|
|
171
|
+
i0.ɵɵelementEnd()();
|
|
172
|
+
i0.ɵɵelementStart(15, "div", 14);
|
|
173
|
+
i0.ɵɵlistener("click", function HeaderComponent_Template_div_click_15_listener($event) { return ctx.showNotifications($event); });
|
|
174
|
+
i0.ɵɵelement(16, "span", 15);
|
|
175
|
+
i0.ɵɵtemplate(17, HeaderComponent_span_17_Template, 2, 1, "span", 16);
|
|
176
|
+
i0.ɵɵelementEnd();
|
|
177
|
+
i0.ɵɵelement(18, "kendo-avatar", 17);
|
|
178
|
+
i0.ɵɵelementStart(19, "div", 18)(20, "div", 19)(21, "kendo-dropdownlist", 20);
|
|
179
|
+
i0.ɵɵlistener("valueChange", function HeaderComponent_Template_kendo_dropdownlist_valueChange_21_listener($event) { return ctx.valueChange($event); });
|
|
180
|
+
i0.ɵɵelementEnd()()()()()()();
|
|
181
|
+
} if (rf & 2) {
|
|
182
|
+
i0.ɵɵadvance(8);
|
|
183
|
+
i0.ɵɵtextInterpolate(ctx.appName);
|
|
184
|
+
i0.ɵɵadvance(3);
|
|
185
|
+
i0.ɵɵproperty("data", ctx.searchableEntities)("ngModel", ctx.selectedEntity);
|
|
186
|
+
i0.ɵɵadvance(6);
|
|
187
|
+
i0.ɵɵproperty("ngIf", ctx.UnreadNotificationCount > 0);
|
|
188
|
+
i0.ɵɵadvance(1);
|
|
189
|
+
i0.ɵɵproperty("imageSrc", ctx.userImageURL);
|
|
190
|
+
i0.ɵɵadvance(3);
|
|
191
|
+
i0.ɵɵproperty("data", ctx.menuItems)("value", ctx.selectedMenuItem);
|
|
192
|
+
} }, dependencies: [i5.NgIf, i6.NgControlStatus, i6.NgModel, i7.TextBoxDirective, i8.AvatarComponent, i8.CardMediaDirective, i9.DropDownListComponent], styles: [".header-wrap[_ngcontent-%COMP%] {\r\n flex: auto;\r\n}\r\n\r\n.title[_ngcontent-%COMP%] {\r\n font-size: x-large; \r\n}\r\n.app-logo[_ngcontent-%COMP%] {\r\n width: 100px;\r\n height: 50px;\r\n}\r\n\r\n.user-info[_ngcontent-%COMP%] kendo-dropdownlist[_ngcontent-%COMP%] {\r\n border: none;\r\n background: transparent;\r\n width: auto;\r\n color: #fff;\r\n}\r\n.user-info-wrapper[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.icon-inbox[_ngcontent-%COMP%] {\r\n position: relative;\r\n margin: 0 26px 0 40px;\r\n}\r\n.icon-inbox[_ngcontent-%COMP%] .notification[_ngcontent-%COMP%] {\r\n position: absolute;\r\n top: -8px;\r\n right: -8px;\r\n width: 16px;\r\n height: 16px;\r\n min-width: 16px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: #ff6358;\r\n border-radius: 50%;\r\n color: #fff;\r\n font-size: 10px;\r\n}\r\n.user-info-wrapper[_ngcontent-%COMP%] .header[_ngcontent-%COMP%] .k-avatar[_ngcontent-%COMP%] {\r\n padding-left: 25px;\r\n border-left: 2px solid #fff;\r\n}\r\n.search-wrapper[_ngcontent-%COMP%] {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n width: 500px;\r\n}\r\n.search-entity-list[_ngcontent-%COMP%] {\r\n width: 200px; \r\n}\r\n .search-wrapper #txtSearch::placeholder, .search-wrapper input::placeholder {\r\n color: #fff;\r\n}\r\n.search-wrapper[_ngcontent-%COMP%] .k-input[_ngcontent-%COMP%], .search-wrapper[_ngcontent-%COMP%] .k-dropdownlist[_ngcontent-%COMP%] {\r\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\r\n background: transparent;\r\n border-radius: 0;\r\n color: #fff;\r\n}\r\n.search-wrapper[_ngcontent-%COMP%] .k-icon[_ngcontent-%COMP%] {\r\n position: absolute;\r\n right: 0;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n z-index: 9;\r\n cursor: pointer;\r\n margin-right: 2px;\r\n} \r\n.k-input[_ngcontent-%COMP%] {\r\n color: black;\r\n}\r\n\r\n\r\n\r\n@media (max-width: 1700px) {\r\n .title[_ngcontent-%COMP%] {\r\n font-size: x-small; \r\n }\r\n .app-logo[_ngcontent-%COMP%] {\r\n width: 50px;\r\n height: 25px;\r\n }\r\n}\r\n@media (max-width: 1200px) {\r\n .title[_ngcontent-%COMP%] {\r\n display: none;\r\n }\r\n .app-logo[_ngcontent-%COMP%] {\r\n display: none\r\n }\r\n\r\n .search-wrapper[_ngcontent-%COMP%] {\r\n width: 350px;\r\n } \r\n .search-entity-list[_ngcontent-%COMP%] {\r\n width: 150px; \r\n }\r\n}"] });
|
|
193
|
+
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(HeaderComponent, [{
|
|
194
|
+
type: Component,
|
|
195
|
+
args: [{ selector: 'app-header-component', template: "<div class=\"header-wrap\">\r\n <div class=\"header header-bg\">\r\n <div class=\"nav-container\">\r\n <div class=\"menu-button\">\r\n <span class=\"k-icon hamburger-icon\" (click)=\"onButtonClick()\"></span>\r\n </div>\r\n\r\n <div class=\"title\">\r\n <img kendoCardMedia src=\"assets/MJ-Logo.png\" height=\"45px\" class=\"app-logo\" />\r\n <h1 class=\"k-ml-2.5\">{{appName}}</h1>\r\n </div>\r\n\r\n <div class=\"user-info-wrapper\">\r\n <div class=\"search-wrapper\">\r\n <kendo-dropdownlist\r\n [data]=\"searchableEntities\"\r\n textField=\"Name\"\r\n valueField=\"ID\"\r\n class = \"search-entity-list\"\r\n [(ngModel)]=\"selectedEntity\"\r\n >\r\n </kendo-dropdownlist>\r\n <input \r\n type=\"text\"\r\n id=\"txtSearch\"\r\n placeholder=\"Search\"\r\n kendoTextBox\r\n (keydown.enter)=\"onSearch($event)\"\r\n #searchInput\r\n />\r\n <span class=\"k-icon k-i-zoom\" (click)=\"onSearch($event)\"></span>\r\n </div>\r\n <div class=\"icon-inbox\" (click)=\"showNotifications($event)\">\r\n <span class=\"k-icon k-i-inbox\" style=\"cursor: pointer;\"></span>\r\n <span class=\"notification\" *ngIf=\"UnreadNotificationCount > 0\">{{UnreadNotificationCount}}</span>\r\n </div>\r\n <kendo-avatar class=\"k-m-0\" style=\"margin: 0;\" [imageSrc]=\"userImageURL\" shape=\"circle\"> </kendo-avatar>\r\n <div class=\"user-info\">\r\n <div class=\"example-col\">\r\n <kendo-dropdownlist [data]=\"menuItems\" [value]=\"selectedMenuItem\" (valueChange)=\"valueChange($event)\">\r\n </kendo-dropdownlist>\r\n \r\n </div>\r\n </div>\r\n \r\n\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <!-- <div class=\"nav-breadcrumb\">\r\n <kendo-breadcrumb (itemClick)=\"onBreadCrumbClick($event)\" [items]=\"breadCrumbItems\">\r\n </kendo-breadcrumb>\r\n </div> -->\r\n</div>\r\n", styles: [".header-wrap {\r\n flex: auto;\r\n}\r\n\r\n.title {\r\n font-size: x-large; \r\n}\r\n.app-logo {\r\n width: 100px;\r\n height: 50px;\r\n}\r\n\r\n.user-info kendo-dropdownlist {\r\n border: none;\r\n background: transparent;\r\n width: auto;\r\n color: #fff;\r\n}\r\n.user-info-wrapper {\r\n display: flex;\r\n align-items: center;\r\n}\r\n.icon-inbox {\r\n position: relative;\r\n margin: 0 26px 0 40px;\r\n}\r\n.icon-inbox .notification {\r\n position: absolute;\r\n top: -8px;\r\n right: -8px;\r\n width: 16px;\r\n height: 16px;\r\n min-width: 16px;\r\n display: flex;\r\n align-items: center;\r\n justify-content: center;\r\n background: #ff6358;\r\n border-radius: 50%;\r\n color: #fff;\r\n font-size: 10px;\r\n}\r\n.user-info-wrapper .header .k-avatar {\r\n padding-left: 25px;\r\n border-left: 2px solid #fff;\r\n}\r\n.search-wrapper {\r\n display: flex;\r\n align-items: center;\r\n position: relative;\r\n width: 500px;\r\n}\r\n.search-entity-list {\r\n width: 200px; \r\n}\r\n::ng-deep .search-wrapper #txtSearch::placeholder, ::ng-deep .search-wrapper input::placeholder {\r\n color: #fff;\r\n}\r\n.search-wrapper .k-input, .search-wrapper .k-dropdownlist {\r\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\r\n background: transparent;\r\n border-radius: 0;\r\n color: #fff;\r\n}\r\n.search-wrapper .k-icon {\r\n position: absolute;\r\n right: 0;\r\n top: 50%;\r\n transform: translateY(-50%);\r\n z-index: 9;\r\n cursor: pointer;\r\n margin-right: 2px;\r\n} \r\n.k-input {\r\n color: black;\r\n}\r\n\r\n\r\n/*RESPONSIVE STUFF HERE */\r\n@media (max-width: 1700px) {\r\n .title {\r\n font-size: x-small; /* or any other size you prefer */\r\n }\r\n .app-logo {\r\n width: 50px;\r\n height: 25px;\r\n }\r\n}\r\n@media (max-width: 1200px) {\r\n .title {\r\n display: none;\r\n }\r\n .app-logo {\r\n display: none\r\n }\r\n\r\n .search-wrapper {\r\n width: 350px;\r\n } \r\n .search-entity-list {\r\n width: 150px; \r\n }\r\n}\r\n"] }]
|
|
196
|
+
}], function () { return [{ type: i1.MJAuthBase }, { type: i2.SharedService }, { type: i3.MSFTUserImageService }, { type: i4.Router }]; }, { applicationName: [{
|
|
197
|
+
type: Input
|
|
198
|
+
}], applicationInstance: [{
|
|
199
|
+
type: Input
|
|
200
|
+
}], toggle: [{
|
|
201
|
+
type: Output
|
|
202
|
+
}], searchInput: [{
|
|
203
|
+
type: ViewChild,
|
|
204
|
+
args: ['searchInput']
|
|
205
|
+
}], entityDropdown: [{
|
|
206
|
+
type: ViewChild,
|
|
207
|
+
args: [DropDownListComponent]
|
|
208
|
+
}] }); })();
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Router } from '@angular/router';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class HomeComponent {
|
|
4
|
+
private router;
|
|
5
|
+
constructor(router: Router);
|
|
6
|
+
navigate(route: string): void;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<HomeComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<HomeComponent, "app-home", never, {}, {}, never, never, false, never>;
|
|
9
|
+
}
|