@memberjunction/ng-core-entity-forms 5.30.0 → 5.31.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/lib/__tests__/content-source-form.test.d.ts +2 -0
- package/dist/lib/__tests__/content-source-form.test.d.ts.map +1 -0
- package/dist/lib/__tests__/content-source-form.test.js +183 -0
- package/dist/lib/__tests__/content-source-form.test.js.map +1 -0
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +15 -15
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +9 -7
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +11 -9
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +6 -5
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +6 -4
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +3 -3
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +6 -6
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +7 -5
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +3 -3
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +12 -12
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/ContentSources/content-source-form.component.d.ts +59 -5
- package/dist/lib/custom/ContentSources/content-source-form.component.d.ts.map +1 -1
- package/dist/lib/custom/ContentSources/content-source-form.component.js +379 -34
- package/dist/lib/custom/ContentSources/content-source-form.component.js.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.js +5 -5
- package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.js +10 -10
- package/dist/lib/custom/Lists/list-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.js +9 -7
- package/dist/lib/custom/Queries/query-category-dialog.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +17 -17
- package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.js +7 -6
- package/dist/lib/custom/Queries/query-run-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts +2 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.js +10 -8
- package/dist/lib/custom/Templates/template-param-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts +2 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.js +9 -7
- package/dist/lib/custom/Templates/template-params-grid.component.js.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.js +8 -8
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts +3 -2
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +8 -6
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.js +7 -7
- package/dist/lib/custom/Tests/test-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.js +5 -5
- package/dist/lib/custom/Tests/test-run-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.js +8 -8
- package/dist/lib/custom/Tests/test-suite-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.js +6 -6
- package/dist/lib/custom/Tests/test-suite-run-form.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +2 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +8 -6
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts +9 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js +15 -3
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts +3 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +10 -5
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +2 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +6 -4
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js +46 -28
- package/dist/lib/generated/Entities/MJAIModel/mjaimodel.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCompanyIntegrationEntityMap/mjcompanyintegrationentitymap.form.component.js +10 -10
- package/dist/lib/generated/Entities/MJCompanyIntegrationEntityMap/mjcompanyintegrationentitymap.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.js +25 -7
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js +25 -7
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +106 -88
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.js +181 -61
- package/dist/lib/generated/Entities/MJTag/mjtag.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.js +63 -0
- package/dist/lib/generated/Entities/MJTagScope/mjtagscope.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.js +95 -0
- package/dist/lib/generated/Entities/MJTagSuggestion/mjtagsuggestion.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js +63 -0
- package/dist/lib/generated/Entities/MJTagSynonym/mjtagsynonym.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +199 -181
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +51 -48
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +27 -18
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/shared/components/template-editor.component.d.ts +3 -2
- package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +8 -6
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/package.json +37 -35
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EventEmitter, OnInit } from '@angular/core';
|
|
2
2
|
import { MJQueryCategoryEntity } from '@memberjunction/core-entities';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
interface CategoryNode {
|
|
5
6
|
id: string;
|
|
@@ -8,7 +9,7 @@ interface CategoryNode {
|
|
|
8
9
|
children: CategoryNode[];
|
|
9
10
|
level: number;
|
|
10
11
|
}
|
|
11
|
-
export declare class QueryCategoryDialogComponent implements OnInit {
|
|
12
|
+
export declare class QueryCategoryDialogComponent extends BaseAngularComponent implements OnInit {
|
|
12
13
|
isVisible: boolean;
|
|
13
14
|
isVisibleChange: EventEmitter<boolean>;
|
|
14
15
|
onCategoryCreated: EventEmitter<MJQueryCategoryEntity>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-category-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Queries/query-category-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC
|
|
1
|
+
{"version":3,"file":"query-category-dialog.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Queries/query-category-dialog.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAItE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE,UAAU,YAAY;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,qBAMa,4BAA6B,SAAQ,oBAAqB,YAAW,MAAM;IAC3E,SAAS,UAAS;IACjB,eAAe,wBAA+B;IAC9C,iBAAiB,sCAA6C;IAEjE,YAAY,SAAM;IAClB,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAQ;IACvC,UAAU,EAAE,qBAAqB,EAAE,CAAM;IACzC,YAAY,EAAE,YAAY,EAAE,CAAM;IAClC,mBAAmB,EAAE,YAAY,EAAE,CAAM;IACzC,UAAU,UAAS;IAEpB,QAAQ;IAIR,cAAc;IAmBpB,OAAO,CAAC,iBAAiB;IAqCzB,OAAO,CAAC,iBAAiB;IAYnB,cAAc;IA4CpB,KAAK;IAOL,iBAAiB,CAAC,QAAQ,EAAE,YAAY,GAAG,MAAM;IAIjD,WAAW,IAAI,MAAM;yCA3IZ,4BAA4B;2CAA5B,4BAA4B;CAgJxC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { RunView } from '@memberjunction/core';
|
|
3
3
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
4
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
import * as i1 from "@angular/forms";
|
|
6
7
|
import * as i2 from "@memberjunction/ng-ui-components";
|
|
@@ -72,8 +73,9 @@ function QueryCategoryDialogComponent_Conditional_0_Template(rf, ctx) { if (rf &
|
|
|
72
73
|
i0.ɵɵadvance();
|
|
73
74
|
i0.ɵɵconditional(ctx_r1.isCreating ? 24 : 25);
|
|
74
75
|
} }
|
|
75
|
-
export class QueryCategoryDialogComponent {
|
|
76
|
+
export class QueryCategoryDialogComponent extends BaseAngularComponent {
|
|
76
77
|
constructor() {
|
|
78
|
+
super(...arguments);
|
|
77
79
|
this.isVisible = false;
|
|
78
80
|
this.isVisibleChange = new EventEmitter();
|
|
79
81
|
this.onCategoryCreated = new EventEmitter();
|
|
@@ -89,7 +91,7 @@ export class QueryCategoryDialogComponent {
|
|
|
89
91
|
}
|
|
90
92
|
async loadCategories() {
|
|
91
93
|
try {
|
|
92
|
-
const rv =
|
|
94
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
93
95
|
const result = await rv.RunView({
|
|
94
96
|
EntityName: 'MJ: Query Categories',
|
|
95
97
|
OrderBy: 'Name',
|
|
@@ -156,7 +158,7 @@ export class QueryCategoryDialogComponent {
|
|
|
156
158
|
}
|
|
157
159
|
this.isCreating = true;
|
|
158
160
|
try {
|
|
159
|
-
const md =
|
|
161
|
+
const md = this.ProviderToUse;
|
|
160
162
|
const newCategory = await md.GetEntityObject('MJ: Query Categories');
|
|
161
163
|
newCategory.Name = this.categoryName.trim();
|
|
162
164
|
newCategory.ParentID = this.selectedParentId;
|
|
@@ -193,8 +195,8 @@ export class QueryCategoryDialogComponent {
|
|
|
193
195
|
const name = this.categoryName || 'New Category';
|
|
194
196
|
return parent ? `${parent.fullPath} / ${name}` : name;
|
|
195
197
|
}
|
|
196
|
-
static { this.ɵfac = function QueryCategoryDialogComponent_Factory(__ngFactoryType__) { return
|
|
197
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCategoryDialogComponent, selectors: [["mj-query-category-dialog"]], inputs: { isVisible: "isVisible" }, outputs: { isVisibleChange: "isVisibleChange", onCategoryCreated: "onCategoryCreated" }, standalone: false, decls: 1, vars: 1, consts: [[3, "Visible", "Width"], [3, "Close", "Visible", "Width"], [2, "display", "flex", "align-items", "center", "gap", "8px"], [1, "fa-solid", "fa-folder-plus", 2, "color", "#28a745"], [2, "padding", "20px"], [1, "form-group", 2, "margin-bottom", "20px"], ["for", "categoryName", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-tag"], [2, "color", "#dc3545"], ["name", "categoryName", "placeholder", "Enter category name...", 1, "mj-input", 2, "width", "100%", 3, "ngModelChange", "ngModel"], [1, "form-group"], ["for", "parentCategory", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-folder-tree"], ["name", "parentCategory", "TextField", "name", "ValueField", "id", "Placeholder", "-- No Parent (Top Level) --", 2, "width", "100%", 3, "ngModelChange", "ngModel", "Data", "ValuePrimitive"], [2, "margin-top", "8px", "padding", "8px", "background", "var(--mj-bg-surface-sunken)", "border-radius", "4px", "font-size", "0.85em", "color", "var(--mj-text-muted)"], ["mjButton", "", 3, "click"], [1, "fa-solid", "fa-times"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-info-circle"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-check"]], template: function QueryCategoryDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
198
|
+
static { this.ɵfac = /*@__PURE__*/ (() => { let ɵQueryCategoryDialogComponent_BaseFactory; return function QueryCategoryDialogComponent_Factory(__ngFactoryType__) { return (ɵQueryCategoryDialogComponent_BaseFactory || (ɵQueryCategoryDialogComponent_BaseFactory = i0.ɵɵgetInheritedFactory(QueryCategoryDialogComponent)))(__ngFactoryType__ || QueryCategoryDialogComponent); }; })(); }
|
|
199
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: QueryCategoryDialogComponent, selectors: [["mj-query-category-dialog"]], inputs: { isVisible: "isVisible" }, outputs: { isVisibleChange: "isVisibleChange", onCategoryCreated: "onCategoryCreated" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[3, "Visible", "Width"], [3, "Close", "Visible", "Width"], [2, "display", "flex", "align-items", "center", "gap", "8px"], [1, "fa-solid", "fa-folder-plus", 2, "color", "#28a745"], [2, "padding", "20px"], [1, "form-group", 2, "margin-bottom", "20px"], ["for", "categoryName", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-tag"], [2, "color", "#dc3545"], ["name", "categoryName", "placeholder", "Enter category name...", 1, "mj-input", 2, "width", "100%", 3, "ngModelChange", "ngModel"], [1, "form-group"], ["for", "parentCategory", 2, "display", "block", "margin-bottom", "8px", "font-weight", "600", "color", "var(--mj-text-secondary)"], [1, "fa-solid", "fa-folder-tree"], ["name", "parentCategory", "TextField", "name", "ValueField", "id", "Placeholder", "-- No Parent (Top Level) --", 2, "width", "100%", 3, "ngModelChange", "ngModel", "Data", "ValuePrimitive"], [2, "margin-top", "8px", "padding", "8px", "background", "var(--mj-bg-surface-sunken)", "border-radius", "4px", "font-size", "0.85em", "color", "var(--mj-text-muted)"], ["mjButton", "", 3, "click"], [1, "fa-solid", "fa-times"], ["mjButton", "", "variant", "primary", 3, "click", "disabled"], [1, "fa-solid", "fa-info-circle"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-check"]], template: function QueryCategoryDialogComponent_Template(rf, ctx) { if (rf & 1) {
|
|
198
200
|
i0.ɵɵconditionalCreate(0, QueryCategoryDialogComponent_Conditional_0_Template, 26, 9, "mj-dialog", 0);
|
|
199
201
|
} if (rf & 2) {
|
|
200
202
|
i0.ɵɵconditional(ctx.isVisible ? 0 : -1);
|
|
@@ -210,5 +212,5 @@ export class QueryCategoryDialogComponent {
|
|
|
210
212
|
}], onCategoryCreated: [{
|
|
211
213
|
type: Output
|
|
212
214
|
}] }); })();
|
|
213
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCategoryDialogComponent, { className: "QueryCategoryDialogComponent", filePath: "src/lib/custom/Queries/query-category-dialog.component.ts", lineNumber:
|
|
215
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(QueryCategoryDialogComponent, { className: "QueryCategoryDialogComponent", filePath: "src/lib/custom/Queries/query-category-dialog.component.ts", lineNumber: 21 }); })();
|
|
214
216
|
//# sourceMappingURL=query-category-dialog.component.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query-category-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/Queries/query-category-dialog.component.ts","../../../../src/lib/custom/Queries/query-category-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;;;;ICkC/D,+BAAyJ;IACvJ,wBAAuC;IACvC,YACF;IAAA,iBAAM;;;IADJ,eACF;IADE,gEACF;;;IAaA,wBAA2C;IAAC,6BAC9C;;;IACE,wBAAiC;IAAC,iCACpC;;;;IAvDN,oCAGoB;IAAlB,mMAAS,cAAO,KAAC;IAEf,AADF,0CAAoB,aACyC;IACzD,uBAA+D;IAC/D,2CACF;IACF,AADE,iBAAM,EACa;IAGjB,AADF,AADF,8BAA4B,aAC2B,eACsE;IACvH,uBAA+B;IAAC,+BAAc;IAAA,gCAA8B;IAAA,kBAAC;IAC/E,AAD+E,iBAAO,EAC9E;IACR,iCAIyB;IAHvB,6TAA0B;IAI9B,AALE,iBAIyB,EACrB;IAEJ,AADF,gCAAwB,iBACqG;IACzH,yBAAuC;IAAC,6CAC1C;IAAA,iBAAQ;IACR,wCAQuB;IAPrB,2UAA8B;IAQhC,iBAAc;IACd,+GAAwB;IAO5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C,CAAC;IACrC,CAAC;IAED,iBAAiB,CAAC,QAAsB;QACpC,OAAO,GAAG,QAAQ,CAAC,KAAK,GAAG,EAAE,IAAI,CAAC;IACtC,CAAC;IAED,WAAW;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,IAAI,cAAc,CAAC;QACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;6HA/IQ,4BAA4B;oEAA5B,4BAA4B;YCnBzC,qGAAiB;;YAAjB,wCA4DC;;;iFDzCY,4BAA4B;cANxC,SAAS;6BACI,KAAK,YACL,0BAA0B;;kBAKnC,KAAK;;kBACL,MAAM;;kBACN,MAAM;;kFAHE,4BAA4B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { MJQueryCategoryEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n\ninterface CategoryNode {\n id: string;\n name: string;\n fullPath: string;\n children: CategoryNode[];\n level: number;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-query-category-dialog',\n templateUrl: './query-category-dialog.component.html',\n styleUrls: ['./query-category-dialog.component.css']\n})\nexport class QueryCategoryDialogComponent implements OnInit {\n @Input() isVisible = false;\n @Output() isVisibleChange = new EventEmitter<boolean>();\n @Output() onCategoryCreated = new EventEmitter<MJQueryCategoryEntity>();\n \n public categoryName = '';\n public selectedParentId: string | null = null;\n public categories: MJQueryCategoryEntity[] = [];\n public categoryTree: CategoryNode[] = [];\n public flattenedCategories: CategoryNode[] = [];\n public isCreating = false;\n \n async ngOnInit() {\n await this.loadCategories();\n }\n \n async loadCategories() {\n try {\n const rv = new RunView();\n const result = await rv.RunView<MJQueryCategoryEntity>({\n EntityName: 'MJ: Query Categories',\n OrderBy: 'Name',\n ResultType: 'entity_object'\n });\n \n if (result.Success && result.Results) {\n this.categories = result.Results;\n this.categoryTree = this.buildCategoryTree(this.categories);\n this.flattenedCategories = this.flattenCategories(this.categoryTree, 0);\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n }\n }\n \n private buildCategoryTree(categories: MJQueryCategoryEntity[]): CategoryNode[] {\n const categoryMap = new Map<string, CategoryNode>();\n const rootCategories: CategoryNode[] = [];\n \n // Create nodes for all categories\n categories.forEach(cat => {\n categoryMap.set(cat.ID, {\n id: cat.ID,\n name: cat.Name,\n fullPath: cat.Name,\n children: [],\n level: 0\n });\n });\n \n // Build the tree structure\n categories.forEach(cat => {\n const node = categoryMap.get(cat.ID)!;\n if (cat.ParentID && categoryMap.has(cat.ParentID)) {\n const parent = categoryMap.get(cat.ParentID)!;\n parent.children.push(node);\n node.fullPath = `${parent.fullPath} / ${node.name}`;\n } else {\n rootCategories.push(node);\n }\n });\n \n // Sort children alphabetically\n const sortNodes = (nodes: CategoryNode[]) => {\n nodes.sort((a, b) => a.name.localeCompare(b.name));\n nodes.forEach(node => sortNodes(node.children));\n };\n sortNodes(rootCategories);\n \n return rootCategories;\n }\n \n private flattenCategories(nodes: CategoryNode[], level: number): CategoryNode[] {\n const result: CategoryNode[] = [];\n nodes.forEach(node => {\n node.level = level;\n result.push(node);\n if (node.children.length > 0) {\n result.push(...this.flattenCategories(node.children, level + 1));\n }\n });\n return result;\n }\n \n async createCategory() {\n if (!this.categoryName.trim()) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please enter a category name',\n 'warning'\n );\n return;\n }\n \n this.isCreating = true;\n \n try {\n const md = new Metadata();\n const newCategory = await md.GetEntityObject<MJQueryCategoryEntity>('MJ: Query Categories');\n newCategory.Name = this.categoryName.trim();\n newCategory.ParentID = this.selectedParentId;\n newCategory.UserID = md.CurrentUser.ID;\n \n const saved = await newCategory.Save();\n \n if (saved) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Category created successfully',\n 'success'\n );\n this.onCategoryCreated.emit(newCategory);\n this.close();\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create category: ${newCategory.LatestResult?.Message || 'Unknown error'}`,\n 'error'\n );\n }\n } catch (error) {\n console.error('Error creating category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating category',\n 'error'\n );\n } finally {\n this.isCreating = false;\n }\n }\n \n close() {\n this.categoryName = '';\n this.selectedParentId = null;\n this.isVisible = false;\n this.isVisibleChange.emit(false);\n }\n \n getCategoryIndent(category: CategoryNode): string {\n return `${category.level * 20}px`;\n }\n \n getFullPath(): string {\n const parent = this.flattenedCategories.find(c => c.id === this.selectedParentId);\n const name = this.categoryName || 'New Category';\n return parent ? `${parent.fullPath} / ${name}` : name;\n }\n}","@if (isVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"500\"\n (Close)=\"close()\">\n <mj-dialog-titlebar>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <i class=\"fa-solid fa-folder-plus\" style=\"color: #28a745;\"></i>\n Create New Query Category\n </div>\n </mj-dialog-titlebar>\n <div style=\"padding: 20px;\">\n <div class=\"form-group\" style=\"margin-bottom: 20px;\">\n <label for=\"categoryName\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-tag\"></i> Category Name <span style=\"color: #dc3545;\">*</span>\n </label>\n <input class=\"mj-input\"\n [(ngModel)]=\"categoryName\"\n name=\"categoryName\"\n placeholder=\"Enter category name...\"\n style=\"width: 100%;\" />\n </div>\n <div class=\"form-group\">\n <label for=\"parentCategory\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-folder-tree\"></i> Parent Category (Optional)\n </label>\n <mj-dropdown\n [(ngModel)]=\"selectedParentId\"\n name=\"parentCategory\"\n [Data]=\"flattenedCategories\"\n TextField=\"name\"\n ValueField=\"id\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"-- No Parent (Top Level) --\"\n style=\"width: 100%;\">\n </mj-dropdown>\n @if (selectedParentId) {\n <div style=\"margin-top: 8px; padding: 8px; background: var(--mj-bg-surface-sunken); border-radius: 4px; font-size: 0.85em; color: var(--mj-text-muted);\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Full path: {{ getFullPath() }}\n </div>\n }\n </div>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"close()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button mjButton\n variant=\"primary\"\n [disabled]=\"!categoryName.trim() || isCreating\"\n (click)=\"createCategory()\">\n @if (isCreating) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i> Creating...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Create Category\n }\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"query-category-dialog.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/Queries/query-category-dialog.component.ts","../../../../src/lib/custom/Queries/query-category-dialog.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAU,MAAM,eAAe,CAAC;AAE/E,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;;;;ICgC3D,+BAAyJ;IACvJ,wBAAuC;IACvC,YACF;IAAA,iBAAM;;;IADJ,eACF;IADE,gEACF;;;IAaA,wBAA2C;IAAC,6BAC9C;;;IACE,wBAAiC;IAAC,iCACpC;;;;IAvDN,oCAGoB;IAAlB,mMAAS,cAAO,KAAC;IAEf,AADF,0CAAoB,aACyC;IACzD,u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AK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;YACjD,qBAAqB,CAAC,QAAQ,CAAC,wBAAwB,CACnD,yBAAyB,EACzB,OAAO,CACV,CAAC;QACN,CAAC;gBAAS,CAAC;YACP,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,KAAK;QACD,IAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrC,CAAC;IAED,iBAAiB,CAAC,QAAsB;QACpC,OAAO,GAAG,QAAQ,CAAC,KAAK,GAAG,EAAE,IAAI,CAAC;IACtC,CAAC;IAED,WAAW;QACP,MAAM,MAAM,GAAG,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,CAAC,gBAAgB,CAAC,CAAC;QAClF,MAAM,IAAI,GAAG,IAAI,CAAC,YAAY,IAAI,cAAc,CAAC;QACjD,OAAO,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,QAAQ,MAAM,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1D,CAAC;oSA/IQ,4BAA4B,yBAA5B,4BAA4B;oEAA5B,4BAA4B;YCpBzC,qGAAiB;;YAAjB,wCA4DC;;;iFDxCY,4BAA4B;cANxC,SAAS;6BACI,KAAK,YACL,0BAA0B;;kBAKnC,KAAK;;kBACL,MAAM;;kBACN,MAAM;;kFAHE,4BAA4B","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit } from '@angular/core';\nimport { MJQueryCategoryEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\n\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\ninterface CategoryNode {\n id: string;\n name: string;\n fullPath: string;\n children: CategoryNode[];\n level: number;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-query-category-dialog',\n templateUrl: './query-category-dialog.component.html',\n styleUrls: ['./query-category-dialog.component.css']\n})\nexport class QueryCategoryDialogComponent extends BaseAngularComponent implements OnInit {\n @Input() isVisible = false;\n @Output() isVisibleChange = new EventEmitter<boolean>();\n @Output() onCategoryCreated = new EventEmitter<MJQueryCategoryEntity>();\n \n public categoryName = '';\n public selectedParentId: string | null = null;\n public categories: MJQueryCategoryEntity[] = [];\n public categoryTree: CategoryNode[] = [];\n public flattenedCategories: CategoryNode[] = [];\n public isCreating = false;\n \n async ngOnInit() {\n await this.loadCategories();\n }\n \n async loadCategories() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJQueryCategoryEntity>({\n EntityName: 'MJ: Query Categories',\n OrderBy: 'Name',\n ResultType: 'entity_object'\n });\n \n if (result.Success && result.Results) {\n this.categories = result.Results;\n this.categoryTree = this.buildCategoryTree(this.categories);\n this.flattenedCategories = this.flattenCategories(this.categoryTree, 0);\n }\n } catch (error) {\n console.error('Error loading categories:', error);\n }\n }\n \n private buildCategoryTree(categories: MJQueryCategoryEntity[]): CategoryNode[] {\n const categoryMap = new Map<string, CategoryNode>();\n const rootCategories: CategoryNode[] = [];\n \n // Create nodes for all categories\n categories.forEach(cat => {\n categoryMap.set(cat.ID, {\n id: cat.ID,\n name: cat.Name,\n fullPath: cat.Name,\n children: [],\n level: 0\n });\n });\n \n // Build the tree structure\n categories.forEach(cat => {\n const node = categoryMap.get(cat.ID)!;\n if (cat.ParentID && categoryMap.has(cat.ParentID)) {\n const parent = categoryMap.get(cat.ParentID)!;\n parent.children.push(node);\n node.fullPath = `${parent.fullPath} / ${node.name}`;\n } else {\n rootCategories.push(node);\n }\n });\n \n // Sort children alphabetically\n const sortNodes = (nodes: CategoryNode[]) => {\n nodes.sort((a, b) => a.name.localeCompare(b.name));\n nodes.forEach(node => sortNodes(node.children));\n };\n sortNodes(rootCategories);\n \n return rootCategories;\n }\n \n private flattenCategories(nodes: CategoryNode[], level: number): CategoryNode[] {\n const result: CategoryNode[] = [];\n nodes.forEach(node => {\n node.level = level;\n result.push(node);\n if (node.children.length > 0) {\n result.push(...this.flattenCategories(node.children, level + 1));\n }\n });\n return result;\n }\n \n async createCategory() {\n if (!this.categoryName.trim()) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please enter a category name',\n 'warning'\n );\n return;\n }\n \n this.isCreating = true;\n \n try {\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJQueryCategoryEntity>('MJ: Query Categories');\n newCategory.Name = this.categoryName.trim();\n newCategory.ParentID = this.selectedParentId;\n newCategory.UserID = md.CurrentUser.ID;\n \n const saved = await newCategory.Save();\n \n if (saved) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Category created successfully',\n 'success'\n );\n this.onCategoryCreated.emit(newCategory);\n this.close();\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create category: ${newCategory.LatestResult?.Message || 'Unknown error'}`,\n 'error'\n );\n }\n } catch (error) {\n console.error('Error creating category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating category',\n 'error'\n );\n } finally {\n this.isCreating = false;\n }\n }\n \n close() {\n this.categoryName = '';\n this.selectedParentId = null;\n this.isVisible = false;\n this.isVisibleChange.emit(false);\n }\n \n getCategoryIndent(category: CategoryNode): string {\n return `${category.level * 20}px`;\n }\n \n getFullPath(): string {\n const parent = this.flattenedCategories.find(c => c.id === this.selectedParentId);\n const name = this.categoryName || 'New Category';\n return parent ? `${parent.fullPath} / ${name}` : name;\n }\n}","@if (isVisible) {\n <mj-dialog\n [Visible]=\"true\"\n [Width]=\"500\"\n (Close)=\"close()\">\n <mj-dialog-titlebar>\n <div style=\"display: flex; align-items: center; gap: 8px;\">\n <i class=\"fa-solid fa-folder-plus\" style=\"color: #28a745;\"></i>\n Create New Query Category\n </div>\n </mj-dialog-titlebar>\n <div style=\"padding: 20px;\">\n <div class=\"form-group\" style=\"margin-bottom: 20px;\">\n <label for=\"categoryName\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-tag\"></i> Category Name <span style=\"color: #dc3545;\">*</span>\n </label>\n <input class=\"mj-input\"\n [(ngModel)]=\"categoryName\"\n name=\"categoryName\"\n placeholder=\"Enter category name...\"\n style=\"width: 100%;\" />\n </div>\n <div class=\"form-group\">\n <label for=\"parentCategory\" style=\"display: block; margin-bottom: 8px; font-weight: 600; color: var(--mj-text-secondary);\">\n <i class=\"fa-solid fa-folder-tree\"></i> Parent Category (Optional)\n </label>\n <mj-dropdown\n [(ngModel)]=\"selectedParentId\"\n name=\"parentCategory\"\n [Data]=\"flattenedCategories\"\n TextField=\"name\"\n ValueField=\"id\"\n [ValuePrimitive]=\"true\"\n Placeholder=\"-- No Parent (Top Level) --\"\n style=\"width: 100%;\">\n </mj-dropdown>\n @if (selectedParentId) {\n <div style=\"margin-top: 8px; padding: 8px; background: var(--mj-bg-surface-sunken); border-radius: 4px; font-size: 0.85em; color: var(--mj-text-muted);\">\n <i class=\"fa-solid fa-info-circle\"></i>\n Full path: {{ getFullPath() }}\n </div>\n }\n </div>\n </div>\n <mj-dialog-actions>\n <button mjButton (click)=\"close()\">\n <i class=\"fa-solid fa-times\"></i> Cancel\n </button>\n <button mjButton\n variant=\"primary\"\n [disabled]=\"!categoryName.trim() || isCreating\"\n (click)=\"createCategory()\">\n @if (isCreating) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i> Creating...\n } @else {\n <i class=\"fa-solid fa-check\"></i> Create Category\n }\n </button>\n </mj-dialog-actions>\n </mj-dialog>\n}\n"]}
|
|
@@ -8,7 +8,7 @@ import { Component, ViewChild, inject } from '@angular/core';
|
|
|
8
8
|
import { RegisterClass, UUIDsEqual } from '@memberjunction/global';
|
|
9
9
|
import { BaseFormComponent, CUSTOM_LAYOUT_TOOLBAR_CONFIG } from '@memberjunction/ng-base-forms';
|
|
10
10
|
import { MJQueryFormComponent } from '../../generated/Entities/MJQuery/mjquery.form.component';
|
|
11
|
-
import {
|
|
11
|
+
import { RunView, RUN_QUERY_SQL_FILTERS, CompositeKey } from '@memberjunction/core';
|
|
12
12
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
13
13
|
import { NavigationService } from '@memberjunction/ng-shared';
|
|
14
14
|
import { Subject } from 'rxjs';
|
|
@@ -1320,7 +1320,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1320
1320
|
get CurrentQueryInfo() {
|
|
1321
1321
|
if (!this.record?.ID)
|
|
1322
1322
|
return undefined;
|
|
1323
|
-
return
|
|
1323
|
+
return this.ProviderToUse.Queries.find(q => UUIDsEqual(q.ID, this.record.ID));
|
|
1324
1324
|
}
|
|
1325
1325
|
/**
|
|
1326
1326
|
* Gets queries that depend on (reference) this query via composition.
|
|
@@ -1396,7 +1396,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1396
1396
|
if (this.record && this.record.ID) {
|
|
1397
1397
|
this.isLoadingParameters = true;
|
|
1398
1398
|
try {
|
|
1399
|
-
const rv =
|
|
1399
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1400
1400
|
const results = await rv.RunView({
|
|
1401
1401
|
EntityName: 'MJ: Query Parameters',
|
|
1402
1402
|
ExtraFilter: `QueryID='${this.record.ID}'`,
|
|
@@ -1421,7 +1421,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1421
1421
|
if (this.record && this.record.ID) {
|
|
1422
1422
|
this.isLoadingFields = true;
|
|
1423
1423
|
try {
|
|
1424
|
-
const rv =
|
|
1424
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1425
1425
|
const results = await rv.RunView({
|
|
1426
1426
|
EntityName: 'MJ: Query Fields',
|
|
1427
1427
|
ExtraFilter: `QueryID='${this.record.ID}'`,
|
|
@@ -1446,7 +1446,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1446
1446
|
if (this.record && this.record.ID) {
|
|
1447
1447
|
this.isLoadingEntities = true;
|
|
1448
1448
|
try {
|
|
1449
|
-
const rv =
|
|
1449
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1450
1450
|
const results = await rv.RunView({
|
|
1451
1451
|
EntityName: 'MJ: Query Entities',
|
|
1452
1452
|
ExtraFilter: `QueryID='${this.record.ID}'`,
|
|
@@ -1472,7 +1472,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1472
1472
|
if (this.record && this.record.ID) {
|
|
1473
1473
|
this.isLoadingPermissions = true;
|
|
1474
1474
|
try {
|
|
1475
|
-
const rv =
|
|
1475
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1476
1476
|
const results = await rv.RunView({
|
|
1477
1477
|
EntityName: 'MJ: Query Permissions',
|
|
1478
1478
|
ExtraFilter: `QueryID='${this.record.ID}'`,
|
|
@@ -1495,7 +1495,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1495
1495
|
}
|
|
1496
1496
|
async loadCategories() {
|
|
1497
1497
|
try {
|
|
1498
|
-
const rv =
|
|
1498
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
1499
1499
|
const results = await rv.RunView({
|
|
1500
1500
|
EntityName: 'MJ: Query Categories',
|
|
1501
1501
|
OrderBy: 'Name',
|
|
@@ -1594,7 +1594,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1594
1594
|
}
|
|
1595
1595
|
try {
|
|
1596
1596
|
// Create new category with trimmed name
|
|
1597
|
-
const md =
|
|
1597
|
+
const md = this.ProviderToUse;
|
|
1598
1598
|
const newCategory = await md.GetEntityObject('MJ: Query Categories');
|
|
1599
1599
|
newCategory.Name = value.trim();
|
|
1600
1600
|
const saved = await newCategory.Save();
|
|
@@ -1668,7 +1668,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1668
1668
|
*/
|
|
1669
1669
|
async addParameter() {
|
|
1670
1670
|
try {
|
|
1671
|
-
const md =
|
|
1671
|
+
const md = this.ProviderToUse;
|
|
1672
1672
|
const newParam = await md.GetEntityObject('MJ: Query Parameters');
|
|
1673
1673
|
newParam.QueryID = this.record.ID;
|
|
1674
1674
|
newParam.Name = `param${this.queryParameters.length + 1}`;
|
|
@@ -1706,7 +1706,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1706
1706
|
try {
|
|
1707
1707
|
// Reload the parameter entity fresh to ensure we have a clean copy
|
|
1708
1708
|
// not tied to any form transaction state
|
|
1709
|
-
const md =
|
|
1709
|
+
const md = this.ProviderToUse;
|
|
1710
1710
|
const freshParam = await md.GetEntityObject('MJ: Query Parameters');
|
|
1711
1711
|
const loaded = await freshParam.Load(param.ID);
|
|
1712
1712
|
if (!loaded) {
|
|
@@ -1782,7 +1782,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1782
1782
|
}
|
|
1783
1783
|
else {
|
|
1784
1784
|
try {
|
|
1785
|
-
const md =
|
|
1785
|
+
const md = this.ProviderToUse;
|
|
1786
1786
|
const newCategory = await md.GetEntityObject('MJ: Query Categories');
|
|
1787
1787
|
newCategory.Name = this.record.CategoryID.trim();
|
|
1788
1788
|
const saved = await newCategory.Save();
|
|
@@ -1865,7 +1865,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1865
1865
|
* Handle composition token click — navigate to the referenced query
|
|
1866
1866
|
*/
|
|
1867
1867
|
onCompositionTokenClick(event) {
|
|
1868
|
-
const md =
|
|
1868
|
+
const md = this.ProviderToUse;
|
|
1869
1869
|
const segments = event.FullPath.split('/').map(s => s.trim()).filter(s => s.length > 0);
|
|
1870
1870
|
if (segments.length === 0)
|
|
1871
1871
|
return;
|
|
@@ -1915,7 +1915,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1915
1915
|
*/
|
|
1916
1916
|
async addField() {
|
|
1917
1917
|
try {
|
|
1918
|
-
const md =
|
|
1918
|
+
const md = this.ProviderToUse;
|
|
1919
1919
|
const newField = await md.GetEntityObject('MJ: Query Fields');
|
|
1920
1920
|
newField.QueryID = this.record.ID;
|
|
1921
1921
|
newField.Name = `field${this.queryFields.length + 1}`;
|
|
@@ -1944,7 +1944,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1944
1944
|
return;
|
|
1945
1945
|
}
|
|
1946
1946
|
try {
|
|
1947
|
-
const md =
|
|
1947
|
+
const md = this.ProviderToUse;
|
|
1948
1948
|
const freshField = await md.GetEntityObject('MJ: Query Fields');
|
|
1949
1949
|
const loaded = await freshField.Load(field.ID);
|
|
1950
1950
|
if (!loaded) {
|
|
@@ -1974,7 +1974,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1974
1974
|
*/
|
|
1975
1975
|
async addEntity() {
|
|
1976
1976
|
try {
|
|
1977
|
-
const md =
|
|
1977
|
+
const md = this.ProviderToUse;
|
|
1978
1978
|
const newEntity = await md.GetEntityObject('MJ: Query Entities');
|
|
1979
1979
|
newEntity.QueryID = this.record.ID;
|
|
1980
1980
|
// Add to the list immediately for UI responsiveness
|
|
@@ -1994,7 +1994,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
1994
1994
|
return;
|
|
1995
1995
|
}
|
|
1996
1996
|
try {
|
|
1997
|
-
const md =
|
|
1997
|
+
const md = this.ProviderToUse;
|
|
1998
1998
|
const freshEntity = await md.GetEntityObject('MJ: Query Entities');
|
|
1999
1999
|
const loaded = await freshEntity.Load(entity.ID);
|
|
2000
2000
|
if (!loaded) {
|
|
@@ -2023,7 +2023,7 @@ let MJQueryFormComponentExtended = class MJQueryFormComponentExtended extends MJ
|
|
|
2023
2023
|
* Get entity options for dropdown
|
|
2024
2024
|
*/
|
|
2025
2025
|
getEntityOptions() {
|
|
2026
|
-
return
|
|
2026
|
+
return this.ProviderToUse.Entities.map(e => ({
|
|
2027
2027
|
text: e.Name,
|
|
2028
2028
|
id: e.ID
|
|
2029
2029
|
})).sort((a, b) => a.text.localeCompare(b.text));
|