@memberjunction/ng-core-entity-forms 6.2.0-edge.5 → 6.2.0-edge.6
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/custom/AIAgentSessions/ai-agent-session-form.component.d.ts +2 -0
- package/dist/lib/custom/AIAgentSessions/ai-agent-session-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgentSessions/ai-agent-session-form.component.js +103 -95
- package/dist/lib/custom/AIAgentSessions/ai-agent-session-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +6 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +6 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +2 -0
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +2 -0
- 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 +2 -0
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +21 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.d.ts +2 -0
- package/dist/lib/custom/Actions/action-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +29 -11
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts +2 -0
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.js +2 -0
- package/dist/lib/custom/EntityActions/entityaction.form.component.js.map +1 -1
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts +11 -4
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts.map +1 -1
- package/dist/lib/custom/MLModels/ml-model-view-models.js +14 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.js.map +1 -1
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts +15 -0
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts.map +1 -1
- package/dist/lib/custom/MLModels/ps-model-detail.component.js +186 -92
- package/dist/lib/custom/MLModels/ps-model-detail.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.d.ts +2 -0
- package/dist/lib/custom/Queries/query-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +2 -0
- package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.d.ts +19 -1
- package/dist/lib/custom/Templates/templates-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.js +20 -27
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +14 -6
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +121 -111
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js +105 -103
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentSession/mjaiagentsession.form.component.js +2 -2
- package/dist/lib/generated/Entities/MJAIAgentSession/mjaiagentsession.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCalendarEventLink/mjcalendareventlink.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJCalendarEventLink/mjcalendareventlink.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJCalendarEventLink/mjcalendareventlink.form.component.js +74 -0
- package/dist/lib/generated/Entities/MJCalendarEventLink/mjcalendareventlink.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJCalendarSyncState/mjcalendarsyncstate.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJCalendarSyncState/mjcalendarsyncstate.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJCalendarSyncState/mjcalendarsyncstate.form.component.js +64 -0
- package/dist/lib/generated/Entities/MJCalendarSyncState/mjcalendarsyncstate.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJCommunicationProvider/mjcommunicationprovider.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJCommunicationProvider/mjcommunicationprovider.form.component.js +62 -16
- package/dist/lib/generated/Entities/MJCommunicationProvider/mjcommunicationprovider.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCompanyIntegration/mjcompanyintegration.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJCompanyIntegration/mjcompanyintegration.form.component.js +28 -10
- package/dist/lib/generated/Entities/MJCompanyIntegration/mjcompanyintegration.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJCompanyIntegrationObject/mjcompanyintegrationobject.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObject/mjcompanyintegrationobject.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObject/mjcompanyintegrationobject.form.component.js +189 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObject/mjcompanyintegrationobject.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObjectField/mjcompanyintegrationobjectfield.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObjectField/mjcompanyintegrationobjectfield.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObjectField/mjcompanyintegrationobjectfield.form.component.js +116 -0
- package/dist/lib/generated/Entities/MJCompanyIntegrationObjectField/mjcompanyintegrationobjectfield.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJComponent/mjcomponent.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJComponent/mjcomponent.form.component.js +51 -35
- package/dist/lib/generated/Entities/MJComponent/mjcomponent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentFileType/mjcontentfiletype.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentFileType/mjcontentfiletype.form.component.js +36 -18
- package/dist/lib/generated/Entities/MJContentFileType/mjcontentfiletype.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 +74 -60
- package/dist/lib/generated/Entities/MJContentItem/mjcontentitem.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentItemChunk/mjcontentitemchunk.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJContentItemChunk/mjcontentitemchunk.form.component.js +30 -32
- package/dist/lib/generated/Entities/MJContentItemChunk/mjcontentitemchunk.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js +43 -35
- package/dist/lib/generated/Entities/MJContentSource/mjcontentsource.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJContentType/mjcontenttype.form.component.js +21 -19
- package/dist/lib/generated/Entities/MJContentType/mjcontenttype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJDashboard/mjdashboard.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJDashboard/mjdashboard.form.component.js +45 -29
- package/dist/lib/generated/Entities/MJDashboard/mjdashboard.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJDuplicateRun/mjduplicaterun.form.component.js +19 -17
- package/dist/lib/generated/Entities/MJDuplicateRun/mjduplicaterun.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 +128 -92
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntityAlternateBaseView/mjentityalternatebaseview.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJEntityAlternateBaseView/mjentityalternatebaseview.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJEntityAlternateBaseView/mjentityalternatebaseview.form.component.js +129 -0
- package/dist/lib/generated/Entities/MJEntityAlternateBaseView/mjentityalternatebaseview.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJEntityDocument/mjentitydocument.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntityDocument/mjentitydocument.form.component.js +27 -9
- package/dist/lib/generated/Entities/MJEntityDocument/mjentitydocument.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJFile/mjfile.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJFile/mjfile.form.component.js +30 -12
- package/dist/lib/generated/Entities/MJFile/mjfile.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJIntegration/mjintegration.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJIntegration/mjintegration.form.component.js +26 -8
- package/dist/lib/generated/Entities/MJIntegration/mjintegration.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js +24 -6
- package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJIntegrationObjectField/mjintegrationobjectfield.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJIntegrationObjectField/mjintegrationobjectfield.form.component.js +25 -6
- package/dist/lib/generated/Entities/MJIntegrationObjectField/mjintegrationobjectfield.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.js +73 -59
- package/dist/lib/generated/Entities/MJQuery/mjquery.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJQueryEntity/mjqueryentity.form.component.js +10 -8
- package/dist/lib/generated/Entities/MJQueryEntity/mjqueryentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJQueryParameter/mjqueryparameter.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJQueryParameter/mjqueryparameter.form.component.js +12 -4
- package/dist/lib/generated/Entities/MJQueryParameter/mjqueryparameter.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +209 -137
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJUserView/mjuserview.form.component.js +50 -38
- package/dist/lib/generated/Entities/MJUserView/mjuserview.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +446 -441
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +15 -0
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts +10 -0
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.js +15 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts +4 -0
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.js +77 -61
- package/dist/lib/panels/model-predictions/model-prediction.panel.js.map +1 -1
- package/dist/lib/shared/components/template-editor.component.d.ts +37 -0
- package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +424 -285
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/package.json +48 -48
|
@@ -12,6 +12,12 @@ export declare class MJTemplateFormComponentExtended extends MJTemplateFormCompo
|
|
|
12
12
|
get toolbarConfig(): import("@memberjunction/ng-base-forms").FormToolbarConfig;
|
|
13
13
|
/** Custom-layout Template form looks best full-width on first open. */
|
|
14
14
|
getDefaultFormWidthMode(): 'centered' | 'full-width';
|
|
15
|
+
/** Custom-layout form owns its entire body; suppress auto-filled relationship sections. */
|
|
16
|
+
get OwnsEntireFormBody(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Read-only mirror of the editor's rows (fed only by {@link OnSharedTemplateContentChange}),
|
|
19
|
+
* kept for the count badges and unsaved-changes flag. Never load or save through it.
|
|
20
|
+
*/
|
|
15
21
|
TemplateContents: MJTemplateContentEntity[];
|
|
16
22
|
/** @deprecated Use {@link TemplateContents}. */
|
|
17
23
|
get templateContents(): MJTemplateContentEntity[];
|
|
@@ -85,7 +91,12 @@ export declare class MJTemplateFormComponentExtended extends MJTemplateFormCompo
|
|
|
85
91
|
get codeEditor(): CodeEditorComponent | null;
|
|
86
92
|
/** @deprecated Use {@link CodeEditor}. */
|
|
87
93
|
set codeEditor(value: CodeEditorComponent | null);
|
|
88
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* The embedded editor OWNS the template content rows: it loads them and the user edits its
|
|
96
|
+
* instances. This form never loads a second copy (a second, separately loaded copy is what
|
|
97
|
+
* silently discarded edits in MJ#4754); on Save it folds the editor's dirty rows into its own
|
|
98
|
+
* transaction (see PopulatePendingRecords).
|
|
99
|
+
*/
|
|
89
100
|
TemplateEditor: TemplateEditorComponent | undefined;
|
|
90
101
|
private isUpdatingEditorValue;
|
|
91
102
|
IsRunningTemplate: boolean;
|
|
@@ -117,8 +128,15 @@ export declare class MJTemplateFormComponentExtended extends MJTemplateFormCompo
|
|
|
117
128
|
private activeTimeouts;
|
|
118
129
|
private confirmService;
|
|
119
130
|
ngOnInit(): Promise<void>;
|
|
131
|
+
/** Also discards the content edits held by the editor, so a later Save cannot persist them. */
|
|
132
|
+
CancelEdit(): void;
|
|
120
133
|
ngOnDestroy(): void;
|
|
121
134
|
ngAfterViewInit(): void;
|
|
135
|
+
/**
|
|
136
|
+
* Reloads the template contents in the embedded editor (discarding unsaved content edits); the
|
|
137
|
+
* editor's ContentChange then refreshes {@link TemplateContents}. No-op while the editor is not
|
|
138
|
+
* rendered, since it loads the contents itself when it is.
|
|
139
|
+
*/
|
|
122
140
|
LoadTemplateContents(): Promise<void>;
|
|
123
141
|
/** @deprecated Use {@link LoadTemplateContents}. */
|
|
124
142
|
loadTemplateContents(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates-form.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Templates/templates-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAa,aAAa,EAA6B,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAA4B,MAAM,+BAA+B,CAAC;AAGpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAMxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;;AAElH,qBAOa,+BAAgC,SAAQ,uBAAwB,YAAW,MAAM,EAAE,SAAS,EAAE,aAAa;IAC7G,MAAM,EAAG,gBAAgB,CAAC;IACjC,SAAgB,aAAa,4DAAgC;IAE7D,6CAA6C;IAC7C,IAAW,aAAa,8DAEvB;IAED,uEAAuE;IACvD,uBAAuB,IAAI,UAAU,GAAG,YAAY;
|
|
1
|
+
{"version":3,"file":"templates-form.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Templates/templates-form.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,MAAM,EAAE,SAAS,EAAa,aAAa,EAA6B,MAAM,eAAe,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAA4B,MAAM,+BAA+B,CAAC;AAGpH,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AAMxG,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;;AAElH,qBAOa,+BAAgC,SAAQ,uBAAwB,YAAW,MAAM,EAAE,SAAS,EAAE,aAAa;IAC7G,MAAM,EAAG,gBAAgB,CAAC;IACjC,SAAgB,aAAa,4DAAgC;IAE7D,6CAA6C;IAC7C,IAAW,aAAa,8DAEvB;IAED,uEAAuE;IACvD,uBAAuB,IAAI,UAAU,GAAG,YAAY;IAEpE,2FAA2F;IAC3F,IAAoB,kBAAkB,IAAI,OAAO,CAAiB;IAElE;;;OAGG;IACI,gBAAgB,EAAE,uBAAuB,EAAE,CAAM;IAExD,gDAAgD;IAChD,IAAW,gBAAgB,IAAI,uBAAuB,EAAE,CAEvD;IACD,gDAAgD;IAChD,IAAW,gBAAgB,CAAC,KAAK,EAAE,uBAAuB,EAAE,EAE3D;IACM,oBAAoB,EAAE,MAAM,CAAK;IAExC,oDAAoD;IACpD,IAAW,oBAAoB,IAAI,MAAM,CAExC;IACD,oDAAoD;IACpD,IAAW,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAE5C;IACM,kBAAkB,EAAE,OAAO,CAAS;IAE3C,kDAAkD;IAClD,IAAW,kBAAkB,IAAI,OAAO,CAEvC;IACD,kDAAkD;IAClD,IAAW,kBAAkB,CAAC,KAAK,EAAE,OAAO,E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EAAE,gBAAgB;yCAtzB5C,+BAA+B;2CAA/B,+BAA+B;CA0zB3C"}
|
|
@@ -297,6 +297,10 @@ let MJTemplateFormComponentExtended = class MJTemplateFormComponentExtended exte
|
|
|
297
297
|
constructor() {
|
|
298
298
|
super(...arguments);
|
|
299
299
|
this.ToolbarConfig = CUSTOM_LAYOUT_TOOLBAR_CONFIG;
|
|
300
|
+
/**
|
|
301
|
+
* Read-only mirror of the editor's rows (fed only by {@link OnSharedTemplateContentChange}),
|
|
302
|
+
* kept for the count badges and unsaved-changes flag. Never load or save through it.
|
|
303
|
+
*/
|
|
300
304
|
this.TemplateContents = [];
|
|
301
305
|
this.SelectedContentIndex = 0;
|
|
302
306
|
this.IsAddingNewContent = false;
|
|
@@ -332,6 +336,8 @@ let MJTemplateFormComponentExtended = class MJTemplateFormComponentExtended exte
|
|
|
332
336
|
}
|
|
333
337
|
/** Custom-layout Template form looks best full-width on first open. */
|
|
334
338
|
getDefaultFormWidthMode() { return 'full-width'; }
|
|
339
|
+
/** Custom-layout form owns its entire body; suppress auto-filled relationship sections. */
|
|
340
|
+
get OwnsEntireFormBody() { return true; }
|
|
335
341
|
/** @deprecated Use {@link TemplateContents}. */
|
|
336
342
|
get templateContents() {
|
|
337
343
|
return this.TemplateContents;
|
|
@@ -462,10 +468,17 @@ let MJTemplateFormComponentExtended = class MJTemplateFormComponentExtended exte
|
|
|
462
468
|
}
|
|
463
469
|
async ngOnInit() {
|
|
464
470
|
await super.ngOnInit();
|
|
465
|
-
|
|
471
|
+
// Template contents are loaded by the embedded editor (see TemplateEditor), not here.
|
|
466
472
|
await this.LoadCategories();
|
|
467
473
|
this.LoadContentTypes();
|
|
468
474
|
}
|
|
475
|
+
/** Also discards the content edits held by the editor, so a later Save cannot persist them. */
|
|
476
|
+
CancelEdit() {
|
|
477
|
+
super.CancelEdit();
|
|
478
|
+
this.TemplateEditor?.RefreshAndDiscardChanges().catch((error) => {
|
|
479
|
+
console.error(`Failed to discard template content changes for template ${this.record?.ID}:`, error);
|
|
480
|
+
});
|
|
481
|
+
}
|
|
469
482
|
ngOnDestroy() {
|
|
470
483
|
super.ngOnDestroy();
|
|
471
484
|
this.destroy$.next();
|
|
@@ -478,33 +491,13 @@ let MJTemplateFormComponentExtended = class MJTemplateFormComponentExtended exte
|
|
|
478
491
|
// Initial sync when view is ready
|
|
479
492
|
this.syncEditorValue();
|
|
480
493
|
}
|
|
494
|
+
/**
|
|
495
|
+
* Reloads the template contents in the embedded editor (discarding unsaved content edits); the
|
|
496
|
+
* editor's ContentChange then refreshes {@link TemplateContents}. No-op while the editor is not
|
|
497
|
+
* rendered, since it loads the contents itself when it is.
|
|
498
|
+
*/
|
|
481
499
|
async LoadTemplateContents() {
|
|
482
|
-
|
|
483
|
-
try {
|
|
484
|
-
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
485
|
-
const results = await rv.RunView({
|
|
486
|
-
EntityName: 'MJ: Template Contents',
|
|
487
|
-
ExtraFilter: `TemplateID='${this.record.ID}'`,
|
|
488
|
-
OrderBy: 'Priority ASC, __mj_CreatedAt ASC',
|
|
489
|
-
ResultType: 'entity_object'
|
|
490
|
-
});
|
|
491
|
-
this.TemplateContents = results.Results;
|
|
492
|
-
// If we have contents but no selection, select the first one
|
|
493
|
-
if (this.TemplateContents.length > 0 && this.SelectedContentIndex === 0) {
|
|
494
|
-
this.SelectedContentIndex = 0;
|
|
495
|
-
}
|
|
496
|
-
// If no template contents exist, create a default one for single-content optimization
|
|
497
|
-
if (this.TemplateContents.length === 0) {
|
|
498
|
-
await this.CreateDefaultTemplateContent();
|
|
499
|
-
}
|
|
500
|
-
// Entity change tracking is handled automatically by BaseEntity
|
|
501
|
-
// Sync editor value after loading content
|
|
502
|
-
this.syncEditorValue();
|
|
503
|
-
}
|
|
504
|
-
catch (error) {
|
|
505
|
-
console.error('Error loading template contents:', error);
|
|
506
|
-
}
|
|
507
|
-
}
|
|
500
|
+
await this.TemplateEditor?.RefreshAndDiscardChanges();
|
|
508
501
|
}
|
|
509
502
|
/** @deprecated Use {@link LoadTemplateContents}. */
|
|
510
503
|
async loadTemplateContents() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates-form.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/Templates/templates-form.component.ts","../../../../src/lib/custom/Templates/templates-form.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,SAAS,EAAoC,MAAM,EAAE,MAAM,eAAe,CAAC;AAElH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;;;;ICUpC,iCAIgF;IAHzE,4UAAyB;IADhC,iBAIgF;;;IAHzE,kDAAyB;;;IAO5B,gCAA2B;IACvB,wBAAwC;IAAC,wBAC7C;IAAA,iBAAO;;;IAEP,gCAA6B;IACzB,wBAAwC;IAAC,0BAC7C;IAAA,iBAAO;;;IARX,0BAAI;IAAA,YAAuC;IAAA,iBAAK;IAK9C,AAJF,gIAAuB,0GAId;;;IALL,cAAuC;IAAvC,8DAAuC;IAC3C,cAQC;IARD,gDAQC;;;;IAQG,AADJ,AADJ,+BAAkG,UACzF,gBAC0B;IAAA,wBAAQ;IAAA,iBAAQ;IAC3C,uCASqC;IATxB,+VAA+B;IAO7B,0OAAe,+BAA8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AAgB;;kFA9HlB,+BAA+B","sourcesContent":["import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ChangeDetectorRef, inject } from '@angular/core';\nimport { MJTemplateEntity, MJTemplateContentEntity, MJTemplateCategoryEntity } from '@memberjunction/core-entities';\nimport { RegisterClass } from '@memberjunction/global';\nimport { BaseFormComponent, CUSTOM_LAYOUT_TOOLBAR_CONFIG } from '@memberjunction/ng-base-forms';\nimport { MJTemplateFormComponent } from '../../generated/Entities/MJTemplate/mjtemplate.form.component';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\nimport { Subject } from 'rxjs';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { LanguageDescription } from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { CodeEditorComponent } from '@memberjunction/ng-code-editor';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { TemplateEditorComponent, TemplateEditorConfig } from '../../shared/components/template-editor.component';\n\n@RegisterClass(BaseFormComponent, 'MJ: Templates') \n@Component({\n standalone: false,\n selector: 'mj-templates-form',\n templateUrl: './templates-form.component.html',\n styleUrls: ['../../../shared/form-styles.css', './templates-form.component.css']\n})\nexport class MJTemplateFormComponentExtended extends MJTemplateFormComponent implements OnInit, OnDestroy, AfterViewInit {\n public record!: MJTemplateEntity;\n public readonly ToolbarConfig = CUSTOM_LAYOUT_TOOLBAR_CONFIG;\n\n /** @deprecated Use {@link ToolbarConfig}. */\n public get toolbarConfig() {\n return this.ToolbarConfig;\n }\n\n /** Custom-layout Template form looks best full-width on first open. */\n public override getDefaultFormWidthMode(): 'centered' | 'full-width' { return 'full-width'; }\n public TemplateContents: MJTemplateContentEntity[] = [];\n\n /** @deprecated Use {@link TemplateContents}. */\n public get templateContents(): MJTemplateContentEntity[] {\n return this.TemplateContents;\n }\n /** @deprecated Use {@link TemplateContents}. */\n public set templateContents(value: MJTemplateContentEntity[]) {\n this.TemplateContents = value;\n }\n public SelectedContentIndex: number = 0;\n\n /** @deprecated Use {@link SelectedContentIndex}. */\n public get selectedContentIndex(): number {\n return this.SelectedContentIndex;\n }\n /** @deprecated Use {@link SelectedContentIndex}. */\n public set selectedContentIndex(value: number) {\n this.SelectedContentIndex = value;\n }\n public IsAddingNewContent: boolean = false;\n\n /** @deprecated Use {@link IsAddingNewContent}. */\n public get isAddingNewContent(): boolean {\n return this.IsAddingNewContent;\n }\n /** @deprecated Use {@link IsAddingNewContent}. */\n public set isAddingNewContent(value: boolean) {\n this.IsAddingNewContent = value;\n }\n public NewTemplateContent: MJTemplateContentEntity | null = null;\n\n /** @deprecated Use {@link NewTemplateContent}. */\n public get newTemplateContent(): MJTemplateContentEntity | null {\n return this.NewTemplateContent;\n }\n /** @deprecated Use {@link NewTemplateContent}. */\n public set newTemplateContent(value: MJTemplateContentEntity | null) {\n this.NewTemplateContent = value;\n }\n public HasUnsavedChanges: boolean = false;\n\n /** @deprecated Use {@link HasUnsavedChanges}. */\n public get hasUnsavedChanges(): boolean {\n return this.HasUnsavedChanges;\n }\n /** @deprecated Use {@link HasUnsavedChanges}. */\n public set hasUnsavedChanges(value: boolean) {\n this.HasUnsavedChanges = value;\n }\n public TemplateInfoExpanded: boolean = true;\n\n /** @deprecated Use {@link TemplateInfoExpanded}. */\n public get templateInfoExpanded(): boolean {\n return this.TemplateInfoExpanded;\n }\n /** @deprecated Use {@link TemplateInfoExpanded}. */\n public set templateInfoExpanded(value: boolean) {\n this.TemplateInfoExpanded = value;\n }\n public TemplateContentsExpanded: boolean = true;\n\n /** @deprecated Use {@link TemplateContentsExpanded}. */\n public get templateContentsExpanded(): boolean {\n return this.TemplateContentsExpanded;\n }\n /** @deprecated Use {@link TemplateContentsExpanded}. */\n public set templateContentsExpanded(value: boolean) {\n this.TemplateContentsExpanded = value;\n }\n public CategoryOptions: Array<{text: string, value: string}> = [\n { text: 'Select Category...', value: '' },\n // TODO: Load from database\n ];\n\n /** @deprecated Use {@link CategoryOptions}. */\n public get categoryOptions(): Array<{text: string, value: string}> {\n return this.CategoryOptions;\n }\n /** @deprecated Use {@link CategoryOptions}. */\n public set categoryOptions(value: Array<{text: string, value: string}>) {\n this.CategoryOptions = value;\n }\n public ContentTypeOptions: Array<{text: string, value: string}> = [];\n\n /** @deprecated Use {@link ContentTypeOptions}. */\n public get contentTypeOptions(): Array<{text: string, value: string}> {\n return this.ContentTypeOptions;\n }\n /** @deprecated Use {@link ContentTypeOptions}. */\n public set contentTypeOptions(value: Array<{text: string, value: string}>) {\n this.ContentTypeOptions = value;\n }\n public SupportedLanguages: LanguageDescription[] = languages;\n\n /** @deprecated Use {@link SupportedLanguages}. */\n public get supportedLanguages(): LanguageDescription[] {\n return this.SupportedLanguages;\n }\n /** @deprecated Use {@link SupportedLanguages}. */\n public set supportedLanguages(value: LanguageDescription[]) {\n this.SupportedLanguages = value;\n }\n \n @ViewChild('codeEditor') CodeEditor: CodeEditorComponent | null = null;\n\n /** @deprecated Use {@link CodeEditor}. */\n get codeEditor(): CodeEditorComponent | null {\n return this.CodeEditor;\n }\n /** @deprecated Use {@link CodeEditor}. */\n set codeEditor(value: CodeEditorComponent | null) {\n this.CodeEditor = value;\n }\n /** The embedded content editor; its dirty contents ride along in this form's save transaction. */\n @ViewChild('templateEditor') TemplateEditor: TemplateEditorComponent | undefined;\n private isUpdatingEditorValue = false;\n public IsRunningTemplate = false;\n\n /** @deprecated Use {@link IsRunningTemplate}. */\n public get isRunningTemplate() {\n return this.IsRunningTemplate;\n }\n /** @deprecated Use {@link IsRunningTemplate}. */\n public set isRunningTemplate(value) {\n this.IsRunningTemplate = value;\n }\n public TemplateTestResult: string | null = null;\n\n /** @deprecated Use {@link TemplateTestResult}. */\n public get templateTestResult(): string | null {\n return this.TemplateTestResult;\n }\n /** @deprecated Use {@link TemplateTestResult}. */\n public set templateTestResult(value: string | null) {\n this.TemplateTestResult = value;\n }\n public TemplateTestError: string | null = null;\n\n /** @deprecated Use {@link TemplateTestError}. */\n public get templateTestError(): string | null {\n return this.TemplateTestError;\n }\n /** @deprecated Use {@link TemplateTestError}. */\n public set templateTestError(value: string | null) {\n this.TemplateTestError = value;\n }\n public ShowParamDialog = false;\n\n /** @deprecated Use {@link ShowParamDialog}. */\n public get showParamDialog() {\n return this.ShowParamDialog;\n }\n /** @deprecated Use {@link ShowParamDialog}. */\n public set showParamDialog(value) {\n this.ShowParamDialog = value;\n }\n \n // Template editor configuration for shared component\n public TemplateEditorConfig: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: true,\n compactMode: false\n };\n\n /** @deprecated Use {@link TemplateEditorConfig}. */\n public get templateEditorConfig(): TemplateEditorConfig {\n return this.TemplateEditorConfig;\n }\n /** @deprecated Use {@link TemplateEditorConfig}. */\n public set templateEditorConfig(value: TemplateEditorConfig) {\n this.TemplateEditorConfig = value;\n }\n \n private destroy$ = new Subject<void>();\n private activeTimeouts: number[] = [];\n private confirmService = inject(MJConfirmService);\n\n async ngOnInit() {\n await super.ngOnInit();\n await this.LoadTemplateContents();\n await this.LoadCategories();\n this.LoadContentTypes();\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n this.destroy$.next();\n this.destroy$.complete();\n \n // Clean up any active timeouts\n this.activeTimeouts.forEach(timeoutId => clearTimeout(timeoutId));\n this.activeTimeouts.length = 0;\n }\n\n ngAfterViewInit() {\n // Initial sync when view is ready\n this.syncEditorValue();\n }\n\n async LoadTemplateContents() {\n if (this.record && this.record.ID) {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const results = await rv.RunView<MJTemplateContentEntity>({\n EntityName: 'MJ: Template Contents',\n ExtraFilter: `TemplateID='${this.record.ID}'`,\n OrderBy: 'Priority ASC, __mj_CreatedAt ASC',\n ResultType: 'entity_object'\n });\n \n this.TemplateContents = results.Results;\n \n // If we have contents but no selection, select the first one\n if (this.TemplateContents.length > 0 && this.SelectedContentIndex === 0) {\n this.SelectedContentIndex = 0;\n }\n \n // If no template contents exist, create a default one for single-content optimization\n if (this.TemplateContents.length === 0) {\n await this.CreateDefaultTemplateContent();\n }\n\n // Entity change tracking is handled automatically by BaseEntity\n \n // Sync editor value after loading content\n this.syncEditorValue();\n } catch (error) {\n console.error('Error loading template contents:', error);\n }\n }\n }\n\n /** @deprecated Use {@link LoadTemplateContents}. */\n async loadTemplateContents() {\n return this.LoadTemplateContents();\n }\n\n async CreateDefaultTemplateContent() {\n const md = this.ProviderToUse;\n const defaultContent = await md.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n defaultContent.TemplateID = this.record.ID;\n defaultContent.Priority = 1;\n defaultContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n defaultContent.TypeID = validContentTypes[0].value;\n }\n \n this.TemplateContents = [defaultContent];\n this.SelectedContentIndex = 0;\n \n // Sync editor value after creating default content\n this.syncEditorValue();\n }\n\n /** @deprecated Use {@link CreateDefaultTemplateContent}. */\n async createDefaultTemplateContent() {\n return this.CreateDefaultTemplateContent();\n }\n\n async SelectTemplateContent(index: number, confirmSwitch: boolean = true): Promise<void> {\n // If we're adding new content and user clicks on existing content, ask for confirmation\n if (this.IsAddingNewContent && confirmSwitch) {\n if (!(await this.confirmService.Confirm({\n title: 'Discard changes?',\n message: 'Switch content version and lose your unsaved changes?',\n detail: 'Your changes to the new content version will be lost.'\n }))) {\n return;\n }\n }\n \n if (index >= 0 && index < this.TemplateContents.length) {\n this.SelectedContentIndex = index;\n this.IsAddingNewContent = false;\n // Don't clear newTemplateContent to preserve the work in progress\n \n // Sync editor value when switching content\n this.syncEditorValue();\n }\n }\n\n /** @deprecated Use {@link SelectTemplateContent}. */\n async selectTemplateContent(index: number, confirmSwitch: boolean = true): Promise<void> {\n return this.SelectTemplateContent(index, confirmSwitch);\n }\n\n async LoadCategories() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const results = await rv.RunView({\n EntityName: 'MJ: Template Categories' \n });\n \n this.CategoryOptions = [\n { text: 'Select Category...', value: '' },\n ...results.Results.map((cat: any) => ({\n text: cat.Name,\n value: cat.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading categories:', error);\n this.CategoryOptions = [{ text: 'Select Category...', value: '' }];\n }\n }\n\n /** @deprecated Use {@link LoadCategories}. */\n async loadCategories() {\n return this.LoadCategories();\n }\n\n LoadContentTypes() {\n try {\n // Get content types from TemplateEngine cache\n const contentTypes = TemplateEngineBase.Instance.TemplateContentTypes;\n this.ContentTypeOptions = [\n { text: 'Select Type...', value: '' },\n ...contentTypes.map(ct => ({\n text: ct.Name,\n value: ct.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading content types:', error);\n // Fallback to basic types\n this.ContentTypeOptions = [\n { text: 'Select Type...', value: '' },\n { text: 'HTML', value: 'HTML' },\n { text: 'Plain Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' }\n ];\n }\n }\n\n /** @deprecated Use {@link LoadContentTypes}. */\n loadContentTypes() {\n return this.LoadContentTypes();\n }\n\n async OnCategoryChange(value: string) {\n // If it's a new category (string but not in existing options)\n if (value && !this.CategoryOptions.find(opt => opt.value === value)) {\n // Check for duplicate category names (case-insensitive, trimmed)\n if (this.isDuplicateCategory(value)) {\n const existingCategory = this.CategoryOptions.find(option => \n option.text && option.text.trim().toLowerCase() === value.trim().toLowerCase()\n );\n if (existingCategory) {\n // Use the existing category instead\n this.record.CategoryID = existingCategory.value;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${existingCategory.text}\" already exists. Using existing category.`, \n 'warning'\n );\n }\n return;\n }\n\n try {\n // Create new category with trimmed name\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJTemplateCategoryEntity>('MJ: Template Categories');\n newCategory.Name = value.trim();\n newCategory.UserID = this.record.UserID || md.CurrentUser.ID;\n const saved = await newCategory.Save();\n \n if (saved) {\n // Add to options and set the ID\n this.CategoryOptions.push({\n text: newCategory.Name,\n value: newCategory.ID\n });\n this.record.CategoryID = newCategory.ID;\n MJNotificationService.Instance.CreateSimpleNotification(\n `New category \"${newCategory.Name}\" created successfully.`, \n 'success'\n );\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create new category. ${newCategory.LatestResult?.CompleteMessage || ''}`, \n 'error'\n );\n }\n } catch (error) {\n console.error('Error creating new category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating new category. Please try again.', \n 'error'\n );\n }\n }\n }\n\n /** @deprecated Use {@link OnCategoryChange}. */\n async onCategoryChange(value: string) {\n return this.OnCategoryChange(value);\n }\n\n async AddNewTemplateContent() {\n const md = this.ProviderToUse;\n this.NewTemplateContent = await md.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n this.NewTemplateContent.TemplateID = this.record.ID;\n this.NewTemplateContent.Priority = this.TemplateContents.length + 1;\n this.NewTemplateContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n this.NewTemplateContent.TypeID = validContentTypes[0].value;\n }\n this.NewTemplateContent.TemplateText = '';\n \n // Add immediately to the array\n this.TemplateContents.push(this.NewTemplateContent);\n this.SelectedContentIndex = this.TemplateContents.length - 1;\n this.IsAddingNewContent = true;\n \n // Sync editor value when adding new content\n this.syncEditorValue();\n }\n\n /** @deprecated Use {@link AddNewTemplateContent}. */\n async addNewTemplateContent() {\n return this.AddNewTemplateContent();\n }\n\n CancelNewTemplateContent() {\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n }\n\n /** @deprecated Use {@link CancelNewTemplateContent}. */\n cancelNewTemplateContent() {\n return this.CancelNewTemplateContent();\n }\n\n async DeleteTemplateContent(index: number) {\n if (index >= 0 && index < this.TemplateContents.length) {\n const contentToDelete = this.TemplateContents[index];\n\n if (contentToDelete.ID) {\n try {\n const result = await contentToDelete.Delete();\n if (result) {\n this.TemplateContents.splice(index, 1);\n \n // Adjust selected index if necessary\n if (this.SelectedContentIndex >= this.TemplateContents.length) {\n this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);\n }\n \n // If no contents remain, create a default one\n if (this.TemplateContents.length === 0) {\n await this.CreateDefaultTemplateContent();\n }\n } else {\n console.error('Delete returned false');\n MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete template content. ${contentToDelete.LatestResult.CompleteMessage}`, 'error');\n }\n } catch (error) {\n console.error('Error deleting template content:', error);\n }\n } else {\n // Not saved yet, just remove from array\n this.TemplateContents.splice(index, 1);\n if (this.SelectedContentIndex >= this.TemplateContents.length) {\n this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);\n }\n \n // Reset adding new content state if we're deleting the new content\n if (this.IsAddingNewContent && index === this.TemplateContents.length) {\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n }\n }\n } else {\n console.error('Invalid index for deletion:', index);\n }\n }\n\n /** @deprecated Use {@link DeleteTemplateContent}. */\n async deleteTemplateContent(index: number) {\n return this.DeleteTemplateContent(index);\n }\n\n get CurrentTemplateContent(): MJTemplateContentEntity | null {\n if (this.IsAddingNewContent) {\n return this.NewTemplateContent;\n }\n return this.TemplateContents[this.SelectedContentIndex] || null;\n }\n\n /** @deprecated Use {@link CurrentTemplateContent}. */\n get currentTemplateContent(): MJTemplateContentEntity | null {\n return this.CurrentTemplateContent;\n }\n\n get HasMultipleContents(): boolean {\n return this.TemplateContents.length > 1 || this.IsAddingNewContent;\n }\n\n /** @deprecated Use {@link HasMultipleContents}. */\n get hasMultipleContents(): boolean {\n return this.HasMultipleContents;\n }\n\n OnContentTypeChange() {\n // Content type changes just modify the current content, no new record creation\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnContentTypeChange}. */\n onContentTypeChange() {\n return this.OnContentTypeChange();\n }\n\n OnContentChange() {\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnContentChange}. */\n onContentChange() {\n return this.OnContentChange();\n }\n\n /**\n * Updates the hasUnsavedChanges flag based on entity dirty states\n */\n private updateUnsavedChangesFlag() {\n this.HasUnsavedChanges = this.TemplateContents.some(content => content.Dirty) || \n this.IsAddingNewContent ||\n this.record?.Dirty || false;\n }\n\n OnTemplateTextChange(event: any) {\n if (this.isUpdatingEditorValue) {\n // Ignore change events when we're programmatically updating the editor\n return;\n }\n \n if (this.CurrentTemplateContent) {\n // Extract value from event - might be event.target.value or just event depending on component\n const value = typeof event === 'string' ? event : (event.target?.value || event);\n this.CurrentTemplateContent.TemplateText = value;\n // hasUnsavedChanges is automatically handled by entity's IsDirty flag\n this.updateUnsavedChangesFlag();\n }\n }\n\n /** @deprecated Use {@link OnTemplateTextChange}. */\n onTemplateTextChange(event: any) {\n return this.OnTemplateTextChange(event);\n }\n\n /**\n * Helper method to track setTimeout calls for cleanup\n */\n private setTrackedTimeout(callback: () => void, delay: number): number {\n const timeoutId = setTimeout(() => {\n // Remove from tracking when it executes\n const index = this.activeTimeouts.indexOf(timeoutId);\n if (index > -1) {\n this.activeTimeouts.splice(index, 1);\n }\n callback();\n }, delay) as any as number;\n this.activeTimeouts.push(timeoutId);\n return timeoutId;\n }\n\n /**\n * Manually sync the editor value without triggering change events\n */\n private syncEditorValue() {\n // Use Promise.resolve() to wait for the next microtask after any pending changes\n Promise.resolve().then(() => {\n // Then tracked setTimeout for the next macrotask to ensure DOM is updated\n this.setTrackedTimeout(() => {\n if (!this.CodeEditor) {\n return;\n }\n \n this.isUpdatingEditorValue = true;\n const newValue = this.CurrentTemplateContent?.TemplateText || '';\n \n // Use the setValue method from mj-code-editor component\n this.CodeEditor.setValue(newValue); \n this.isUpdatingEditorValue = false;\n }, 0);\n });\n }\n\n /**\n * The embedded editor's new/dirty Template Contents join this form's pending records, so\n * `InternalSaveRecord()` commits the template and its contents in ONE transaction group (the\n * template first, so the content's TemplateID resolves) and `Validate()` covers the contents too.\n *\n * Before this, the form saved each content on its own AFTER the template save had already been\n * reported as successful; a content whose `Save()` returned false only reached `console.error`,\n * no mutation was issued, and the editor kept showing \"Unsaved changes\" forever.\n */\n protected override PopulatePendingRecords(): void {\n super.PopulatePendingRecords();\n const editorChanges = this.TemplateEditor?.GetPendingChanges() ?? [];\n for (const change of editorChanges) {\n this.PendingRecords.push(change);\n }\n }\n\n async SaveRecord(StopEditModeAfterSave: boolean = true): Promise<boolean> {\n // Check if we need to create a new category first\n if (this.record.CategoryID && !this.CategoryOptions.find(opt => opt.value === this.record.CategoryID)) {\n // Check for duplicate category names (case-insensitive, trimmed)\n if (this.isDuplicateCategory(this.record.CategoryID)) {\n const existingCategory = this.CategoryOptions.find(option => \n option.text && option.text.trim().toLowerCase() === this.record.CategoryID?.trim().toLowerCase()\n );\n if (existingCategory) {\n // Use the existing category instead\n this.record.CategoryID = existingCategory.value;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${existingCategory.text}\" already exists. Using existing category.`, \n 'warning'\n );\n }\n } else {\n try {\n // Create new category with trimmed name\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJTemplateCategoryEntity>('MJ: Template Categories');\n newCategory.Name = this.record.CategoryID.trim(); // CategoryID contains the new category name, trim it\n newCategory.UserID = this.record.UserID || md.CurrentUser.ID; \n const saved = await newCategory.Save();\n \n if (saved) {\n // Add to options and set the ID\n this.CategoryOptions.push({\n text: newCategory.Name,\n value: newCategory.ID\n });\n this.record.CategoryID = newCategory.ID;\n } else {\n console.error('Failed to create new category');\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create new category. ${newCategory.LatestResult?.CompleteMessage || ''}`, \n 'error'\n );\n return false;\n }\n } catch (error) {\n console.error('Error creating new category during save:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating new category during save. Please try again.', \n 'error'\n );\n return false;\n }\n }\n }\n\n // Call the parent save method to save the template\n // Before saving, if a new record, make sure the UserID is set\n if (!this.record.IsSaved && !this.record.UserID) {\n const md = this.ProviderToUse;\n this.record.UserID = md.CurrentUser.ID;\n }\n // The template AND the editor's contents commit together here (see PopulatePendingRecords)\n const templateSaved = await super.SaveRecord(StopEditModeAfterSave);\n\n if (templateSaved) {\n this.TemplateEditor?.MarkContentsSaved();\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n this.updateUnsavedChangesFlag();\n }\n\n return templateSaved;\n }\n\n GetContentTypeDisplayText(typeId: string): string {\n if (!typeId) return '-';\n const option = this.ContentTypeOptions.find(opt => opt.value === typeId);\n return option ? option.text : typeId;\n }\n\n /** @deprecated Use {@link GetContentTypeDisplayText}. */\n getContentTypeDisplayText(typeId: string): string {\n return this.GetContentTypeDisplayText(typeId);\n }\n\n GetEditorLanguage(): string {\n if (!this.CurrentTemplateContent?.TypeID) {\n return 'jinja2'; // default to jinja2 for template syntax (compatible with Nunjucks)\n }\n\n const contentType = this.CurrentTemplateContent.TypeID.toLowerCase();\n \n // Map content types to CodeMirror language modes\n switch (contentType) {\n case 'html':\n return 'jinja2'; // Use jinja2 for HTML templates to get template syntax highlighting\n case 'markdown':\n case 'md':\n return 'markdown';\n case 'javascript':\n case 'js':\n return 'javascript';\n case 'css':\n return 'css';\n case 'json':\n return 'json';\n case 'xml':\n return 'xml';\n case 'sql':\n return 'sql';\n case 'text':\n case 'plain':\n default:\n return 'jinja2'; // Default to jinja2 since templates often contain template syntax\n }\n }\n\n /** @deprecated Use {@link GetEditorLanguage}. */\n getEditorLanguage(): string {\n return this.GetEditorLanguage();\n }\n\n private isDuplicateCategory(categoryName: string): boolean {\n const normalizedName = categoryName.trim().toLowerCase();\n return this.CategoryOptions.some(option => \n option.text && option.text.trim().toLowerCase() === normalizedName\n );\n }\n\n /**\n * Test run the current template using the parameter dialog\n */\n async RunTemplate() {\n if (!this.record?.IsSaved || !this.CurrentTemplateContent) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please save the template before running it.', \n 'warning'\n );\n return;\n }\n\n // Save any unsaved changes first\n if (this.HasUnsavedChanges) {\n const saveResult = await this.SaveRecord(false); // Don't exit edit mode\n if (!saveResult) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to save template changes.', \n 'error'\n );\n return;\n }\n }\n\n // Show the parameter dialog\n this.ShowParamDialog = true;\n }\n\n /** @deprecated Use {@link RunTemplate}. */\n async runTemplate() {\n return this.RunTemplate();\n }\n\n /**\n * Handle parameter dialog close\n */\n OnParamDialogClose() {\n this.ShowParamDialog = false;\n }\n\n /** @deprecated Use {@link OnParamDialogClose}. */\n onParamDialogClose() {\n return this.OnParamDialogClose();\n }\n\n GetContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n // Always exclude \"Select Type...\" option for all content\n return this.ContentTypeOptions.filter(option => option.value !== '');\n }\n\n /** @deprecated Use {@link GetContentTypeOptionsForContent}. */\n getContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n return this.GetContentTypeOptionsForContent();\n }\n\n /**\n * Handles template content changes from the shared editor\n */\n public OnSharedTemplateContentChange(content: MJTemplateContentEntity[]) {\n this.TemplateContents = content;\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnSharedTemplateContentChange}. */\n public onSharedTemplateContentChange(content: MJTemplateContentEntity[]) {\n return this.OnSharedTemplateContentChange(content);\n }\n\n /**\n * Handles template run requests from the shared editor\n */\n public OnSharedTemplateRun(template: MJTemplateEntity) {\n this.RunTemplate();\n }\n\n /** @deprecated Use {@link OnSharedTemplateRun}. */\n public onSharedTemplateRun(template: MJTemplateEntity) {\n return this.OnSharedTemplateRun(template);\n }\n\n} \n","@if (record) {\n<mj-record-form-container [Record]=\"record\" [FormComponent]=\"this\"\n [ToolbarConfig]=\"toolbarConfig\"\n [WidthMode]=\"'full-width'\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n <form class=\"record-form\" #form=\"ngForm\" style=\"display: flex; flex-direction: column; height: 100%; overflow: hidden;\">\n\n <!-- Main Content Area -->\n <div class=\"template-main-area\" style=\"display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto;\">\n\n <!-- Header Section -->\n <div class=\"template-header-area\">\n <div style=\"display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;\">\n\n <!-- Left: Template Info -->\n <div style=\"flex: 1; min-width: 0;\">\n <div style=\"display: flex; align-items: center; gap: 12px; margin-bottom: 8px;\">\n <i class=\"fa-solid fa-file-code template-icon\"></i>\n @if (EditMode) {\n <input type=\"text\" class=\"mj-input\"\n [(ngModel)]=\"record.Name\"\n name=\"templateName\"\n placeholder=\"Enter template name...\"\n style=\"font-size: 1.2em; font-weight: 600; min-width: 300px; flex: 1;\" />\n } @else {\n <h4>{{ record.Name || 'Unnamed Template' }}</h4>\n @if (record.IsActive) {\n <span class=\"active-badge\">\n <i class=\"fa-solid fa-check-circle\"></i> Active\n </span>\n } @else {\n <span class=\"inactive-badge\">\n <i class=\"fa-solid fa-pause-circle\"></i> Inactive\n </span>\n }\n }\n </div>\n\n <!-- Category and Active toggle when in edit mode -->\n @if (EditMode) {\n <div style=\"display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;\">\n <div>\n <label class=\"field-label\">Category</label>\n <mj-combobox [(ngModel)]=\"record.CategoryID\"\n name=\"categoryId\"\n [Data]=\"categoryOptions\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [AllowCustom]=\"true\"\n (ValueChange)=\"onCategoryChange($any($event))\"\n Placeholder=\"Select or enter new category...\"\n style=\"width: 250px;\">\n </mj-combobox>\n </div>\n <div>\n <label class=\"field-label\">Active</label>\n <mj-switch [(ngModel)]=\"record.IsActive\" name=\"isActive\"></mj-switch>\n </div>\n </div>\n }\n\n @if (EditMode) {\n <textarea class=\"mj-textarea\"\n [(ngModel)]=\"record.Description\"\n name=\"description\"\n [rows]=\"2\"\n placeholder=\"Enter template description...\"\n style=\"width: 100%; max-width: 600px; margin-bottom: 12px;\"></textarea>\n } @else if (record.Description) {\n <p class=\"description-text\">{{ record.Description }}</p>\n }\n\n <!-- Quick Info Row -->\n <div style=\"display: flex; align-items: center; gap: 16px; flex-wrap: wrap;\">\n @if (record.Category) {\n <div style=\"display: flex; align-items: center; gap: 6px; font-size: 0.85em;\">\n <i class=\"fa-solid fa-folder meta-icon\"></i>\n <span class=\"meta-label\">Category:</span>\n <span class=\"meta-value\">{{ record.Category }}</span>\n </div>\n }\n\n <div style=\"display: flex; align-items: center; gap: 6px; font-size: 0.85em;\">\n <i class=\"fa-solid fa-file-lines meta-icon\"></i>\n <span class=\"meta-label\">Contents:</span>\n <span class=\"meta-value\">{{ templateContents.length }}</span>\n </div>\n </div>\n </div>\n\n <!-- Right: Action Buttons -->\n <div style=\"display: flex; flex-direction: column; gap: 8px; align-items: flex-end;\">\n @if (record.IsSaved) {\n <button class=\"run-template-btn\"\n (click)=\"runTemplate()\"\n title=\"Run Template\">\n <i class=\"fa-solid fa-play\"></i> Run\n </button>\n }\n </div>\n </div>\n </div>\n\n <!-- Configuration Sections with Expansion Panels -->\n <div class=\"configuration-sections\">\n\n <!-- Template Editor Section -->\n <mj-accordion-panel\n [Expanded]=\"true\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-code\"></i>\n Template Editor\n @if (templateContents.length > 0) {\n <span class=\"count-badge\">{{ templateContents.length }}</span>\n }\n </span>\n </ng-template>\n\n <div style=\"padding: 8px; min-height: 400px;\">\n <mj-template-editor\n #templateEditor\n [template]=\"record\"\n [config]=\"templateEditorConfig\"\n (contentChange)=\"onSharedTemplateContentChange($event)\"\n (runTemplate)=\"onSharedTemplateRun($event)\"\n style=\"height: 100%; display: block;\">\n </mj-template-editor>\n </div>\n </mj-accordion-panel>\n\n <!-- Details Section -->\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-cogs\"></i>\n Details\n </span>\n </ng-template>\n\n <div style=\"padding: 16px;\">\n <div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 20px;\">\n <!-- Left Column -->\n <div>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"UserPrompt\"\n Type=\"textarea\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"UserID\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\"\n LinkType=\"Record\"\n LinkComponentType=\"Search\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"ActiveAt\"\n Type=\"datepicker\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"DisabledAt\"\n Type=\"datepicker\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n </div>\n\n <!-- Right Column -->\n <div>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"IsActive\"\n Type=\"checkbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"__mj_CreatedAt\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"__mj_UpdatedAt\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"Category\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"User\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n </div>\n </div>\n </div>\n </mj-accordion-panel>\n\n <!-- Template Parameters Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-sliders\"></i>\n Parameters\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-template-params-grid\n [template]=\"record\"\n [editMode]=\"EditMode\">\n </mj-template-params-grid>\n </div>\n </mj-accordion-panel>\n }\n\n <!-- AI Prompts Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-robot\"></i>\n AI Prompts\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-explorer-entity-data-grid\n [Params]=\"BuildRelationshipViewParamsByEntityName('MJ: AI Prompts','TemplateID')\"\n [NewRecordValues]=\"NewRecordValues('MJ: AI Prompts')\"\n [AllowLoad]=\"true\"\n [ShowToolbar]=\"false\">\n </mj-explorer-entity-data-grid>\n </div>\n </mj-accordion-panel>\n }\n\n <!-- Entity Documents Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-file-text\"></i>\n Entity Documents\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-explorer-entity-data-grid\n [Params]=\"BuildRelationshipViewParamsByEntityName('MJ: Entity Documents','TemplateID')\"\n [NewRecordValues]=\"NewRecordValues('MJ: Entity Documents')\"\n [AllowLoad]=\"true\"\n [ShowToolbar]=\"false\">\n </mj-explorer-entity-data-grid>\n </div>\n </mj-accordion-panel>\n }\n </div>\n </div>\n </form>\n</mj-record-form-container>\n\n<!-- Template Parameter Dialog -->\n<mj-template-param-dialog\n [template]=\"record\"\n [(isVisible)]=\"showParamDialog\"\n (onClose)=\"onParamDialogClose()\">\n</mj-template-param-dialog>\n}\n"]}
|
|
1
|
+
{"version":3,"file":"templates-form.component.js","sourceRoot":"","sources":["../../../../src/lib/custom/Templates/templates-form.component.ts","../../../../src/lib/custom/Templates/templates-form.component.html"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,SAAS,EAAqB,SAAS,EAAoC,MAAM,EAAE,MAAM,eAAe,CAAC;AAElH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAChG,OAAO,EAAE,uBAAuB,EAAE,MAAM,+DAA+D,CAAC;AACxG,OAAO,EAAY,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;;;;;;;;;;;;ICUpC,iCAIgF;IAHzE,4UAAyB;IADhC,iBAIgF;;;IAHzE,kDAAyB;;;IAO5B,gCAA2B;IACvB,wBAAwC;IAAC,wBAC7C;IAAA,iBAAO;;;IAEP,gCAA6B;IACzB,wBAAwC;IAAC,0BAC7C;IAAA,iBAAO;;;IARX,0BAAI;IAAA,YAAuC;IAAA,iBAAK;IAK9C,AAJF,gIAAuB,0GAId;;;IALL,cAAuC;IAAvC,8DAAuC;IAC3C,cAQC;IARD,gDAQC;;;;IAQG,AADJ,AADJ,+BAAkG,UACzF,gBAC0B;IAAA,wBAAQ;IAAA,iBAAQ;IAC3C,uCASqC;IATxB,+V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I,CAAC,gBAAgB,GAAG,OAAO,CAAC;QAChC,IAAI,CAAC,wBAAwB,EAAE,CAAC;IACpC,CAAC;IAED,6DAA6D;IACtD,6BAA6B,CAAC,OAAkC;QACrE,OAAO,IAAI,CAAC,6BAA6B,CAAC,OAAO,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACI,mBAAmB,CAAC,QAA0B;QACjD,IAAI,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;IAED,mDAAmD;IAC5C,mBAAmB,CAAC,QAA0B;QACnD,OAAO,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;gTAxzBQ,+BAA+B,yBAA/B,+BAA+B;oEAA/B,+BAA+B;;;;;;;YCvB5C,yFAAc;;YAAd,qCA+SC;;;ADxRY,+BAA+B;IAP3C,aAAa,CAAC,iBAAiB,EAAE,eAAe,CAAC;GAOrC,+BAA+B,CA0zB3C;;iFA1zBY,+BAA+B;cAN3C,SAAS;6BACI,KAAK,YACL,mBAAmB;;kBA+H5B,SAAS;mBAAC,YAAY;;kBAgBtB,SAAS;mBAAC,gBAAgB;;kFA3IlB,+BAA+B","sourcesContent":["import { Component, OnInit, OnDestroy, ViewChild, AfterViewInit, ChangeDetectorRef, inject } from '@angular/core';\nimport { MJTemplateEntity, MJTemplateContentEntity, MJTemplateCategoryEntity } from '@memberjunction/core-entities';\nimport { RegisterClass } from '@memberjunction/global';\nimport { BaseFormComponent, CUSTOM_LAYOUT_TOOLBAR_CONFIG } from '@memberjunction/ng-base-forms';\nimport { MJTemplateFormComponent } from '../../generated/Entities/MJTemplate/mjtemplate.form.component';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\nimport { Subject } from 'rxjs';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { LanguageDescription } from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { CodeEditorComponent } from '@memberjunction/ng-code-editor';\nimport { MJConfirmService } from '@memberjunction/ng-ui-components';\nimport { TemplateEditorComponent, TemplateEditorConfig } from '../../shared/components/template-editor.component';\n\n@RegisterClass(BaseFormComponent, 'MJ: Templates') \n@Component({\n standalone: false,\n selector: 'mj-templates-form',\n templateUrl: './templates-form.component.html',\n styleUrls: ['../../../shared/form-styles.css', './templates-form.component.css']\n})\nexport class MJTemplateFormComponentExtended extends MJTemplateFormComponent implements OnInit, OnDestroy, AfterViewInit {\n public record!: MJTemplateEntity;\n public readonly ToolbarConfig = CUSTOM_LAYOUT_TOOLBAR_CONFIG;\n\n /** @deprecated Use {@link ToolbarConfig}. */\n public get toolbarConfig() {\n return this.ToolbarConfig;\n }\n\n /** Custom-layout Template form looks best full-width on first open. */\n public override getDefaultFormWidthMode(): 'centered' | 'full-width' { return 'full-width'; }\n\n /** Custom-layout form owns its entire body; suppress auto-filled relationship sections. */\n public override get OwnsEntireFormBody(): boolean { return true; }\n\n /**\n * Read-only mirror of the editor's rows (fed only by {@link OnSharedTemplateContentChange}),\n * kept for the count badges and unsaved-changes flag. Never load or save through it.\n */\n public TemplateContents: MJTemplateContentEntity[] = [];\n\n /** @deprecated Use {@link TemplateContents}. */\n public get templateContents(): MJTemplateContentEntity[] {\n return this.TemplateContents;\n }\n /** @deprecated Use {@link TemplateContents}. */\n public set templateContents(value: MJTemplateContentEntity[]) {\n this.TemplateContents = value;\n }\n public SelectedContentIndex: number = 0;\n\n /** @deprecated Use {@link SelectedContentIndex}. */\n public get selectedContentIndex(): number {\n return this.SelectedContentIndex;\n }\n /** @deprecated Use {@link SelectedContentIndex}. */\n public set selectedContentIndex(value: number) {\n this.SelectedContentIndex = value;\n }\n public IsAddingNewContent: boolean = false;\n\n /** @deprecated Use {@link IsAddingNewContent}. */\n public get isAddingNewContent(): boolean {\n return this.IsAddingNewContent;\n }\n /** @deprecated Use {@link IsAddingNewContent}. */\n public set isAddingNewContent(value: boolean) {\n this.IsAddingNewContent = value;\n }\n public NewTemplateContent: MJTemplateContentEntity | null = null;\n\n /** @deprecated Use {@link NewTemplateContent}. */\n public get newTemplateContent(): MJTemplateContentEntity | null {\n return this.NewTemplateContent;\n }\n /** @deprecated Use {@link NewTemplateContent}. */\n public set newTemplateContent(value: MJTemplateContentEntity | null) {\n this.NewTemplateContent = value;\n }\n public HasUnsavedChanges: boolean = false;\n\n /** @deprecated Use {@link HasUnsavedChanges}. */\n public get hasUnsavedChanges(): boolean {\n return this.HasUnsavedChanges;\n }\n /** @deprecated Use {@link HasUnsavedChanges}. */\n public set hasUnsavedChanges(value: boolean) {\n this.HasUnsavedChanges = value;\n }\n public TemplateInfoExpanded: boolean = true;\n\n /** @deprecated Use {@link TemplateInfoExpanded}. */\n public get templateInfoExpanded(): boolean {\n return this.TemplateInfoExpanded;\n }\n /** @deprecated Use {@link TemplateInfoExpanded}. */\n public set templateInfoExpanded(value: boolean) {\n this.TemplateInfoExpanded = value;\n }\n public TemplateContentsExpanded: boolean = true;\n\n /** @deprecated Use {@link TemplateContentsExpanded}. */\n public get templateContentsExpanded(): boolean {\n return this.TemplateContentsExpanded;\n }\n /** @deprecated Use {@link TemplateContentsExpanded}. */\n public set templateContentsExpanded(value: boolean) {\n this.TemplateContentsExpanded = value;\n }\n public CategoryOptions: Array<{text: string, value: string}> = [\n { text: 'Select Category...', value: '' },\n // TODO: Load from database\n ];\n\n /** @deprecated Use {@link CategoryOptions}. */\n public get categoryOptions(): Array<{text: string, value: string}> {\n return this.CategoryOptions;\n }\n /** @deprecated Use {@link CategoryOptions}. */\n public set categoryOptions(value: Array<{text: string, value: string}>) {\n this.CategoryOptions = value;\n }\n public ContentTypeOptions: Array<{text: string, value: string}> = [];\n\n /** @deprecated Use {@link ContentTypeOptions}. */\n public get contentTypeOptions(): Array<{text: string, value: string}> {\n return this.ContentTypeOptions;\n }\n /** @deprecated Use {@link ContentTypeOptions}. */\n public set contentTypeOptions(value: Array<{text: string, value: string}>) {\n this.ContentTypeOptions = value;\n }\n public SupportedLanguages: LanguageDescription[] = languages;\n\n /** @deprecated Use {@link SupportedLanguages}. */\n public get supportedLanguages(): LanguageDescription[] {\n return this.SupportedLanguages;\n }\n /** @deprecated Use {@link SupportedLanguages}. */\n public set supportedLanguages(value: LanguageDescription[]) {\n this.SupportedLanguages = value;\n }\n \n @ViewChild('codeEditor') CodeEditor: CodeEditorComponent | null = null;\n\n /** @deprecated Use {@link CodeEditor}. */\n get codeEditor(): CodeEditorComponent | null {\n return this.CodeEditor;\n }\n /** @deprecated Use {@link CodeEditor}. */\n set codeEditor(value: CodeEditorComponent | null) {\n this.CodeEditor = value;\n }\n /**\n * The embedded editor OWNS the template content rows: it loads them and the user edits its\n * instances. This form never loads a second copy (a second, separately loaded copy is what\n * silently discarded edits in MJ#4754); on Save it folds the editor's dirty rows into its own\n * transaction (see PopulatePendingRecords).\n */\n @ViewChild('templateEditor') TemplateEditor: TemplateEditorComponent | undefined;\n private isUpdatingEditorValue = false;\n public IsRunningTemplate = false;\n\n /** @deprecated Use {@link IsRunningTemplate}. */\n public get isRunningTemplate() {\n return this.IsRunningTemplate;\n }\n /** @deprecated Use {@link IsRunningTemplate}. */\n public set isRunningTemplate(value) {\n this.IsRunningTemplate = value;\n }\n public TemplateTestResult: string | null = null;\n\n /** @deprecated Use {@link TemplateTestResult}. */\n public get templateTestResult(): string | null {\n return this.TemplateTestResult;\n }\n /** @deprecated Use {@link TemplateTestResult}. */\n public set templateTestResult(value: string | null) {\n this.TemplateTestResult = value;\n }\n public TemplateTestError: string | null = null;\n\n /** @deprecated Use {@link TemplateTestError}. */\n public get templateTestError(): string | null {\n return this.TemplateTestError;\n }\n /** @deprecated Use {@link TemplateTestError}. */\n public set templateTestError(value: string | null) {\n this.TemplateTestError = value;\n }\n public ShowParamDialog = false;\n\n /** @deprecated Use {@link ShowParamDialog}. */\n public get showParamDialog() {\n return this.ShowParamDialog;\n }\n /** @deprecated Use {@link ShowParamDialog}. */\n public set showParamDialog(value) {\n this.ShowParamDialog = value;\n }\n \n // Template editor configuration for shared component\n public TemplateEditorConfig: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: true,\n compactMode: false\n };\n\n /** @deprecated Use {@link TemplateEditorConfig}. */\n public get templateEditorConfig(): TemplateEditorConfig {\n return this.TemplateEditorConfig;\n }\n /** @deprecated Use {@link TemplateEditorConfig}. */\n public set templateEditorConfig(value: TemplateEditorConfig) {\n this.TemplateEditorConfig = value;\n }\n \n private destroy$ = new Subject<void>();\n private activeTimeouts: number[] = [];\n private confirmService = inject(MJConfirmService);\n\n async ngOnInit() {\n await super.ngOnInit();\n // Template contents are loaded by the embedded editor (see TemplateEditor), not here.\n await this.LoadCategories();\n this.LoadContentTypes();\n }\n\n /** Also discards the content edits held by the editor, so a later Save cannot persist them. */\n public override CancelEdit(): void {\n super.CancelEdit();\n this.TemplateEditor?.RefreshAndDiscardChanges().catch((error: unknown) => {\n console.error(`Failed to discard template content changes for template ${this.record?.ID}:`, error);\n });\n }\n\n ngOnDestroy() {\n super.ngOnDestroy();\n this.destroy$.next();\n this.destroy$.complete();\n \n // Clean up any active timeouts\n this.activeTimeouts.forEach(timeoutId => clearTimeout(timeoutId));\n this.activeTimeouts.length = 0;\n }\n\n ngAfterViewInit() {\n // Initial sync when view is ready\n this.syncEditorValue();\n }\n\n /**\n * Reloads the template contents in the embedded editor (discarding unsaved content edits); the\n * editor's ContentChange then refreshes {@link TemplateContents}. No-op while the editor is not\n * rendered, since it loads the contents itself when it is.\n */\n async LoadTemplateContents() {\n await this.TemplateEditor?.RefreshAndDiscardChanges();\n }\n\n /** @deprecated Use {@link LoadTemplateContents}. */\n async loadTemplateContents() {\n return this.LoadTemplateContents();\n }\n\n async CreateDefaultTemplateContent() {\n const md = this.ProviderToUse;\n const defaultContent = await md.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n defaultContent.TemplateID = this.record.ID;\n defaultContent.Priority = 1;\n defaultContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n defaultContent.TypeID = validContentTypes[0].value;\n }\n \n this.TemplateContents = [defaultContent];\n this.SelectedContentIndex = 0;\n \n // Sync editor value after creating default content\n this.syncEditorValue();\n }\n\n /** @deprecated Use {@link CreateDefaultTemplateContent}. */\n async createDefaultTemplateContent() {\n return this.CreateDefaultTemplateContent();\n }\n\n async SelectTemplateContent(index: number, confirmSwitch: boolean = true): Promise<void> {\n // If we're adding new content and user clicks on existing content, ask for confirmation\n if (this.IsAddingNewContent && confirmSwitch) {\n if (!(await this.confirmService.Confirm({\n title: 'Discard changes?',\n message: 'Switch content version and lose your unsaved changes?',\n detail: 'Your changes to the new content version will be lost.'\n }))) {\n return;\n }\n }\n \n if (index >= 0 && index < this.TemplateContents.length) {\n this.SelectedContentIndex = index;\n this.IsAddingNewContent = false;\n // Don't clear newTemplateContent to preserve the work in progress\n \n // Sync editor value when switching content\n this.syncEditorValue();\n }\n }\n\n /** @deprecated Use {@link SelectTemplateContent}. */\n async selectTemplateContent(index: number, confirmSwitch: boolean = true): Promise<void> {\n return this.SelectTemplateContent(index, confirmSwitch);\n }\n\n async LoadCategories() {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const results = await rv.RunView({\n EntityName: 'MJ: Template Categories' \n });\n \n this.CategoryOptions = [\n { text: 'Select Category...', value: '' },\n ...results.Results.map((cat: any) => ({\n text: cat.Name,\n value: cat.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading categories:', error);\n this.CategoryOptions = [{ text: 'Select Category...', value: '' }];\n }\n }\n\n /** @deprecated Use {@link LoadCategories}. */\n async loadCategories() {\n return this.LoadCategories();\n }\n\n LoadContentTypes() {\n try {\n // Get content types from TemplateEngine cache\n const contentTypes = TemplateEngineBase.Instance.TemplateContentTypes;\n this.ContentTypeOptions = [\n { text: 'Select Type...', value: '' },\n ...contentTypes.map(ct => ({\n text: ct.Name,\n value: ct.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading content types:', error);\n // Fallback to basic types\n this.ContentTypeOptions = [\n { text: 'Select Type...', value: '' },\n { text: 'HTML', value: 'HTML' },\n { text: 'Plain Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' }\n ];\n }\n }\n\n /** @deprecated Use {@link LoadContentTypes}. */\n loadContentTypes() {\n return this.LoadContentTypes();\n }\n\n async OnCategoryChange(value: string) {\n // If it's a new category (string but not in existing options)\n if (value && !this.CategoryOptions.find(opt => opt.value === value)) {\n // Check for duplicate category names (case-insensitive, trimmed)\n if (this.isDuplicateCategory(value)) {\n const existingCategory = this.CategoryOptions.find(option => \n option.text && option.text.trim().toLowerCase() === value.trim().toLowerCase()\n );\n if (existingCategory) {\n // Use the existing category instead\n this.record.CategoryID = existingCategory.value;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${existingCategory.text}\" already exists. Using existing category.`, \n 'warning'\n );\n }\n return;\n }\n\n try {\n // Create new category with trimmed name\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJTemplateCategoryEntity>('MJ: Template Categories');\n newCategory.Name = value.trim();\n newCategory.UserID = this.record.UserID || md.CurrentUser.ID;\n const saved = await newCategory.Save();\n \n if (saved) {\n // Add to options and set the ID\n this.CategoryOptions.push({\n text: newCategory.Name,\n value: newCategory.ID\n });\n this.record.CategoryID = newCategory.ID;\n MJNotificationService.Instance.CreateSimpleNotification(\n `New category \"${newCategory.Name}\" created successfully.`, \n 'success'\n );\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create new category. ${newCategory.LatestResult?.CompleteMessage || ''}`, \n 'error'\n );\n }\n } catch (error) {\n console.error('Error creating new category:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating new category. Please try again.', \n 'error'\n );\n }\n }\n }\n\n /** @deprecated Use {@link OnCategoryChange}. */\n async onCategoryChange(value: string) {\n return this.OnCategoryChange(value);\n }\n\n async AddNewTemplateContent() {\n const md = this.ProviderToUse;\n this.NewTemplateContent = await md.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n this.NewTemplateContent.TemplateID = this.record.ID;\n this.NewTemplateContent.Priority = this.TemplateContents.length + 1;\n this.NewTemplateContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n this.NewTemplateContent.TypeID = validContentTypes[0].value;\n }\n this.NewTemplateContent.TemplateText = '';\n \n // Add immediately to the array\n this.TemplateContents.push(this.NewTemplateContent);\n this.SelectedContentIndex = this.TemplateContents.length - 1;\n this.IsAddingNewContent = true;\n \n // Sync editor value when adding new content\n this.syncEditorValue();\n }\n\n /** @deprecated Use {@link AddNewTemplateContent}. */\n async addNewTemplateContent() {\n return this.AddNewTemplateContent();\n }\n\n CancelNewTemplateContent() {\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n }\n\n /** @deprecated Use {@link CancelNewTemplateContent}. */\n cancelNewTemplateContent() {\n return this.CancelNewTemplateContent();\n }\n\n async DeleteTemplateContent(index: number) {\n if (index >= 0 && index < this.TemplateContents.length) {\n const contentToDelete = this.TemplateContents[index];\n\n if (contentToDelete.ID) {\n try {\n const result = await contentToDelete.Delete();\n if (result) {\n this.TemplateContents.splice(index, 1);\n \n // Adjust selected index if necessary\n if (this.SelectedContentIndex >= this.TemplateContents.length) {\n this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);\n }\n \n // If no contents remain, create a default one\n if (this.TemplateContents.length === 0) {\n await this.CreateDefaultTemplateContent();\n }\n } else {\n console.error('Delete returned false');\n MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete template content. ${contentToDelete.LatestResult.CompleteMessage}`, 'error');\n }\n } catch (error) {\n console.error('Error deleting template content:', error);\n }\n } else {\n // Not saved yet, just remove from array\n this.TemplateContents.splice(index, 1);\n if (this.SelectedContentIndex >= this.TemplateContents.length) {\n this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);\n }\n \n // Reset adding new content state if we're deleting the new content\n if (this.IsAddingNewContent && index === this.TemplateContents.length) {\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n }\n }\n } else {\n console.error('Invalid index for deletion:', index);\n }\n }\n\n /** @deprecated Use {@link DeleteTemplateContent}. */\n async deleteTemplateContent(index: number) {\n return this.DeleteTemplateContent(index);\n }\n\n get CurrentTemplateContent(): MJTemplateContentEntity | null {\n if (this.IsAddingNewContent) {\n return this.NewTemplateContent;\n }\n return this.TemplateContents[this.SelectedContentIndex] || null;\n }\n\n /** @deprecated Use {@link CurrentTemplateContent}. */\n get currentTemplateContent(): MJTemplateContentEntity | null {\n return this.CurrentTemplateContent;\n }\n\n get HasMultipleContents(): boolean {\n return this.TemplateContents.length > 1 || this.IsAddingNewContent;\n }\n\n /** @deprecated Use {@link HasMultipleContents}. */\n get hasMultipleContents(): boolean {\n return this.HasMultipleContents;\n }\n\n OnContentTypeChange() {\n // Content type changes just modify the current content, no new record creation\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnContentTypeChange}. */\n onContentTypeChange() {\n return this.OnContentTypeChange();\n }\n\n OnContentChange() {\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnContentChange}. */\n onContentChange() {\n return this.OnContentChange();\n }\n\n /**\n * Updates the hasUnsavedChanges flag based on entity dirty states\n */\n private updateUnsavedChangesFlag() {\n this.HasUnsavedChanges = this.TemplateContents.some(content => content.Dirty) || \n this.IsAddingNewContent ||\n this.record?.Dirty || false;\n }\n\n OnTemplateTextChange(event: any) {\n if (this.isUpdatingEditorValue) {\n // Ignore change events when we're programmatically updating the editor\n return;\n }\n \n if (this.CurrentTemplateContent) {\n // Extract value from event - might be event.target.value or just event depending on component\n const value = typeof event === 'string' ? event : (event.target?.value || event);\n this.CurrentTemplateContent.TemplateText = value;\n // hasUnsavedChanges is automatically handled by entity's IsDirty flag\n this.updateUnsavedChangesFlag();\n }\n }\n\n /** @deprecated Use {@link OnTemplateTextChange}. */\n onTemplateTextChange(event: any) {\n return this.OnTemplateTextChange(event);\n }\n\n /**\n * Helper method to track setTimeout calls for cleanup\n */\n private setTrackedTimeout(callback: () => void, delay: number): number {\n const timeoutId = setTimeout(() => {\n // Remove from tracking when it executes\n const index = this.activeTimeouts.indexOf(timeoutId);\n if (index > -1) {\n this.activeTimeouts.splice(index, 1);\n }\n callback();\n }, delay) as any as number;\n this.activeTimeouts.push(timeoutId);\n return timeoutId;\n }\n\n /**\n * Manually sync the editor value without triggering change events\n */\n private syncEditorValue() {\n // Use Promise.resolve() to wait for the next microtask after any pending changes\n Promise.resolve().then(() => {\n // Then tracked setTimeout for the next macrotask to ensure DOM is updated\n this.setTrackedTimeout(() => {\n if (!this.CodeEditor) {\n return;\n }\n \n this.isUpdatingEditorValue = true;\n const newValue = this.CurrentTemplateContent?.TemplateText || '';\n \n // Use the setValue method from mj-code-editor component\n this.CodeEditor.setValue(newValue); \n this.isUpdatingEditorValue = false;\n }, 0);\n });\n }\n\n /**\n * The embedded editor's new/dirty Template Contents join this form's pending records, so\n * `InternalSaveRecord()` commits the template and its contents in ONE transaction group (the\n * template first, so the content's TemplateID resolves) and `Validate()` covers the contents too.\n *\n * Before this, the form saved each content on its own AFTER the template save had already been\n * reported as successful; a content whose `Save()` returned false only reached `console.error`,\n * no mutation was issued, and the editor kept showing \"Unsaved changes\" forever.\n */\n protected override PopulatePendingRecords(): void {\n super.PopulatePendingRecords();\n const editorChanges = this.TemplateEditor?.GetPendingChanges() ?? [];\n for (const change of editorChanges) {\n this.PendingRecords.push(change);\n }\n }\n\n async SaveRecord(StopEditModeAfterSave: boolean = true): Promise<boolean> {\n // Check if we need to create a new category first\n if (this.record.CategoryID && !this.CategoryOptions.find(opt => opt.value === this.record.CategoryID)) {\n // Check for duplicate category names (case-insensitive, trimmed)\n if (this.isDuplicateCategory(this.record.CategoryID)) {\n const existingCategory = this.CategoryOptions.find(option => \n option.text && option.text.trim().toLowerCase() === this.record.CategoryID?.trim().toLowerCase()\n );\n if (existingCategory) {\n // Use the existing category instead\n this.record.CategoryID = existingCategory.value;\n MJNotificationService.Instance.CreateSimpleNotification(\n `Category \"${existingCategory.text}\" already exists. Using existing category.`, \n 'warning'\n );\n }\n } else {\n try {\n // Create new category with trimmed name\n const md = this.ProviderToUse;\n const newCategory = await md.GetEntityObject<MJTemplateCategoryEntity>('MJ: Template Categories');\n newCategory.Name = this.record.CategoryID.trim(); // CategoryID contains the new category name, trim it\n newCategory.UserID = this.record.UserID || md.CurrentUser.ID; \n const saved = await newCategory.Save();\n \n if (saved) {\n // Add to options and set the ID\n this.CategoryOptions.push({\n text: newCategory.Name,\n value: newCategory.ID\n });\n this.record.CategoryID = newCategory.ID;\n } else {\n console.error('Failed to create new category');\n MJNotificationService.Instance.CreateSimpleNotification(\n `Failed to create new category. ${newCategory.LatestResult?.CompleteMessage || ''}`, \n 'error'\n );\n return false;\n }\n } catch (error) {\n console.error('Error creating new category during save:', error);\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Error creating new category during save. Please try again.', \n 'error'\n );\n return false;\n }\n }\n }\n\n // Call the parent save method to save the template\n // Before saving, if a new record, make sure the UserID is set\n if (!this.record.IsSaved && !this.record.UserID) {\n const md = this.ProviderToUse;\n this.record.UserID = md.CurrentUser.ID;\n }\n // The template AND the editor's contents commit together here (see PopulatePendingRecords)\n const templateSaved = await super.SaveRecord(StopEditModeAfterSave);\n\n if (templateSaved) {\n this.TemplateEditor?.MarkContentsSaved();\n this.IsAddingNewContent = false;\n this.NewTemplateContent = null;\n this.updateUnsavedChangesFlag();\n }\n\n return templateSaved;\n }\n\n GetContentTypeDisplayText(typeId: string): string {\n if (!typeId) return '-';\n const option = this.ContentTypeOptions.find(opt => opt.value === typeId);\n return option ? option.text : typeId;\n }\n\n /** @deprecated Use {@link GetContentTypeDisplayText}. */\n getContentTypeDisplayText(typeId: string): string {\n return this.GetContentTypeDisplayText(typeId);\n }\n\n GetEditorLanguage(): string {\n if (!this.CurrentTemplateContent?.TypeID) {\n return 'jinja2'; // default to jinja2 for template syntax (compatible with Nunjucks)\n }\n\n const contentType = this.CurrentTemplateContent.TypeID.toLowerCase();\n \n // Map content types to CodeMirror language modes\n switch (contentType) {\n case 'html':\n return 'jinja2'; // Use jinja2 for HTML templates to get template syntax highlighting\n case 'markdown':\n case 'md':\n return 'markdown';\n case 'javascript':\n case 'js':\n return 'javascript';\n case 'css':\n return 'css';\n case 'json':\n return 'json';\n case 'xml':\n return 'xml';\n case 'sql':\n return 'sql';\n case 'text':\n case 'plain':\n default:\n return 'jinja2'; // Default to jinja2 since templates often contain template syntax\n }\n }\n\n /** @deprecated Use {@link GetEditorLanguage}. */\n getEditorLanguage(): string {\n return this.GetEditorLanguage();\n }\n\n private isDuplicateCategory(categoryName: string): boolean {\n const normalizedName = categoryName.trim().toLowerCase();\n return this.CategoryOptions.some(option => \n option.text && option.text.trim().toLowerCase() === normalizedName\n );\n }\n\n /**\n * Test run the current template using the parameter dialog\n */\n async RunTemplate() {\n if (!this.record?.IsSaved || !this.CurrentTemplateContent) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please save the template before running it.', \n 'warning'\n );\n return;\n }\n\n // Save any unsaved changes first\n if (this.HasUnsavedChanges) {\n const saveResult = await this.SaveRecord(false); // Don't exit edit mode\n if (!saveResult) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to save template changes.', \n 'error'\n );\n return;\n }\n }\n\n // Show the parameter dialog\n this.ShowParamDialog = true;\n }\n\n /** @deprecated Use {@link RunTemplate}. */\n async runTemplate() {\n return this.RunTemplate();\n }\n\n /**\n * Handle parameter dialog close\n */\n OnParamDialogClose() {\n this.ShowParamDialog = false;\n }\n\n /** @deprecated Use {@link OnParamDialogClose}. */\n onParamDialogClose() {\n return this.OnParamDialogClose();\n }\n\n GetContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n // Always exclude \"Select Type...\" option for all content\n return this.ContentTypeOptions.filter(option => option.value !== '');\n }\n\n /** @deprecated Use {@link GetContentTypeOptionsForContent}. */\n getContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n return this.GetContentTypeOptionsForContent();\n }\n\n /**\n * Handles template content changes from the shared editor\n */\n public OnSharedTemplateContentChange(content: MJTemplateContentEntity[]) {\n this.TemplateContents = content;\n this.updateUnsavedChangesFlag();\n }\n\n /** @deprecated Use {@link OnSharedTemplateContentChange}. */\n public onSharedTemplateContentChange(content: MJTemplateContentEntity[]) {\n return this.OnSharedTemplateContentChange(content);\n }\n\n /**\n * Handles template run requests from the shared editor\n */\n public OnSharedTemplateRun(template: MJTemplateEntity) {\n this.RunTemplate();\n }\n\n /** @deprecated Use {@link OnSharedTemplateRun}. */\n public onSharedTemplateRun(template: MJTemplateEntity) {\n return this.OnSharedTemplateRun(template);\n }\n\n} \n","@if (record) {\n<mj-record-form-container [Record]=\"record\" [FormComponent]=\"this\"\n [ToolbarConfig]=\"toolbarConfig\"\n [WidthMode]=\"'full-width'\"\n (Navigate)=\"OnFormNavigate($event)\"\n (DeleteRequested)=\"OnDeleteRequested()\"\n (FavoriteToggled)=\"OnFavoriteToggled()\"\n (HistoryRequested)=\"OnHistoryRequested()\"\n (ListManagementRequested)=\"OnListManagementRequested()\">\n <form class=\"record-form\" #form=\"ngForm\" style=\"display: flex; flex-direction: column; height: 100%; overflow: hidden;\">\n\n <!-- Main Content Area -->\n <div class=\"template-main-area\" style=\"display: flex; flex-direction: column; flex: 1; min-height: 0; overflow-y: auto;\">\n\n <!-- Header Section -->\n <div class=\"template-header-area\">\n <div style=\"display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;\">\n\n <!-- Left: Template Info -->\n <div style=\"flex: 1; min-width: 0;\">\n <div style=\"display: flex; align-items: center; gap: 12px; margin-bottom: 8px;\">\n <i class=\"fa-solid fa-file-code template-icon\"></i>\n @if (EditMode) {\n <input type=\"text\" class=\"mj-input\"\n [(ngModel)]=\"record.Name\"\n name=\"templateName\"\n placeholder=\"Enter template name...\"\n style=\"font-size: 1.2em; font-weight: 600; min-width: 300px; flex: 1;\" />\n } @else {\n <h4>{{ record.Name || 'Unnamed Template' }}</h4>\n @if (record.IsActive) {\n <span class=\"active-badge\">\n <i class=\"fa-solid fa-check-circle\"></i> Active\n </span>\n } @else {\n <span class=\"inactive-badge\">\n <i class=\"fa-solid fa-pause-circle\"></i> Inactive\n </span>\n }\n }\n </div>\n\n <!-- Category and Active toggle when in edit mode -->\n @if (EditMode) {\n <div style=\"display: flex; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; align-items: center;\">\n <div>\n <label class=\"field-label\">Category</label>\n <mj-combobox [(ngModel)]=\"record.CategoryID\"\n name=\"categoryId\"\n [Data]=\"categoryOptions\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n [AllowCustom]=\"true\"\n (ValueChange)=\"onCategoryChange($any($event))\"\n Placeholder=\"Select or enter new category...\"\n style=\"width: 250px;\">\n </mj-combobox>\n </div>\n <div>\n <label class=\"field-label\">Active</label>\n <mj-switch [(ngModel)]=\"record.IsActive\" name=\"isActive\"></mj-switch>\n </div>\n </div>\n }\n\n @if (EditMode) {\n <textarea class=\"mj-textarea\"\n [(ngModel)]=\"record.Description\"\n name=\"description\"\n [rows]=\"2\"\n placeholder=\"Enter template description...\"\n style=\"width: 100%; max-width: 600px; margin-bottom: 12px;\"></textarea>\n } @else if (record.Description) {\n <p class=\"description-text\">{{ record.Description }}</p>\n }\n\n <!-- Quick Info Row -->\n <div style=\"display: flex; align-items: center; gap: 16px; flex-wrap: wrap;\">\n @if (record.Category) {\n <div style=\"display: flex; align-items: center; gap: 6px; font-size: 0.85em;\">\n <i class=\"fa-solid fa-folder meta-icon\"></i>\n <span class=\"meta-label\">Category:</span>\n <span class=\"meta-value\">{{ record.Category }}</span>\n </div>\n }\n\n <div style=\"display: flex; align-items: center; gap: 6px; font-size: 0.85em;\">\n <i class=\"fa-solid fa-file-lines meta-icon\"></i>\n <span class=\"meta-label\">Contents:</span>\n <span class=\"meta-value\">{{ templateContents.length }}</span>\n </div>\n </div>\n </div>\n\n <!-- Right: Action Buttons -->\n <div style=\"display: flex; flex-direction: column; gap: 8px; align-items: flex-end;\">\n @if (record.IsSaved) {\n <button class=\"run-template-btn\"\n (click)=\"runTemplate()\"\n title=\"Run Template\">\n <i class=\"fa-solid fa-play\"></i> Run\n </button>\n }\n </div>\n </div>\n </div>\n\n <!-- Configuration Sections with Expansion Panels -->\n <div class=\"configuration-sections\">\n\n <!-- Template Editor Section -->\n <mj-accordion-panel\n [Expanded]=\"true\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-code\"></i>\n Template Editor\n @if (templateContents.length > 0) {\n <span class=\"count-badge\">{{ templateContents.length }}</span>\n }\n </span>\n </ng-template>\n\n <div style=\"padding: 8px; min-height: 400px;\">\n <mj-template-editor\n #templateEditor\n [template]=\"record\"\n [config]=\"templateEditorConfig\"\n (contentChange)=\"onSharedTemplateContentChange($event)\"\n (runTemplate)=\"onSharedTemplateRun($event)\"\n style=\"height: 100%; display: block;\">\n </mj-template-editor>\n </div>\n </mj-accordion-panel>\n\n <!-- Details Section -->\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-cogs\"></i>\n Details\n </span>\n </ng-template>\n\n <div style=\"padding: 16px;\">\n <div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 20px;\">\n <!-- Left Column -->\n <div>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"UserPrompt\"\n Type=\"textarea\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"UserID\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\"\n LinkType=\"Record\"\n LinkComponentType=\"Search\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"ActiveAt\"\n Type=\"datepicker\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"DisabledAt\"\n Type=\"datepicker\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n </div>\n\n <!-- Right Column -->\n <div>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"IsActive\"\n Type=\"checkbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"__mj_CreatedAt\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"__mj_UpdatedAt\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"Category\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n <mj-form-field\n [Record]=\"record\"\n [ShowLabel]=\"true\"\n FieldName=\"User\"\n Type=\"textbox\"\n [EditMode]=\"EditMode\">\n </mj-form-field>\n </div>\n </div>\n </div>\n </mj-accordion-panel>\n\n <!-- Template Parameters Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-sliders\"></i>\n Parameters\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-template-params-grid\n [template]=\"record\"\n [editMode]=\"EditMode\">\n </mj-template-params-grid>\n </div>\n </mj-accordion-panel>\n }\n\n <!-- AI Prompts Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-robot\"></i>\n AI Prompts\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-explorer-entity-data-grid\n [Params]=\"BuildRelationshipViewParamsByEntityName('MJ: AI Prompts','TemplateID')\"\n [NewRecordValues]=\"NewRecordValues('MJ: AI Prompts')\"\n [AllowLoad]=\"true\"\n [ShowToolbar]=\"false\">\n </mj-explorer-entity-data-grid>\n </div>\n </mj-accordion-panel>\n }\n\n <!-- Entity Documents Section -->\n @if (record.IsSaved) {\n <mj-accordion-panel\n [Expanded]=\"false\"\n style=\"margin-bottom: 12px;\">\n <ng-template mjAccordionTitle>\n <span class=\"panel-title\">\n <i class=\"fa-solid fa-file-text\"></i>\n Entity Documents\n </span>\n </ng-template>\n\n <div style=\"padding: 16px 0;\">\n <mj-explorer-entity-data-grid\n [Params]=\"BuildRelationshipViewParamsByEntityName('MJ: Entity Documents','TemplateID')\"\n [NewRecordValues]=\"NewRecordValues('MJ: Entity Documents')\"\n [AllowLoad]=\"true\"\n [ShowToolbar]=\"false\">\n </mj-explorer-entity-data-grid>\n </div>\n </mj-accordion-panel>\n }\n </div>\n </div>\n </form>\n</mj-record-form-container>\n\n<!-- Template Parameter Dialog -->\n<mj-template-param-dialog\n [template]=\"record\"\n [(isVisible)]=\"showParamDialog\"\n (onClose)=\"onParamDialogClose()\">\n</mj-template-param-dialog>\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-link-pill.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Tests/entity-link-pill.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAA0B,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE;;;;;;;;;;;;;GAaG;AACH,
|
|
1
|
+
{"version":3,"file":"entity-link-pill.component.d.ts","sourceRoot":"","sources":["../../../../src/lib/custom/Tests/entity-link-pill.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6C,iBAAiB,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACvH,OAAO,EAA0B,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAG1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;;AACrE;;;;;;;;;;;;;GAaG;AACH,qBAmEa,uBAAwB,SAAQ,oBAAqB,YAAW,SAAS;IA6CxE,OAAO,CAAC,GAAG;IA5CvB;;OAEG;IACM,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1C;;OAEG;IACM,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAQ;IAExC,wCAAwC;IACxC,IAAa,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAEzC;IACD,wCAAwC;IACxC,IAAI,QAAQ,IAAI,MAAM,GAAG,IAAI,CAE5B;IAED;;OAEG;IACM,UAAU,EAAE,MAAM,GAAG,IAAI,CAAQ;IAE1C,0CAA0C;IAC1C,IAAa,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,EAE3C;IACD,0CAA0C;IAC1C,IAAI,UAAU,IAAI,MAAM,GAAG,IAAI,CAE9B;IAED,UAAU,EAAE,UAAU,GAAG,IAAI,CAAQ;IAErC,0CAA0C;IAC1C,IAAI,UAAU,IAAI,UAAU,GAAG,IAAI,CAElC;IACD,0CAA0C;IAC1C,IAAI,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,EAEtC;IACD,OAAO,KAAK,QAAQ,GAAiC;gBACjC,GAAG,EAAE,iBAAiB;IAG1C,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAOzC,IAAI,SAAS,IAAI,MAAM,CAYtB;IAED,yCAAyC;IACzC,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,YAAY,IAAI,MAAM,CAQzB;IAED,4CAA4C;IAC5C,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IAAI,WAAW,IAAI,MAAM,CAMxB;IAED,2CAA2C;IAC3C,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,UAAU,IAAI,IAAI;IAQlB,0CAA0C;IAC1C,UAAU,IAAI,IAAI;yCA/GP,uBAAuB;2CAAvB,uBAAuB;CAkHnC"}
|
|
@@ -4,6 +4,7 @@ import { SharedService } from '@memberjunction/ng-shared';
|
|
|
4
4
|
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
5
5
|
import * as i0 from "@angular/core";
|
|
6
6
|
import * as i1 from "@angular/common";
|
|
7
|
+
import * as i2 from "@memberjunction/ng-base-forms";
|
|
7
8
|
function EntityLinkPillComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
8
9
|
const _r1 = i0.ɵɵgetCurrentView();
|
|
9
10
|
i0.ɵɵelementStart(0, "span", 1);
|
|
@@ -16,7 +17,7 @@ function EntityLinkPillComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
16
17
|
i0.ɵɵelementEnd();
|
|
17
18
|
} if (rf & 2) {
|
|
18
19
|
const ctx_r1 = i0.ɵɵnextContext();
|
|
19
|
-
i0.ɵɵproperty("title", ctx_r1.tooltipText);
|
|
20
|
+
i0.ɵɵproperty("EntityName", ctx_r1.entityName)("RecordID", ctx_r1.recordId)("DisplayName", ctx_r1.displayLabel)("HandleClick", false)("title", ctx_r1.tooltipText);
|
|
20
21
|
i0.ɵɵadvance();
|
|
21
22
|
i0.ɵɵproperty("ngClass", ctx_r1.iconClass);
|
|
22
23
|
i0.ɵɵadvance(2);
|
|
@@ -138,17 +139,24 @@ export class EntityLinkPillComponent extends BaseAngularComponent {
|
|
|
138
139
|
return this.OpenRecord();
|
|
139
140
|
}
|
|
140
141
|
static { this.ɵfac = function EntityLinkPillComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EntityLinkPillComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
|
|
141
|
-
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityLinkPillComponent, selectors: [["mj-entity-link-pill"]], inputs: { entityName: "entityName", RecordId: "RecordId", recordId: "recordId", RecordName: "RecordName", recordName: "recordName" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [[1, "entity-link-pill", 3, "title"], [1, "entity-link-pill", 3, "click", "title"], [1, "entity-icon", 3, "ngClass"], [1, "entity-label"], [1, "fas", "fa-external-link-alt", "pill-action"]], template: function EntityLinkPillComponent_Template(rf, ctx) { if (rf & 1) {
|
|
142
|
-
i0.ɵɵconditionalCreate(0, EntityLinkPillComponent_Conditional_0_Template, 5,
|
|
142
|
+
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityLinkPillComponent, selectors: [["mj-entity-link-pill"]], inputs: { entityName: "entityName", RecordId: "RecordId", recordId: "recordId", RecordName: "RecordName", recordName: "recordName" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["mjRecordLink", "", 1, "entity-link-pill", 3, "EntityName", "RecordID", "DisplayName", "HandleClick", "title"], ["mjRecordLink", "", 1, "entity-link-pill", 3, "click", "EntityName", "RecordID", "DisplayName", "HandleClick", "title"], [1, "entity-icon", 3, "ngClass"], [1, "entity-label"], [1, "fas", "fa-external-link-alt", "pill-action"]], template: function EntityLinkPillComponent_Template(rf, ctx) { if (rf & 1) {
|
|
143
|
+
i0.ɵɵconditionalCreate(0, EntityLinkPillComponent_Conditional_0_Template, 5, 7, "span", 0);
|
|
143
144
|
} if (rf & 2) {
|
|
144
145
|
i0.ɵɵconditional(ctx.entityInfo && ctx.recordId ? 0 : -1);
|
|
145
|
-
} }, dependencies: [i1.NgClass], styles: [".entity-link-pill[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n color: var(--mj-brand-primary);\n cursor: pointer;\n transition: all 0.2s ease;\n white-space: nowrap;\n max-width: 200px;\n }\n\n .entity-link-pill[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n transform: translateY(-1px);\n box-shadow: var(--mj-shadow-sm);\n }\n\n .entity-icon[_ngcontent-%COMP%] {\n font-size: 11px;\n opacity: 0.9;\n }\n\n .entity-label[_ngcontent-%COMP%] {\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 150px;\n }\n\n .pill-action[_ngcontent-%COMP%] {\n font-size: 9px;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n }\n\n .entity-link-pill[_ngcontent-%COMP%]:hover .pill-action[_ngcontent-%COMP%] {\n opacity: 1;\n }"], changeDetection: 0 }); }
|
|
146
|
+
} }, dependencies: [i1.NgClass, i2.MjRecordLinkDirective], styles: [".entity-link-pill[_ngcontent-%COMP%] {\n display: inline-flex;\n align-items: center;\n gap: 6px;\n padding: 4px 10px;\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, transparent);\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 20%, transparent);\n border-radius: 16px;\n font-size: 12px;\n font-weight: 500;\n color: var(--mj-brand-primary);\n cursor: pointer;\n transition: all 0.2s ease;\n white-space: nowrap;\n max-width: 200px;\n }\n\n .entity-link-pill[_ngcontent-%COMP%]:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 15%, transparent);\n border-color: color-mix(in srgb, var(--mj-brand-primary) 40%, transparent);\n transform: translateY(-1px);\n box-shadow: var(--mj-shadow-sm);\n }\n\n .entity-icon[_ngcontent-%COMP%] {\n font-size: 11px;\n opacity: 0.9;\n }\n\n .entity-label[_ngcontent-%COMP%] {\n overflow: hidden;\n text-overflow: ellipsis;\n max-width: 150px;\n }\n\n .pill-action[_ngcontent-%COMP%] {\n font-size: 9px;\n opacity: 0.6;\n transition: opacity 0.2s ease;\n }\n\n .entity-link-pill[_ngcontent-%COMP%]:hover .pill-action[_ngcontent-%COMP%] {\n opacity: 1;\n }"], changeDetection: 0 }); }
|
|
146
147
|
}
|
|
147
148
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityLinkPillComponent, [{
|
|
148
149
|
type: Component,
|
|
149
150
|
args: [{ standalone: false, selector: 'mj-entity-link-pill', template: `
|
|
150
151
|
@if (entityInfo && recordId) {
|
|
151
|
-
<span class="entity-link-pill"
|
|
152
|
+
<span class="entity-link-pill"
|
|
153
|
+
mjRecordLink
|
|
154
|
+
[EntityName]="entityName"
|
|
155
|
+
[RecordID]="recordId"
|
|
156
|
+
[DisplayName]="displayLabel"
|
|
157
|
+
[HandleClick]="false"
|
|
158
|
+
(click)="openRecord()"
|
|
159
|
+
[title]="tooltipText">
|
|
152
160
|
<i class="entity-icon" [ngClass]="iconClass"></i>
|
|
153
161
|
<span class="entity-label">{{ displayLabel }}</span>
|
|
154
162
|
<i class="fas fa-external-link-alt pill-action"></i>
|
|
@@ -166,5 +174,5 @@ export class EntityLinkPillComponent extends BaseAngularComponent {
|
|
|
166
174
|
}], recordName: [{
|
|
167
175
|
type: Input
|
|
168
176
|
}] }); })();
|
|
169
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntityLinkPillComponent, { className: "EntityLinkPillComponent", filePath: "src/lib/custom/Tests/entity-link-pill.component.ts", lineNumber:
|
|
177
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntityLinkPillComponent, { className: "EntityLinkPillComponent", filePath: "src/lib/custom/Tests/entity-link-pill.component.ts", lineNumber: 87 }); })();
|
|
170
178
|
//# sourceMappingURL=entity-link-pill.component.js.map
|