@memberjunction/ng-explorer-core 1.0.6 → 1.0.7

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.
Files changed (75) hide show
  1. package/dist/lib/app-view/application-view.component.js +3 -3
  2. package/dist/lib/auth-button/auth-button.component.js +2 -2
  3. package/dist/lib/dashboard-browser-component/dashboard-browser.component.js +3 -3
  4. package/dist/lib/data-browser-component/data-browser.component.js +3 -3
  5. package/dist/lib/expansion-panel-component/expansion-panel-component.js +3 -3
  6. package/dist/lib/favorites/favorites.component.js +3 -3
  7. package/dist/lib/files/files.component.js +3 -3
  8. package/dist/lib/generic/form-toolbar.js +10 -10
  9. package/dist/lib/generic/resource-container-component.js +1 -1
  10. package/dist/lib/generic/section-loader-component.js +1 -1
  11. package/dist/lib/generic-browse-list/generic-browse-list.component.js +3 -3
  12. package/dist/lib/generic-browser-list/generic-browser-list.component.js +4 -4
  13. package/dist/lib/header/header.component.js +3 -3
  14. package/dist/lib/home-component/home.component.js +3 -3
  15. package/dist/lib/join-grid/join-grid.component.js +2 -2
  16. package/dist/lib/navigation/navigation.component.js +3 -3
  17. package/dist/lib/query-browser-component/query-browser.component.js +3 -3
  18. package/dist/lib/report-browser-component/report-browser.component.js +3 -3
  19. package/dist/lib/resource-wrappers/dashboard-resource.component.js +1 -1
  20. package/dist/lib/resource-wrappers/query-resource.component.js +1 -1
  21. package/dist/lib/resource-wrappers/record-resource.component.js +1 -1
  22. package/dist/lib/resource-wrappers/report-resource.component.js +1 -1
  23. package/dist/lib/resource-wrappers/search-results-resource.component.js +1 -1
  24. package/dist/lib/resource-wrappers/view-resource.component.js +6 -6
  25. package/dist/lib/single-application/single-application.component.js +3 -3
  26. package/dist/lib/single-dashboard/Components/add-item/add-item.component.js +3 -3
  27. package/dist/lib/single-dashboard/Components/delete-item/delete-item.component.js +3 -3
  28. package/dist/lib/single-dashboard/Components/edit-dashboard/edit-dashboard.component.js +3 -3
  29. package/dist/lib/single-dashboard/single-dashboard.component.js +3 -3
  30. package/dist/lib/single-entity/single-entity.component.js +3 -3
  31. package/dist/lib/single-query/single-query.component.js +1 -1
  32. package/dist/lib/single-record/single-record.component.js +2 -2
  33. package/dist/lib/single-report/single-report.component.js +2 -2
  34. package/dist/lib/single-search-result/single-search-result.component.js +2 -2
  35. package/dist/lib/single-view/single-view.component.js +3 -3
  36. package/dist/lib/user-notifications/user-notifications.component.js +3 -3
  37. package/dist/lib/user-profile/user-profile.component.js +2 -2
  38. package/package.json +59 -59
  39. package/dist/lib/ask-skip/ask-skip.component.d.ts +0 -87
  40. package/dist/lib/ask-skip/ask-skip.component.js +0 -626
  41. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.d.ts +0 -12
  42. package/dist/lib/ask-skip/skip-dynamic-report-wrapper.js +0 -50
  43. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts +0 -14
  44. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.d.ts.map +0 -1
  45. package/dist/lib/expansion-panel-component/components/expansion-panel-item-component.js +0 -33
  46. package/dist/lib/generic/base-form-component.d.ts +0 -77
  47. package/dist/lib/generic/base-form-component.d.ts.map +0 -1
  48. package/dist/lib/generic/base-form-component.js +0 -436
  49. package/dist/lib/generic/base-form-section-component.d.ts +0 -7
  50. package/dist/lib/generic/base-form-section-component.d.ts.map +0 -1
  51. package/dist/lib/generic/base-form-section-component.js +0 -9
  52. package/dist/lib/generic/base-record-component.d.ts +0 -7
  53. package/dist/lib/generic/base-record-component.d.ts.map +0 -1
  54. package/dist/lib/generic/base-record-component.js +0 -15
  55. package/dist/lib/generic/base-resource-component.d.ts +0 -34
  56. package/dist/lib/generic/base-resource-component.js +0 -75
  57. package/dist/lib/generic/dynamic-chart.d.ts +0 -33
  58. package/dist/lib/generic/dynamic-chart.js +0 -252
  59. package/dist/lib/generic/dynamic-grid.d.ts +0 -25
  60. package/dist/lib/generic/dynamic-grid.js +0 -142
  61. package/dist/lib/generic/dynamic-report.d.ts +0 -38
  62. package/dist/lib/generic/dynamic-report.js +0 -405
  63. package/dist/lib/generic-browser-list/components/resource/resource.d.ts +0 -1
  64. package/dist/lib/generic-browser-list/components/resource/resource.d.ts.map +0 -1
  65. package/dist/lib/generic-browser-list/components/resource/resource.js +0 -1
  66. package/dist/lib/settings/settings.component.d.ts +0 -8
  67. package/dist/lib/settings/settings.component.d.ts.map +0 -1
  68. package/dist/lib/settings/settings.component.js +0 -64
  69. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts +0 -72
  70. package/dist/lib/user-view-properties/view-properties-dialog.component.d.ts.map +0 -1
  71. package/dist/lib/user-view-properties/view-properties-dialog.component.js +0 -605
  72. package/dist/shared/shared.service.d.ts +0 -94
  73. package/dist/shared/shared.service.js +0 -324
  74. package/dist/shared/urlPipe.d.ts +0 -7
  75. package/dist/shared/urlPipe.js +0 -16
@@ -1,12 +0,0 @@
1
- import { DynamicReportComponent } from '../generic/dynamic-report';
2
- import { SkipData } from './ask-skip.component';
3
- import * as i0 from "@angular/core";
4
- export declare class SkipDynamicReportComponent {
5
- theReport: DynamicReportComponent;
6
- SkipData: SkipData | undefined;
7
- ConversationID: number | null;
8
- ConversationName: string | null;
9
- ConversationDetailID: number | null;
10
- static ɵfac: i0.ɵɵFactoryDeclaration<SkipDynamicReportComponent, never>;
11
- static ɵcmp: i0.ɵɵComponentDeclaration<SkipDynamicReportComponent, "app-skip-dynamic-report", never, { "SkipData": { "alias": "SkipData"; "required": false; }; "ConversationID": { "alias": "ConversationID"; "required": false; }; "ConversationName": { "alias": "ConversationName"; "required": false; }; "ConversationDetailID": { "alias": "ConversationDetailID"; "required": false; }; }, {}, never, never, false, never>;
12
- }
@@ -1,50 +0,0 @@
1
- import { Component, Input, ViewChild } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- const _c0 = ["theReport"];
4
- export class SkipDynamicReportComponent {
5
- constructor() {
6
- this.ConversationID = null;
7
- this.ConversationName = null;
8
- this.ConversationDetailID = null;
9
- }
10
- }
11
- SkipDynamicReportComponent.ɵfac = function SkipDynamicReportComponent_Factory(t) { return new (t || SkipDynamicReportComponent)(); };
12
- SkipDynamicReportComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: SkipDynamicReportComponent, selectors: [["app-skip-dynamic-report"]], viewQuery: function SkipDynamicReportComponent_Query(rf, ctx) { if (rf & 1) {
13
- i0.ɵɵviewQuery(_c0, 5);
14
- } if (rf & 2) {
15
- let _t;
16
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.theReport = _t.first);
17
- } }, inputs: { SkipData: "SkipData", ConversationID: "ConversationID", ConversationName: "ConversationName", ConversationDetailID: "ConversationDetailID" }, decls: 3, vars: 5, consts: [[1, "skip-dynamic-report-container"], [3, "SkipData", "ConversationID", "ConversationName", "ConversationDetailID", "ShowCreateReportButton"], ["theReport", ""]], template: function SkipDynamicReportComponent_Template(rf, ctx) { if (rf & 1) {
18
- i0.ɵɵelementStart(0, "div", 0);
19
- i0.ɵɵelement(1, "app-dynamic-report", 1, 2);
20
- i0.ɵɵelementEnd();
21
- } if (rf & 2) {
22
- i0.ɵɵadvance();
23
- i0.ɵɵproperty("SkipData", ctx.SkipData)("ConversationID", ctx.ConversationID)("ConversationName", ctx.ConversationName)("ConversationDetailID", ctx.ConversationDetailID)("ShowCreateReportButton", true);
24
- } }, styles: [".report-tab-title[_ngcontent-%COMP%] { margin-left: 10px;}", ".skip-dynamic-report-container[_ngcontent-%COMP%] {\n display: block;\n height: 450px;\n width: 90%;\n margin-right: 20px;\n }"] });
25
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SkipDynamicReportComponent, [{
26
- type: Component,
27
- args: [{ selector: 'app-skip-dynamic-report', template: `
28
- <div class='skip-dynamic-report-container'>
29
- <app-dynamic-report #theReport
30
- [SkipData]="SkipData"
31
- [ConversationID]="ConversationID"
32
- [ConversationName]="ConversationName"
33
- [ConversationDetailID]="ConversationDetailID"
34
- [ShowCreateReportButton]="true"
35
- ></app-dynamic-report>
36
- </div>
37
- `, styles: [".report-tab-title { margin-left: 10px;}", ".skip-dynamic-report-container {\n display: block;\n height: 450px;\n width: 90%;\n margin-right: 20px;\n }"] }]
38
- }], null, { theReport: [{
39
- type: ViewChild,
40
- args: ['theReport', { static: false }]
41
- }], SkipData: [{
42
- type: Input
43
- }], ConversationID: [{
44
- type: Input
45
- }], ConversationName: [{
46
- type: Input
47
- }], ConversationDetailID: [{
48
- type: Input
49
- }] }); })();
50
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(SkipDynamicReportComponent, { className: "SkipDynamicReportComponent", filePath: "src\\lib\\ask-skip\\skip-dynamic-report-wrapper.ts", lineNumber: 28 }); })();
@@ -1,14 +0,0 @@
1
- import { Router } from "@angular/router";
2
- import { SharedService } from "@memberjunction/ng-shared";
3
- import { StubData } from '../../../generic/app-nav-view.types';
4
- import * as i0 from "@angular/core";
5
- export declare class ExpansionPanelItemComponent {
6
- sharedService: SharedService;
7
- private router;
8
- items: StubData[];
9
- constructor(sharedService: SharedService, router: Router);
10
- ngOnInit(): void;
11
- static ɵfac: i0.ɵɵFactoryDeclaration<ExpansionPanelItemComponent, never>;
12
- static ɵcmp: i0.ɵɵComponentDeclaration<ExpansionPanelItemComponent, "expansion-panel-item-component", never, { "items": { "alias": "items"; "required": false; }; }, {}, never, never, false, never>;
13
- }
14
- //# sourceMappingURL=expansion-panel-item-component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"expansion-panel-item-component.d.ts","sourceRoot":"","sources":["../../../../src/lib/expansion-panel-component/components/expansion-panel-item-component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;;AAE/D,qBAKa,2BAA2B;IAIjB,aAAa,EAAE,aAAa;IAAE,OAAO,CAAC,MAAM;IAF/C,KAAK,EAAE,QAAQ,EAAE,CAAM;gBAEpB,aAAa,EAAE,aAAa,EAAU,MAAM,EAAE,MAAM;IAEvE,QAAQ,IAAI,IAAI;yCANP,2BAA2B;2CAA3B,2BAA2B;CAiBvC"}
@@ -1,33 +0,0 @@
1
- import { Component, Input } from '@angular/core';
2
- import * as i0 from "@angular/core";
3
- import * as i1 from "@memberjunction/ng-shared";
4
- import * as i2 from "@angular/router";
5
- export class ExpansionPanelItemComponent {
6
- constructor(sharedService, router) {
7
- this.sharedService = sharedService;
8
- this.router = router;
9
- this.items = [];
10
- }
11
- ngOnInit() {
12
- /*
13
- const md = new Metadata();
14
- this.items = md.Applications.map(app =>
15
- new StubData(app.Name, app.ApplicationEntities.map(entity => new StubData(entity.ApplicationName, []))));
16
-
17
- for(const application of md.Applications){
18
- this.items.push(new StubData(application.Name, []));
19
- }
20
- */
21
- }
22
- }
23
- ExpansionPanelItemComponent.ɵfac = function ExpansionPanelItemComponent_Factory(t) { return new (t || ExpansionPanelItemComponent)(i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.Router)); };
24
- ExpansionPanelItemComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ExpansionPanelItemComponent, selectors: [["expansion-panel-item-component"]], inputs: { items: "items" }, decls: 1, vars: 0, consts: [[1, "wrapper"]], template: function ExpansionPanelItemComponent_Template(rf, ctx) { if (rf & 1) {
25
- i0.ɵɵelement(0, "div", 0);
26
- } }, styles: [".wrapper[_ngcontent-%COMP%] {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n}"] });
27
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ExpansionPanelItemComponent, [{
28
- type: Component,
29
- args: [{ selector: 'expansion-panel-item-component', template: "<div class=\"wrapper\">\r\n</div>", styles: [".wrapper {\r\n display: flex;\r\n flex-direction: column;\r\n align-items: center;\r\n}"] }]
30
- }], () => [{ type: i1.SharedService }, { type: i2.Router }], { items: [{
31
- type: Input
32
- }] }); })();
33
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ExpansionPanelItemComponent, { className: "ExpansionPanelItemComponent", filePath: "src\\lib\\expansion-panel-component\\components\\expansion-panel-item-component.ts", lineNumber: 11 }); })();
@@ -1,77 +0,0 @@
1
- import { AfterViewInit, OnInit, OnDestroy, QueryList, ElementRef } from '@angular/core';
2
- import { EntityInfo, ValidationResult, BaseEntity, EntityPermissionType, EntityRelationshipInfo, RunViewParams } from '@memberjunction/core';
3
- import { UserViewGridComponent } from '@memberjunction/ng-user-view-grid';
4
- import { BaseRecordComponent } from './base-record-component';
5
- import { SharedService } from '@memberjunction/ng-shared';
6
- import { ActivatedRoute, Router } from '@angular/router';
7
- import { TabStripComponent } from '@progress/kendo-angular-layout';
8
- import * as i0 from "@angular/core";
9
- export declare abstract class BaseFormComponent extends BaseRecordComponent implements AfterViewInit, OnInit, OnDestroy {
10
- protected elementRef: ElementRef;
11
- protected sharedService: SharedService;
12
- protected router: Router;
13
- protected route: ActivatedRoute;
14
- activeTabIndex: number;
15
- selectedTab: number;
16
- EditMode: boolean;
17
- BottomMargin: number;
18
- TabHeight: string;
19
- GridBottomMargin: number;
20
- FavoriteInitDone: boolean;
21
- isHistoryDialogOpen: boolean;
22
- private splitterLayoutChangeSubject;
23
- private _pendingRecords;
24
- private _updatingBrowserUrl;
25
- constructor(elementRef: ElementRef, sharedService: SharedService, router: Router, route: ActivatedRoute);
26
- tabComponent: TabStripComponent;
27
- ngOnInit(): Promise<void>;
28
- ngAfterViewInit(): void;
29
- private resizeSub;
30
- ngOnDestroy(): void;
31
- userViewGridComponents: QueryList<UserViewGridComponent>;
32
- protected get PendingRecords(): BaseEntity[];
33
- onTabSelect(e: any): void;
34
- StartEditMode(): void;
35
- handleHistoryDialog(): void;
36
- RemoveFavorite(): Promise<void>;
37
- MakeFavorite(): Promise<void>;
38
- SetFavoriteStatus(isFavorite: boolean): Promise<void>;
39
- private _isFavorite;
40
- get IsFavorite(): boolean;
41
- CheckUserPermission(type: EntityPermissionType): boolean;
42
- get UserCanEdit(): boolean;
43
- get UserCanRead(): boolean;
44
- get UserCanCreate(): boolean;
45
- get UserCanDelete(): boolean;
46
- GridEditMode(): "None" | "Save" | "Queue";
47
- private _tabIndexes;
48
- GetTabIndex(tabName: string): number;
49
- RegisterTabs(tabs: string[]): void;
50
- RegisterTab(tabName: string): number;
51
- IsCurrentTab(tabName: string): boolean;
52
- RegisterAndCheckIfCurrentTab(tabName: string): boolean;
53
- protected BuildRelationshipViewParams(item: EntityRelationshipInfo): RunViewParams;
54
- BuildRelationshipViewParamsByEntityName(relatedEntityName: string): RunViewParams;
55
- GetRelatedEntityTabDisplayName(relatedEntityName: string): string;
56
- protected ValidatePendingRecords(): ValidationResult[];
57
- Validate(): ValidationResult;
58
- SaveRecord(StopEditModeAfterSave: boolean): Promise<boolean>;
59
- Wait(duration: number): Promise<void>;
60
- CancelEdit(): void;
61
- protected PendingRecordsDirty(): boolean;
62
- protected PopulatePendingRecords(): Promise<void>;
63
- protected InternalSaveRecord(): Promise<boolean>;
64
- protected GetTabTopPosition(): number;
65
- private _tabMargin;
66
- setTabHeight(): void;
67
- protected get ContainerObjectHeight(): number;
68
- protected ResizeTab(): void;
69
- protected setupSplitterLayoutDebounce(): void;
70
- splitterLayoutChange(): void;
71
- protected ResizeGrids(): void;
72
- ShowDependencies(): Promise<void>;
73
- get EntityInfo(): EntityInfo | undefined;
74
- static ɵfac: i0.ɵɵFactoryDeclaration<BaseFormComponent, never>;
75
- static ɵdir: i0.ɵɵDirectiveDeclaration<BaseFormComponent, never, never, {}, {}, never, never, false, never>;
76
- }
77
- //# sourceMappingURL=base-form-component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-form-component.d.ts","sourceRoot":"","sources":["../../../src/lib/generic/base-form-component.ts"],"names":[],"mappings":"AAAA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OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAiC5D,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3C,UAAU;IA8BjB,SAAS,CAAC,mBAAmB,IAAI,OAAO;cAYxB,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;cAqBvC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IA8BtD,SAAS,CAAC,iBAAiB,IAAI,MAAM;IAerC,OAAO,CAAC,UAAU,CAAM;IACxB,YAAY,IAAI,IAAI;IAepB,SAAS,KAAK,qBAAqB,IAAI,MAAM,CAE5C;IAED,SAAS,CAAC,SAAS,IAAI,IAAI;IAO3B,SAAS,CAAC,2BAA2B;IAY9B,oBAAoB,IAAI,IAAI;IAInC,SAAS,CAAC,WAAW,IAAI,IAAI;IAWhB,gBAAgB;IAiB7B,IAAW,UAAU,IAAI,UAAU,GAAG,SAAS,CAY9C;yCAxbmB,iBAAiB;2CAAjB,iBAAiB;CAybtC"}
@@ -1,436 +0,0 @@
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 { Directive, ViewChildren, ViewChild } from '@angular/core';
11
- import { Subject, debounceTime, fromEvent } from 'rxjs';
12
- import { EntityInfo, EntityPermissionType, Metadata, LogError } from '@memberjunction/core';
13
- import { UserViewGridComponent } from '@memberjunction/ng-user-view-grid';
14
- import { BaseRecordComponent } from './base-record-component';
15
- import { TabStripComponent } from '@progress/kendo-angular-layout';
16
- import * as i0 from "@angular/core";
17
- import * as i1 from "@memberjunction/ng-shared";
18
- import * as i2 from "@angular/router";
19
- export class BaseFormComponent extends BaseRecordComponent {
20
- constructor(elementRef, sharedService, router, route) {
21
- super();
22
- this.elementRef = elementRef;
23
- this.sharedService = sharedService;
24
- this.router = router;
25
- this.route = route;
26
- this.activeTabIndex = 0;
27
- this.selectedTab = 0;
28
- this.EditMode = false;
29
- this.BottomMargin = 53;
30
- this.TabHeight = '500px';
31
- this.GridBottomMargin = 100;
32
- this.FavoriteInitDone = false;
33
- this.isHistoryDialogOpen = false;
34
- this.splitterLayoutChangeSubject = new Subject();
35
- this._pendingRecords = [];
36
- this._updatingBrowserUrl = false;
37
- this.resizeSub = null;
38
- this._isFavorite = false;
39
- this._tabIndexes = [];
40
- this._tabMargin = 10;
41
- this.setupSplitterLayoutDebounce();
42
- }
43
- ngOnInit() {
44
- return __awaiter(this, void 0, void 0, function* () {
45
- if (this.record) {
46
- const md = new Metadata();
47
- this._isFavorite = yield md.GetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKeys.map(pk => { return { FieldName: pk.Name, Value: pk.Value }; }));
48
- this.FavoriteInitDone = true;
49
- }
50
- });
51
- }
52
- ngAfterViewInit() {
53
- this.setTabHeight();
54
- this.route.queryParams.subscribe(params => {
55
- if (!this._updatingBrowserUrl) {
56
- // only do this if WE didn't invoke the browser URL update
57
- const tabName = params['tab'];
58
- if (tabName && tabName.length > 0) {
59
- // Select the proper tab based on the tabName
60
- const tabIndex = this.GetTabIndex(tabName);
61
- if (tabIndex >= 0) {
62
- // found the tab index, if we don't find it, do nothing
63
- this.activeTabIndex = tabIndex;
64
- this.tabComponent.selectTab(tabIndex);
65
- // now resize after a pause to allow the UI to settle
66
- setTimeout(() => {
67
- this.sharedService.InvokeManualResize();
68
- }, 100);
69
- }
70
- }
71
- }
72
- });
73
- }
74
- ngOnDestroy() {
75
- if (this.resizeSub) {
76
- this.resizeSub.unsubscribe();
77
- }
78
- }
79
- get PendingRecords() {
80
- return this._pendingRecords;
81
- }
82
- onTabSelect(e) {
83
- this.activeTabIndex = e.index;
84
- this.sharedService.InvokeManualResize();
85
- // now that we've updated our state and re-sized, also update the browser URL to add the tab name as a query parameter to the URL
86
- const tabName = this._tabIndexes[this.activeTabIndex];
87
- this._updatingBrowserUrl = true;
88
- this.router.navigate([], { queryParams: { tab: tabName }, queryParamsHandling: 'merge' });
89
- this._updatingBrowserUrl = true;
90
- }
91
- StartEditMode() {
92
- this.EditMode = true;
93
- }
94
- handleHistoryDialog() {
95
- this.isHistoryDialogOpen = !this.isHistoryDialogOpen;
96
- }
97
- RemoveFavorite() {
98
- return __awaiter(this, void 0, void 0, function* () {
99
- return this.SetFavoriteStatus(false);
100
- });
101
- }
102
- MakeFavorite() {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- return this.SetFavoriteStatus(true);
105
- });
106
- }
107
- SetFavoriteStatus(isFavorite) {
108
- return __awaiter(this, void 0, void 0, function* () {
109
- const md = new Metadata();
110
- yield md.SetRecordFavoriteStatus(md.CurrentUser.ID, this.record.EntityInfo.Name, this.record.PrimaryKeys.map(pk => { return { FieldName: pk.Name, Value: pk.Value }; }), isFavorite);
111
- this._isFavorite = isFavorite;
112
- });
113
- }
114
- get IsFavorite() {
115
- return this._isFavorite;
116
- }
117
- CheckUserPermission(type) {
118
- try {
119
- if (this.record)
120
- return this.record.CheckPermissions(type, false);
121
- else
122
- return false;
123
- }
124
- catch (e) {
125
- LogError(e);
126
- return false;
127
- }
128
- }
129
- get UserCanEdit() {
130
- return this.CheckUserPermission(EntityPermissionType.Update);
131
- }
132
- get UserCanRead() {
133
- return this.CheckUserPermission(EntityPermissionType.Read);
134
- }
135
- get UserCanCreate() {
136
- return this.CheckUserPermission(EntityPermissionType.Create);
137
- }
138
- get UserCanDelete() {
139
- return this.CheckUserPermission(EntityPermissionType.Delete);
140
- }
141
- GridEditMode() {
142
- return this.EditMode ? "Queue" : "None";
143
- }
144
- GetTabIndex(tabName) {
145
- return this._tabIndexes.indexOf(tabName);
146
- }
147
- RegisterTabs(tabs) {
148
- // copy the array, clear existing array and copy all elements
149
- this._tabIndexes.splice(0, this._tabIndexes.length);
150
- for (let i = 0; i < tabs.length; i++)
151
- this.RegisterTab(tabs[i]);
152
- }
153
- RegisterTab(tabName) {
154
- const currentIndex = this._tabIndexes.indexOf(tabName);
155
- if (currentIndex === -1) {
156
- this._tabIndexes.push(tabName);
157
- return this._tabIndexes.length - 1;
158
- }
159
- else
160
- return currentIndex;
161
- }
162
- IsCurrentTab(tabName) {
163
- if (this._tabIndexes.length === 0 || this._tabIndexes.indexOf(tabName) === -1)
164
- return false;
165
- else
166
- return this.activeTabIndex === this.GetTabIndex(tabName);
167
- }
168
- RegisterAndCheckIfCurrentTab(tabName) {
169
- this.RegisterTab(tabName);
170
- return this.IsCurrentTab(tabName);
171
- }
172
- BuildRelationshipViewParams(item) {
173
- return EntityInfo.BuildRelationshipViewParams(this.record, item); // new helper method in EntityInfo
174
- }
175
- BuildRelationshipViewParamsByEntityName(relatedEntityName) {
176
- if (this.record) {
177
- const eri = this.record.EntityInfo.RelatedEntities.find(x => x.RelatedEntity === relatedEntityName);
178
- if (eri)
179
- return this.BuildRelationshipViewParams(eri);
180
- }
181
- return {};
182
- }
183
- GetRelatedEntityTabDisplayName(relatedEntityName) {
184
- if (this.record) {
185
- const eri = this.record.EntityInfo.RelatedEntities.find(x => x.RelatedEntity === relatedEntityName);
186
- if (eri)
187
- return eri.DisplayName;
188
- }
189
- return relatedEntityName;
190
- }
191
- ValidatePendingRecords() {
192
- const results = [];
193
- for (let i = 0; i < this._pendingRecords.length; i++) {
194
- const pendingRecord = this._pendingRecords[i];
195
- results.push(pendingRecord.Validate());
196
- }
197
- return results;
198
- }
199
- Validate() {
200
- const valResults = this.record.Validate();
201
- const pendingValResults = this.ValidatePendingRecords();
202
- for (let i = 0; i < pendingValResults.length; i++) {
203
- const pendingValResult = pendingValResults[i];
204
- if (!pendingValResult.Success) {
205
- valResults.Success = false;
206
- valResults.Errors.push(...pendingValResult.Errors);
207
- }
208
- }
209
- return valResults;
210
- }
211
- SaveRecord(StopEditModeAfterSave) {
212
- return __awaiter(this, void 0, void 0, function* () {
213
- try {
214
- if (this.record) {
215
- yield this.PopulatePendingRecords(); // do this before we validate as we must validate pending records too
216
- const valResults = this.Validate();
217
- if (valResults.Success) {
218
- const result = yield this.InternalSaveRecord();
219
- if (result) {
220
- // we have saved the record, so clear the pending records
221
- this._pendingRecords = [];
222
- if (StopEditModeAfterSave)
223
- this.EditMode = false;
224
- this.sharedService.CreateSimpleNotification('Record saved succesfully', 'success', 2500);
225
- return true;
226
- }
227
- else
228
- this.sharedService.CreateSimpleNotification('Error saving record', 'error', 5000);
229
- }
230
- else {
231
- this.sharedService.CreateSimpleNotification('Validation Errors\n' + valResults.Errors.map(x => x.Message).join('\n'), 'warning', 10000);
232
- }
233
- }
234
- return false; // if we get here, we have failed/validation error/etc
235
- }
236
- catch (e) {
237
- this.sharedService.CreateSimpleNotification('Error saving record: ' + e, 'error', 5000);
238
- return false;
239
- }
240
- });
241
- }
242
- Wait(duration) {
243
- return __awaiter(this, void 0, void 0, function* () {
244
- return new Promise(resolve => setTimeout(resolve, duration));
245
- });
246
- }
247
- CancelEdit() {
248
- if (this.record) {
249
- const r = this.record;
250
- if (r.Dirty || this.PendingRecordsDirty()) {
251
- // ask the user to make sure they want to throw out changes
252
- if (!confirm('Are you sure you want to cancel your changes?')) {
253
- return;
254
- }
255
- r.Revert();
256
- const pendingRecords = this.PendingRecords;
257
- if (pendingRecords && pendingRecords.length > 0) {
258
- // we have pending records, so we need to revert them as well
259
- pendingRecords.forEach(p => {
260
- p.Revert();
261
- });
262
- }
263
- if (this.userViewGridComponents && this.userViewGridComponents.length > 0) {
264
- // we have grids, so we need to revert them as well
265
- this.userViewGridComponents.forEach(grid => {
266
- grid.RevertPendingChanges();
267
- });
268
- }
269
- }
270
- // if we get here we are good to go
271
- this.EditMode = false;
272
- }
273
- }
274
- PendingRecordsDirty() {
275
- this.PopulatePendingRecords();
276
- const pendingRecords = this.PendingRecords;
277
- if (pendingRecords && pendingRecords.length > 0) {
278
- for (let i = 0; i < pendingRecords.length; i++) {
279
- if (pendingRecords[i].Dirty)
280
- return true;
281
- }
282
- }
283
- return false;
284
- }
285
- PopulatePendingRecords() {
286
- return __awaiter(this, void 0, void 0, function* () {
287
- // this method is called by the parent class at the right time to populate all of the pending records for a transaction
288
- // all we do is talk to all of our grids and get their pending records and xfer them over to the PendingRecords array
289
- // the parent class will then take care of the rest...
290
- this._pendingRecords = []; // wipe out our array first
291
- const grids = this.userViewGridComponents;
292
- if (grids && grids.length > 0) {
293
- for (let i = 0; i < grids.length; i++) {
294
- const grid = grids.get(i);
295
- if (grid) {
296
- yield grid.EditingComplete(); // need to check this and wait for it to make sure grid editing is done before we try to save
297
- grid.PendingRecords.forEach(p => {
298
- // populate our pending grids array from the composite of all the grids
299
- this.PendingRecords.push(p.record);
300
- });
301
- }
302
- }
303
- }
304
- });
305
- }
306
- InternalSaveRecord() {
307
- return __awaiter(this, void 0, void 0, function* () {
308
- if (this.record) {
309
- // save the record, but first create a transaction group if we have any other stuf to submit
310
- yield this.PopulatePendingRecords();
311
- if (this._pendingRecords.length > 0) {
312
- // we need to create a transaction group
313
- const md = new Metadata();
314
- const tg = yield md.CreateTransactionGroup();
315
- this.record.TransactionGroup = tg;
316
- this.record.Save(); // DO NOT USE await - trans group.submit() is where we await
317
- // now add to the rest of the pending records
318
- for (let i = 0; i < this._pendingRecords.length; i++) {
319
- const x = this._pendingRecords[i];
320
- x.TransactionGroup = tg;
321
- x.Save(); // DO NOT USE await - trans group.submit() is where we await
322
- }
323
- // finally submit the TG
324
- return yield tg.Submit();
325
- }
326
- else
327
- return yield this.record.Save();
328
- }
329
- else
330
- return false;
331
- });
332
- }
333
- GetTabTopPosition() {
334
- if (this.elementRef && this.elementRef.nativeElement) {
335
- const tabs = this.elementRef.nativeElement.getElementsByClassName('k-tabstrip');
336
- if (tabs && tabs.length > 0) {
337
- const tabElement = tabs[0];
338
- const tabRect = tabElement.getBoundingClientRect();
339
- const bodyRect = document.body.getBoundingClientRect();
340
- return tabRect.top - bodyRect.top;
341
- }
342
- }
343
- return 0;
344
- }
345
- setTabHeight() {
346
- // Subscribe to the window resize event
347
- this.resizeSub = fromEvent(window, 'resize').pipe(debounceTime(100) // Debounce the resize event to avoid frequent updates
348
- ).subscribe(() => {
349
- // Update the grid height when the window is resized
350
- this.ResizeTab();
351
- });
352
- // Set the initial grid height with a slight delay to allow stuff to get set
353
- setTimeout(() => {
354
- this.ResizeTab();
355
- }, 100);
356
- }
357
- get ContainerObjectHeight() {
358
- return window.innerHeight; // default, can be overriden by subclasses
359
- }
360
- ResizeTab() {
361
- this._tabMargin = this.GetTabTopPosition();
362
- const height = this.ContainerObjectHeight - this._tabMargin - this.BottomMargin;
363
- this.TabHeight = height.toString() + 'px';
364
- this.GridBottomMargin = 40;
365
- }
366
- setupSplitterLayoutDebounce() {
367
- this.splitterLayoutChangeSubject.pipe(debounceTime(300)).subscribe(() => {
368
- this.setTabHeight(); // set the height of the tab first
369
- // then wait through the timeout so the tab height change actually takes effect in the DOM - that's why we have the timeout
370
- setTimeout(() => {
371
- this.sharedService.InvokeManualResize();
372
- }, 100);
373
- });
374
- }
375
- splitterLayoutChange() {
376
- this.splitterLayoutChangeSubject.next();
377
- }
378
- ResizeGrids() {
379
- // do with a little timeout to let the visible grid show up and the DOM settle
380
- setTimeout(() => {
381
- if (this.userViewGridComponents && this.userViewGridComponents.length > 0) {
382
- this.userViewGridComponents.forEach(grid => {
383
- //grid.ResizeGrid(); // automatic now via mjFillContainer
384
- });
385
- }
386
- }, 10);
387
- }
388
- ShowDependencies() {
389
- return __awaiter(this, void 0, void 0, function* () {
390
- // for now dump to console
391
- const md = new Metadata();
392
- const dep = yield md.GetRecordDependencies(this.record.EntityInfo.Name, this.record.PrimaryKey.Value);
393
- console.log('Dependencies for: ' + this.record.EntityInfo.Name + ' ' + this.record.PrimaryKey.Value);
394
- console.log(dep);
395
- // if (confirm('Do you want to merge records test?') == true) {
396
- // const mergeResult = await md.MergeRecords({
397
- // EntityName: this.record.EntityInfo.Name,
398
- // SurvivingRecordID: this.record.PrimaryKey.Value,
399
- // RecordsToMerge: [4],
400
- // })
401
- // console.log(mergeResult);
402
- // }
403
- });
404
- }
405
- get EntityInfo() {
406
- try {
407
- const r = this.record;
408
- if (r)
409
- return r.EntityInfo;
410
- else
411
- return undefined;
412
- }
413
- catch (e) {
414
- LogError(e);
415
- return undefined;
416
- }
417
- }
418
- }
419
- BaseFormComponent.ɵfac = function BaseFormComponent_Factory(t) { return new (t || BaseFormComponent)(i0.ɵɵdirectiveInject(i0.ElementRef), i0.ɵɵdirectiveInject(i1.SharedService), i0.ɵɵdirectiveInject(i2.Router), i0.ɵɵdirectiveInject(i2.ActivatedRoute)); };
420
- BaseFormComponent.ɵdir = /*@__PURE__*/ i0.ɵɵdefineDirective({ type: BaseFormComponent, viewQuery: function BaseFormComponent_Query(rf, ctx) { if (rf & 1) {
421
- i0.ɵɵviewQuery(TabStripComponent, 5);
422
- i0.ɵɵviewQuery(UserViewGridComponent, 5);
423
- } if (rf & 2) {
424
- let _t;
425
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tabComponent = _t.first);
426
- i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.userViewGridComponents = _t);
427
- } }, features: [i0.ɵɵInheritDefinitionFeature] });
428
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(BaseFormComponent, [{
429
- type: Directive
430
- }], () => [{ type: i0.ElementRef }, { type: i1.SharedService }, { type: i2.Router }, { type: i2.ActivatedRoute }], { tabComponent: [{
431
- type: ViewChild,
432
- args: [TabStripComponent, { static: false }]
433
- }], userViewGridComponents: [{
434
- type: ViewChildren,
435
- args: [UserViewGridComponent]
436
- }] }); })();
@@ -1,7 +0,0 @@
1
- import { BaseEntity } from "@memberjunction/core";
2
- import { BaseRecordComponent } from "./base-record-component";
3
- export declare class BaseFormSectionComponent extends BaseRecordComponent {
4
- record: BaseEntity;
5
- EditMode: boolean;
6
- }
7
- //# sourceMappingURL=base-form-section-component.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"base-form-section-component.d.ts","sourceRoot":"","sources":["../../../src/lib/generic/base-form-section-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAI9D,qBAAa,wBAAyB,SAAQ,mBAAmB;IAC7D,MAAM,EAAG,UAAU,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAS;CAC7B"}
@@ -1,9 +0,0 @@
1
- import { BaseRecordComponent } from "./base-record-component";
2
- // This is a base class for form sections, it is used to have a clear hiearchy for all sections to subclass
3
- // which is primarily needed for the Class Factory and registration process to differentiate between sections and other components
4
- export class BaseFormSectionComponent extends BaseRecordComponent {
5
- constructor() {
6
- super(...arguments);
7
- this.EditMode = false;
8
- }
9
- }