@memberjunction/ng-credentials 5.51.0 → 6.1.0-edge.1
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/LICENSE +7 -0
- package/dist/lib/dialogs/credential-dialog.component.d.ts +2 -1
- package/dist/lib/dialogs/credential-dialog.component.d.ts.map +1 -1
- package/dist/lib/dialogs/credential-dialog.component.js +5 -3
- package/dist/lib/dialogs/credential-dialog.component.js.map +1 -1
- package/dist/lib/services/credential-dialog.service.d.ts +11 -0
- package/dist/lib/services/credential-dialog.service.d.ts.map +1 -1
- package/dist/lib/services/credential-dialog.service.js +14 -2
- package/dist/lib/services/credential-dialog.service.js.map +1 -1
- package/package.json +20 -18
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 MemberJunction
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* a convenient way to create or edit credentials in a modal dialog.
|
|
6
6
|
*/
|
|
7
7
|
import { EventEmitter, ChangeDetectorRef, OnInit, OnChanges, SimpleChanges } from '@angular/core';
|
|
8
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
8
9
|
import { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';
|
|
9
10
|
import { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';
|
|
10
11
|
import * as i0 from "@angular/core";
|
|
@@ -36,7 +37,7 @@ export interface CredentialDialogResult {
|
|
|
36
37
|
/** The action that was taken */
|
|
37
38
|
action: 'saved' | 'deleted' | 'cancelled';
|
|
38
39
|
}
|
|
39
|
-
export declare class CredentialDialogComponent implements OnInit, OnChanges {
|
|
40
|
+
export declare class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {
|
|
40
41
|
private cdr;
|
|
41
42
|
editPanel: CredentialEditPanelComponent;
|
|
42
43
|
Visible: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAAsC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iEAAiE,CAAC;;AAE/G;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,oEAAoE;IACpE,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;CAC7C;AAED,qBAsCa,yBAA0B,YAAW,MAAM,EAAE,SAAS;
|
|
1
|
+
{"version":3,"file":"credential-dialog.component.d.ts","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAA4B,YAAY,EAAE,iBAAiB,EAAsC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,iEAAiE,CAAC;;AAE/G;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,oEAAoE;IACpE,UAAU,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACvC,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,mDAAmD;IACnD,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,4BAA4B;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6BAA6B;IAC7B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACnC,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,CAAC,EAAE,kBAAkB,CAAC;IAChC,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gCAAgC;IAChC,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;CAC7C;AAED,qBAsCa,yBAA0B,SAAQ,oBAAqB,YAAW,MAAM,EAAE,SAAS;IAiBhF,OAAO,CAAC,GAAG;IAhBC,SAAS,EAAG,4BAA4B,CAAC;IAExD,OAAO,UAAS;IAChB,UAAU,EAAE,kBAAkB,GAAG,IAAI,CAAQ;IAC7C,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,qBAAqB,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1C,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,KAAK,SAAO;IAEX,KAAK,uCAA8C;IAEtD,SAAS,UAAS;IAClB,eAAe,EAAE,sBAAsB,EAAE,CAAM;IAEtD,OAAO,CAAC,YAAY,CAAgB;gBAEhB,GAAG,EAAE,iBAAiB;IAG1C,QAAQ,IAAI,IAAI;IAMhB,WAAW,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI;IAiBzC,IAAW,WAAW,IAAI,MAAM,CAK/B;IAED;;OAEG;IACU,IAAI,CAAC,OAAO,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;YAsBrD,mBAAmB;IA2B1B,OAAO,CAAC,UAAU,EAAE,kBAAkB,GAAG,IAAI;IAU7C,SAAS,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI;IAUrC,QAAQ,IAAI,IAAI;yCA1Hd,yBAAyB;2CAAzB,yBAAyB;CAkIrC"}
|
|
@@ -5,11 +5,12 @@
|
|
|
5
5
|
* a convenient way to create or edit credentials in a modal dialog.
|
|
6
6
|
*/
|
|
7
7
|
import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy, ViewChild } from '@angular/core';
|
|
8
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
8
9
|
import { RunView } from '@memberjunction/core';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
import * as i1 from "@memberjunction/ng-shared-generic";
|
|
11
12
|
import * as i2 from "../panels/credential-edit-panel/credential-edit-panel.component";
|
|
12
|
-
export class CredentialDialogComponent {
|
|
13
|
+
export class CredentialDialogComponent extends BaseAngularComponent {
|
|
13
14
|
cdr;
|
|
14
15
|
editPanel;
|
|
15
16
|
Visible = false;
|
|
@@ -23,6 +24,7 @@ export class CredentialDialogComponent {
|
|
|
23
24
|
credentialTypes = [];
|
|
24
25
|
_dialogTitle = 'Credential';
|
|
25
26
|
constructor(cdr) {
|
|
27
|
+
super();
|
|
26
28
|
this.cdr = cdr;
|
|
27
29
|
}
|
|
28
30
|
ngOnInit() {
|
|
@@ -79,7 +81,7 @@ export class CredentialDialogComponent {
|
|
|
79
81
|
this.IsLoading = true;
|
|
80
82
|
this.cdr.markForCheck();
|
|
81
83
|
try {
|
|
82
|
-
const rv =
|
|
84
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
83
85
|
const result = await rv.RunView({
|
|
84
86
|
EntityName: 'MJ: Credential Types',
|
|
85
87
|
OrderBy: 'Category, Name',
|
|
@@ -124,7 +126,7 @@ export class CredentialDialogComponent {
|
|
|
124
126
|
this.cdr.markForCheck();
|
|
125
127
|
}
|
|
126
128
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: CredentialDialogComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
127
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "editPanel", first: true, predicate: ["editPanel"], descendants: true }], usesOnChanges: true, ngImport: i0, template: `
|
|
129
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: CredentialDialogComponent, isStandalone: false, selector: "mj-credential-dialog", inputs: { Visible: "Visible", Credential: "Credential", PreselectedTypeId: "PreselectedTypeId", PreselectedCategoryId: "PreselectedCategoryId", Title: "Title", Width: "Width" }, outputs: { close: "close" }, viewQueries: [{ propertyName: "editPanel", first: true, predicate: ["editPanel"], descendants: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: `
|
|
128
130
|
@if (Visible) {
|
|
129
131
|
@if (IsLoading) {
|
|
130
132
|
<div class="loading-backdrop">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAEhK,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;AAuE/C,MAAM,OAAO,yBAAyB;IAiBd;IAhBI,SAAS,CAAgC;IAExD,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAA8B,IAAI,CAAC;IAC7C,iBAAiB,CAAqB;IACtC,qBAAqB,CAAqB;IAC1C,KAAK,CAAqB;IAC1B,KAAK,GAAG,GAAG,CAAC;IAEX,KAAK,GAAG,IAAI,YAAY,EAA0B,CAAC;IAEtD,SAAS,GAAG,KAAK,CAAC;IAClB,eAAe,GAA6B,EAAE,CAAC;IAE9C,YAAY,GAAG,YAAY,CAAC;IAEpC,YAAoB,GAAsB;QAAtB,QAAG,GAAH,GAAG,CAAmB;IAAG,CAAC;IAE9C,QAAQ;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,WAAW,CAAC,OAAsB;QAC9B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,SAAS,CAAC,CAAC,YAAY,K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AAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAEM,SAAS,CAAC,YAAoB;QACjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,YAAY;YACvB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAEM,QAAQ;QACX,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;uGAhIQ,yBAAyB;2FAAzB,yBAAyB,6ZAnCxB;;;;;;;;;;;;;;;;;;KAkBT;;2FAiBQ,yBAAyB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAErB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') editPanel!: CredentialEditPanelComponent;\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public credentialTypes: MJCredentialTypeEntity[] = [];\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.editPanel) {\n this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get dialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.editPanel) {\n await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.credentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = new RunView();\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.credentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public onSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n public onDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"credential-dialog.component.js","sourceRoot":"","sources":["../../../src/lib/dialogs/credential-dialog.component.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAqB,uBAAuB,EAAE,SAAS,EAAoC,MAAM,eAAe,CAAC;AAChK,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAErE,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;;;;AAuE/C,MAAM,OAAO,yBAA0B,SAAQ,oBAAoB;IAiB3C;IAhBI,SAAS,CAAgC;IAExD,OAAO,GAAG,KAAK,CAAC;IAChB,UAAU,GAA8B,IAAI,CAAC;IAC7C,iBAAiB,CAAqB;IACtC,qBAAqB,CAAqB;IAC1C,KAAK,CAAqB;IAC1B,KAAK,GAAG,GAAG,CAAC;IAEX,KAAK,GAAG,IAAI,YAAY,EAA0B,CAAC;IAEtD,SAAS,GAAG,KAAK,CAAC;IAClB,eAAe,GAA6B,EAAE,CAAC;IAE9C,YAAY,GAAG,YAAY,CAAC;IAEpC,YAAoB,GAAsB;QACtC,KAAK,EAAE,CAAC;QADQ,QAAG,GAAH,GAAG,CAAmB;IAC9B,CAAC;IAEb,QAAQ;QACJ,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YACf,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC/B,CAAC;IACL,CAAC;IAED,WAAW,CAAC,OAAsB;QAC9B,IAAI,OAAO,CAAC,SAAS,CAAC,IAAI,OAAO,CAAC,SAAS,C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AAU;YACV,MAAM,EAAE,OAAO;SAClB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAEM,SAAS,CAAC,YAAoB;QACjC,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,YAAY;YACvB,MAAM,EAAE,SAAS;SACpB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAEM,QAAQ;QACX,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;QACrB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC;YACZ,OAAO,EAAE,KAAK;YACd,MAAM,EAAE,WAAW;SACtB,CAAC,CAAC;QACH,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;uGAjIQ,yBAAyB;2FAAzB,yBAAyB,obAnCxB;;;;;;;;;;;;;;;;;;KAkBT;;2FAiBQ,yBAAyB;kBAtCrC,SAAS;iCACI,KAAK,YACL,sBAAsB,YACtB;;;;;;;;;;;;;;;;;;KAkBT,mBAegB,uBAAuB,CAAC,MAAM;;sBAG9C,SAAS;uBAAC,WAAW;;sBAErB,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBACL,KAAK;;sBAEL,MAAM","sourcesContent":["/**\n * @fileoverview Credential Dialog Component\n *\n * A dialog wrapper for the CredentialEditPanelComponent that provides\n * a convenient way to create or edit credentials in a modal dialog.\n */\n\nimport { Component, Input, Output, EventEmitter, ChangeDetectorRef, ChangeDetectionStrategy, ViewChild, OnInit, OnChanges, SimpleChanges } from '@angular/core';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { CredentialEditPanelComponent } from '../panels/credential-edit-panel/credential-edit-panel.component';\n\n/**\n * Configuration options for opening the credential dialog\n */\nexport interface CredentialDialogOptions {\n /** The credential to edit, or null for creating a new credential */\n credential?: MJCredentialEntity | null;\n /** Pre-selected credential type ID for new credentials */\n preselectedTypeId?: string;\n /** Pre-selected category ID for new credentials */\n preselectedCategoryId?: string;\n /** Dialog title override */\n title?: string;\n /** Dialog width in pixels */\n width?: number;\n}\n\n/**\n * Result returned when the dialog closes\n */\nexport interface CredentialDialogResult {\n /** Whether a credential was saved or deleted */\n success: boolean;\n /** The saved credential entity (if save was successful) */\n credential?: MJCredentialEntity;\n /** The ID of the deleted credential (if delete was successful) */\n deletedId?: string;\n /** The action that was taken */\n action: 'saved' | 'deleted' | 'cancelled';\n}\n\n@Component({\n standalone: false,\n selector: 'mj-credential-dialog',\n template: `\n @if (Visible) {\n @if (IsLoading) {\n <div class=\"loading-backdrop\">\n <mj-loading text=\"Loading credential types...\"></mj-loading>\n </div>\n } @else {\n <mj-credential-edit-panel\n #editPanel\n [credential]=\"Credential\"\n [credentialTypes]=\"credentialTypes\"\n [isOpen]=\"Visible\"\n (saved)=\"onSaved($event)\"\n (deleted)=\"onDeleted($event)\"\n (close)=\"onCancel()\">\n </mj-credential-edit-panel>\n }\n }\n `,\n styles: [`\n .loading-backdrop {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n }\n `],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class CredentialDialogComponent extends BaseAngularComponent implements OnInit, OnChanges {\n @ViewChild('editPanel') editPanel!: CredentialEditPanelComponent;\n\n @Input() Visible = false;\n @Input() Credential: MJCredentialEntity | null = null;\n @Input() PreselectedTypeId: string | undefined;\n @Input() PreselectedCategoryId: string | undefined;\n @Input() Title: string | undefined;\n @Input() Width = 600;\n\n @Output() close = new EventEmitter<CredentialDialogResult>();\n\n public IsLoading = false;\n public credentialTypes: MJCredentialTypeEntity[] = [];\n\n private _dialogTitle = 'Credential';\n\n constructor(private cdr: ChangeDetectorRef) {\n super();}\n\n ngOnInit(): void {\n if (this.Visible) {\n this.loadCredentialTypes();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes['Visible'] && changes['Visible'].currentValue === true) {\n // When dialog becomes visible, load credential types and initialize the panel\n this.loadCredentialTypes().then(() => {\n // Wait for next change detection cycle to ensure panel is rendered\n // (panel is only rendered when IsLoading is false)\n this.cdr.detectChanges();\n // Use setTimeout to ensure ViewChild is resolved after render\n setTimeout(() => {\n if (this.editPanel) {\n this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }, 0);\n });\n }\n }\n\n public get dialogTitle(): string {\n if (this.Title) {\n return this.Title;\n }\n return this.Credential?.ID ? 'Edit Credential' : 'Create Credential';\n }\n\n /**\n * Opens the dialog with the specified options\n */\n public async open(options?: CredentialDialogOptions): Promise<void> {\n this.Credential = options?.credential ?? null;\n this.PreselectedTypeId = options?.preselectedTypeId;\n this.PreselectedCategoryId = options?.preselectedCategoryId;\n this.Title = options?.title;\n if (options?.width) {\n this.Width = options.width;\n }\n\n this.Visible = true;\n\n await this.loadCredentialTypes();\n\n // Force synchronous render so @if (Visible) creates the editPanel ViewChild\n this.cdr.detectChanges();\n\n // Initialize the edit panel after types are loaded and template is rendered\n if (this.editPanel) {\n await this.editPanel.open(this.Credential, this.PreselectedTypeId, this.PreselectedCategoryId);\n }\n }\n\n private async loadCredentialTypes(): Promise<void> {\n if (this.credentialTypes.length > 0) {\n return; // Already loaded\n }\n\n this.IsLoading = true;\n this.cdr.markForCheck();\n\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n this.credentialTypes = result.Results;\n }\n } catch (error) {\n console.error('Error loading credential types:', error);\n } finally {\n this.IsLoading = false;\n this.cdr.markForCheck();\n }\n }\n\n public onSaved(credential: MJCredentialEntity): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n credential,\n action: 'saved'\n });\n this.cdr.markForCheck();\n }\n\n public onDeleted(credentialId: string): void {\n this.Visible = false;\n this.close.emit({\n success: true,\n deletedId: credentialId,\n action: 'deleted'\n });\n this.cdr.markForCheck();\n }\n\n public onCancel(): void {\n this.Visible = false;\n this.close.emit({\n success: false,\n action: 'cancelled'\n });\n this.cdr.markForCheck();\n }\n}\n"]}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { ViewContainerRef } from '@angular/core';
|
|
9
9
|
import { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';
|
|
10
|
+
import { type IMetadataProvider } from '@memberjunction/core';
|
|
10
11
|
import { CredentialDialogOptions, CredentialDialogResult } from '../dialogs/credential-dialog.component';
|
|
11
12
|
import * as i0 from "@angular/core";
|
|
12
13
|
/**
|
|
@@ -41,6 +42,16 @@ import * as i0 from "@angular/core";
|
|
|
41
42
|
* ```
|
|
42
43
|
*/
|
|
43
44
|
export declare class CredentialDialogService {
|
|
45
|
+
/**
|
|
46
|
+
* The provider every read goes through.
|
|
47
|
+
*
|
|
48
|
+
* A `providedIn: 'root'` service that constructs its own `RunView` silently binds the global
|
|
49
|
+
* default and ignores whichever provider its host was handed. Null means "use the global
|
|
50
|
+
* default", so single-provider apps see no behaviour change.
|
|
51
|
+
*/
|
|
52
|
+
Provider: IMetadataProvider | null;
|
|
53
|
+
/** The provider to actually use — the injected one, or the global default. */
|
|
54
|
+
get ProviderToUse(): IMetadataProvider;
|
|
44
55
|
private _credentialTypes;
|
|
45
56
|
private _credentialTypesLoading;
|
|
46
57
|
private _credentialTypesLoadPromise;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,gBAAgB,EAAQ,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"credential-dialog.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA4B,gBAAgB,EAAQ,MAAM,eAAe,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAC3F,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAA6B,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,qBAGa,uBAAuB;IAChC;;;;;;OAMG;IACI,QAAQ,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IAEjD,8EAA8E;IAC9E,IAAW,aAAa,IAAI,iBAAiB,CAE5C;IAED,OAAO,CAAC,gBAAgB,CAAyC;IACjE,OAAO,CAAC,uBAAuB,CAAS;IACxC,OAAO,CAAC,2BAA2B,CAAkD;IAErF;;;;;;OAMG;IACU,UAAU,CACnB,gBAAgB,EAAE,gBAAgB,EAClC,OAAO,CAAC,EAAE,uBAAuB,GAClC,OAAO,CAAC,sBAAsB,CAAC;IAwBlC;;;;;;;;OAQG;IACU,gBAAgB,CACzB,gBAAgB,EAAE,gBAAgB,EAClC,iBAAiB,CAAC,EAAE,MAAM,EAC1B,qBAAqB,CAAC,EAAE,MAAM,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IASlC;;;;;;;OAOG;IACU,cAAc,CACvB,gBAAgB,EAAE,gBAAgB,EAClC,UAAU,EAAE,kBAAkB,GAC/B,OAAO,CAAC,sBAAsB,CAAC;IAOlC;;;OAGG;IACU,kBAAkB,IAAI,OAAO,CAAC,sBAAsB,EAAE,CAAC;IAIpE;;;OAGG;IACI,UAAU,IAAI,IAAI;YAKX,mBAAmB;YAsBnB,qBAAqB;yCApI1B,uBAAuB;6CAAvB,uBAAuB;CAwJnC"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* in your application without needing to include the component in your template.
|
|
7
7
|
*/
|
|
8
8
|
import { Injectable } from '@angular/core';
|
|
9
|
-
import { RunView } from '@memberjunction/core';
|
|
9
|
+
import { Metadata, RunView } from '@memberjunction/core';
|
|
10
10
|
import { Subject, firstValueFrom } from 'rxjs';
|
|
11
11
|
import { CredentialDialogComponent } from '../dialogs/credential-dialog.component';
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
@@ -42,6 +42,18 @@ import * as i0 from "@angular/core";
|
|
|
42
42
|
* ```
|
|
43
43
|
*/
|
|
44
44
|
export class CredentialDialogService {
|
|
45
|
+
/**
|
|
46
|
+
* The provider every read goes through.
|
|
47
|
+
*
|
|
48
|
+
* A `providedIn: 'root'` service that constructs its own `RunView` silently binds the global
|
|
49
|
+
* default and ignores whichever provider its host was handed. Null means "use the global
|
|
50
|
+
* default", so single-provider apps see no behaviour change.
|
|
51
|
+
*/
|
|
52
|
+
Provider = null;
|
|
53
|
+
/** The provider to actually use — the injected one, or the global default. */
|
|
54
|
+
get ProviderToUse() {
|
|
55
|
+
return this.Provider ?? Metadata.Provider;
|
|
56
|
+
}
|
|
45
57
|
_credentialTypes = null;
|
|
46
58
|
_credentialTypesLoading = false;
|
|
47
59
|
_credentialTypesLoadPromise = null;
|
|
@@ -137,7 +149,7 @@ export class CredentialDialogService {
|
|
|
137
149
|
}
|
|
138
150
|
async doLoadCredentialTypes() {
|
|
139
151
|
try {
|
|
140
|
-
const rv =
|
|
152
|
+
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
141
153
|
const result = await rv.RunView({
|
|
142
154
|
EntityName: 'MJ: Credential Types',
|
|
143
155
|
OrderBy: 'Category, Name',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credential-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAwC,MAAM,eAAe,CAAC;AAEjF,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAc,cAAc,EAAE,MAAM,MAAM,CAAC;AAC3D,OAAO,EAAE,yBAAyB,EAAmD,MAAM,wCAAwC,CAAC;;AAEpI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAIH,MAAM,OAAO,uBAAuB;IACxB,gBAAgB,GAAoC,IAAI,CAAC;IACzD,uBAAuB,GAAG,KAAK,CAAC;IAChC,2BAA2B,GAA6C,IAAI,CAAC;IAErF;;;;;;OAMG;IACI,KAAK,CAAC,UAAU,CACnB,gBAAkC,EAClC,OAAiC;QAEjC,4BAA4B;QAC5B,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAEjC,0CAA0C;QAC1C,MAAM,YAAY,GAAG,gBAAgB,CAAC,eAAe,CAAC,yBAAyB,CAAC,CAAC;QACjF,MAAM,QAAQ,GAAG,YAAY,CAAC,QAAQ,CAAC;QAEvC,6BAA6B;QAC7B,MAAM,aAAa,GAAG,IAAI,OAAO,EAA0B,CAAC;QAE5D,QAAQ,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,MAA8B,EAAE,EAAE;YACxD,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;YAC3B,aAAa,CAAC,QAAQ,EAAE,CAAC;YACzB,YAAY,CAAC,OAAO,EAAE,CAAC;QAC3B,CAAC,CAAC,CAAC;QAEH,kBAAkB;QAClB,MAAM,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAE7B,sBAAsB;QACtB,OAAO,cAAc,CAAC,aAAa,CAAC,CAA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,CAAC;IAEO,KAAK,CAAC,qBAAqB;QAC/B,IAAI,CAAC;YACD,MAAM,EAAE,GAAG,IAAI,OAAO,EAAE,CAAC;YACzB,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAyB;gBACpD,UAAU,EAAE,sBAAsB;gBAClC,OAAO,EAAE,gBAAgB;gBACzB,UAAU,EAAE,eAAe;aAC9B,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,MAAM,CAAC,OAAO,CAAC;YAC1B,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACvE,OAAO,EAAE,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;uGAzIQ,uBAAuB;2GAAvB,uBAAuB,cAFpB,MAAM;;2FAET,uBAAuB;kBAHnC,UAAU;mBAAC;oBACR,UAAU,EAAE,MAAM;iBACrB","sourcesContent":["/**\n * @fileoverview Credential Dialog Service\n *\n * A service that provides easy programmatic access to credential dialogs.\n * Use this service to open credential creation/editing dialogs from anywhere\n * in your application without needing to include the component in your template.\n */\n\nimport { Injectable, ComponentRef, ViewContainerRef, Type } from '@angular/core';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { RunView } from '@memberjunction/core';\nimport { Subject, Observable, firstValueFrom } from 'rxjs';\nimport { CredentialDialogComponent, CredentialDialogOptions, CredentialDialogResult } from '../dialogs/credential-dialog.component';\n\n/**\n * Service for programmatically opening credential dialogs.\n *\n * @example\n * ```typescript\n * // Inject the service\n * constructor(private credentialDialog: CredentialDialogService) {}\n *\n * // Open dialog to create a new credential\n * async createCredential() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef);\n * if (result.success && result.credential) {\n * console.log('Created credential:', result.credential.Name);\n * }\n * }\n *\n * // Open dialog with pre-selected type\n * async createApiKey() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * preselectedTypeId: 'api-key-type-id'\n * });\n * }\n *\n * // Edit an existing credential\n * async editCredential(credential: MJCredentialEntity) {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * credential\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CredentialDialogService {\n private _credentialTypes: MJCredentialTypeEntity[] | null = null;\n private _credentialTypesLoading = false;\n private _credentialTypesLoadPromise: Promise<MJCredentialTypeEntity[]> | null = null;\n\n /**\n * Opens a credential dialog and returns a promise that resolves when the dialog closes.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param options - Optional configuration for the dialog\n * @returns Promise resolving to the dialog result\n */\n public async openDialog(\n viewContainerRef: ViewContainerRef,\n options?: CredentialDialogOptions\n ): Promise<CredentialDialogResult> {\n // Pre-load credential types\n await this.loadCredentialTypes();\n\n // Create the dialog component dynamically\n const componentRef = viewContainerRef.createComponent(CredentialDialogComponent);\n const instance = componentRef.instance;\n\n // Set up the result handling\n const resultSubject = new Subject<CredentialDialogResult>();\n\n instance.close.subscribe((result: CredentialDialogResult) => {\n resultSubject.next(result);\n resultSubject.complete();\n componentRef.destroy();\n });\n\n // Open the dialog\n await instance.open(options);\n\n // Wait for the result\n return firstValueFrom(resultSubject);\n }\n\n /**\n * Opens a dialog to create a new credential with optional pre-selections.\n * Convenience method that wraps openDialog with create-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param preselectedTypeId - Optional credential type to pre-select\n * @param preselectedCategoryId - Optional category to pre-select\n * @returns Promise resolving to the dialog result\n */\n public async createCredential(\n viewContainerRef: ViewContainerRef,\n preselectedTypeId?: string,\n preselectedCategoryId?: string\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential: null,\n preselectedTypeId,\n preselectedCategoryId,\n title: 'Create Credential'\n });\n }\n\n /**\n * Opens a dialog to edit an existing credential.\n * Convenience method that wraps openDialog with edit-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param credential - The credential to edit\n * @returns Promise resolving to the dialog result\n */\n public async editCredential(\n viewContainerRef: ViewContainerRef,\n credential: MJCredentialEntity\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential,\n title: `Edit Credential: ${credential.Name}`\n });\n }\n\n /**\n * Gets cached credential types or loads them if not cached.\n * Types are cached to avoid repeated database calls.\n */\n public async getCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n return this.loadCredentialTypes();\n }\n\n /**\n * Clears the cached credential types.\n * Call this if you need to refresh the list after adding new types.\n */\n public clearCache(): void {\n this._credentialTypes = null;\n this._credentialTypesLoadPromise = null;\n }\n\n private async loadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n // Return cached types if available\n if (this._credentialTypes) {\n return this._credentialTypes;\n }\n\n // Return existing load promise if already loading\n if (this._credentialTypesLoadPromise) {\n return this._credentialTypesLoadPromise;\n }\n\n // Start loading\n this._credentialTypesLoadPromise = this.doLoadCredentialTypes();\n\n try {\n this._credentialTypes = await this._credentialTypesLoadPromise;\n return this._credentialTypes;\n } finally {\n this._credentialTypesLoadPromise = null;\n }\n }\n\n private async doLoadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n try {\n const rv = new RunView();\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n return result.Results;\n }\n\n console.error('Failed to load credential types:', result.ErrorMessage);\n return [];\n } catch (error) {\n console.error('Error loading credential types:', error);\n return [];\n }\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"credential-dialog.service.js","sourceRoot":"","sources":["../../../src/lib/services/credential-dialog.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH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CAAC;IACL,CAAC;IAEO,KAAK,CAAC,qBAAqB;QAC/B,IAAI,CAAC;YACD,MAAM,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YAC5D,MAAM,MAAM,GAAG,MAAM,EAAE,CAAC,OAAO,CAAyB;gBACpD,UAAU,EAAE,sBAAsB;gBAClC,OAAO,EAAE,gBAAgB;gBACzB,UAAU,EAAE,eAAe;aAC9B,CAAC,CAAC;YAEH,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;gBACjB,OAAO,MAAM,CAAC,OAAO,CAAC;YAC1B,CAAC;YAED,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;YACvE,OAAO,EAAE,CAAC;QACd,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACb,OAAO,CAAC,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,CAAC;YACxD,OAAO,EAAE,CAAC;QACd,CAAC;IACL,CAAC;uGAvJQ,uBAAuB;2GAAvB,uBAAuB,cAFpB,MAAM;;2FAET,uBAAuB;kBAHnC,UAAU;mBAAC;oBACR,UAAU,EAAE,MAAM;iBACrB","sourcesContent":["/**\n * @fileoverview Credential Dialog Service\n *\n * A service that provides easy programmatic access to credential dialogs.\n * Use this service to open credential creation/editing dialogs from anywhere\n * in your application without needing to include the component in your template.\n */\n\nimport { Injectable, ComponentRef, ViewContainerRef, Type } from '@angular/core';\nimport { MJCredentialEntity, MJCredentialTypeEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView, type IMetadataProvider } from '@memberjunction/core';\nimport { Subject, Observable, firstValueFrom } from 'rxjs';\nimport { CredentialDialogComponent, CredentialDialogOptions, CredentialDialogResult } from '../dialogs/credential-dialog.component';\n\n/**\n * Service for programmatically opening credential dialogs.\n *\n * @example\n * ```typescript\n * // Inject the service\n * constructor(private credentialDialog: CredentialDialogService) {}\n *\n * // Open dialog to create a new credential\n * async createCredential() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef);\n * if (result.success && result.credential) {\n * console.log('Created credential:', result.credential.Name);\n * }\n * }\n *\n * // Open dialog with pre-selected type\n * async createApiKey() {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * preselectedTypeId: 'api-key-type-id'\n * });\n * }\n *\n * // Edit an existing credential\n * async editCredential(credential: MJCredentialEntity) {\n * const result = await this.credentialDialog.openDialog(this.viewContainerRef, {\n * credential\n * });\n * }\n * ```\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class CredentialDialogService {\n /**\n * The provider every read goes through.\n *\n * A `providedIn: 'root'` service that constructs its own `RunView` silently binds the global\n * default and ignores whichever provider its host was handed. Null means \"use the global\n * default\", so single-provider apps see no behaviour change.\n */\n public Provider: IMetadataProvider | null = null;\n\n /** The provider to actually use — the injected one, or the global default. */\n public get ProviderToUse(): IMetadataProvider {\n return this.Provider ?? Metadata.Provider;\n }\n\n private _credentialTypes: MJCredentialTypeEntity[] | null = null;\n private _credentialTypesLoading = false;\n private _credentialTypesLoadPromise: Promise<MJCredentialTypeEntity[]> | null = null;\n\n /**\n * Opens a credential dialog and returns a promise that resolves when the dialog closes.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param options - Optional configuration for the dialog\n * @returns Promise resolving to the dialog result\n */\n public async openDialog(\n viewContainerRef: ViewContainerRef,\n options?: CredentialDialogOptions\n ): Promise<CredentialDialogResult> {\n // Pre-load credential types\n await this.loadCredentialTypes();\n\n // Create the dialog component dynamically\n const componentRef = viewContainerRef.createComponent(CredentialDialogComponent);\n const instance = componentRef.instance;\n\n // Set up the result handling\n const resultSubject = new Subject<CredentialDialogResult>();\n\n instance.close.subscribe((result: CredentialDialogResult) => {\n resultSubject.next(result);\n resultSubject.complete();\n componentRef.destroy();\n });\n\n // Open the dialog\n await instance.open(options);\n\n // Wait for the result\n return firstValueFrom(resultSubject);\n }\n\n /**\n * Opens a dialog to create a new credential with optional pre-selections.\n * Convenience method that wraps openDialog with create-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param preselectedTypeId - Optional credential type to pre-select\n * @param preselectedCategoryId - Optional category to pre-select\n * @returns Promise resolving to the dialog result\n */\n public async createCredential(\n viewContainerRef: ViewContainerRef,\n preselectedTypeId?: string,\n preselectedCategoryId?: string\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential: null,\n preselectedTypeId,\n preselectedCategoryId,\n title: 'Create Credential'\n });\n }\n\n /**\n * Opens a dialog to edit an existing credential.\n * Convenience method that wraps openDialog with edit-specific defaults.\n *\n * @param viewContainerRef - The ViewContainerRef to attach the dialog to\n * @param credential - The credential to edit\n * @returns Promise resolving to the dialog result\n */\n public async editCredential(\n viewContainerRef: ViewContainerRef,\n credential: MJCredentialEntity\n ): Promise<CredentialDialogResult> {\n return this.openDialog(viewContainerRef, {\n credential,\n title: `Edit Credential: ${credential.Name}`\n });\n }\n\n /**\n * Gets cached credential types or loads them if not cached.\n * Types are cached to avoid repeated database calls.\n */\n public async getCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n return this.loadCredentialTypes();\n }\n\n /**\n * Clears the cached credential types.\n * Call this if you need to refresh the list after adding new types.\n */\n public clearCache(): void {\n this._credentialTypes = null;\n this._credentialTypesLoadPromise = null;\n }\n\n private async loadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n // Return cached types if available\n if (this._credentialTypes) {\n return this._credentialTypes;\n }\n\n // Return existing load promise if already loading\n if (this._credentialTypesLoadPromise) {\n return this._credentialTypesLoadPromise;\n }\n\n // Start loading\n this._credentialTypesLoadPromise = this.doLoadCredentialTypes();\n\n try {\n this._credentialTypes = await this._credentialTypesLoadPromise;\n return this._credentialTypes;\n } finally {\n this._credentialTypesLoadPromise = null;\n }\n }\n\n private async doLoadCredentialTypes(): Promise<MJCredentialTypeEntity[]> {\n try {\n const rv = RunView.FromMetadataProvider(this.ProviderToUse);\n const result = await rv.RunView<MJCredentialTypeEntity>({\n EntityName: 'MJ: Credential Types',\n OrderBy: 'Category, Name',\n ResultType: 'entity_object'\n });\n\n if (result.Success) {\n return result.Results;\n }\n\n console.error('Failed to load credential types:', result.ErrorMessage);\n return [];\n } catch (error) {\n console.error('Error loading credential types:', error);\n return [];\n }\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-credentials",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.1.0-edge.1",
|
|
4
4
|
"description": "MemberJunction: Angular components for credential management - panels and dialogs for creating and editing credentials",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"/dist"
|
|
9
9
|
],
|
|
10
|
-
"scripts": {
|
|
11
|
-
"test": "vitest run",
|
|
12
|
-
"build": "ngc",
|
|
13
|
-
"test:watch": "vitest"
|
|
14
|
-
},
|
|
15
10
|
"keywords": [
|
|
16
11
|
"memberjunction",
|
|
17
12
|
"credentials",
|
|
@@ -23,22 +18,22 @@
|
|
|
23
18
|
"devDependencies": {
|
|
24
19
|
"@angular/compiler": "21.1.3",
|
|
25
20
|
"@angular/compiler-cli": "21.1.3",
|
|
26
|
-
"@memberjunction/ng-test-utils": "
|
|
21
|
+
"@memberjunction/ng-test-utils": "6.1.0-edge.1",
|
|
27
22
|
"vitest": "^4.0.18"
|
|
28
23
|
},
|
|
29
24
|
"peerDependencies": {
|
|
30
|
-
"@angular/common": "21.1.3",
|
|
31
|
-
"@angular/core": "21.1.3",
|
|
32
|
-
"@angular/forms": "21.1.3"
|
|
25
|
+
"@angular/common": "^21.1.3",
|
|
26
|
+
"@angular/core": "^21.1.3",
|
|
27
|
+
"@angular/forms": "^21.1.3"
|
|
33
28
|
},
|
|
34
29
|
"dependencies": {
|
|
35
|
-
"@memberjunction/core": "
|
|
36
|
-
"@memberjunction/ng-base-types": "
|
|
37
|
-
"@memberjunction/core-entities": "
|
|
38
|
-
"@memberjunction/global": "
|
|
39
|
-
"@memberjunction/ng-notifications": "
|
|
40
|
-
"@memberjunction/ng-shared-generic": "
|
|
41
|
-
"@memberjunction/ng-ui-components": "
|
|
30
|
+
"@memberjunction/core": "6.1.0-edge.1",
|
|
31
|
+
"@memberjunction/ng-base-types": "6.1.0-edge.1",
|
|
32
|
+
"@memberjunction/core-entities": "6.1.0-edge.1",
|
|
33
|
+
"@memberjunction/global": "6.1.0-edge.1",
|
|
34
|
+
"@memberjunction/ng-notifications": "6.1.0-edge.1",
|
|
35
|
+
"@memberjunction/ng-shared-generic": "6.1.0-edge.1",
|
|
36
|
+
"@memberjunction/ng-ui-components": "6.1.0-edge.1",
|
|
42
37
|
"tslib": "^2.8.1",
|
|
43
38
|
"rxjs": "^7.8.2"
|
|
44
39
|
},
|
|
@@ -46,5 +41,12 @@
|
|
|
46
41
|
"repository": {
|
|
47
42
|
"type": "git",
|
|
48
43
|
"url": "https://github.com/MemberJunction/MJ"
|
|
44
|
+
},
|
|
45
|
+
"mjUILayer": "widgets",
|
|
46
|
+
"scripts": {
|
|
47
|
+
"test": "vitest run",
|
|
48
|
+
"test:types": "tsc --noEmit -p tsconfig.spec.json",
|
|
49
|
+
"build": "ngc",
|
|
50
|
+
"test:watch": "vitest"
|
|
49
51
|
}
|
|
50
|
-
}
|
|
52
|
+
}
|