@memberjunction/ng-explorer-core 5.22.0 → 5.24.0
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/app-routing.module.d.ts.map +1 -1
- package/dist/app-routing.module.js +1 -3
- package/dist/app-routing.module.js.map +1 -1
- package/dist/generated/lazy-feature-config.d.ts +1 -1
- package/dist/generated/lazy-feature-config.d.ts.map +1 -1
- package/dist/generated/lazy-feature-config.js +5 -2
- package/dist/generated/lazy-feature-config.js.map +1 -1
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js +49 -49
- package/dist/lib/dashboard-preferences-dialog/dashboard-preferences-dialog.component.js.map +1 -1
- package/dist/lib/oauth/oauth-callback.component.js +6 -6
- package/dist/lib/oauth/oauth-callback.component.js.map +1 -1
- package/dist/lib/oauth/oauth.module.d.ts +2 -3
- package/dist/lib/oauth/oauth.module.d.ts.map +1 -1
- package/dist/lib/oauth/oauth.module.js +0 -4
- package/dist/lib/oauth/oauth.module.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts +6 -25
- package/dist/lib/resource-wrappers/chat-collections-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js +30 -124
- package/dist/lib/resource-wrappers/chat-collections-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts +7 -23
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js +50 -142
- package/dist/lib/resource-wrappers/chat-conversations-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts +3 -19
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js +16 -98
- package/dist/lib/resource-wrappers/chat-tasks-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/list-detail-resource.component.d.ts +3 -1
- package/dist/lib/resource-wrappers/list-detail-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/list-detail-resource.component.js +3 -0
- package/dist/lib/resource-wrappers/list-detail-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/notifications-resource.component.js +1 -0
- package/dist/lib/resource-wrappers/notifications-resource.component.js.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.d.ts +13 -11
- package/dist/lib/resource-wrappers/view-resource.component.d.ts.map +1 -1
- package/dist/lib/resource-wrappers/view-resource.component.js +80 -89
- package/dist/lib/resource-wrappers/view-resource.component.js.map +1 -1
- package/dist/lib/services/startup-validation.service.d.ts.map +1 -1
- package/dist/lib/services/startup-validation.service.js +0 -3
- package/dist/lib/services/startup-validation.service.js.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.d.ts.map +1 -1
- package/dist/lib/shell/components/header/app-nav.component.js +18 -3
- package/dist/lib/shell/components/header/app-nav.component.js.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts +45 -16
- package/dist/lib/shell/components/tabs/component-cache-manager.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/component-cache-manager.js +57 -35
- package/dist/lib/shell/components/tabs/component-cache-manager.js.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts +33 -0
- package/dist/lib/shell/components/tabs/tab-container.component.d.ts.map +1 -1
- package/dist/lib/shell/components/tabs/tab-container.component.js +99 -17
- package/dist/lib/shell/components/tabs/tab-container.component.js.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.d.ts +8 -8
- package/dist/lib/shell/services/settings-dialog.service.d.ts.map +1 -1
- package/dist/lib/shell/services/settings-dialog.service.js +20 -26
- package/dist/lib/shell/services/settings-dialog.service.js.map +1 -1
- package/dist/lib/shell/shell.component.d.ts.map +1 -1
- package/dist/lib/shell/shell.component.js +17 -17
- package/dist/lib/shell/shell.component.js.map +1 -1
- package/dist/lib/shell/shell.module.d.ts +4 -5
- package/dist/lib/shell/shell.module.d.ts.map +1 -1
- package/dist/lib/shell/shell.module.js +4 -8
- package/dist/lib/shell/shell.module.js.map +1 -1
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +72 -71
- package/dist/lib/single-dashboard/Components/add-item/add-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +11 -11
- package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts +36 -12
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +78 -50
- package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts +12 -5
- package/dist/lib/single-dashboard/single-dashboard.component.d.ts.map +1 -1
- package/dist/lib/single-dashboard/single-dashboard.component.js +44 -55
- package/dist/lib/single-dashboard/single-dashboard.component.js.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts +10 -2
- package/dist/lib/single-list-detail/single-list-detail.component.d.ts.map +1 -1
- package/dist/lib/single-list-detail/single-list-detail.component.js +313 -243
- package/dist/lib/single-list-detail/single-list-detail.component.js.map +1 -1
- package/dist/module.d.ts +51 -63
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +35 -80
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +0 -1
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +0 -1
- package/dist/public-api.js.map +1 -1
- package/package.json +38 -47
- package/dist/lib/generic/form-toolbar.d.ts +0 -8
- package/dist/lib/generic/form-toolbar.d.ts.map +0 -1
- package/dist/lib/generic/form-toolbar.js +0 -114
- package/dist/lib/generic/form-toolbar.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list-detail-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/list-detail-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"list-detail-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/list-detail-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;;;AAOvD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,qBAAqB;IACzD,QAAQ;QACJ,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,sBAAsB,CAAC,IAAkB;QAC3C,MAAM,EAAE,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC1B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YACxB,IAAI,YAAY,GAAiB,IAAI,YAAY,CAAC,CAAC,EAAC,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,gBAAgB,EAAC,CAAC,CAAC,CAAC;YACrG,MAAM,IAAI,GAAG,MAAM,EAAE,CAAC,mBAAmB,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;YACjE,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC1D,CAAC;aACG,CAAC;YACD,OAAO,cAAc,CAAC;QAC1B,CAAC;IACL,CAAC;IAED,KAAK,CAAC,oBAAoB,CAAC,IAAkB;QACzC,OAAO,EAAE,CAAC;IACd,CAAC;qPAnBQ,kBAAkB,yBAAlB,kBAAkB;6DAAlB,kBAAkB;YAFhB,oCAAkD;;YAAlC,kDAAgC;;;AAElD,kBAAkB;IAN9B,aAAa,CAAC,qBAAqB,EAAE,oBAAoB,CAAC;GAM9C,kBAAkB,CAoB9B;;iFApBY,kBAAkB;cAL9B,SAAS;eAAC;gBACT,UAAU,EAAE,KAAK;gBACf,QAAQ,EAAE,yBAAyB;gBACnC,QAAQ,EAAE,oDAAoD;aACjE;;kFACY,kBAAkB","sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { BaseResourceComponent } from '@memberjunction/ng-shared';\nimport { ResourceData } from '@memberjunction/core-entities';\nimport { RegisterClass } from '@memberjunction/global';\nimport { CompositeKey, Metadata } from '@memberjunction/core';\n@RegisterClass(BaseResourceComponent, 'ListDetailResource')\n@Component({\n standalone: false,\n selector: 'mj-list-detail-resource',\n template: `<mj-list-detail [ListID]=\"Data.ResourceRecordID\"/>`\n})\nexport class ListDetailResource extends BaseResourceComponent implements OnInit {\n ngOnInit(): void {\n this.NotifyLoadComplete();\n }\n\n async GetResourceDisplayName(data: ResourceData): Promise<string> {\n const md = new Metadata();\n if (data.ResourceRecordID) {\n let compositeKey: CompositeKey = new CompositeKey([{FieldName: \"ID\", Value: data.ResourceRecordID}]);\n const name = await md.GetEntityRecordName('Lists', compositeKey);\n return name ? name : `List: ${data.ResourceRecordID}`;\n }\n else{\n return 'List [Error]';\n }\n }\n\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return '';\n }\n}\n"]}
|
|
@@ -11,6 +11,7 @@ import * as i0 from "@angular/core";
|
|
|
11
11
|
import * as i1 from "../user-notifications/user-notifications.component";
|
|
12
12
|
let NotificationsResource = class NotificationsResource extends BaseResourceComponent {
|
|
13
13
|
ngOnInit() {
|
|
14
|
+
this.NotifyLoadComplete();
|
|
14
15
|
}
|
|
15
16
|
async GetResourceDisplayName(data) {
|
|
16
17
|
return 'Notifications';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notifications-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/notifications-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;;AAOhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,qBAAqB;IAC5D,QAAQ;
|
|
1
|
+
{"version":3,"file":"notifications-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/notifications-resource.component.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAU,MAAM,eAAe,CAAC;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;;;AAOhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,qBAAqB;IAC5D,QAAQ;QACJ,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC9B,CAAC;IACD,KAAK,CAAC,sBAAsB,CAAC,IAAkB;QAC3C,OAAO,eAAe,CAAC;IAC3B,CAAC;IACD,KAAK,CAAC,oBAAoB,CAAC,IAAkB;QACzC,OAAO,kBAAkB,CAAC;IAC9B,CAAC;iQATQ,qBAAqB,yBAArB,qBAAqB;6DAArB,qBAAqB;YAFnB,yCAAiD;;;AAEnD,qBAAqB;IANjC,aAAa,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;GAMjD,qBAAqB,CAUjC;;iFAVY,qBAAqB;cALjC,SAAS;eAAC;gBACT,UAAU,EAAE,KAAK;gBACf,QAAQ,EAAE,2BAA2B;gBACrC,QAAQ,EAAE,mDAAmD;aAChE;;kFACY,qBAAqB","sourcesContent":["import { Component, OnInit } from '@angular/core';\nimport { BaseResourceComponent } from '@memberjunction/ng-shared';\nimport { ResourceData } from '@memberjunction/core-entities';\nimport { RegisterClass } from '@memberjunction/global';\n@RegisterClass(BaseResourceComponent, 'NotificationsResource')\n@Component({\n standalone: false,\n selector: 'mj-notifications-resource',\n template: `<app-user-notifications></app-user-notifications>`\n})\nexport class NotificationsResource extends BaseResourceComponent implements OnInit {\n ngOnInit(): void {\n this.NotifyLoadComplete();\n }\n async GetResourceDisplayName(data: ResourceData): Promise<string> {\n return 'Notifications';\n }\n async GetResourceIconClass(data: ResourceData): Promise<string> {\n return 'fa-solid fa-bell';\n }\n}\n"]}
|
|
@@ -3,7 +3,7 @@ import { BaseResourceComponent, NavigationService } from '@memberjunction/ng-sha
|
|
|
3
3
|
import { ResourceData, MJUserViewEntityExtended } from '@memberjunction/core-entities';
|
|
4
4
|
import { EntityInfo } from '@memberjunction/core';
|
|
5
5
|
import { RecordOpenedEvent, ViewGridState, EntityViewerComponent } from '@memberjunction/ng-entity-viewer';
|
|
6
|
-
import {
|
|
6
|
+
import { ExportService } from '@memberjunction/ng-export-service';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
8
|
/**
|
|
9
9
|
* UserViewResource - Resource wrapper for displaying User Views in tabs
|
|
@@ -20,24 +20,18 @@ import * as i0 from "@angular/core";
|
|
|
20
20
|
export declare class UserViewResource extends BaseResourceComponent {
|
|
21
21
|
private navigationService;
|
|
22
22
|
private cdr;
|
|
23
|
+
private exportService;
|
|
23
24
|
containerElement: ElementRef<HTMLDivElement>;
|
|
24
25
|
entityViewerRef?: EntityViewerComponent;
|
|
25
|
-
excelExportRef?: ExcelExportComponent;
|
|
26
26
|
isLoading: boolean;
|
|
27
27
|
errorMessage: string | null;
|
|
28
28
|
entityInfo: EntityInfo | null;
|
|
29
29
|
viewEntity: MJUserViewEntityExtended | null;
|
|
30
30
|
gridState: ViewGridState | null;
|
|
31
31
|
isExporting: boolean;
|
|
32
|
-
exportData: any[];
|
|
33
|
-
exportColumns: {
|
|
34
|
-
Name: string;
|
|
35
|
-
DisplayName: string;
|
|
36
|
-
}[];
|
|
37
|
-
exportFileName: string;
|
|
38
32
|
private dataLoaded;
|
|
39
33
|
private metadata;
|
|
40
|
-
constructor(navigationService: NavigationService, cdr: ChangeDetectorRef);
|
|
34
|
+
constructor(navigationService: NavigationService, cdr: ChangeDetectorRef, exportService: ExportService);
|
|
41
35
|
set Data(value: ResourceData);
|
|
42
36
|
get Data(): ResourceData;
|
|
43
37
|
/**
|
|
@@ -77,9 +71,17 @@ export declare class UserViewResource extends BaseResourceComponent {
|
|
|
77
71
|
*/
|
|
78
72
|
onExport(): Promise<void>;
|
|
79
73
|
/**
|
|
80
|
-
*
|
|
74
|
+
* Load all records for the current view/entity for export
|
|
81
75
|
*/
|
|
82
|
-
private
|
|
76
|
+
private loadExportRows;
|
|
77
|
+
/**
|
|
78
|
+
* Determine which columns to export based on grid state, view entity, or entity fields
|
|
79
|
+
*/
|
|
80
|
+
private buildExportColumns;
|
|
81
|
+
/**
|
|
82
|
+
* Build the export file name based on entity and view
|
|
83
|
+
*/
|
|
84
|
+
private buildExportFileName;
|
|
83
85
|
/**
|
|
84
86
|
* Show a notification to the user
|
|
85
87
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/view-resource.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAY,MAAM,+BAA+B,CAAC;AAEjG,OAAO,EAA0B,UAAU,EAAW,MAAM,sBAAsB,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAC3G,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"view-resource.component.d.ts","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/view-resource.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,UAAU,EAAE,iBAAiB,EAAE,MAAM,e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BAAsB,CAAC,IAAI,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAc1E;;OAEG;IACY,oBAAoB,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC;IAIzE;;OAEG;IACI,iBAAiB,IAAI,IAAI;IAOhC;;OAEG;IACU,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAuCtC;;OAEG;YACW,cAAc;IAyB5B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA0B1B;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAK3B;;OAEG;IACH,OAAO,CAAC,gBAAgB;yCAxTf,gBAAgB;2CAAhB,gBAAgB;CAoU5B"}
|
|
@@ -11,21 +11,19 @@ import { RegisterClass, MJGlobal, MJEventType, UUIDsEqual } from '@memberjunctio
|
|
|
11
11
|
import { CompositeKey, Metadata, RunView } from '@memberjunction/core';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
import * as i1 from "@memberjunction/ng-shared";
|
|
14
|
-
import * as i2 from "@
|
|
14
|
+
import * as i2 from "@memberjunction/ng-export-service";
|
|
15
15
|
import * as i3 from "@memberjunction/ng-shared-generic";
|
|
16
16
|
import * as i4 from "@memberjunction/ng-entity-viewer";
|
|
17
17
|
const _c0 = ["container"];
|
|
18
18
|
const _c1 = ["entityViewer"];
|
|
19
|
-
const _c2 = ["excelExport"];
|
|
20
|
-
const _forTrack0 = ($index, $item) => $item.Name;
|
|
21
19
|
function UserViewResource_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
22
|
-
i0.ɵɵelementStart(0, "div",
|
|
23
|
-
i0.ɵɵelement(1, "mj-loading",
|
|
20
|
+
i0.ɵɵelementStart(0, "div", 3);
|
|
21
|
+
i0.ɵɵelement(1, "mj-loading", 5);
|
|
24
22
|
i0.ɵɵelementEnd();
|
|
25
23
|
} }
|
|
26
24
|
function UserViewResource_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
27
|
-
i0.ɵɵelementStart(0, "div",
|
|
28
|
-
i0.ɵɵelement(1, "i",
|
|
25
|
+
i0.ɵɵelementStart(0, "div", 4);
|
|
26
|
+
i0.ɵɵelement(1, "i", 6);
|
|
29
27
|
i0.ɵɵelementStart(2, "p");
|
|
30
28
|
i0.ɵɵtext(3);
|
|
31
29
|
i0.ɵɵelementEnd()();
|
|
@@ -35,7 +33,7 @@ function UserViewResource_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
|
35
33
|
i0.ɵɵtextInterpolate(ctx_r0.errorMessage);
|
|
36
34
|
} }
|
|
37
35
|
function UserViewResource_Conditional_4_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
38
|
-
i0.ɵɵelementStart(0, "p",
|
|
36
|
+
i0.ɵɵelementStart(0, "p", 10);
|
|
39
37
|
i0.ɵɵtext(1);
|
|
40
38
|
i0.ɵɵelementEnd();
|
|
41
39
|
} if (rf & 2) {
|
|
@@ -44,42 +42,33 @@ function UserViewResource_Conditional_4_Conditional_4_Template(rf, ctx) { if (rf
|
|
|
44
42
|
i0.ɵɵtextInterpolate(ctx_r0.viewEntity.Description);
|
|
45
43
|
} }
|
|
46
44
|
function UserViewResource_Conditional_4_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
47
|
-
i0.ɵɵelement(0, "i",
|
|
45
|
+
i0.ɵɵelement(0, "i", 15);
|
|
48
46
|
} }
|
|
49
47
|
function UserViewResource_Conditional_4_Conditional_12_Template(rf, ctx) { if (rf & 1) {
|
|
50
|
-
i0.ɵɵelement(0, "i",
|
|
51
|
-
} }
|
|
52
|
-
function UserViewResource_Conditional_4_For_20_Template(rf, ctx) { if (rf & 1) {
|
|
53
|
-
i0.ɵɵelement(0, "kendo-excelexport-column", 20);
|
|
54
|
-
} if (rf & 2) {
|
|
55
|
-
const column_r3 = ctx.$implicit;
|
|
56
|
-
i0.ɵɵproperty("field", column_r3.Name)("title", column_r3.DisplayName);
|
|
48
|
+
i0.ɵɵelement(0, "i", 16);
|
|
57
49
|
} }
|
|
58
50
|
function UserViewResource_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
59
51
|
const _r2 = i0.ɵɵgetCurrentView();
|
|
60
|
-
i0.ɵɵelementStart(0, "div",
|
|
52
|
+
i0.ɵɵelementStart(0, "div", 7)(1, "div", 8)(2, "h2", 9);
|
|
61
53
|
i0.ɵɵtext(3);
|
|
62
54
|
i0.ɵɵelementEnd();
|
|
63
|
-
i0.ɵɵconditionalCreate(4, UserViewResource_Conditional_4_Conditional_4_Template, 2, 1, "p",
|
|
55
|
+
i0.ɵɵconditionalCreate(4, UserViewResource_Conditional_4_Conditional_4_Template, 2, 1, "p", 10);
|
|
64
56
|
i0.ɵɵelementEnd();
|
|
65
|
-
i0.ɵɵelementStart(5, "div",
|
|
57
|
+
i0.ɵɵelementStart(5, "div", 11)(6, "button", 12);
|
|
66
58
|
i0.ɵɵlistener("click", function UserViewResource_Conditional_4_Template_button_click_6_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onCreateNewRecord()); });
|
|
67
|
-
i0.ɵɵelement(7, "i",
|
|
59
|
+
i0.ɵɵelement(7, "i", 13);
|
|
68
60
|
i0.ɵɵelementStart(8, "span");
|
|
69
61
|
i0.ɵɵtext(9, "New Record");
|
|
70
62
|
i0.ɵɵelementEnd()();
|
|
71
|
-
i0.ɵɵelementStart(10, "button",
|
|
63
|
+
i0.ɵɵelementStart(10, "button", 14);
|
|
72
64
|
i0.ɵɵlistener("click", function UserViewResource_Conditional_4_Template_button_click_10_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onExport()); });
|
|
73
|
-
i0.ɵɵconditionalCreate(11, UserViewResource_Conditional_4_Conditional_11_Template, 1, 0, "i",
|
|
65
|
+
i0.ɵɵconditionalCreate(11, UserViewResource_Conditional_4_Conditional_11_Template, 1, 0, "i", 15)(12, UserViewResource_Conditional_4_Conditional_12_Template, 1, 0, "i", 16);
|
|
74
66
|
i0.ɵɵelementStart(13, "span");
|
|
75
67
|
i0.ɵɵtext(14);
|
|
76
68
|
i0.ɵɵelementEnd()()()();
|
|
77
|
-
i0.ɵɵelementStart(15, "mj-entity-viewer",
|
|
69
|
+
i0.ɵɵelementStart(15, "mj-entity-viewer", 17, 1);
|
|
78
70
|
i0.ɵɵlistener("recordOpened", function UserViewResource_Conditional_4_Template_mj_entity_viewer_recordOpened_15_listener($event) { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onRecordOpened($event)); })("dataLoaded", function UserViewResource_Conditional_4_Template_mj_entity_viewer_dataLoaded_15_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r0.onDataLoaded()); });
|
|
79
71
|
i0.ɵɵelementEnd();
|
|
80
|
-
i0.ɵɵelementStart(17, "kendo-excelexport", 19, 2);
|
|
81
|
-
i0.ɵɵrepeaterCreate(19, UserViewResource_Conditional_4_For_20_Template, 1, 2, "kendo-excelexport-column", 20, _forTrack0);
|
|
82
|
-
i0.ɵɵelementEnd();
|
|
83
72
|
} if (rf & 2) {
|
|
84
73
|
const ctx_r0 = i0.ɵɵnextContext();
|
|
85
74
|
i0.ɵɵadvance(3);
|
|
@@ -96,10 +85,6 @@ function UserViewResource_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
96
85
|
i0.ɵɵtextInterpolate(ctx_r0.isExporting ? "Exporting..." : "Export");
|
|
97
86
|
i0.ɵɵadvance();
|
|
98
87
|
i0.ɵɵproperty("entity", ctx_r0.entityInfo)("viewEntity", ctx_r0.viewEntity)("gridState", ctx_r0.gridState);
|
|
99
|
-
i0.ɵɵadvance(2);
|
|
100
|
-
i0.ɵɵproperty("data", ctx_r0.exportData)("fileName", ctx_r0.exportFileName);
|
|
101
|
-
i0.ɵɵadvance(2);
|
|
102
|
-
i0.ɵɵrepeater(ctx_r0.exportColumns);
|
|
103
88
|
} }
|
|
104
89
|
/**
|
|
105
90
|
* UserViewResource - Resource wrapper for displaying User Views in tabs
|
|
@@ -116,9 +101,9 @@ function UserViewResource_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
|
116
101
|
let UserViewResource = class UserViewResource extends BaseResourceComponent {
|
|
117
102
|
navigationService;
|
|
118
103
|
cdr;
|
|
104
|
+
exportService;
|
|
119
105
|
containerElement;
|
|
120
106
|
entityViewerRef;
|
|
121
|
-
excelExportRef;
|
|
122
107
|
isLoading = false;
|
|
123
108
|
errorMessage = null;
|
|
124
109
|
entityInfo = null;
|
|
@@ -126,15 +111,13 @@ let UserViewResource = class UserViewResource extends BaseResourceComponent {
|
|
|
126
111
|
gridState = null;
|
|
127
112
|
// Export state
|
|
128
113
|
isExporting = false;
|
|
129
|
-
exportData = [];
|
|
130
|
-
exportColumns = [];
|
|
131
|
-
exportFileName = 'export.xlsx';
|
|
132
114
|
dataLoaded = false;
|
|
133
115
|
metadata = new Metadata();
|
|
134
|
-
constructor(navigationService, cdr) {
|
|
116
|
+
constructor(navigationService, cdr, exportService) {
|
|
135
117
|
super();
|
|
136
118
|
this.navigationService = navigationService;
|
|
137
119
|
this.cdr = cdr;
|
|
120
|
+
this.exportService = exportService;
|
|
138
121
|
}
|
|
139
122
|
set Data(value) {
|
|
140
123
|
const previousRecordId = super.Data?.ResourceRecordID;
|
|
@@ -290,68 +273,47 @@ let UserViewResource = class UserViewResource extends BaseResourceComponent {
|
|
|
290
273
|
* Handle export to Excel request
|
|
291
274
|
*/
|
|
292
275
|
async onExport() {
|
|
293
|
-
if (!this.
|
|
294
|
-
console.error('Cannot export:
|
|
276
|
+
if (!this.entityInfo) {
|
|
277
|
+
console.error('Cannot export: entity not available');
|
|
295
278
|
return;
|
|
296
279
|
}
|
|
297
280
|
this.isExporting = true;
|
|
298
281
|
this.cdr.detectChanges();
|
|
299
282
|
try {
|
|
300
283
|
this.showNotification('Working on the export, will notify you when it is complete...', 'info', 2000);
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
// Use view's column configuration - only export visible columns in view order
|
|
313
|
-
const visibleColumns = this.viewEntity.Columns.filter(col => !col.hidden);
|
|
314
|
-
this.exportColumns = visibleColumns.map(col => ({
|
|
315
|
-
Name: col.Name,
|
|
316
|
-
DisplayName: col.DisplayName || col.Name
|
|
317
|
-
}));
|
|
284
|
+
const rows = await this.loadExportRows();
|
|
285
|
+
const columns = this.buildExportColumns();
|
|
286
|
+
const fileName = this.buildExportFileName();
|
|
287
|
+
const result = await this.exportService.toExcel(rows, {
|
|
288
|
+
fileName,
|
|
289
|
+
columns,
|
|
290
|
+
includeHeaders: true
|
|
291
|
+
});
|
|
292
|
+
if (result.success) {
|
|
293
|
+
this.exportService.downloadResult(result);
|
|
294
|
+
this.showNotification('Excel Export Complete', 'success', 2000);
|
|
318
295
|
}
|
|
319
296
|
else {
|
|
320
|
-
|
|
321
|
-
const visibleFields = this.entityInfo.Fields.filter(f => !f.IsVirtual);
|
|
322
|
-
this.exportColumns = visibleFields.map(f => ({
|
|
323
|
-
Name: f.Name,
|
|
324
|
-
DisplayName: f.DisplayNameOrName
|
|
325
|
-
}));
|
|
297
|
+
this.showNotification('Export failed', 'error', 5000);
|
|
326
298
|
}
|
|
327
|
-
this.exportData = data;
|
|
328
|
-
// Set the export filename
|
|
329
|
-
const viewName = this.viewEntity?.Name || 'Data';
|
|
330
|
-
this.exportFileName = `${this.entityInfo.Name}_${viewName}_${new Date().toISOString().split('T')[0]}.xlsx`;
|
|
331
|
-
// Wait for Angular to update the DOM with the new data before triggering save
|
|
332
|
-
setTimeout(() => {
|
|
333
|
-
this.excelExportRef.save();
|
|
334
|
-
this.showNotification('Excel Export Complete', 'success', 2000);
|
|
335
|
-
this.isExporting = false;
|
|
336
|
-
this.cdr.detectChanges();
|
|
337
|
-
}, 100);
|
|
338
299
|
}
|
|
339
300
|
catch (e) {
|
|
340
301
|
this.showNotification('Error exporting data', 'error', 5000);
|
|
341
302
|
console.error('Export error:', e);
|
|
303
|
+
}
|
|
304
|
+
finally {
|
|
342
305
|
this.isExporting = false;
|
|
343
306
|
this.cdr.detectChanges();
|
|
344
307
|
}
|
|
345
308
|
}
|
|
346
309
|
/**
|
|
347
|
-
*
|
|
310
|
+
* Load all records for the current view/entity for export
|
|
348
311
|
*/
|
|
349
|
-
async
|
|
312
|
+
async loadExportRows() {
|
|
350
313
|
if (!this.entityInfo) {
|
|
351
314
|
throw new Error('No entity selected for export');
|
|
352
315
|
}
|
|
353
316
|
const rv = new RunView();
|
|
354
|
-
// Build the filter for the export - combine view's WhereClause with any smart filter
|
|
355
317
|
let filter = '';
|
|
356
318
|
if (this.viewEntity?.WhereClause) {
|
|
357
319
|
filter = this.viewEntity.WhereClause;
|
|
@@ -359,14 +321,47 @@ let UserViewResource = class UserViewResource extends BaseResourceComponent {
|
|
|
359
321
|
const result = await rv.RunView({
|
|
360
322
|
EntityName: this.entityInfo.Name,
|
|
361
323
|
ExtraFilter: filter,
|
|
362
|
-
OrderBy: '',
|
|
363
|
-
ResultType: 'simple'
|
|
324
|
+
OrderBy: '',
|
|
325
|
+
ResultType: 'simple'
|
|
364
326
|
});
|
|
365
327
|
if (!result.Success) {
|
|
366
328
|
throw new Error(result.ErrorMessage || 'Failed to load data for export');
|
|
367
329
|
}
|
|
368
330
|
return result.Results || [];
|
|
369
331
|
}
|
|
332
|
+
/**
|
|
333
|
+
* Determine which columns to export based on grid state, view entity, or entity fields
|
|
334
|
+
*/
|
|
335
|
+
buildExportColumns() {
|
|
336
|
+
if (!this.entityInfo)
|
|
337
|
+
return [];
|
|
338
|
+
if (this.gridState?.columnSettings && this.gridState.columnSettings.length > 0) {
|
|
339
|
+
const visibleColumns = this.gridState.columnSettings.filter(col => col.hidden !== true);
|
|
340
|
+
return visibleColumns.map(col => ({
|
|
341
|
+
name: col.Name,
|
|
342
|
+
displayName: col.DisplayName || col.Name
|
|
343
|
+
}));
|
|
344
|
+
}
|
|
345
|
+
if (this.viewEntity?.Columns) {
|
|
346
|
+
const visibleColumns = this.viewEntity.Columns.filter(col => !col.hidden);
|
|
347
|
+
return visibleColumns.map(col => ({
|
|
348
|
+
name: col.Name,
|
|
349
|
+
displayName: col.DisplayName || col.Name
|
|
350
|
+
}));
|
|
351
|
+
}
|
|
352
|
+
const visibleFields = this.entityInfo.Fields.filter(f => !f.IsVirtual);
|
|
353
|
+
return visibleFields.map(f => ({
|
|
354
|
+
name: f.Name,
|
|
355
|
+
displayName: f.DisplayNameOrName
|
|
356
|
+
}));
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Build the export file name based on entity and view
|
|
360
|
+
*/
|
|
361
|
+
buildExportFileName() {
|
|
362
|
+
const viewName = this.viewEntity?.Name || 'Data';
|
|
363
|
+
return `${this.entityInfo.Name}_${viewName}_${new Date().toISOString().split('T')[0]}`;
|
|
364
|
+
}
|
|
370
365
|
/**
|
|
371
366
|
* Show a notification to the user
|
|
372
367
|
*/
|
|
@@ -382,22 +377,21 @@ let UserViewResource = class UserViewResource extends BaseResourceComponent {
|
|
|
382
377
|
}
|
|
383
378
|
});
|
|
384
379
|
}
|
|
385
|
-
static ɵfac = function UserViewResource_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserViewResource)(i0.ɵɵdirectiveInject(i1.NavigationService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
|
|
380
|
+
static ɵfac = function UserViewResource_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || UserViewResource)(i0.ɵɵdirectiveInject(i1.NavigationService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.ExportService)); };
|
|
386
381
|
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: UserViewResource, selectors: [["mj-userview-resource"]], viewQuery: function UserViewResource_Query(rf, ctx) { if (rf & 1) {
|
|
387
|
-
i0.ɵɵviewQuery(_c0, 7)(_c1, 5)
|
|
382
|
+
i0.ɵɵviewQuery(_c0, 7)(_c1, 5);
|
|
388
383
|
} if (rf & 2) {
|
|
389
384
|
let _t;
|
|
390
385
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.containerElement = _t.first);
|
|
391
386
|
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.entityViewerRef = _t.first);
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
i0.ɵɵ
|
|
395
|
-
i0.ɵɵconditionalCreate(2, UserViewResource_Conditional_2_Template, 2, 0, "div", 4)(3, UserViewResource_Conditional_3_Template, 4, 1, "div", 5)(4, UserViewResource_Conditional_4_Template, 21, 12);
|
|
387
|
+
} }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 5, vars: 1, consts: [["container", ""], ["entityViewer", ""], [1, "view-resource-container"], [1, "view-loading-state"], [1, "view-error-state"], ["text", "Loading view...", "size", "large"], [1, "fas", "fa-exclamation-triangle"], [1, "view-header"], [1, "header-left"], [1, "view-title"], [1, "view-description"], [1, "header-right"], [1, "action-button", "create-button", 3, "click", "title"], [1, "fa-solid", "fa-plus"], ["title", "Export to Excel", 1, "action-button", "export-button", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-file-excel"], [3, "recordOpened", "dataLoaded", "entity", "viewEntity", "gridState"]], template: function UserViewResource_Template(rf, ctx) { if (rf & 1) {
|
|
388
|
+
i0.ɵɵelementStart(0, "div", 2, 0);
|
|
389
|
+
i0.ɵɵconditionalCreate(2, UserViewResource_Conditional_2_Template, 2, 0, "div", 3)(3, UserViewResource_Conditional_3_Template, 4, 1, "div", 4)(4, UserViewResource_Conditional_4_Template, 17, 10);
|
|
396
390
|
i0.ɵɵelementEnd();
|
|
397
391
|
} if (rf & 2) {
|
|
398
392
|
i0.ɵɵadvance(2);
|
|
399
393
|
i0.ɵɵconditional(ctx.isLoading ? 2 : ctx.errorMessage ? 3 : ctx.entityInfo ? 4 : -1);
|
|
400
|
-
} }, dependencies: [
|
|
394
|
+
} }, dependencies: [i3.LoadingComponent, i4.EntityViewerComponent], styles: ["[_nghost-%COMP%] {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .view-resource-container[_ngcontent-%COMP%] {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .view-header[_ngcontent-%COMP%] {\n padding: 16px 20px 8px 20px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n }\n .header-left[_ngcontent-%COMP%] {\n flex: 1;\n min-width: 0;\n }\n .header-right[_ngcontent-%COMP%] {\n display: flex;\n gap: 8px;\n flex-shrink: 0;\n }\n .view-title[_ngcontent-%COMP%] {\n margin: 0 0 4px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--text-primary, #1a1a1a);\n }\n .view-description[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 0.875rem;\n color: var(--text-secondary, #666);\n }\n .action-button[_ngcontent-%COMP%] {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n white-space: nowrap;\n }\n .action-button[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n }\n .action-button[_ngcontent-%COMP%]:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .action-button[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 0.875rem;\n }\n .create-button[_ngcontent-%COMP%] {\n background: var(--mj-brand-primary);\n color: white;\n border-color: var(--mj-brand-primary);\n }\n .create-button[_ngcontent-%COMP%]:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n border-color: var(--mj-brand-primary-hover);\n }\n .export-button[_ngcontent-%COMP%]:hover:not(:disabled) {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n }\n .view-loading-state[_ngcontent-%COMP%], \n .view-error-state[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 16px;\n }\n .view-error-state[_ngcontent-%COMP%] {\n color: var(--danger-color, #dc3545);\n }\n .view-error-state[_ngcontent-%COMP%] i[_ngcontent-%COMP%] {\n font-size: 2rem;\n }\n .view-error-state[_ngcontent-%COMP%] p[_ngcontent-%COMP%] {\n margin: 0;\n font-size: 1rem;\n }\n mj-entity-viewer[_ngcontent-%COMP%] {\n flex: 1;\n min-height: 0;\n }"] });
|
|
401
395
|
};
|
|
402
396
|
UserViewResource = __decorate([
|
|
403
397
|
RegisterClass(BaseResourceComponent, 'ViewResource')
|
|
@@ -405,16 +399,13 @@ UserViewResource = __decorate([
|
|
|
405
399
|
export { UserViewResource };
|
|
406
400
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(UserViewResource, [{
|
|
407
401
|
type: Component,
|
|
408
|
-
args: [{ standalone: false, selector: 'mj-userview-resource', template: "<div #container class=\"view-resource-container\">\n @if (isLoading) {\n <div class=\"view-loading-state\">\n <mj-loading text=\"Loading view...\" size=\"large\"></mj-loading>\n </div>\n } @else if (errorMessage) {\n <div class=\"view-error-state\">\n <i class=\"fas fa-exclamation-triangle\"></i>\n <p>{{ errorMessage }}</p>\n </div>\n } @else if (entityInfo) {\n <!-- Header with title and action buttons -->\n <div class=\"view-header\">\n <div class=\"header-left\">\n <h2 class=\"view-title\">{{ viewEntity?.Name || entityInfo.Name }}</h2>\n @if (viewEntity?.Description) {\n <p class=\"view-description\">{{ viewEntity!.Description }}</p>\n }\n </div>\n <div class=\"header-right\">\n <!-- Create New Record Button -->\n <button\n class=\"action-button create-button\"\n (click)=\"onCreateNewRecord()\"\n title=\"Create new {{ entityInfo.Name }} record\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New Record</span>\n </button>\n\n <!-- Export Button -->\n <button\n class=\"action-button export-button\"\n (click)=\"onExport()\"\n [disabled]=\"isExporting\"\n title=\"Export to Excel\">\n @if (isExporting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-file-excel\"></i>\n }\n <span>{{ isExporting ? 'Exporting...' : 'Export' }}</span>\n </button>\n </div>\n </div>\n\n <!-- Entity Viewer -->\n <mj-entity-viewer\n #entityViewer\n [entity]=\"entityInfo\"\n [viewEntity]=\"viewEntity\"\n [gridState]=\"gridState\"\n (recordOpened)=\"onRecordOpened($any($event))\"\n (dataLoaded)=\"onDataLoaded()\">\n </mj-entity-viewer>\n
|
|
409
|
-
}], () => [{ type: i1.NavigationService }, { type: i0.ChangeDetectorRef }], { containerElement: [{
|
|
402
|
+
args: [{ standalone: false, selector: 'mj-userview-resource', template: "<div #container class=\"view-resource-container\">\n @if (isLoading) {\n <div class=\"view-loading-state\">\n <mj-loading text=\"Loading view...\" size=\"large\"></mj-loading>\n </div>\n } @else if (errorMessage) {\n <div class=\"view-error-state\">\n <i class=\"fas fa-exclamation-triangle\"></i>\n <p>{{ errorMessage }}</p>\n </div>\n } @else if (entityInfo) {\n <!-- Header with title and action buttons -->\n <div class=\"view-header\">\n <div class=\"header-left\">\n <h2 class=\"view-title\">{{ viewEntity?.Name || entityInfo.Name }}</h2>\n @if (viewEntity?.Description) {\n <p class=\"view-description\">{{ viewEntity!.Description }}</p>\n }\n </div>\n <div class=\"header-right\">\n <!-- Create New Record Button -->\n <button\n class=\"action-button create-button\"\n (click)=\"onCreateNewRecord()\"\n title=\"Create new {{ entityInfo.Name }} record\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New Record</span>\n </button>\n\n <!-- Export Button -->\n <button\n class=\"action-button export-button\"\n (click)=\"onExport()\"\n [disabled]=\"isExporting\"\n title=\"Export to Excel\">\n @if (isExporting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-file-excel\"></i>\n }\n <span>{{ isExporting ? 'Exporting...' : 'Export' }}</span>\n </button>\n </div>\n </div>\n\n <!-- Entity Viewer -->\n <mj-entity-viewer\n #entityViewer\n [entity]=\"entityInfo\"\n [viewEntity]=\"viewEntity\"\n [gridState]=\"gridState\"\n (recordOpened)=\"onRecordOpened($any($event))\"\n (dataLoaded)=\"onDataLoaded()\">\n </mj-entity-viewer>\n }\n</div>\n", styles: ["\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .view-resource-container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .view-header {\n padding: 16px 20px 8px 20px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n }\n .header-left {\n flex: 1;\n min-width: 0;\n }\n .header-right {\n display: flex;\n gap: 8px;\n flex-shrink: 0;\n }\n .view-title {\n margin: 0 0 4px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--text-primary, #1a1a1a);\n }\n .view-description {\n margin: 0;\n font-size: 0.875rem;\n color: var(--text-secondary, #666);\n }\n .action-button {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n white-space: nowrap;\n }\n .action-button:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n }\n .action-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .action-button i {\n font-size: 0.875rem;\n }\n .create-button {\n background: var(--mj-brand-primary);\n color: white;\n border-color: var(--mj-brand-primary);\n }\n .create-button:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n border-color: var(--mj-brand-primary-hover);\n }\n .export-button:hover:not(:disabled) {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n }\n .view-loading-state,\n .view-error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 16px;\n }\n .view-error-state {\n color: var(--danger-color, #dc3545);\n }\n .view-error-state i {\n font-size: 2rem;\n }\n .view-error-state p {\n margin: 0;\n font-size: 1rem;\n }\n mj-entity-viewer {\n flex: 1;\n min-height: 0;\n }\n "] }]
|
|
403
|
+
}], () => [{ type: i1.NavigationService }, { type: i0.ChangeDetectorRef }, { type: i2.ExportService }], { containerElement: [{
|
|
410
404
|
type: ViewChild,
|
|
411
405
|
args: ['container', { static: true }]
|
|
412
406
|
}], entityViewerRef: [{
|
|
413
407
|
type: ViewChild,
|
|
414
408
|
args: ['entityViewer']
|
|
415
|
-
}], excelExportRef: [{
|
|
416
|
-
type: ViewChild,
|
|
417
|
-
args: ['excelExport']
|
|
418
409
|
}] }); })();
|
|
419
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserViewResource, { className: "UserViewResource", filePath: "src/lib/resource-wrappers/view-resource.component.ts", lineNumber:
|
|
410
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(UserViewResource, { className: "UserViewResource", filePath: "src/lib/resource-wrappers/view-resource.component.ts", lineNumber: 136 }); })();
|
|
420
411
|
//# sourceMappingURL=view-resource.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"view-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/view-resource.component.ts","../../../src/lib/resource-wrappers/view-resource.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO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C;;;ADsEQ,gBAAgB;IAtH5B,aAAa,CAAC,qBAAqB,EAAE,cAAc,CAAC;GAsHxC,gBAAgB,CAyT5B;;iFAzTY,gBAAgB;cArH5B,SAAS;6BACI,KAAK,YACL,sBAAsB;;kBAoH/B,SAAS;mBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kBACvC,SAAS;mBAAC,cAAc;;kBACxB,SAAS;mBAAC,aAAa;;kFAHf,gBAAgB","sourcesContent":["import { Component, ViewChild, ElementRef, ChangeDetectorRef } from '@angular/core';\nimport { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';\nimport { ResourceData, MJUserViewEntityExtended, ViewInfo } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, MJEventType , UUIDsEqual } from '@memberjunction/global';\nimport { CompositeKey, Metadata, EntityInfo, RunView } from '@memberjunction/core';\nimport { RecordOpenedEvent, ViewGridState, EntityViewerComponent } from '@memberjunction/ng-entity-viewer';\nimport { ExcelExportComponent } from '@progress/kendo-angular-excel-export';\n/**\n * UserViewResource - Resource wrapper for displaying User Views in tabs\n *\n * This component wraps the EntityViewerComponent to display view data.\n * It loads the view configuration and entity, then renders the data grid/cards.\n *\n * Key features:\n * - Loads view by ID from ResourceRecordID\n * - Supports dynamic views by entity name + extra filter\n * - Applies view's WhereClause, GridState, and SortState\n * - Opens records in new tabs via NavigationService\n */\n@RegisterClass(BaseResourceComponent, 'ViewResource')\n@Component({\n standalone: false,\n selector: 'mj-userview-resource',\n templateUrl: './view-resource.component.html',\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .view-resource-container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .view-header {\n padding: 16px 20px 8px 20px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n }\n .header-left {\n flex: 1;\n min-width: 0;\n }\n .header-right {\n display: flex;\n gap: 8px;\n flex-shrink: 0;\n }\n .view-title {\n margin: 0 0 4px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--text-primary, #1a1a1a);\n }\n .view-description {\n margin: 0;\n font-size: 0.875rem;\n color: var(--text-secondary, #666);\n }\n .action-button {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n white-space: nowrap;\n }\n .action-button:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n }\n .action-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .action-button i {\n font-size: 0.875rem;\n }\n .create-button {\n background: var(--mj-brand-primary);\n color: white;\n border-color: var(--mj-brand-primary);\n }\n .create-button:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n border-color: var(--mj-brand-primary-hover);\n }\n .export-button:hover:not(:disabled) {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n }\n .view-loading-state,\n .view-error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 16px;\n }\n .view-error-state {\n color: var(--danger-color, #dc3545);\n }\n .view-error-state i {\n font-size: 2rem;\n }\n .view-error-state p {\n margin: 0;\n font-size: 1rem;\n }\n mj-entity-viewer {\n flex: 1;\n min-height: 0;\n }\n kendo-excelexport {\n display: none;\n }\n `]\n})\nexport class UserViewResource extends BaseResourceComponent {\n @ViewChild('container', { static: true }) containerElement!: ElementRef<HTMLDivElement>;\n @ViewChild('entityViewer') entityViewerRef?: EntityViewerComponent;\n @ViewChild('excelExport') excelExportRef?: ExcelExportComponent;\n\n public isLoading: boolean = false;\n public errorMessage: string | null = null;\n public entityInfo: EntityInfo | null = null;\n public viewEntity: MJUserViewEntityExtended | null = null;\n public gridState: ViewGridState | null = null;\n\n // Export state\n public isExporting: boolean = false;\n public exportData: any[] = [];\n public exportColumns: { Name: string; DisplayName: string }[] = [];\n public exportFileName: string = 'export.xlsx';\n\n private dataLoaded = false;\n private metadata = new Metadata();\n\n constructor(\n private navigationService: NavigationService,\n private cdr: ChangeDetectorRef\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n const previousEntity = super.Data?.Configuration?.Entity;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n const newEntity = value?.Configuration?.Entity;\n\n // Load on first set, or when the view/entity has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId || newEntity !== previousEntity) {\n this.dataLoaded = true;\n // Reset state before loading new view\n this.entityInfo = null;\n this.viewEntity = null;\n this.gridState = null;\n this.errorMessage = null;\n this.loadView();\n }\n }\n\n override get Data(): ResourceData {\n return super.Data;\n }\n\n /**\n * Load the view and entity based on ResourceData\n */\n private async loadView(): Promise<void> {\n const data = this.Data;\n\n if (!data) {\n this.NotifyLoadComplete();\n return;\n }\n\n this.isLoading = true;\n this.errorMessage = null;\n this.NotifyLoadStarted();\n this.cdr.detectChanges();\n\n try {\n // Case 1: Load view by ID\n if (data.ResourceRecordID) {\n await this.loadViewById(data.ResourceRecordID);\n }\n // Case 2: Load dynamic view by entity name\n else if (data.Configuration?.Entity) {\n await this.loadDynamicView(\n data.Configuration.Entity as string,\n data.Configuration.ExtraFilter as string | undefined\n );\n }\n else {\n this.errorMessage = 'No view ID or entity specified';\n }\n } catch (error) {\n console.error('Error loading view:', error);\n this.errorMessage = error instanceof Error ? error.message : 'Failed to load view';\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // If there was an error, notify load complete now\n if (this.errorMessage) {\n this.NotifyLoadComplete();\n }\n // Otherwise, wait for dataLoaded event from entity-viewer\n }\n }\n\n /**\n * Load a saved view by its ID\n */\n private async loadViewById(viewId: string): Promise<void> {\n // Load the view entity\n const view = await ViewInfo.GetViewEntity(viewId);\n\n if (!view) {\n throw new Error(`View with ID ${viewId} not found`);\n }\n\n this.viewEntity = view as MJUserViewEntityExtended;\n\n // Check permissions\n if (!this.viewEntity.UserCanView) {\n throw new Error('You do not have permission to view this view');\n }\n\n // Load the entity info\n const entity = this.metadata.Entities.find(e => UUIDsEqual(e.ID, this.viewEntity!.EntityID));\n\n if (!entity) {\n throw new Error(`Entity for view not found`);\n }\n\n this.entityInfo = entity;\n\n // Parse grid state if available\n if (this.viewEntity.GridState) {\n try {\n this.gridState = JSON.parse(this.viewEntity.GridState) as ViewGridState;\n } catch (e) {\n console.warn('Failed to parse GridState:', e);\n this.gridState = null;\n }\n }\n }\n\n /**\n * Load a dynamic view (no saved view, just entity + filter)\n */\n private async loadDynamicView(entityName: string, _extraFilter?: string): Promise<void> {\n const entity = this.metadata.Entities.find(\n e => e.Name.trim().toLowerCase() === entityName.trim().toLowerCase()\n );\n\n if (!entity) {\n throw new Error(`Entity '${entityName}' not found`);\n }\n\n this.entityInfo = entity;\n this.viewEntity = null;\n this.gridState = null;\n\n // For dynamic views, we could create a synthetic viewEntity with just the WhereClause\n // but for now, we'll rely on the entity-viewer's default behavior\n }\n\n /**\n * Handle record opened event - open in new tab\n */\n public onRecordOpened(event: RecordOpenedEvent): void {\n if (event && event.entity && event.compositeKey) {\n this.navigationService.OpenEntityRecord(event.entity.Name, event.compositeKey);\n }\n }\n\n /**\n * Handle data loaded event from entity-viewer\n */\n public onDataLoaded(): void {\n this.NotifyLoadComplete();\n }\n\n /**\n * Get display name for the resource tab\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n if (data.ResourceRecordID) {\n const compositeKey = new CompositeKey([{ FieldName: 'ID', Value: data.ResourceRecordID }]);\n const name = await this.metadata.GetEntityRecordName('MJ: User Views', compositeKey);\n return name ? name : `View: ${data.ResourceRecordID}`;\n }\n else if (data.Configuration?.Entity) {\n const entityName = data.Configuration.Entity as string;\n const hasFilter = data.Configuration.ExtraFilter;\n return `${entityName} [Dynamic${hasFilter ? ' - Filtered' : ' - All'}]`;\n }\n return 'User Views [Error]';\n }\n\n /**\n * Get icon class for the resource tab\n */\n override async GetResourceIconClass(_data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-list';\n }\n\n /**\n * Handle creating a new record for the current entity\n */\n public onCreateNewRecord(): void {\n if (!this.entityInfo) return;\n\n // Use NavigationService to open a new record form\n this.navigationService.OpenNewEntityRecord(this.entityInfo.Name);\n }\n\n /**\n * Handle export to Excel request\n */\n public async onExport(): Promise<void> {\n if (!this.excelExportRef || !this.entityInfo) {\n console.error('Cannot export: Excel export component or entity not available');\n return;\n }\n\n this.isExporting = true;\n this.cdr.detectChanges();\n\n try {\n this.showNotification('Working on the export, will notify you when it is complete...', 'info', 2000);\n\n const data = await this.getExportData();\n\n // Determine which columns to export based on grid state or view entity\n if (this.gridState?.columnSettings && this.gridState.columnSettings.length > 0) {\n // Use grid state - only export visible columns in grid order\n const visibleColumns = this.gridState.columnSettings.filter(col => col.hidden !== true);\n this.exportColumns = visibleColumns.map(col => ({\n Name: col.Name,\n DisplayName: col.DisplayName || col.Name\n }));\n } else if (this.viewEntity?.Columns) {\n // Use view's column configuration - only export visible columns in view order\n const visibleColumns = this.viewEntity.Columns.filter(col => !col.hidden);\n this.exportColumns = visibleColumns.map(col => ({\n Name: col.Name,\n DisplayName: col.DisplayName || col.Name\n }));\n } else {\n // Fall back to all non-virtual fields\n const visibleFields = this.entityInfo.Fields.filter(f => !f.IsVirtual);\n this.exportColumns = visibleFields.map(f => ({\n Name: f.Name,\n DisplayName: f.DisplayNameOrName\n }));\n }\n\n this.exportData = data;\n\n // Set the export filename\n const viewName = this.viewEntity?.Name || 'Data';\n this.exportFileName = `${this.entityInfo.Name}_${viewName}_${new Date().toISOString().split('T')[0]}.xlsx`;\n\n // Wait for Angular to update the DOM with the new data before triggering save\n setTimeout(() => {\n this.excelExportRef!.save();\n this.showNotification('Excel Export Complete', 'success', 2000);\n this.isExporting = false;\n this.cdr.detectChanges();\n }, 100);\n }\n catch (e) {\n this.showNotification('Error exporting data', 'error', 5000);\n console.error('Export error:', e);\n this.isExporting = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Get the data for export - loads all records for the current view/entity\n */\n private async getExportData(): Promise<any[]> {\n if (!this.entityInfo) {\n throw new Error('No entity selected for export');\n }\n\n const rv = new RunView();\n\n // Build the filter for the export - combine view's WhereClause with any smart filter\n let filter = '';\n if (this.viewEntity?.WhereClause) {\n filter = this.viewEntity.WhereClause;\n }\n\n const result = await rv.RunView({\n EntityName: this.entityInfo.Name,\n ExtraFilter: filter,\n OrderBy: '', // Let view handle sorting\n ResultType: 'simple' // Get plain objects for export\n });\n\n if (!result.Success) {\n throw new Error(result.ErrorMessage || 'Failed to load data for export');\n }\n\n return result.Results || [];\n }\n\n /**\n * Show a notification to the user\n */\n private showNotification(message: string, style: 'info' | 'success' | 'error' | 'warning', duration: number): void {\n MJGlobal.Instance.RaiseEvent({\n component: this,\n event: MJEventType.DisplaySimpleNotificationRequest,\n eventCode: '',\n args: {\n message,\n style,\n DisplayDuration: duration\n }\n });\n }\n}\n","<div #container class=\"view-resource-container\">\n @if (isLoading) {\n <div class=\"view-loading-state\">\n <mj-loading text=\"Loading view...\" size=\"large\"></mj-loading>\n </div>\n } @else if (errorMessage) {\n <div class=\"view-error-state\">\n <i class=\"fas fa-exclamation-triangle\"></i>\n <p>{{ errorMessage }}</p>\n </div>\n } @else if (entityInfo) {\n <!-- Header with title and action buttons -->\n <div class=\"view-header\">\n <div class=\"header-left\">\n <h2 class=\"view-title\">{{ viewEntity?.Name || entityInfo.Name }}</h2>\n @if (viewEntity?.Description) {\n <p class=\"view-description\">{{ viewEntity!.Description }}</p>\n }\n </div>\n <div class=\"header-right\">\n <!-- Create New Record Button -->\n <button\n class=\"action-button create-button\"\n (click)=\"onCreateNewRecord()\"\n title=\"Create new {{ entityInfo.Name }} record\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New Record</span>\n </button>\n\n <!-- Export Button -->\n <button\n class=\"action-button export-button\"\n (click)=\"onExport()\"\n [disabled]=\"isExporting\"\n title=\"Export to Excel\">\n @if (isExporting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-file-excel\"></i>\n }\n <span>{{ isExporting ? 'Exporting...' : 'Export' }}</span>\n </button>\n </div>\n </div>\n\n <!-- Entity Viewer -->\n <mj-entity-viewer\n #entityViewer\n [entity]=\"entityInfo\"\n [viewEntity]=\"viewEntity\"\n [gridState]=\"gridState\"\n (recordOpened)=\"onRecordOpened($any($event))\"\n (dataLoaded)=\"onDataLoaded()\">\n </mj-entity-viewer>\n\n <!-- Hidden Excel Export Component -->\n <kendo-excelexport\n #excelExport\n [data]=\"exportData\"\n [fileName]=\"exportFileName\">\n @for (column of exportColumns; track column.Name) {\n <kendo-excelexport-column\n [field]=\"column.Name\"\n [title]=\"column.DisplayName\">\n </kendo-excelexport-column>\n }\n </kendo-excelexport>\n }\n</div>\n"]}
|
|
1
|
+
{"version":3,"file":"view-resource.component.js","sourceRoot":"","sources":["../../../src/lib/resource-wrappers/view-resource.component.ts","../../../src/lib/resource-wrappers/view-resource.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAiC,MAAM,eAAe,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAqB,MAAM,2BAA2B,CAAC;AACrF,OAAO,EAA0C,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,WAAW,EAAG,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAc,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;;;;;;ICF3E,8BAAgC;IAC5B,gCAA6D;IACjE,iBAAM;;;IAEN,8BAA8B;IAC1B,uBAA2C;IAC3C,yBAAG;IAAA,YAAkB;IACzB,AADyB,i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IAAI,CAAC,UAAU,EAAE,IAAI,IAAI,MAAM,CAAC;QACjD,OAAO,GAAG,IAAI,CAAC,UAAW,CAAC,IAAI,IAAI,QAAQ,IAAI,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,CAAC;IAED;;OAEG;IACK,gBAAgB,CAAC,OAAe,EAAE,KAA+C,EAAE,QAAgB;QACvG,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC;YACzB,SAAS,EAAE,IAAI;YACf,KAAK,EAAE,WAAW,CAAC,gCAAgC;YACnD,SAAS,EAAE,EAAE;YACb,IAAI,EAAE;gBACF,OAAO;gBACP,KAAK;gBACL,eAAe,EAAE,QAAQ;aAC5B;SACJ,CAAC,CAAC;IACP,CAAC;0GAnUQ,gBAAgB;6DAAhB,gBAAgB;;;;;;;YCvI7B,iCAAgD;YAU1C,AALA,AAJF,kFAAiB,4DAIU,oDAKF;YA6C7B,iBAAM;;YAtDF,eAqDC;YArDD,oFAqDC;;;ADiFQ,gBAAgB;IAnH5B,aAAa,CAAC,qBAAqB,EAAE,cAAc,CAAC;GAmHxC,gBAAgB,CAoU5B;;iFApUY,gBAAgB;cAlH5B,SAAS;6BACI,KAAK,YACL,sBAAsB;;kBAiH/B,SAAS;mBAAC,WAAW,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE;;kBACvC,SAAS;mBAAC,cAAc;;kFAFhB,gBAAgB","sourcesContent":["import { Component, ViewChild, ElementRef, ChangeDetectorRef } from '@angular/core';\nimport { BaseResourceComponent, NavigationService } from '@memberjunction/ng-shared';\nimport { ResourceData, MJUserViewEntityExtended, ViewInfo } from '@memberjunction/core-entities';\nimport { RegisterClass, MJGlobal, MJEventType , UUIDsEqual } from '@memberjunction/global';\nimport { CompositeKey, Metadata, EntityInfo, RunView } from '@memberjunction/core';\nimport { RecordOpenedEvent, ViewGridState, EntityViewerComponent } from '@memberjunction/ng-entity-viewer';\nimport { ExportService } from '@memberjunction/ng-export-service';\nimport { ExportColumn } from '@memberjunction/export-engine';\n/**\n * UserViewResource - Resource wrapper for displaying User Views in tabs\n *\n * This component wraps the EntityViewerComponent to display view data.\n * It loads the view configuration and entity, then renders the data grid/cards.\n *\n * Key features:\n * - Loads view by ID from ResourceRecordID\n * - Supports dynamic views by entity name + extra filter\n * - Applies view's WhereClause, GridState, and SortState\n * - Opens records in new tabs via NavigationService\n */\n@RegisterClass(BaseResourceComponent, 'ViewResource')\n@Component({\n standalone: false,\n selector: 'mj-userview-resource',\n templateUrl: './view-resource.component.html',\n styles: [`\n :host {\n display: block;\n width: 100%;\n height: 100%;\n position: relative;\n overflow: hidden;\n }\n .view-resource-container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: flex;\n flex-direction: column;\n overflow: hidden;\n }\n .view-header {\n padding: 16px 20px 8px 20px;\n flex-shrink: 0;\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 16px;\n }\n .header-left {\n flex: 1;\n min-width: 0;\n }\n .header-right {\n display: flex;\n gap: 8px;\n flex-shrink: 0;\n }\n .view-title {\n margin: 0 0 4px 0;\n font-size: 1.25rem;\n font-weight: 600;\n color: var(--text-primary, #1a1a1a);\n }\n .view-description {\n margin: 0;\n font-size: 0.875rem;\n color: var(--text-secondary, #666);\n }\n .action-button {\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 8px 16px;\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n background: var(--mj-bg-surface-card);\n color: var(--mj-text-primary);\n font-size: 0.875rem;\n font-weight: 500;\n cursor: pointer;\n transition: all 0.15s ease;\n white-space: nowrap;\n }\n .action-button:hover:not(:disabled) {\n background: var(--mj-bg-surface-sunken);\n border-color: var(--mj-border-default);\n }\n .action-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n .action-button i {\n font-size: 0.875rem;\n }\n .create-button {\n background: var(--mj-brand-primary);\n color: white;\n border-color: var(--mj-brand-primary);\n }\n .create-button:hover:not(:disabled) {\n background: var(--mj-brand-primary-hover);\n border-color: var(--mj-brand-primary-hover);\n }\n .export-button:hover:not(:disabled) {\n color: var(--mj-brand-primary);\n border-color: var(--mj-brand-primary);\n }\n .view-loading-state,\n .view-error-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n height: 100%;\n gap: 16px;\n }\n .view-error-state {\n color: var(--danger-color, #dc3545);\n }\n .view-error-state i {\n font-size: 2rem;\n }\n .view-error-state p {\n margin: 0;\n font-size: 1rem;\n }\n mj-entity-viewer {\n flex: 1;\n min-height: 0;\n }\n `]\n})\nexport class UserViewResource extends BaseResourceComponent {\n @ViewChild('container', { static: true }) containerElement!: ElementRef<HTMLDivElement>;\n @ViewChild('entityViewer') entityViewerRef?: EntityViewerComponent;\n\n public isLoading: boolean = false;\n public errorMessage: string | null = null;\n public entityInfo: EntityInfo | null = null;\n public viewEntity: MJUserViewEntityExtended | null = null;\n public gridState: ViewGridState | null = null;\n\n // Export state\n public isExporting: boolean = false;\n\n private dataLoaded = false;\n private metadata = new Metadata();\n\n constructor(\n private navigationService: NavigationService,\n private cdr: ChangeDetectorRef,\n private exportService: ExportService\n ) {\n super();\n }\n\n override set Data(value: ResourceData) {\n const previousRecordId = super.Data?.ResourceRecordID;\n const previousEntity = super.Data?.Configuration?.Entity;\n super.Data = value;\n\n const newRecordId = value?.ResourceRecordID;\n const newEntity = value?.Configuration?.Entity;\n\n // Load on first set, or when the view/entity has changed\n if (!this.dataLoaded || newRecordId !== previousRecordId || newEntity !== previousEntity) {\n this.dataLoaded = true;\n // Reset state before loading new view\n this.entityInfo = null;\n this.viewEntity = null;\n this.gridState = null;\n this.errorMessage = null;\n this.loadView();\n }\n }\n\n override get Data(): ResourceData {\n return super.Data;\n }\n\n /**\n * Load the view and entity based on ResourceData\n */\n private async loadView(): Promise<void> {\n const data = this.Data;\n\n if (!data) {\n this.NotifyLoadComplete();\n return;\n }\n\n this.isLoading = true;\n this.errorMessage = null;\n this.NotifyLoadStarted();\n this.cdr.detectChanges();\n\n try {\n // Case 1: Load view by ID\n if (data.ResourceRecordID) {\n await this.loadViewById(data.ResourceRecordID);\n }\n // Case 2: Load dynamic view by entity name\n else if (data.Configuration?.Entity) {\n await this.loadDynamicView(\n data.Configuration.Entity as string,\n data.Configuration.ExtraFilter as string | undefined\n );\n }\n else {\n this.errorMessage = 'No view ID or entity specified';\n }\n } catch (error) {\n console.error('Error loading view:', error);\n this.errorMessage = error instanceof Error ? error.message : 'Failed to load view';\n } finally {\n this.isLoading = false;\n this.cdr.detectChanges();\n\n // If there was an error, notify load complete now\n if (this.errorMessage) {\n this.NotifyLoadComplete();\n }\n // Otherwise, wait for dataLoaded event from entity-viewer\n }\n }\n\n /**\n * Load a saved view by its ID\n */\n private async loadViewById(viewId: string): Promise<void> {\n // Load the view entity\n const view = await ViewInfo.GetViewEntity(viewId);\n\n if (!view) {\n throw new Error(`View with ID ${viewId} not found`);\n }\n\n this.viewEntity = view as MJUserViewEntityExtended;\n\n // Check permissions\n if (!this.viewEntity.UserCanView) {\n throw new Error('You do not have permission to view this view');\n }\n\n // Load the entity info\n const entity = this.metadata.Entities.find(e => UUIDsEqual(e.ID, this.viewEntity!.EntityID));\n\n if (!entity) {\n throw new Error(`Entity for view not found`);\n }\n\n this.entityInfo = entity;\n\n // Parse grid state if available\n if (this.viewEntity.GridState) {\n try {\n this.gridState = JSON.parse(this.viewEntity.GridState) as ViewGridState;\n } catch (e) {\n console.warn('Failed to parse GridState:', e);\n this.gridState = null;\n }\n }\n }\n\n /**\n * Load a dynamic view (no saved view, just entity + filter)\n */\n private async loadDynamicView(entityName: string, _extraFilter?: string): Promise<void> {\n const entity = this.metadata.Entities.find(\n e => e.Name.trim().toLowerCase() === entityName.trim().toLowerCase()\n );\n\n if (!entity) {\n throw new Error(`Entity '${entityName}' not found`);\n }\n\n this.entityInfo = entity;\n this.viewEntity = null;\n this.gridState = null;\n\n // For dynamic views, we could create a synthetic viewEntity with just the WhereClause\n // but for now, we'll rely on the entity-viewer's default behavior\n }\n\n /**\n * Handle record opened event - open in new tab\n */\n public onRecordOpened(event: RecordOpenedEvent): void {\n if (event && event.entity && event.compositeKey) {\n this.navigationService.OpenEntityRecord(event.entity.Name, event.compositeKey);\n }\n }\n\n /**\n * Handle data loaded event from entity-viewer\n */\n public onDataLoaded(): void {\n this.NotifyLoadComplete();\n }\n\n /**\n * Get display name for the resource tab\n */\n override async GetResourceDisplayName(data: ResourceData): Promise<string> {\n if (data.ResourceRecordID) {\n const compositeKey = new CompositeKey([{ FieldName: 'ID', Value: data.ResourceRecordID }]);\n const name = await this.metadata.GetEntityRecordName('MJ: User Views', compositeKey);\n return name ? name : `View: ${data.ResourceRecordID}`;\n }\n else if (data.Configuration?.Entity) {\n const entityName = data.Configuration.Entity as string;\n const hasFilter = data.Configuration.ExtraFilter;\n return `${entityName} [Dynamic${hasFilter ? ' - Filtered' : ' - All'}]`;\n }\n return 'User Views [Error]';\n }\n\n /**\n * Get icon class for the resource tab\n */\n override async GetResourceIconClass(_data: ResourceData): Promise<string> {\n return 'fa-solid fa-table-list';\n }\n\n /**\n * Handle creating a new record for the current entity\n */\n public onCreateNewRecord(): void {\n if (!this.entityInfo) return;\n\n // Use NavigationService to open a new record form\n this.navigationService.OpenNewEntityRecord(this.entityInfo.Name);\n }\n\n /**\n * Handle export to Excel request\n */\n public async onExport(): Promise<void> {\n if (!this.entityInfo) {\n console.error('Cannot export: entity not available');\n return;\n }\n\n this.isExporting = true;\n this.cdr.detectChanges();\n\n try {\n this.showNotification('Working on the export, will notify you when it is complete...', 'info', 2000);\n\n const rows = await this.loadExportRows();\n const columns = this.buildExportColumns();\n const fileName = this.buildExportFileName();\n\n const result = await this.exportService.toExcel(rows, {\n fileName,\n columns,\n includeHeaders: true\n });\n\n if (result.success) {\n this.exportService.downloadResult(result);\n this.showNotification('Excel Export Complete', 'success', 2000);\n } else {\n this.showNotification('Export failed', 'error', 5000);\n }\n }\n catch (e) {\n this.showNotification('Error exporting data', 'error', 5000);\n console.error('Export error:', e);\n }\n finally {\n this.isExporting = false;\n this.cdr.detectChanges();\n }\n }\n\n /**\n * Load all records for the current view/entity for export\n */\n private async loadExportRows(): Promise<Record<string, unknown>[]> {\n if (!this.entityInfo) {\n throw new Error('No entity selected for export');\n }\n\n const rv = new RunView();\n let filter = '';\n if (this.viewEntity?.WhereClause) {\n filter = this.viewEntity.WhereClause;\n }\n\n const result = await rv.RunView<Record<string, unknown>>({\n EntityName: this.entityInfo.Name,\n ExtraFilter: filter,\n OrderBy: '',\n ResultType: 'simple'\n });\n\n if (!result.Success) {\n throw new Error(result.ErrorMessage || 'Failed to load data for export');\n }\n\n return result.Results || [];\n }\n\n /**\n * Determine which columns to export based on grid state, view entity, or entity fields\n */\n private buildExportColumns(): ExportColumn[] {\n if (!this.entityInfo) return [];\n\n if (this.gridState?.columnSettings && this.gridState.columnSettings.length > 0) {\n const visibleColumns = this.gridState.columnSettings.filter(col => col.hidden !== true);\n return visibleColumns.map(col => ({\n name: col.Name,\n displayName: col.DisplayName || col.Name\n }));\n }\n\n if (this.viewEntity?.Columns) {\n const visibleColumns = this.viewEntity.Columns.filter(col => !col.hidden);\n return visibleColumns.map(col => ({\n name: col.Name,\n displayName: col.DisplayName || col.Name\n }));\n }\n\n const visibleFields = this.entityInfo.Fields.filter(f => !f.IsVirtual);\n return visibleFields.map(f => ({\n name: f.Name,\n displayName: f.DisplayNameOrName\n }));\n }\n\n /**\n * Build the export file name based on entity and view\n */\n private buildExportFileName(): string {\n const viewName = this.viewEntity?.Name || 'Data';\n return `${this.entityInfo!.Name}_${viewName}_${new Date().toISOString().split('T')[0]}`;\n }\n\n /**\n * Show a notification to the user\n */\n private showNotification(message: string, style: 'info' | 'success' | 'error' | 'warning', duration: number): void {\n MJGlobal.Instance.RaiseEvent({\n component: this,\n event: MJEventType.DisplaySimpleNotificationRequest,\n eventCode: '',\n args: {\n message,\n style,\n DisplayDuration: duration\n }\n });\n }\n}\n","<div #container class=\"view-resource-container\">\n @if (isLoading) {\n <div class=\"view-loading-state\">\n <mj-loading text=\"Loading view...\" size=\"large\"></mj-loading>\n </div>\n } @else if (errorMessage) {\n <div class=\"view-error-state\">\n <i class=\"fas fa-exclamation-triangle\"></i>\n <p>{{ errorMessage }}</p>\n </div>\n } @else if (entityInfo) {\n <!-- Header with title and action buttons -->\n <div class=\"view-header\">\n <div class=\"header-left\">\n <h2 class=\"view-title\">{{ viewEntity?.Name || entityInfo.Name }}</h2>\n @if (viewEntity?.Description) {\n <p class=\"view-description\">{{ viewEntity!.Description }}</p>\n }\n </div>\n <div class=\"header-right\">\n <!-- Create New Record Button -->\n <button\n class=\"action-button create-button\"\n (click)=\"onCreateNewRecord()\"\n title=\"Create new {{ entityInfo.Name }} record\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New Record</span>\n </button>\n\n <!-- Export Button -->\n <button\n class=\"action-button export-button\"\n (click)=\"onExport()\"\n [disabled]=\"isExporting\"\n title=\"Export to Excel\">\n @if (isExporting) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n } @else {\n <i class=\"fa-solid fa-file-excel\"></i>\n }\n <span>{{ isExporting ? 'Exporting...' : 'Export' }}</span>\n </button>\n </div>\n </div>\n\n <!-- Entity Viewer -->\n <mj-entity-viewer\n #entityViewer\n [entity]=\"entityInfo\"\n [viewEntity]=\"viewEntity\"\n [gridState]=\"gridState\"\n (recordOpened)=\"onRecordOpened($any($event))\"\n (dataLoaded)=\"onDataLoaded()\">\n </mj-entity-viewer>\n }\n</div>\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startup-validation.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/startup-validation.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;;AAEtE;;GAEG;AACH,qBAGa,wBAAwB;IACvB,OAAO,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,uBAAuB;IAE9D;;OAEG;IACI,mBAAmB,IAAI,IAAI;IAKlC;;;OAGG;IACI,yBAAyB,IAAI,IAAI;IAUxC;;OAEG;IACH,OAAO,CAAC,iBAAiB;yCA5Bd,wBAAwB;6CAAxB,wBAAwB;
|
|
1
|
+
{"version":3,"file":"startup-validation.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/startup-validation.service.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;;AAEtE;;GAEG;AACH,qBAGa,wBAAwB;IACvB,OAAO,CAAC,iBAAiB;gBAAjB,iBAAiB,EAAE,uBAAuB;IAE9D;;OAEG;IACI,mBAAmB,IAAI,IAAI;IAKlC;;;OAGG;IACI,yBAAyB,IAAI,IAAI;IAUxC;;OAEG;IACH,OAAO,CAAC,iBAAiB;yCA5Bd,wBAAwB;6CAAxB,wBAAwB;CAkEpC"}
|