@memberjunction/ng-entity-communications 5.22.0 → 5.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,7 +5,7 @@ import { UUIDsEqual } from '@memberjunction/global';
5
5
  import { EntityCommunicationsEngineClient } from '@memberjunction/entity-communications-client';
6
6
  import { TemplateEngineBase } from '@memberjunction/templates-base-types';
7
7
  import * as i0 from "@angular/core";
8
- import * as i1 from "@progress/kendo-angular-buttons";
8
+ import * as i1 from "@memberjunction/ng-ui-components";
9
9
  import * as i2 from "@memberjunction/ng-shared-generic";
10
10
  function EntityCommunicationsPreviewComponent_Conditional_1_For_5_Template(rf, ctx) { if (rf & 1) {
11
11
  const _r1 = i0.ɵɵgetCurrentView();
@@ -222,7 +222,7 @@ export class EntityCommunicationsPreviewComponent {
222
222
  }
223
223
  }
224
224
  static ɵfac = function EntityCommunicationsPreviewComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EntityCommunicationsPreviewComponent)(); };
225
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityCommunicationsPreviewComponent, selectors: [["mj-entity-communications-preview"]], inputs: { templateFilter: "templateFilter", entityInfo: "entityInfo", runViewParams: "runViewParams" }, outputs: { templateSelected: "templateSelected" }, standalone: false, decls: 3, vars: 2, consts: [[1, "step-1"], [1, "step-2"], [3, "click"], ["size", "medium", 3, "showText"], ["kendoButton", "", 3, "click"], [1, "vcr-controls"], ["aria-label", "First", 3, "click", "disabled"], [1, "fas", "fa-angle-double-left"], ["aria-label", "Previous", 3, "click", "disabled"], [1, "fas", "fa-angle-left"], [1, "index-indicator"], ["aria-label", "Next", 3, "click", "disabled"], [1, "fas", "fa-angle-right"], ["aria-label", "Last", 3, "click", "disabled"], [1, "fas", "fa-angle-double-right"], [1, "template-preview"], [1, "subject-line"], [1, "preview-body", 3, "innerHTML"]], template: function EntityCommunicationsPreviewComponent_Template(rf, ctx) { if (rf & 1) {
225
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityCommunicationsPreviewComponent, selectors: [["mj-entity-communications-preview"]], inputs: { templateFilter: "templateFilter", entityInfo: "entityInfo", runViewParams: "runViewParams" }, outputs: { templateSelected: "templateSelected" }, standalone: false, decls: 3, vars: 2, consts: [[1, "step-1"], [1, "step-2"], [3, "click"], ["size", "medium", 3, "showText"], ["mjButton", "", 3, "click"], [1, "vcr-controls"], ["aria-label", "First", 3, "click", "disabled"], [1, "fas", "fa-angle-double-left"], ["aria-label", "Previous", 3, "click", "disabled"], [1, "fas", "fa-angle-left"], [1, "index-indicator"], ["aria-label", "Next", 3, "click", "disabled"], [1, "fas", "fa-angle-right"], ["aria-label", "Last", 3, "click", "disabled"], [1, "fas", "fa-angle-double-right"], [1, "template-preview"], [1, "subject-line"], [1, "preview-body", 3, "innerHTML"]], template: function EntityCommunicationsPreviewComponent_Template(rf, ctx) { if (rf & 1) {
226
226
  i0.ɵɵelementStart(0, "div");
227
227
  i0.ɵɵconditionalCreate(1, EntityCommunicationsPreviewComponent_Conditional_1_Template, 6, 0, "div", 0);
228
228
  i0.ɵɵconditionalCreate(2, EntityCommunicationsPreviewComponent_Conditional_2_Template, 3, 1, "div", 1);
@@ -232,11 +232,11 @@ export class EntityCommunicationsPreviewComponent {
232
232
  i0.ɵɵconditional(ctx.step === 1 ? 1 : -1);
233
233
  i0.ɵɵadvance();
234
234
  i0.ɵɵconditional(ctx.step === 2 ? 2 : -1);
235
- } }, dependencies: [i1.ButtonComponent, i2.LoadingComponent], styles: [".step-1[_ngcontent-%COMP%], .step-2[_ngcontent-%COMP%] {\n margin: 20px 0;\n}\n\n.template-preview[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-border-strong);\n margin-top: 10px;\n}\n\n.subject-line[_ngcontent-%COMP%] {\n font-weight: bolder;\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 5px;\n}\n\n.preview-body[_ngcontent-%COMP%] {\n padding: 5px;\n}\n\nul[_ngcontent-%COMP%] {\n list-style: none;\n padding: 0;\n}\n\nli[_ngcontent-%COMP%] {\n padding: 10px;\n border: 1px solid var(--mj-border-strong);\n margin: 5px 0;\n cursor: pointer;\n}\n\nli[_ngcontent-%COMP%]:hover {\n background-color: var(--mj-bg-surface-sunken);\n}\n\n.vcr-controls[_ngcontent-%COMP%] {\n margin-top: 5px;\n margin-bottom: 15px;\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n margin-right: 5px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 20px;\n color: var(--mj-brand-primary);\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover {\n color: var(--mj-brand-primary-hover);\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled {\n color: var(--mj-border-strong);\n cursor: not-allowed;\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled span[_ngcontent-%COMP%] {\n color: var(--mj-border-strong);\n}\n\n.index-indicator[_ngcontent-%COMP%] {\n margin: 0 10px;\n}"] });
235
+ } }, dependencies: [i1.MJButtonDirective, i2.LoadingComponent], styles: [".step-1[_ngcontent-%COMP%], .step-2[_ngcontent-%COMP%] {\n margin: 20px 0;\n}\n\n.template-preview[_ngcontent-%COMP%] {\n border: 1px solid var(--mj-border-strong);\n margin-top: 10px;\n}\n\n.subject-line[_ngcontent-%COMP%] {\n font-weight: bolder;\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 5px;\n}\n\n.preview-body[_ngcontent-%COMP%] {\n padding: 5px;\n}\n\nul[_ngcontent-%COMP%] {\n list-style: none;\n padding: 0;\n}\n\nli[_ngcontent-%COMP%] {\n padding: 10px;\n border: 1px solid var(--mj-border-strong);\n margin: 5px 0;\n cursor: pointer;\n}\n\nli[_ngcontent-%COMP%]:hover {\n background-color: var(--mj-bg-surface-sunken);\n}\n\n.vcr-controls[_ngcontent-%COMP%] {\n margin-top: 5px;\n margin-bottom: 15px;\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%] {\n margin-right: 5px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 20px;\n color: var(--mj-brand-primary);\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:hover {\n color: var(--mj-brand-primary-hover);\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled {\n color: var(--mj-border-strong);\n cursor: not-allowed;\n}\n\n.vcr-controls[_ngcontent-%COMP%] button[_ngcontent-%COMP%]:disabled span[_ngcontent-%COMP%] {\n color: var(--mj-border-strong);\n}\n\n.index-indicator[_ngcontent-%COMP%] {\n margin: 0 10px;\n}"] });
236
236
  }
237
237
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityCommunicationsPreviewComponent, [{
238
238
  type: Component,
239
- args: [{ standalone: false, selector: 'mj-entity-communications-preview', template: "<div>\n @if (step === 1) {\n <div class=\"step-1\">\n <h2>Select a Template</h2>\n <ul>\n @for (template of templates; track template) {\n <li (click)=\"selectTemplate(template)\">\n {{ template.Name }}\n </li>\n }\n </ul>\n </div>\n }\n\n @if (step === 2) {\n <div class=\"step-2\">\n @if(!loading) {\n @if (previewMessages.length === 0) {\n <h2>No Messages Available</h2>\n <button kendoButton (click)=\"goBack()\">Back</button>\n }\n @else {\n <h2>Preview {{ selectedTemplate?.Name }}</h2>\n <button kendoButton (click)=\"goBack()\">Back</button>\n <div class=\"vcr-controls\">\n <button (click)=\"firstMessage()\" aria-label=\"First\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-double-left\"></span>\n </button>\n <button (click)=\"previousMessage()\" aria-label=\"Previous\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-left\"></span>\n </button>\n <span class=\"index-indicator\">{{ currentMessageIndex + 1 }} of {{ previewMessages.length }}</span>\n <button (click)=\"nextMessage()\" aria-label=\"Next\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-right\"></span>\n </button>\n <button (click)=\"lastMessage()\" aria-label=\"Last\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-double-right\"></span>\n </button>\n </div>\n <div class=\"template-preview\">\n <div class=\"subject-line\">{{currentPreviewItemSubject()}}</div>\n <div class=\"preview-body\" [innerHTML]=\"currentPreviewItemBody()\"></div>\n </div>\n }\n }\n @else {\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n }\n</div>\n}\n</div>", styles: [".step-1, .step-2 {\n margin: 20px 0;\n}\n\n.template-preview {\n border: 1px solid var(--mj-border-strong);\n margin-top: 10px;\n}\n\n.subject-line {\n font-weight: bolder;\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 5px;\n}\n\n.preview-body {\n padding: 5px;\n}\n\nul {\n list-style: none;\n padding: 0;\n}\n\nli {\n padding: 10px;\n border: 1px solid var(--mj-border-strong);\n margin: 5px 0;\n cursor: pointer;\n}\n\nli:hover {\n background-color: var(--mj-bg-surface-sunken);\n}\n\n.vcr-controls {\n margin-top: 5px;\n margin-bottom: 15px;\n}\n\n.vcr-controls button {\n margin-right: 5px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 20px;\n color: var(--mj-brand-primary);\n}\n\n.vcr-controls button:hover {\n color: var(--mj-brand-primary-hover);\n}\n\n.vcr-controls button:disabled {\n color: var(--mj-border-strong);\n cursor: not-allowed;\n}\n\n.vcr-controls button:disabled span {\n color: var(--mj-border-strong);\n}\n\n.index-indicator {\n margin: 0 10px;\n}"] }]
239
+ args: [{ standalone: false, selector: 'mj-entity-communications-preview', template: "<div>\n @if (step === 1) {\n <div class=\"step-1\">\n <h2>Select a Template</h2>\n <ul>\n @for (template of templates; track template) {\n <li (click)=\"selectTemplate(template)\">\n {{ template.Name }}\n </li>\n }\n </ul>\n </div>\n }\n\n @if (step === 2) {\n <div class=\"step-2\">\n @if(!loading) {\n @if (previewMessages.length === 0) {\n <h2>No Messages Available</h2>\n <button mjButton (click)=\"goBack()\">Back</button>\n }\n @else {\n <h2>Preview {{ selectedTemplate?.Name }}</h2>\n <button mjButton (click)=\"goBack()\">Back</button>\n <div class=\"vcr-controls\">\n <button (click)=\"firstMessage()\" aria-label=\"First\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-double-left\"></span>\n </button>\n <button (click)=\"previousMessage()\" aria-label=\"Previous\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-left\"></span>\n </button>\n <span class=\"index-indicator\">{{ currentMessageIndex + 1 }} of {{ previewMessages.length }}</span>\n <button (click)=\"nextMessage()\" aria-label=\"Next\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-right\"></span>\n </button>\n <button (click)=\"lastMessage()\" aria-label=\"Last\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-double-right\"></span>\n </button>\n </div>\n <div class=\"template-preview\">\n <div class=\"subject-line\">{{currentPreviewItemSubject()}}</div>\n <div class=\"preview-body\" [innerHTML]=\"currentPreviewItemBody()\"></div>\n </div>\n }\n }\n @else {\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n }\n</div>\n}\n</div>", styles: [".step-1, .step-2 {\n margin: 20px 0;\n}\n\n.template-preview {\n border: 1px solid var(--mj-border-strong);\n margin-top: 10px;\n}\n\n.subject-line {\n font-weight: bolder;\n border-bottom: 1px solid var(--mj-border-strong);\n padding: 5px;\n}\n\n.preview-body {\n padding: 5px;\n}\n\nul {\n list-style: none;\n padding: 0;\n}\n\nli {\n padding: 10px;\n border: 1px solid var(--mj-border-strong);\n margin: 5px 0;\n cursor: pointer;\n}\n\nli:hover {\n background-color: var(--mj-bg-surface-sunken);\n}\n\n.vcr-controls {\n margin-top: 5px;\n margin-bottom: 15px;\n}\n\n.vcr-controls button {\n margin-right: 5px;\n background: none;\n border: none;\n cursor: pointer;\n font-size: 20px;\n color: var(--mj-brand-primary);\n}\n\n.vcr-controls button:hover {\n color: var(--mj-brand-primary-hover);\n}\n\n.vcr-controls button:disabled {\n color: var(--mj-border-strong);\n cursor: not-allowed;\n}\n\n.vcr-controls button:disabled span {\n color: var(--mj-border-strong);\n}\n\n.index-indicator {\n margin: 0 10px;\n}"] }]
240
240
  }], () => [], { templateFilter: [{
241
241
  type: Input
242
242
  }], entityInfo: [{
@@ -1 +1 @@
1
- {"version":3,"file":"preview.component.js","sourceRoot":"","sources":["../../src/lib/preview.component.ts","../../src/lib/preview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAoB,MAAM,qCAAqC,CAAC;AACzG,OAAO,EAAc,OAAO,EAAiB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;;;;;;ICDhE,6BAAuC;IAAnC,yOAAS,kCAAwB,KAAC;IACpC,YACF;IAAA,iBAAK;;;IADH,cACF;IADE,iDACF;;;IALJ,AADF,8BAAoB,SACd;IAAA,iCAAiB;IAAA,iBAAK;IAC1B,0BAAI;IACF,yIAIC;IAEL,AADE,iBAAK,EACD;;;IANF,eAIC;IAJD,+BAIC;;;;IASC,0BAAI;IAAA,qCAAqB;IAAA,iBAAK;IAC9B,iCAAuC;IAAnB,qOAAS,eAAQ,KAAC;IAAC,oBAAI;IAAA,iBAAS;;;;IAGtD,0BAAI;IAAA,YAAoC;IAAA,iBAAK;IAC7C,iCAAuC;IAAnB,qOAAS,eAAQ,KAAC;IAAC,oBAAI;IAAA,iBAAS;IAElD,AADF,8BAA0B,gBACmE;IA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,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/D,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;8HApIU,oCAAoC;6DAApC,oCAAoC;YClBjD,2BAAK;YACH,sGAAkB;YAalB,sGAAkB;YAoCpB,iBAAM;;YAjDJ,cAWC;YAXD,yCAWC;YAED,cAmCD;YAnCC,yCAmCD;;;iFD/BY,oCAAoC;cANhD,SAAS;6BACI,KAAK,YACP,kCAAkC;;kBAK3C,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,MAAM;;kFAJI,oCAAoC","sourcesContent":["import { Component, Output, EventEmitter, Input, OnInit } from '@angular/core';\nimport { CommunicationEngineBase, Message, ProcessedMessage } from '@memberjunction/communication-types';\nimport { EntityInfo, RunView, RunViewParams } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJTemplateContentEntity, MJTemplateEntityExtended } from '@memberjunction/core-entities';\nimport { EntityCommunicationParams } from '@memberjunction/entity-communications-base';\nimport { EntityCommunicationsEngineClient } from '@memberjunction/entity-communications-client';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\n\n/**\n * Component for previewing in the UI what a communication will look like when sent using a specific entity and parameters for running a view that drive a dataset against a given template\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-communications-preview',\n templateUrl: './preview.component.html',\n styleUrls: ['./preview.component.css']\n})\nexport class EntityCommunicationsPreviewComponent implements OnInit {\n @Input() templateFilter: string | undefined;\n @Input() entityInfo: EntityInfo | undefined;\n @Input() runViewParams: RunViewParams | undefined;\n @Output() templateSelected = new EventEmitter<MJTemplateEntityExtended>();\n\n templates: MJTemplateEntityExtended[] = [];\n selectedTemplate: MJTemplateEntityExtended | null = null;\n step: number = 1;\n\n public previewMessages: ProcessedMessage[] = [];\n currentMessageIndex: number = 0;\n public loading: boolean = false;\n\n constructor() {}\n\n async ngOnInit() {\n if (!this.entityInfo || !this.runViewParams)\n throw new Error(\"EntityInfo and RunViewParams are required\");\n\n await this.loadTemplates();\n }\n\n async loadTemplates() {\n // load up all template metadata\n const rv = new RunView();\n const result = await rv.RunView<MJTemplateEntityExtended>(\n {\n EntityName: \"MJ: Templates\",\n ExtraFilter: `(IsActive = 1 AND (ActiveAt IS NULL OR ActiveAt <= GETDATE())) ${this.templateFilter ? `AND ${this.templateFilter}` : ''}`,\n ResultType: 'entity_object'\n }\n );\n const content = await rv.RunView<MJTemplateContentEntity>({\n EntityName: \"MJ: Template Contents\",\n ResultType: 'entity_object'\n })\n this.templates = result.Results;\n this.templates.forEach(template => {\n template.Content = content.Results.filter(c => UUIDsEqual(c.TemplateID, template.ID));\n });\n }\n\n selectTemplate(template: MJTemplateEntityExtended) {\n this.selectedTemplate = template;\n this.templateSelected.emit(template);\n this.step = 2;\n this.loadMessagePreviews(); \n }\n\n protected async loadMessagePreviews() {\n this.loading = true;\n\n const msg: Message = new Message();\n msg.From = \"amith@bluecypress.io\"\n msg.Subject = \"Test Subject\";\n\n const sendGrid = CommunicationEngineBase.Instance.Providers.find(p => p.Name === \"SendGrid\")\n if (!sendGrid)\n throw new Error(\"SendGrid provider not found\");\n\n const email = sendGrid.MessageTypes.find(mt => mt.Name === \"Email\");\n if (!email) \n throw new Error(\"Email message type not found\");\n\n if (!this.selectedTemplate)\n throw new Error(\"No template selected\");\n\n msg.MessageType = email;\n\n msg.HTMLBodyTemplate = this.selectedTemplate;\n msg.SubjectTemplate = TemplateEngineBase.Instance.FindTemplate('Test Subject Template')\n \n const commParams: EntityCommunicationParams = {\n EntityID: this.entityInfo!.ID, \n RunViewParams: this.runViewParams!, \n ProviderName: \"SendGrid\", \n ProviderMessageTypeName: \"Email\", \n Message: msg,\n PreviewOnly: true,\n IncludeProcessedMessages: true\n }\n const result = await EntityCommunicationsEngineClient.Instance.RunEntityCommunication(commParams);\n if (result && result.Success && result.Results) {\n this.previewMessages = result.Results.map(r => r.Message)\n }\n\n this.loading = false;\n }\n\n currentPreviewItemSubject(): string {\n if (this.previewMessages && this.previewMessages.length > 0) {\n if (this.currentMessageIndex >=0 && this.currentMessageIndex < this.previewMessages.length) {\n return this.previewMessages[this.currentMessageIndex].ProcessedSubject!; \n }\n }\n\n return 'Error processing template content';\n }\n currentPreviewItemBody(): string {\n if (this.previewMessages && this.previewMessages.length > 0) {\n if (this.currentMessageIndex >=0 && this.currentMessageIndex < this.previewMessages.length) {\n return this.previewMessages[this.currentMessageIndex].ProcessedHTMLBody!; \n }\n }\n\n return 'Error processing template content';\n }\n\n goBack() {\n this.step = 1;\n }\n\n\n firstMessage() {\n this.currentMessageIndex = 0;\n }\n\n lastMessage() {\n this.currentMessageIndex = this.previewMessages.length - 1;\n }\n\n nextMessage() {\n if (this.currentMessageIndex < this.previewMessages.length - 1) {\n this.currentMessageIndex++;\n }\n }\n\n previousMessage() {\n if (this.currentMessageIndex > 0) {\n this.currentMessageIndex--;\n }\n }\n}\n\n ","<div>\n @if (step === 1) {\n <div class=\"step-1\">\n <h2>Select a Template</h2>\n <ul>\n @for (template of templates; track template) {\n <li (click)=\"selectTemplate(template)\">\n {{ template.Name }}\n </li>\n }\n </ul>\n </div>\n }\n\n @if (step === 2) {\n <div class=\"step-2\">\n @if(!loading) {\n @if (previewMessages.length === 0) {\n <h2>No Messages Available</h2>\n <button kendoButton (click)=\"goBack()\">Back</button>\n }\n @else {\n <h2>Preview {{ selectedTemplate?.Name }}</h2>\n <button kendoButton (click)=\"goBack()\">Back</button>\n <div class=\"vcr-controls\">\n <button (click)=\"firstMessage()\" aria-label=\"First\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-double-left\"></span>\n </button>\n <button (click)=\"previousMessage()\" aria-label=\"Previous\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-left\"></span>\n </button>\n <span class=\"index-indicator\">{{ currentMessageIndex + 1 }} of {{ previewMessages.length }}</span>\n <button (click)=\"nextMessage()\" aria-label=\"Next\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-right\"></span>\n </button>\n <button (click)=\"lastMessage()\" aria-label=\"Last\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-double-right\"></span>\n </button>\n </div>\n <div class=\"template-preview\">\n <div class=\"subject-line\">{{currentPreviewItemSubject()}}</div>\n <div class=\"preview-body\" [innerHTML]=\"currentPreviewItemBody()\"></div>\n </div>\n }\n }\n @else {\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n }\n</div>\n}\n</div>"]}
1
+ {"version":3,"file":"preview.component.js","sourceRoot":"","sources":["../../src/lib/preview.component.ts","../../src/lib/preview.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAU,MAAM,eAAe,CAAC;AAC/E,OAAO,EAAE,uBAAuB,EAAE,OAAO,EAAoB,MAAM,qCAAqC,CAAC;AACzG,OAAO,EAAc,OAAO,EAAiB,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,gCAAgC,EAAE,MAAM,8CAA8C,CAAC;AAChG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;;;;;;ICDhE,6BAAuC;IAAnC,yOAAS,kCAAwB,KAAC;IACpC,YACF;IAAA,iBAAK;;;IADH,cACF;IADE,iDACF;;;IALJ,AADF,8BAAoB,SACd;IAAA,iCAAiB;IAAA,iBAAK;IAC1B,0BAAI;IACF,yIAIC;IAEL,AADE,iBAAK,EACD;;;IANF,eAIC;IAJD,+BAIC;;;;IASC,0BAAI;IAAA,qCAAqB;IAAA,iBAAK;IAC9B,iCAAoC;IAAnB,qOAAS,eAAQ,KAAC;IAAC,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,WAAW;QACT,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,CAAC;IAC7D,CAAC;IAED,WAAW;QACT,IAAI,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC/D,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,eAAe;QACb,IAAI,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAAE,CAAC;YACjC,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,CAAC;IACH,CAAC;8HApIU,oCAAoC;6DAApC,oCAAoC;YClBjD,2BAAK;YACH,sGAAkB;YAalB,sGAAkB;YAoCpB,iBAAM;;YAjDJ,cAWC;YAXD,yCAWC;YAED,cAmCD;YAnCC,yCAmCD;;;iFD/BY,oCAAoC;cANhD,SAAS;6BACI,KAAK,YACP,kCAAkC;;kBAK3C,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,MAAM;;kFAJI,oCAAoC","sourcesContent":["import { Component, Output, EventEmitter, Input, OnInit } from '@angular/core';\nimport { CommunicationEngineBase, Message, ProcessedMessage } from '@memberjunction/communication-types';\nimport { EntityInfo, RunView, RunViewParams } from '@memberjunction/core';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { MJTemplateContentEntity, MJTemplateEntityExtended } from '@memberjunction/core-entities';\nimport { EntityCommunicationParams } from '@memberjunction/entity-communications-base';\nimport { EntityCommunicationsEngineClient } from '@memberjunction/entity-communications-client';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\n\n/**\n * Component for previewing in the UI what a communication will look like when sent using a specific entity and parameters for running a view that drive a dataset against a given template\n */\n@Component({\n standalone: false,\n selector: 'mj-entity-communications-preview',\n templateUrl: './preview.component.html',\n styleUrls: ['./preview.component.css']\n})\nexport class EntityCommunicationsPreviewComponent implements OnInit {\n @Input() templateFilter: string | undefined;\n @Input() entityInfo: EntityInfo | undefined;\n @Input() runViewParams: RunViewParams | undefined;\n @Output() templateSelected = new EventEmitter<MJTemplateEntityExtended>();\n\n templates: MJTemplateEntityExtended[] = [];\n selectedTemplate: MJTemplateEntityExtended | null = null;\n step: number = 1;\n\n public previewMessages: ProcessedMessage[] = [];\n currentMessageIndex: number = 0;\n public loading: boolean = false;\n\n constructor() {}\n\n async ngOnInit() {\n if (!this.entityInfo || !this.runViewParams)\n throw new Error(\"EntityInfo and RunViewParams are required\");\n\n await this.loadTemplates();\n }\n\n async loadTemplates() {\n // load up all template metadata\n const rv = new RunView();\n const result = await rv.RunView<MJTemplateEntityExtended>(\n {\n EntityName: \"MJ: Templates\",\n ExtraFilter: `(IsActive = 1 AND (ActiveAt IS NULL OR ActiveAt <= GETDATE())) ${this.templateFilter ? `AND ${this.templateFilter}` : ''}`,\n ResultType: 'entity_object'\n }\n );\n const content = await rv.RunView<MJTemplateContentEntity>({\n EntityName: \"MJ: Template Contents\",\n ResultType: 'entity_object'\n })\n this.templates = result.Results;\n this.templates.forEach(template => {\n template.Content = content.Results.filter(c => UUIDsEqual(c.TemplateID, template.ID));\n });\n }\n\n selectTemplate(template: MJTemplateEntityExtended) {\n this.selectedTemplate = template;\n this.templateSelected.emit(template);\n this.step = 2;\n this.loadMessagePreviews(); \n }\n\n protected async loadMessagePreviews() {\n this.loading = true;\n\n const msg: Message = new Message();\n msg.From = \"amith@bluecypress.io\"\n msg.Subject = \"Test Subject\";\n\n const sendGrid = CommunicationEngineBase.Instance.Providers.find(p => p.Name === \"SendGrid\")\n if (!sendGrid)\n throw new Error(\"SendGrid provider not found\");\n\n const email = sendGrid.MessageTypes.find(mt => mt.Name === \"Email\");\n if (!email) \n throw new Error(\"Email message type not found\");\n\n if (!this.selectedTemplate)\n throw new Error(\"No template selected\");\n\n msg.MessageType = email;\n\n msg.HTMLBodyTemplate = this.selectedTemplate;\n msg.SubjectTemplate = TemplateEngineBase.Instance.FindTemplate('Test Subject Template')\n \n const commParams: EntityCommunicationParams = {\n EntityID: this.entityInfo!.ID, \n RunViewParams: this.runViewParams!, \n ProviderName: \"SendGrid\", \n ProviderMessageTypeName: \"Email\", \n Message: msg,\n PreviewOnly: true,\n IncludeProcessedMessages: true\n }\n const result = await EntityCommunicationsEngineClient.Instance.RunEntityCommunication(commParams);\n if (result && result.Success && result.Results) {\n this.previewMessages = result.Results.map(r => r.Message)\n }\n\n this.loading = false;\n }\n\n currentPreviewItemSubject(): string {\n if (this.previewMessages && this.previewMessages.length > 0) {\n if (this.currentMessageIndex >=0 && this.currentMessageIndex < this.previewMessages.length) {\n return this.previewMessages[this.currentMessageIndex].ProcessedSubject!; \n }\n }\n\n return 'Error processing template content';\n }\n currentPreviewItemBody(): string {\n if (this.previewMessages && this.previewMessages.length > 0) {\n if (this.currentMessageIndex >=0 && this.currentMessageIndex < this.previewMessages.length) {\n return this.previewMessages[this.currentMessageIndex].ProcessedHTMLBody!; \n }\n }\n\n return 'Error processing template content';\n }\n\n goBack() {\n this.step = 1;\n }\n\n\n firstMessage() {\n this.currentMessageIndex = 0;\n }\n\n lastMessage() {\n this.currentMessageIndex = this.previewMessages.length - 1;\n }\n\n nextMessage() {\n if (this.currentMessageIndex < this.previewMessages.length - 1) {\n this.currentMessageIndex++;\n }\n }\n\n previousMessage() {\n if (this.currentMessageIndex > 0) {\n this.currentMessageIndex--;\n }\n }\n}\n\n ","<div>\n @if (step === 1) {\n <div class=\"step-1\">\n <h2>Select a Template</h2>\n <ul>\n @for (template of templates; track template) {\n <li (click)=\"selectTemplate(template)\">\n {{ template.Name }}\n </li>\n }\n </ul>\n </div>\n }\n\n @if (step === 2) {\n <div class=\"step-2\">\n @if(!loading) {\n @if (previewMessages.length === 0) {\n <h2>No Messages Available</h2>\n <button mjButton (click)=\"goBack()\">Back</button>\n }\n @else {\n <h2>Preview {{ selectedTemplate?.Name }}</h2>\n <button mjButton (click)=\"goBack()\">Back</button>\n <div class=\"vcr-controls\">\n <button (click)=\"firstMessage()\" aria-label=\"First\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-double-left\"></span>\n </button>\n <button (click)=\"previousMessage()\" aria-label=\"Previous\" [disabled]=\"currentMessageIndex === 0\">\n <span class=\"fas fa-angle-left\"></span>\n </button>\n <span class=\"index-indicator\">{{ currentMessageIndex + 1 }} of {{ previewMessages.length }}</span>\n <button (click)=\"nextMessage()\" aria-label=\"Next\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-right\"></span>\n </button>\n <button (click)=\"lastMessage()\" aria-label=\"Last\" [disabled]=\"currentMessageIndex >= previewMessages.length - 1\">\n <span class=\"fas fa-angle-double-right\"></span>\n </button>\n </div>\n <div class=\"template-preview\">\n <div class=\"subject-line\">{{currentPreviewItemSubject()}}</div>\n <div class=\"preview-body\" [innerHTML]=\"currentPreviewItemBody()\"></div>\n </div>\n }\n }\n @else {\n <mj-loading [showText]=\"false\" size=\"medium\"></mj-loading>\n }\n</div>\n}\n</div>"]}
@@ -1,6 +1,5 @@
1
1
  import { EventEmitter } from '@angular/core';
2
2
  import { BaseEntity, EntityInfo, RunViewParams } from '@memberjunction/core';
3
- import { ListBoxToolbarConfig } from '@progress/kendo-angular-listbox';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class EntityCommunicationsPreviewWindowComponent {
6
5
  Title: string;
@@ -21,7 +20,10 @@ export declare class EntityCommunicationsPreviewWindowComponent {
21
20
  /**
22
21
  * Configurable settings for the toolbar
23
22
  */
24
- ToolbarSettings: ListBoxToolbarConfig;
23
+ ToolbarSettings: {
24
+ position: string;
25
+ tools: string[];
26
+ };
25
27
  RecordSelected: EventEmitter<BaseEntity<unknown>[]>;
26
28
  RecordUnselected: EventEmitter<BaseEntity<unknown>[]>;
27
29
  protected _initialSelected: BaseEntity[];
@@ -1 +1 @@
1
- {"version":3,"file":"window.component.d.ts","sourceRoot":"","sources":["../../src/lib/window.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,YAAY,E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;IAElD,IAAa,aAAa,IAAI,OAAO,CAEpC;IACD,IAAI,aAAa,CAAC,KAAK,EAAE,OAAO,EAM/B;IACD,OAAO,CAAC,cAAc,CAAkB;IACxC;;OAEG;IACO,YAAY,wBAA+B;IAIrD;;OAEG;IACa,eAAe,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAGpE;IAEQ,cAAc,sCAAoC;IAClD,gBAAgB,sCAAoC;IAE9D,SAAS,CAAC,gBAAgB,EAAE,UAAU,EAAE,CAAM;IAC9C,SAAS,CAAC,kBAAkB,EAAE,UAAU,EAAE,CAAM;IAGzC,QAAQ;IAKR,IAAI;yCAjDA,0CAA0C;2CAA1C,0CAA0C;CAqDtD"}
@@ -1,16 +1,16 @@
1
1
  import { Component, Output, EventEmitter, Input } from '@angular/core';
2
2
  import * as i0 from "@angular/core";
3
- import * as i1 from "@progress/kendo-angular-dialog";
3
+ import * as i1 from "@memberjunction/ng-ui-components";
4
4
  import * as i2 from "./preview.component";
5
5
  function EntityCommunicationsPreviewWindowComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
6
6
  const _r1 = i0.ɵɵgetCurrentView();
7
- i0.ɵɵelementStart(0, "kendo-window", 1);
8
- i0.ɵɵlistener("close", function EntityCommunicationsPreviewWindowComponent_Conditional_0_Template_kendo_window_close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
7
+ i0.ɵɵelementStart(0, "mj-window", 1);
8
+ i0.ɵɵlistener("Close", function EntityCommunicationsPreviewWindowComponent_Conditional_0_Template_mj_window_Close_0_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.OnCancel()); });
9
9
  i0.ɵɵelement(1, "mj-entity-communications-preview", 2);
10
10
  i0.ɵɵelementEnd();
11
11
  } if (rf & 2) {
12
12
  const ctx_r1 = i0.ɵɵnextContext();
13
- i0.ɵɵproperty("width", ctx_r1.Width)("height", ctx_r1.Height)("minWidth", ctx_r1.MinWidth)("minHeight", ctx_r1.MinHeight)("title", ctx_r1.Title)("resizable", ctx_r1.Resizable);
13
+ i0.ɵɵproperty("Visible", true)("Width", ctx_r1.Width)("Height", ctx_r1.Height)("MinWidth", ctx_r1.MinWidth)("MinHeight", ctx_r1.MinHeight)("Title", ctx_r1.Title)("Resizable", ctx_r1.Resizable);
14
14
  i0.ɵɵadvance();
15
15
  i0.ɵɵproperty("entityInfo", ctx_r1.entityInfo)("runViewParams", ctx_r1.runViewParams);
16
16
  } }
@@ -58,15 +58,15 @@ export class EntityCommunicationsPreviewWindowComponent {
58
58
  this.DialogClosed.emit(true);
59
59
  }
60
60
  static ɵfac = function EntityCommunicationsPreviewWindowComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EntityCommunicationsPreviewWindowComponent)(); };
61
- static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityCommunicationsPreviewWindowComponent, selectors: [["mj-entity-communications-preview-window"]], inputs: { Title: "Title", Width: "Width", Height: "Height", MinWidth: "MinWidth", MinHeight: "MinHeight", Resizable: "Resizable", entityInfo: "entityInfo", runViewParams: "runViewParams", DialogVisible: "DialogVisible", ToolbarSettings: "ToolbarSettings" }, outputs: { DialogClosed: "DialogClosed", RecordSelected: "RecordSelected", RecordUnselected: "RecordUnselected" }, standalone: false, decls: 1, vars: 1, consts: [[3, "width", "height", "minWidth", "minHeight", "title", "resizable"], [3, "close", "width", "height", "minWidth", "minHeight", "title", "resizable"], [3, "entityInfo", "runViewParams"]], template: function EntityCommunicationsPreviewWindowComponent_Template(rf, ctx) { if (rf & 1) {
62
- i0.ɵɵconditionalCreate(0, EntityCommunicationsPreviewWindowComponent_Conditional_0_Template, 2, 8, "kendo-window", 0);
61
+ static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: EntityCommunicationsPreviewWindowComponent, selectors: [["mj-entity-communications-preview-window"]], inputs: { Title: "Title", Width: "Width", Height: "Height", MinWidth: "MinWidth", MinHeight: "MinHeight", Resizable: "Resizable", entityInfo: "entityInfo", runViewParams: "runViewParams", DialogVisible: "DialogVisible", ToolbarSettings: "ToolbarSettings" }, outputs: { DialogClosed: "DialogClosed", RecordSelected: "RecordSelected", RecordUnselected: "RecordUnselected" }, standalone: false, decls: 1, vars: 1, consts: [[3, "Visible", "Width", "Height", "MinWidth", "MinHeight", "Title", "Resizable"], [3, "Close", "Visible", "Width", "Height", "MinWidth", "MinHeight", "Title", "Resizable"], [3, "entityInfo", "runViewParams"]], template: function EntityCommunicationsPreviewWindowComponent_Template(rf, ctx) { if (rf & 1) {
62
+ i0.ɵɵconditionalCreate(0, EntityCommunicationsPreviewWindowComponent_Conditional_0_Template, 2, 9, "mj-window", 0);
63
63
  } if (rf & 2) {
64
64
  i0.ɵɵconditional(ctx.DialogVisible ? 0 : -1);
65
- } }, dependencies: [i1.WindowComponent, i2.EntityCommunicationsPreviewComponent], encapsulation: 2 });
65
+ } }, dependencies: [i1.MJWindowComponent, i2.EntityCommunicationsPreviewComponent], encapsulation: 2 });
66
66
  }
67
67
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityCommunicationsPreviewWindowComponent, [{
68
68
  type: Component,
69
- args: [{ standalone: false, selector: 'mj-entity-communications-preview-window', template: "@if (DialogVisible) {\n <kendo-window\n [width]=\"Width\"\n [height]=\"Height\"\n [minWidth]=\"MinWidth\"\n [minHeight]=\"MinHeight\"\n [title]=\"Title\" \n (close)=\"OnCancel()\"\n [resizable]=\"Resizable\"\n >\n <mj-entity-communications-preview\n [entityInfo]=\"entityInfo\"\n [runViewParams]=\"runViewParams\"\n >\n </mj-entity-communications-preview>\n </kendo-window> \n}" }]
69
+ args: [{ standalone: false, selector: 'mj-entity-communications-preview-window', template: "@if (DialogVisible) {\n <mj-window\n [Visible]=\"true\"\n [Width]=\"Width\"\n [Height]=\"Height\"\n [MinWidth]=\"MinWidth\"\n [MinHeight]=\"MinHeight\"\n [Title]=\"Title\"\n (Close)=\"OnCancel()\"\n [Resizable]=\"Resizable\"\n >\n <mj-entity-communications-preview\n [entityInfo]=\"entityInfo\"\n [runViewParams]=\"runViewParams\"\n >\n </mj-entity-communications-preview>\n </mj-window>\n}" }]
70
70
  }], null, { Title: [{
71
71
  type: Input
72
72
  }], Width: [{
@@ -94,5 +94,5 @@ export class EntityCommunicationsPreviewWindowComponent {
94
94
  }], RecordUnselected: [{
95
95
  type: Output
96
96
  }] }); })();
97
- (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntityCommunicationsPreviewWindowComponent, { className: "EntityCommunicationsPreviewWindowComponent", filePath: "src/lib/window.component.ts", lineNumber: 14 }); })();
97
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(EntityCommunicationsPreviewWindowComponent, { className: "EntityCommunicationsPreviewWindowComponent", filePath: "src/lib/window.component.ts", lineNumber: 11 }); })();
98
98
  //# sourceMappingURL=window.component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"window.component.js","sourceRoot":"","sources":["../../src/lib/window.component.ts","../../src/lib/window.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAyB,MAAM,EAAE,YAAY,EAAU,KAAK,EAAmC,MAAM,eAAe,CAAC;;;;;;ICCnI,uCAQC;IAFG,oNAAS,iBAAU,KAAC;IAGpB,sDAImC;IACvC,iBAAe;;;IAPX,AAFA,AADA,AADA,AADA,AADA,oCAAe,yBACE,6BACI,+BACE,uBACR,+BAEQ;IAGnB,cAAyB;IACzB,AADA,8CAAyB,uCACM;;ADC3C,MAAM,OAAO,0CAA0C;IAC5C,KAAK,GAAW,wBAAwB,CAAC;IACzC,KAAK,GAAG,GAAG,CAAC;IACZ,MAAM,GAAG,GAAG,CAAC;IACb,QAAQ,GAAG,GAAG,CAAC;IACf,SAAS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;kBACL,KAAK;;kBAEL,KAAK;;kBAcL,MAAM;;kBAON,KAAK;;kBAKL,MAAM;;kBACN,MAAM;;kFAtCI,0CAA0C","sourcesContent":["import { Component, ViewChild, ElementRef, Output, EventEmitter, OnInit, Input, AfterViewInit, AfterViewChecked } from '@angular/core';\n\nimport { Metadata, BaseEntity, LogError, KeyValuePair, RunQueryParams, RunQuery, EntityInfo, RunViewParams } from '@memberjunction/core';\n \nimport { DisplaySimpleNotificationRequestData, MJEventType, MJGlobal } from '@memberjunction/global';\nimport { ListBoxToolbarConfig } from '@progress/kendo-angular-listbox';\n \n@Component({\n standalone: false,\n selector: 'mj-entity-communications-preview-window',\n templateUrl: './window.component.html',\n styleUrls: ['./window.component.css']\n})\nexport class EntityCommunicationsPreviewWindowComponent {\n @Input() Title: string = 'Communications Preview';\n @Input() Width = 650;\n @Input() Height = 600;\n @Input() MinWidth = 400;\n @Input() MinHeight = 350;\n @Input() Resizable = true;\n\n @Input() entityInfo: EntityInfo | undefined;\n @Input() runViewParams: RunViewParams | undefined;\n\n @Input() get DialogVisible(): boolean {\n return this._dialogVisible;\n }\n set DialogVisible(value: boolean) {\n if (value !== this._dialogVisible && value) {\n // showing the dialog\n //this.RefreshInitialValues();\n }\n this._dialogVisible = value;\n }\n private _dialogVisible: boolean = false;\n /**\n * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button\n */\n @Output() DialogClosed = new EventEmitter<boolean>();\n \n \n\n /**\n * Configurable settings for the toolbar\n */\n @Input() public ToolbarSettings: ListBoxToolbarConfig = {\n position: \"right\",\n tools: [\"moveUp\", \"transferFrom\", \"transferAllFrom\", \"transferAllTo\", \"transferTo\", \"moveDown\"],\n };\n\n @Output() RecordSelected = new EventEmitter<BaseEntity[]>();\n @Output() RecordUnselected = new EventEmitter<BaseEntity[]>();\n\n protected _initialSelected: BaseEntity[] = [];\n protected _initialUnselected: BaseEntity[] = []; \n \n\n public OnCancel() { \n this.DialogVisible = false;\n this.DialogClosed.emit(false);\n }\n\n public OnOK() { \n this.DialogVisible = false;\n this.DialogClosed.emit(true);\n }\n}\n","@if (DialogVisible) {\n <kendo-window\n [width]=\"Width\"\n [height]=\"Height\"\n [minWidth]=\"MinWidth\"\n [minHeight]=\"MinHeight\"\n [title]=\"Title\" \n (close)=\"OnCancel()\"\n [resizable]=\"Resizable\"\n >\n <mj-entity-communications-preview\n [entityInfo]=\"entityInfo\"\n [runViewParams]=\"runViewParams\"\n >\n </mj-entity-communications-preview>\n </kendo-window> \n}"]}
1
+ {"version":3,"file":"window.component.js","sourceRoot":"","sources":["../../src/lib/window.component.ts","../../src/lib/window.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;;;;;;ICCnE,oCASC;IAFG,iNAAS,iBAAU,KAAC;IAGpB,sDAImC;IACvC,iBAAY;;;IAPR,AAFA,AADA,AADA,AADA,AADA,AADA,8BAAgB,uBACD,yBACE,6BACI,+BACE,uBACR,+BAEQ;IAGnB,cAAyB;IACzB,AADA,8CAAyB,uCACM;;ADH3C,MAAM,OAAO,0CAA0C;IAC5C,KAAK,GAAW,wBAAwB,CAAC;IACzC,KAAK,GAAG,GAAG,CAAC;IACZ,MAAM,GAAG,GAAG,CAAC;IACb,QAAQ,GAAG,GAAG,CAAC;IACf,SAAS,GAAG,GAAG,CAAC;IAChB,SAAS,GAAG,IAAI,CAAC;IAEjB,UAAU,CAAyB;IACnC,aAAa,CAA4B;IAElD,IAAa,aAAa;QACxB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;IACD,IAAI,aAAa,CAAC,KAAc;QAC9B,IAAI,KAAK,KAAK,IAAI,CAAC,cAAc,IAAI,KAAK,EAAE,CAAC;YAC3C,qBAAqB;YACrB,8BAA8B;QAChC,CAAC;QACD,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;IAC9B,CAAC;IACO,cAAc,GAAY,KAAK,CAAC;IACxC;;OAEG;IACO,YAAY,GAAG,IAAI,YAAY,EAAW,CAAC;IAIrD;;OAEG;IACa,eAAe,GAA0C;QACvE,QAAQ,EAAE,OAAO;QACjB,KAAK,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,iBAAiB,EAAE,eAAe,EAAE,YAAY,EAAE,UAAU,CAAC;KAChG,CAAC;IAEQ,cAAc,GAAG,IAAI,YAAY,EAAgB,CAAC;IAClD,gBAAgB,GAAG,IAAI,YAAY,EAAgB,CAAC;IAEpD,gBAAgB,GAAiB,EAAE,CAAC;IACpC,kBAAkB,GAAiB,EAAE,CAAC;IAGzC,QAAQ;QACb,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChC,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;oIApDU,0CAA0C;6DAA1C,0CAA0C;YCVvD,kHAAqB;;YAArB,4CAiBC;;;iFDPY,0CAA0C;cANtD,SAAS;6BACI,KAAK,YACP,yCAAyC;;kBAKlD,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBACL,KAAK;;kBAEL,KAAK;;kBAcL,MAAM;;kBAON,KAAK;;kBAKL,MAAM;;kBACN,MAAM;;kFAtCI,0CAA0C","sourcesContent":["import { Component, Output, EventEmitter, Input } from '@angular/core';\n\nimport { BaseEntity, EntityInfo, RunViewParams } from '@memberjunction/core';\n \n@Component({\n standalone: false,\n selector: 'mj-entity-communications-preview-window',\n templateUrl: './window.component.html',\n styleUrls: ['./window.component.css']\n})\nexport class EntityCommunicationsPreviewWindowComponent {\n @Input() Title: string = 'Communications Preview';\n @Input() Width = 650;\n @Input() Height = 600;\n @Input() MinWidth = 400;\n @Input() MinHeight = 350;\n @Input() Resizable = true;\n\n @Input() entityInfo: EntityInfo | undefined;\n @Input() runViewParams: RunViewParams | undefined;\n\n @Input() get DialogVisible(): boolean {\n return this._dialogVisible;\n }\n set DialogVisible(value: boolean) {\n if (value !== this._dialogVisible && value) {\n // showing the dialog\n //this.RefreshInitialValues();\n }\n this._dialogVisible = value;\n }\n private _dialogVisible: boolean = false;\n /**\n * Emits when the dialog is closed, the parameter is true if the dialog was closed with the OK button, false if it was closed with the Cancel button\n */\n @Output() DialogClosed = new EventEmitter<boolean>();\n \n \n\n /**\n * Configurable settings for the toolbar\n */\n @Input() public ToolbarSettings: { position: string; tools: string[] } = {\n position: \"right\",\n tools: [\"moveUp\", \"transferFrom\", \"transferAllFrom\", \"transferAllTo\", \"transferTo\", \"moveDown\"],\n };\n\n @Output() RecordSelected = new EventEmitter<BaseEntity[]>();\n @Output() RecordUnselected = new EventEmitter<BaseEntity[]>();\n\n protected _initialSelected: BaseEntity[] = [];\n protected _initialUnselected: BaseEntity[] = []; \n \n\n public OnCancel() { \n this.DialogVisible = false;\n this.DialogClosed.emit(false);\n }\n\n public OnOK() { \n this.DialogVisible = false;\n this.DialogClosed.emit(true);\n }\n}\n","@if (DialogVisible) {\n <mj-window\n [Visible]=\"true\"\n [Width]=\"Width\"\n [Height]=\"Height\"\n [MinWidth]=\"MinWidth\"\n [MinHeight]=\"MinHeight\"\n [Title]=\"Title\"\n (Close)=\"OnCancel()\"\n [Resizable]=\"Resizable\"\n >\n <mj-entity-communications-preview\n [entityInfo]=\"entityInfo\"\n [runViewParams]=\"runViewParams\"\n >\n </mj-entity-communications-preview>\n </mj-window>\n}"]}
package/dist/module.d.ts CHANGED
@@ -2,15 +2,12 @@ import * as i0 from "@angular/core";
2
2
  import * as i1 from "./lib/preview.component";
3
3
  import * as i2 from "./lib/window.component";
4
4
  import * as i3 from "@angular/common";
5
- import * as i4 from "@progress/kendo-angular-dialog";
6
- import * as i5 from "@memberjunction/ng-container-directives";
7
- import * as i6 from "@progress/kendo-angular-buttons";
8
- import * as i7 from "@progress/kendo-angular-listbox";
9
- import * as i8 from "@progress/kendo-angular-indicators";
10
- import * as i9 from "@memberjunction/ng-shared-generic";
5
+ import * as i4 from "@memberjunction/ng-container-directives";
6
+ import * as i5 from "@memberjunction/ng-ui-components";
7
+ import * as i6 from "@memberjunction/ng-shared-generic";
11
8
  export declare class EntityCommunicationsModule {
12
9
  static ɵfac: i0.ɵɵFactoryDeclaration<EntityCommunicationsModule, never>;
13
- static ɵmod: i0.ɵɵNgModuleDeclaration<EntityCommunicationsModule, [typeof i1.EntityCommunicationsPreviewComponent, typeof i2.EntityCommunicationsPreviewWindowComponent], [typeof i3.CommonModule, typeof i4.DialogsModule, typeof i5.ContainerDirectivesModule, typeof i6.ButtonsModule, typeof i7.ListBoxModule, typeof i8.IndicatorsModule, typeof i9.SharedGenericModule], [typeof i1.EntityCommunicationsPreviewComponent, typeof i2.EntityCommunicationsPreviewWindowComponent]>;
10
+ static ɵmod: i0.ɵɵNgModuleDeclaration<EntityCommunicationsModule, [typeof i1.EntityCommunicationsPreviewComponent, typeof i2.EntityCommunicationsPreviewWindowComponent], [typeof i3.CommonModule, typeof i4.ContainerDirectivesModule, typeof i5.MJButtonDirective, typeof i5.MJWindowComponent, typeof i6.SharedGenericModule], [typeof i1.EntityCommunicationsPreviewComponent, typeof i2.EntityCommunicationsPreviewWindowComponent]>;
14
11
  static ɵinj: i0.ɵɵInjectorDeclaration<EntityCommunicationsModule>;
15
12
  }
16
13
  //# sourceMappingURL=module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;;;;AAcA,qBAmBa,0BAA0B;yCAA1B,0BAA0B;0CAA1B,0BAA0B;0CAA1B,0BAA0B;CAAI"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":";;;;;;;AAWA,qBAiBa,0BAA0B;yCAA1B,0BAA0B;0CAA1B,0BAA0B;0CAA1B,0BAA0B;CAAI"}
package/dist/module.js CHANGED
@@ -1,24 +1,18 @@
1
1
  import { NgModule } from '@angular/core';
2
2
  import { CommonModule } from '@angular/common';
3
- // Kendo UI Angular imports
4
- import { DialogsModule } from "@progress/kendo-angular-dialog";
5
- import { ButtonsModule } from '@progress/kendo-angular-buttons';
6
- import { ListBoxModule } from '@progress/kendo-angular-listbox';
3
+ // MJ UI Components
4
+ import { MJButtonDirective, MJWindowComponent } from '@memberjunction/ng-ui-components';
7
5
  import { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';
8
6
  import { SharedGenericModule } from '@memberjunction/ng-shared-generic';
9
7
  import { EntityCommunicationsPreviewWindowComponent } from './lib/window.component';
10
8
  import { EntityCommunicationsPreviewComponent } from './lib/preview.component';
11
- import { IndicatorsModule } from '@progress/kendo-angular-indicators';
12
9
  import * as i0 from "@angular/core";
13
10
  export class EntityCommunicationsModule {
14
11
  static ɵfac = function EntityCommunicationsModule_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || EntityCommunicationsModule)(); };
15
12
  static ɵmod = /*@__PURE__*/ i0.ɵɵdefineNgModule({ type: EntityCommunicationsModule });
16
13
  static ɵinj = /*@__PURE__*/ i0.ɵɵdefineInjector({ imports: [CommonModule,
17
- DialogsModule,
18
14
  ContainerDirectivesModule,
19
- ButtonsModule,
20
- ListBoxModule,
21
- IndicatorsModule,
15
+ MJWindowComponent,
22
16
  SharedGenericModule] });
23
17
  }
24
18
  (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(EntityCommunicationsModule, [{
@@ -30,11 +24,9 @@ export class EntityCommunicationsModule {
30
24
  ],
31
25
  imports: [
32
26
  CommonModule,
33
- DialogsModule,
34
27
  ContainerDirectivesModule,
35
- ButtonsModule,
36
- ListBoxModule,
37
- IndicatorsModule,
28
+ MJButtonDirective,
29
+ MJWindowComponent,
38
30
  SharedGenericModule
39
31
  ],
40
32
  exports: [
@@ -45,11 +37,9 @@ export class EntityCommunicationsModule {
45
37
  }], null, null); })();
46
38
  (function () { (typeof ngJitMode === "undefined" || ngJitMode) && i0.ɵɵsetNgModuleScope(EntityCommunicationsModule, { declarations: [EntityCommunicationsPreviewComponent,
47
39
  EntityCommunicationsPreviewWindowComponent], imports: [CommonModule,
48
- DialogsModule,
49
40
  ContainerDirectivesModule,
50
- ButtonsModule,
51
- ListBoxModule,
52
- IndicatorsModule,
41
+ MJButtonDirective,
42
+ MJWindowComponent,
53
43
  SharedGenericModule], exports: [EntityCommunicationsPreviewComponent,
54
44
  EntityCommunicationsPreviewWindowComponent] }); })();
55
45
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,2BAA2B;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,0CAA0C,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;;AAqBtE,MAAM,OAAO,0BAA0B;oHAA1B,0BAA0B;4DAA1B,0BAA0B;gEAbnC,YAAY;YACZ,aAAa;YACb,yBAAyB;YACzB,aAAa;YACb,aAAa;YACb,gBAAgB;YAChB,mBAAmB;;iFAOV,0BAA0B;cAnBtC,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,oCAAoC;oBACpC,0CAA0C;iBAC3C;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,aAAa;oBACb,yBAAyB;oBACzB,aAAa;oBACb,aAAa;oBACb,gBAAgB;oBAChB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,oCAAoC;oBACpC,0CAA0C;iBAC3C;aACF;;wFACY,0BAA0B,mBAjBnC,oCAAoC;QACpC,0CAA0C,aAG1C,YAAY;QACZ,aAAa;QACb,yBAAyB;QACzB,aAAa;QACb,aAAa;QACb,gBAAgB;QAChB,mBAAmB,aAGnB,oCAAoC;QACpC,0CAA0C","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n// Kendo UI Angular imports\nimport { DialogsModule } from \"@progress/kendo-angular-dialog\";\nimport { ButtonsModule } from '@progress/kendo-angular-buttons'; \nimport { ListBoxModule } from '@progress/kendo-angular-listbox';\n \nimport { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\nimport { EntityCommunicationsPreviewWindowComponent } from './lib/window.component';\nimport { EntityCommunicationsPreviewComponent } from './lib/preview.component';\nimport { IndicatorsModule } from '@progress/kendo-angular-indicators';\n\n@NgModule({\n declarations: [\n EntityCommunicationsPreviewComponent,\n EntityCommunicationsPreviewWindowComponent\n ],\n imports: [\n CommonModule,\n DialogsModule,\n ContainerDirectivesModule,\n ButtonsModule,\n ListBoxModule,\n IndicatorsModule,\n SharedGenericModule\n ],\n exports: [\n EntityCommunicationsPreviewComponent,\n EntityCommunicationsPreviewWindowComponent\n ]\n})\nexport class EntityCommunicationsModule { }"]}
1
+ {"version":3,"file":"module.js","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,mBAAmB;AACnB,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAExF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,EAAE,0CAA0C,EAAE,MAAM,wBAAwB,CAAC;AACpF,OAAO,EAAE,oCAAoC,EAAE,MAAM,yBAAyB,CAAC;;AAmB/E,MAAM,OAAO,0BAA0B;oHAA1B,0BAA0B;4DAA1B,0BAA0B;gEAXnC,YAAY;YACZ,yBAAyB;YAEzB,iBAAiB;YACjB,mBAAmB;;iFAOV,0BAA0B;cAjBtC,QAAQ;eAAC;gBACR,YAAY,EAAE;oBACZ,oCAAoC;oBACpC,0CAA0C;iBAC3C;gBACD,OAAO,EAAE;oBACP,YAAY;oBACZ,yBAAyB;oBACzB,iBAAiB;oBACjB,iBAAiB;oBACjB,mBAAmB;iBACpB;gBACD,OAAO,EAAE;oBACP,oCAAoC;oBACpC,0CAA0C;iBAC3C;aACF;;wFACY,0BAA0B,mBAfnC,oCAAoC;QACpC,0CAA0C,aAG1C,YAAY;QACZ,yBAAyB;QACzB,iBAAiB;QACjB,iBAAiB;QACjB,mBAAmB,aAGnB,oCAAoC;QACpC,0CAA0C","sourcesContent":["import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\n\n// MJ UI Components\nimport { MJButtonDirective, MJWindowComponent } from '@memberjunction/ng-ui-components';\n\nimport { ContainerDirectivesModule } from '@memberjunction/ng-container-directives';\nimport { SharedGenericModule } from '@memberjunction/ng-shared-generic';\nimport { EntityCommunicationsPreviewWindowComponent } from './lib/window.component';\nimport { EntityCommunicationsPreviewComponent } from './lib/preview.component';\n\n@NgModule({\n declarations: [\n EntityCommunicationsPreviewComponent,\n EntityCommunicationsPreviewWindowComponent\n ],\n imports: [\n CommonModule,\n ContainerDirectivesModule,\n MJButtonDirective,\n MJWindowComponent,\n SharedGenericModule\n ],\n exports: [\n EntityCommunicationsPreviewComponent,\n EntityCommunicationsPreviewWindowComponent\n ]\n})\nexport class EntityCommunicationsModule { }"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-entity-communications",
3
- "version": "5.22.0",
3
+ "version": "5.23.0",
4
4
  "description": "MemberJunction: Angular Components to allow a user to select templates, preview the messages with those tempaltes, and send them",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -24,23 +24,20 @@
24
24
  "@angular/common": "21.1.3",
25
25
  "@angular/core": "21.1.3",
26
26
  "@angular/forms": "21.1.3",
27
- "@angular/router": "21.1.3",
28
- "@progress/kendo-angular-buttons": "22.0.1",
29
- "@progress/kendo-angular-dialog": "22.0.1",
30
- "@progress/kendo-angular-listbox": "22.0.1",
31
- "@progress/kendo-angular-indicators": "22.0.1"
27
+ "@angular/router": "21.1.3"
32
28
  },
33
29
  "dependencies": {
34
- "@memberjunction/communication-types": "5.22.0",
35
- "@memberjunction/core": "5.22.0",
36
- "@memberjunction/core-entities": "5.22.0",
37
- "@memberjunction/entity-communications-base": "5.22.0",
38
- "@memberjunction/entity-communications-client": "5.22.0",
39
- "@memberjunction/global": "5.22.0",
40
- "@memberjunction/ng-container-directives": "5.22.0",
41
- "@memberjunction/ng-shared": "5.22.0",
42
- "@memberjunction/ng-shared-generic": "5.22.0",
43
- "@memberjunction/templates-base-types": "5.22.0",
30
+ "@memberjunction/communication-types": "5.23.0",
31
+ "@memberjunction/core": "5.23.0",
32
+ "@memberjunction/core-entities": "5.23.0",
33
+ "@memberjunction/entity-communications-base": "5.23.0",
34
+ "@memberjunction/entity-communications-client": "5.23.0",
35
+ "@memberjunction/global": "5.23.0",
36
+ "@memberjunction/ng-container-directives": "5.23.0",
37
+ "@memberjunction/ng-shared": "5.23.0",
38
+ "@memberjunction/ng-shared-generic": "5.23.0",
39
+ "@memberjunction/ng-ui-components": "5.23.0",
40
+ "@memberjunction/templates-base-types": "5.23.0",
44
41
  "tslib": "^2.8.1"
45
42
  },
46
43
  "sideEffects": false,