@memberjunction/ng-base-forms 6.2.0 → 6.3.0-edge.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -8
- package/dist/lib/base-form-component.d.ts +20 -0
- package/dist/lib/base-form-component.d.ts.map +1 -1
- package/dist/lib/base-form-component.js +69 -7
- package/dist/lib/base-form-component.js.map +1 -1
- package/dist/lib/comments/comment-card-driver-host.component.d.ts +55 -0
- package/dist/lib/comments/comment-card-driver-host.component.d.ts.map +1 -0
- package/dist/lib/comments/comment-card-driver-host.component.js +134 -0
- package/dist/lib/comments/comment-card-driver-host.component.js.map +1 -0
- package/dist/lib/comments/field-suggestion-card.component.d.ts +43 -0
- package/dist/lib/comments/field-suggestion-card.component.d.ts.map +1 -0
- package/dist/lib/comments/field-suggestion-card.component.js +357 -0
- package/dist/lib/comments/field-suggestion-card.component.js.map +1 -0
- package/dist/lib/comments/form-record-comments-coordinator.service.d.ts +69 -7
- package/dist/lib/comments/form-record-comments-coordinator.service.d.ts.map +1 -1
- package/dist/lib/comments/form-record-comments-coordinator.service.js +251 -11
- package/dist/lib/comments/form-record-comments-coordinator.service.js.map +1 -1
- package/dist/lib/comments/record-comments.component.d.ts +31 -1
- package/dist/lib/comments/record-comments.component.d.ts.map +1 -1
- package/dist/lib/comments/record-comments.component.js +765 -465
- package/dist/lib/comments/record-comments.component.js.map +1 -1
- package/dist/lib/container/record-form-container.component.d.ts +6 -0
- package/dist/lib/container/record-form-container.component.d.ts.map +1 -1
- package/dist/lib/container/record-form-container.component.js +286 -246
- package/dist/lib/container/record-form-container.component.js.map +1 -1
- package/dist/lib/field/form-field.component.d.ts +7 -3
- package/dist/lib/field/form-field.component.d.ts.map +1 -1
- package/dist/lib/field/form-field.component.js +58 -22
- package/dist/lib/field/form-field.component.js.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.d.ts.map +1 -1
- package/dist/lib/isa-related-panel/isa-related-panel.component.js +10 -0
- package/dist/lib/isa-related-panel/isa-related-panel.component.js.map +1 -1
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js +1 -1
- package/dist/lib/panel-slot/collect-form-contribution-registrations.js.map +1 -1
- package/dist/lib/subtype-ui-driver/entity-subtype-ui-driver.d.ts +100 -0
- package/dist/lib/subtype-ui-driver/entity-subtype-ui-driver.d.ts.map +1 -0
- package/dist/lib/subtype-ui-driver/entity-subtype-ui-driver.js +181 -0
- package/dist/lib/subtype-ui-driver/entity-subtype-ui-driver.js.map +1 -0
- package/dist/lib/subtype-ui-driver/folded-subtype-section.component.d.ts +104 -0
- package/dist/lib/subtype-ui-driver/folded-subtype-section.component.d.ts.map +1 -0
- package/dist/lib/subtype-ui-driver/folded-subtype-section.component.js +487 -0
- package/dist/lib/subtype-ui-driver/folded-subtype-section.component.js.map +1 -0
- package/dist/lib/toolbar/actions/record-comments-toolbar-action.js +2 -2
- package/dist/lib/toolbar/actions/record-comments-toolbar-action.js.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.d.ts +2 -0
- package/dist/lib/toolbar/form-toolbar.component.d.ts.map +1 -1
- package/dist/lib/toolbar/form-toolbar.component.js +241 -290
- package/dist/lib/toolbar/form-toolbar.component.js.map +1 -1
- package/dist/module.d.ts +17 -14
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +25 -6
- package/dist/module.js.map +1 -1
- package/dist/public-api.d.ts +4 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +4 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +20 -20
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-card-driver-host.component.d.ts","sourceRoot":"","sources":["../../../src/lib/comments/comment-card-driver-host.component.ts"],"names":[],"mappings":"AAAA,OAAO,EAKH,YAAY,EAGZ,SAAS,EACT,SAAS,EAOZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,eA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C,WAAW,IAAI,IAAI;IAInB,WAAW,IAAI,IAAI;IAI1B,OAAO,CAAC,iBAAiB;IAoCzB,OAAO,CAAC,UAAU;IAalB,OAAO,CAAC,oBAAoB;yCA1FnB,gCAAgC;2CAAhC,gCAAgC;CAkG5C"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostBinding, Input, Output, ViewChild, ViewContainerRef, ViewEncapsulation, inject } from '@angular/core';
|
|
2
|
+
import { MJGlobal } from '@memberjunction/global';
|
|
3
|
+
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
4
|
+
import { EntitySubtypeUIDriverBase } from '../subtype-ui-driver/entity-subtype-ui-driver';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
const _c0 = ["cardHost"];
|
|
7
|
+
/**
|
|
8
|
+
* Dynamic host component that mounts a registered {@link EntitySubtypeUIDriverBase}
|
|
9
|
+
* subclass (`@RegisterClass(EntitySubtypeUIDriverBase, UIDriverClass)`) for a comment
|
|
10
|
+
* subtype card inside `<mj-record-comments>`.
|
|
11
|
+
*/
|
|
12
|
+
export class MjCommentCardDriverHostComponent extends BaseAngularComponent {
|
|
13
|
+
HostDisplay = 'contents';
|
|
14
|
+
cdr = inject(ChangeDetectorRef);
|
|
15
|
+
mountedRef = null;
|
|
16
|
+
mountedKey = null;
|
|
17
|
+
cardHost;
|
|
18
|
+
/** Registration key (`MJ: Comment Types.UIDriverClass`) in `MJGlobal.Instance.ClassFactory`. */
|
|
19
|
+
UIDriverKey = null;
|
|
20
|
+
/** The `MJ: Comments` record (or null when mocked in tests). */
|
|
21
|
+
CommentRecord = null;
|
|
22
|
+
/** The subtype IS-A child record (e.g., `MJFieldSuggestionEntity`). */
|
|
23
|
+
ChildRecord = null;
|
|
24
|
+
/** The target entity record that the comment is anchored to. */
|
|
25
|
+
TargetRecord = null;
|
|
26
|
+
/** Whether the host form is currently in edit mode. */
|
|
27
|
+
EditMode = false;
|
|
28
|
+
/** Structured card context (coordinator, discussion callback, error callback). */
|
|
29
|
+
DriverContext = null;
|
|
30
|
+
Navigate = new EventEmitter();
|
|
31
|
+
RecordMutated = new EventEmitter();
|
|
32
|
+
ngOnChanges() {
|
|
33
|
+
this.syncMountedDriver();
|
|
34
|
+
}
|
|
35
|
+
ngOnDestroy() {
|
|
36
|
+
this.destroyMountedDriver();
|
|
37
|
+
}
|
|
38
|
+
syncMountedDriver() {
|
|
39
|
+
const key = this.UIDriverKey?.trim() || null;
|
|
40
|
+
if (!key || !this.cardHost) {
|
|
41
|
+
this.destroyMountedDriver();
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
if (this.mountedRef && this.mountedKey === key) {
|
|
45
|
+
this.pushInputs();
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
this.destroyMountedDriver();
|
|
49
|
+
const reg = MJGlobal.Instance.ClassFactory.GetRegistration(EntitySubtypeUIDriverBase, key);
|
|
50
|
+
if (!reg?.SubClass) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const componentType = reg.SubClass;
|
|
54
|
+
const ref = this.cardHost.createComponent(componentType);
|
|
55
|
+
this.mountedRef = ref;
|
|
56
|
+
this.mountedKey = key;
|
|
57
|
+
const navSub = ref.instance.Navigate.subscribe((evt) => this.Navigate.emit(evt));
|
|
58
|
+
const mutSub = ref.instance.RecordMutated.subscribe(() => {
|
|
59
|
+
this.RecordMutated.emit();
|
|
60
|
+
this.cdr.markForCheck();
|
|
61
|
+
});
|
|
62
|
+
ref.onDestroy(() => {
|
|
63
|
+
navSub.unsubscribe();
|
|
64
|
+
mutSub.unsubscribe();
|
|
65
|
+
});
|
|
66
|
+
this.pushInputs();
|
|
67
|
+
}
|
|
68
|
+
pushInputs() {
|
|
69
|
+
if (!this.mountedRef)
|
|
70
|
+
return;
|
|
71
|
+
const inst = this.mountedRef.instance;
|
|
72
|
+
inst.Provider = this.Provider;
|
|
73
|
+
inst.Record = this.CommentRecord;
|
|
74
|
+
inst.ChildRecord = this.ChildRecord;
|
|
75
|
+
inst.TargetRecord = this.TargetRecord;
|
|
76
|
+
inst.EditMode = this.EditMode;
|
|
77
|
+
inst.Surface = 'comment-card';
|
|
78
|
+
inst.DriverContext = this.DriverContext;
|
|
79
|
+
this.mountedRef.changeDetectorRef.markForCheck();
|
|
80
|
+
}
|
|
81
|
+
destroyMountedDriver() {
|
|
82
|
+
if (this.mountedRef) {
|
|
83
|
+
this.mountedRef.destroy();
|
|
84
|
+
this.mountedRef = null;
|
|
85
|
+
this.mountedKey = null;
|
|
86
|
+
}
|
|
87
|
+
this.cardHost?.clear();
|
|
88
|
+
}
|
|
89
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵMjCommentCardDriverHostComponent_BaseFactory; return function MjCommentCardDriverHostComponent_Factory(__ngFactoryType__) { return (ɵMjCommentCardDriverHostComponent_BaseFactory || (ɵMjCommentCardDriverHostComponent_BaseFactory = i0.ɵɵgetInheritedFactory(MjCommentCardDriverHostComponent)))(__ngFactoryType__ || MjCommentCardDriverHostComponent); }; })();
|
|
90
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: MjCommentCardDriverHostComponent, selectors: [["mj-comment-card-driver-host"]], viewQuery: function MjCommentCardDriverHostComponent_Query(rf, ctx) { if (rf & 1) {
|
|
91
|
+
i0.ɵɵviewQuery(_c0, 7, ViewContainerRef);
|
|
92
|
+
} if (rf & 2) {
|
|
93
|
+
let _t;
|
|
94
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.cardHost = _t.first);
|
|
95
|
+
} }, hostVars: 2, hostBindings: function MjCommentCardDriverHostComponent_HostBindings(rf, ctx) { if (rf & 2) {
|
|
96
|
+
i0.ɵɵstyleProp("display", ctx.HostDisplay);
|
|
97
|
+
} }, inputs: { UIDriverKey: "UIDriverKey", CommentRecord: "CommentRecord", ChildRecord: "ChildRecord", TargetRecord: "TargetRecord", EditMode: "EditMode", DriverContext: "DriverContext" }, outputs: { Navigate: "Navigate", RecordMutated: "RecordMutated" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 2, vars: 0, consts: [["cardHost", ""]], template: function MjCommentCardDriverHostComponent_Template(rf, ctx) { if (rf & 1) {
|
|
98
|
+
i0.ɵɵelementContainer(0, null, 0);
|
|
99
|
+
} }, encapsulation: 2, changeDetection: 0 });
|
|
100
|
+
}
|
|
101
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(MjCommentCardDriverHostComponent, [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{
|
|
104
|
+
standalone: false,
|
|
105
|
+
selector: 'mj-comment-card-driver-host',
|
|
106
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
107
|
+
encapsulation: ViewEncapsulation.None,
|
|
108
|
+
template: `<ng-container #cardHost></ng-container>`
|
|
109
|
+
}]
|
|
110
|
+
}], null, { HostDisplay: [{
|
|
111
|
+
type: HostBinding,
|
|
112
|
+
args: ['style.display']
|
|
113
|
+
}], cardHost: [{
|
|
114
|
+
type: ViewChild,
|
|
115
|
+
args: ['cardHost', { read: ViewContainerRef, static: true }]
|
|
116
|
+
}], UIDriverKey: [{
|
|
117
|
+
type: Input
|
|
118
|
+
}], CommentRecord: [{
|
|
119
|
+
type: Input
|
|
120
|
+
}], ChildRecord: [{
|
|
121
|
+
type: Input
|
|
122
|
+
}], TargetRecord: [{
|
|
123
|
+
type: Input
|
|
124
|
+
}], EditMode: [{
|
|
125
|
+
type: Input
|
|
126
|
+
}], DriverContext: [{
|
|
127
|
+
type: Input
|
|
128
|
+
}], Navigate: [{
|
|
129
|
+
type: Output
|
|
130
|
+
}], RecordMutated: [{
|
|
131
|
+
type: Output
|
|
132
|
+
}] }); })();
|
|
133
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(MjCommentCardDriverHostComponent, { className: "MjCommentCardDriverHostComponent", filePath: "src/lib/comments/comment-card-driver-host.component.ts", lineNumber: 53 }); })();
|
|
134
|
+
//# sourceMappingURL=comment-card-driver-host.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comment-card-driver-host.component.js","sourceRoot":"","sources":["../../../src/lib/comments/comment-card-driver-host.component.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EAET,YAAY,EACZ,WAAW,EACX,KAAK,EAGL,MAAM,EAEN,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,MAAM,EACT,MAAM,eAAe,CAAC;AAGvB,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAC;;;AAmB1F;;;;GAIG;AAQH,MAAM,OAAO,gCAAiC,SAAQ,oBAAoB;IAEtD,WAAW,GAAG,UAAU,CAAC;IAExB,GAAG,GAAG,MAAM,CAAC,iBAAiB,CAAC,CAAC;IAEzC,UAAU,GAAmD,IAAI,CAAC;IAClE,UAAU,GAAkB,IAAI,CAAC;IAGjC,QAAQ,CAAoB;IAEpC,gGAAgG;IACvF,WAAW,GAAkB,IAAI,CAAC;IAE3C,gEAAgE;IACvD,aAAa,GAA2B,IAAI,CAAC;IAEtD,uEAAuE;IAC9D,WAAW,GAAsB,IAAI,CAAC;IAE/C,gEAAgE;IACvD,YAAY,GAAsB,IAAI,CAAC;IAEhD,uDAAuD;IAC9C,QAAQ,GAAG,KAAK,CAAC;IAE1B,kFAAkF;IACzE,aAAa,GAAoC,IAAI,CAAC;IAErD,QAAQ,GAAG,IAAI,YAAY,EAAuB,CAAC;IACnD,aAAa,GAAG,IAAI,YAAY,EAAQ,CAAC;IAE5C,WAAW;QACd,IAAI,CAAC,iBAAiB,EAAE,CAAC;IA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Ae,EAAE,uBAAuB,CAAC,MAAM;gBAC/C,aAAa,EAAE,iBAAiB,CAAC,IAAI;gBACrC,QAAQ,EAAE,yCAAyC;aACtD;;kBAEI,WAAW;mBAAC,eAAe;;kBAQ3B,SAAS;mBAAC,UAAU,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE;;kBAI9D,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAGL,KAAK;;kBAEL,MAAM;;kBACN,MAAM;;kFA/BE,gCAAgC","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ComponentRef,\n EventEmitter,\n HostBinding,\n Input,\n OnChanges,\n OnDestroy,\n Output,\n Type,\n ViewChild,\n ViewContainerRef,\n ViewEncapsulation,\n inject\n} from '@angular/core';\nimport { BaseEntity } from '@memberjunction/core';\nimport { MJCommentEntity, MJConversationEntity } from '@memberjunction/core-entities';\nimport { MJGlobal } from '@memberjunction/global';\nimport { BaseAngularComponent } from '@memberjunction/ng-base-types';\nimport { EntitySubtypeUIDriverBase } from '../subtype-ui-driver/entity-subtype-ui-driver';\nimport { FormNavigationEvent } from '../types/navigation-events';\nimport { FormRecordCommentsCoordinatorService } from './form-record-comments-coordinator.service';\n\n/**\n * Strongly-typed context passed via `DriverContext` to {@link EntitySubtypeUIDriverBase}\n * instances mounted inside `<mj-record-comments>` (`Surface = 'comment-card'`).\n */\nexport interface CommentCardDriverContext extends Record<string, unknown> {\n Coordinator: FormRecordCommentsCoordinatorService | null;\n Conversation: MJConversationEntity;\n AnchorBadgeLabel: string;\n CurrentLiveValue: string | null;\n CanUserUpdateTargetField: boolean;\n CanUserDiscuss: boolean;\n OnDiscuss: () => void;\n OnError: (message: string) => void;\n}\n\n/**\n * Dynamic host component that mounts a registered {@link EntitySubtypeUIDriverBase}\n * subclass (`@RegisterClass(EntitySubtypeUIDriverBase, UIDriverClass)`) for a comment\n * subtype card inside `<mj-record-comments>`.\n */\n@Component({\n standalone: false,\n selector: 'mj-comment-card-driver-host',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n template: `<ng-container #cardHost></ng-container>`\n})\nexport class MjCommentCardDriverHostComponent extends BaseAngularComponent implements OnChanges, OnDestroy {\n @HostBinding('style.display')\n public readonly HostDisplay = 'contents';\n\n private readonly cdr = inject(ChangeDetectorRef);\n\n private mountedRef: ComponentRef<EntitySubtypeUIDriverBase> | null = null;\n private mountedKey: string | null = null;\n\n @ViewChild('cardHost', { read: ViewContainerRef, static: true })\n private cardHost!: ViewContainerRef;\n\n /** Registration key (`MJ: Comment Types.UIDriverClass`) in `MJGlobal.Instance.ClassFactory`. */\n @Input() UIDriverKey: string | null = null;\n\n /** The `MJ: Comments` record (or null when mocked in tests). */\n @Input() CommentRecord: MJCommentEntity | null = null;\n\n /** The subtype IS-A child record (e.g., `MJFieldSuggestionEntity`). */\n @Input() ChildRecord: BaseEntity | null = null;\n\n /** The target entity record that the comment is anchored to. */\n @Input() TargetRecord: BaseEntity | null = null;\n\n /** Whether the host form is currently in edit mode. */\n @Input() EditMode = false;\n\n /** Structured card context (coordinator, discussion callback, error callback). */\n @Input() DriverContext: CommentCardDriverContext | null = null;\n\n @Output() Navigate = new EventEmitter<FormNavigationEvent>();\n @Output() RecordMutated = new EventEmitter<void>();\n\n public ngOnChanges(): void {\n this.syncMountedDriver();\n }\n\n public ngOnDestroy(): void {\n this.destroyMountedDriver();\n }\n\n private syncMountedDriver(): void {\n const key = this.UIDriverKey?.trim() || null;\n if (!key || !this.cardHost) {\n this.destroyMountedDriver();\n return;\n }\n\n if (this.mountedRef && this.mountedKey === key) {\n this.pushInputs();\n return;\n }\n\n this.destroyMountedDriver();\n const reg = MJGlobal.Instance.ClassFactory.GetRegistration(EntitySubtypeUIDriverBase, key);\n if (!reg?.SubClass) {\n return;\n }\n\n const componentType = reg.SubClass as Type<EntitySubtypeUIDriverBase>;\n const ref = this.cardHost.createComponent(componentType);\n this.mountedRef = ref;\n this.mountedKey = key;\n\n const navSub = ref.instance.Navigate.subscribe((evt: FormNavigationEvent) => this.Navigate.emit(evt));\n const mutSub = ref.instance.RecordMutated.subscribe(() => {\n this.RecordMutated.emit();\n this.cdr.markForCheck();\n });\n ref.onDestroy(() => {\n navSub.unsubscribe();\n mutSub.unsubscribe();\n });\n\n this.pushInputs();\n }\n\n private pushInputs(): void {\n if (!this.mountedRef) return;\n const inst = this.mountedRef.instance;\n inst.Provider = this.Provider;\n inst.Record = this.CommentRecord;\n inst.ChildRecord = this.ChildRecord;\n inst.TargetRecord = this.TargetRecord;\n inst.EditMode = this.EditMode;\n inst.Surface = 'comment-card';\n inst.DriverContext = this.DriverContext;\n this.mountedRef.changeDetectorRef.markForCheck();\n }\n\n private destroyMountedDriver(): void {\n if (this.mountedRef) {\n this.mountedRef.destroy();\n this.mountedRef = null;\n this.mountedKey = null;\n }\n this.cardHost?.clear();\n }\n}\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { MJCommentEntity, MJFieldSuggestionEntity } from '@memberjunction/core-entities';
|
|
2
|
+
import { EntitySubtypeUIDriverBase } from '../subtype-ui-driver/entity-subtype-ui-driver';
|
|
3
|
+
import type { CommentCardDriverContext } from './comment-card-driver-host.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
type FieldSuggestionOutcome = MJFieldSuggestionEntity['Outcome'];
|
|
6
|
+
type FieldSuggestionSource = MJFieldSuggestionEntity['Source'];
|
|
7
|
+
/**
|
|
8
|
+
* Built-in {@link EntitySubtypeUIDriverBase} card component for `MJ: Comment Types`
|
|
9
|
+
* rows whose `UIDriverClass` is `'FieldSuggestionCardComponent'`.
|
|
10
|
+
*
|
|
11
|
+
* Displays:
|
|
12
|
+
* - Provenance (`Source` + optional `Confidence` score) and disposition (`Outcome`).
|
|
13
|
+
* - Current live value on `TargetRecord` vs proposed ghost value (`SuggestedValue`).
|
|
14
|
+
* - Interactive **Accept**, **Reject**, and **Discuss** actions for pending suggestions.
|
|
15
|
+
*/
|
|
16
|
+
export declare class FieldSuggestionCardComponent extends EntitySubtypeUIDriverBase<MJCommentEntity, MJFieldSuggestionEntity> {
|
|
17
|
+
private readonly cdr;
|
|
18
|
+
ActiveAction: 'accept' | 'reject' | null;
|
|
19
|
+
get CardContext(): CommentCardDriverContext | null;
|
|
20
|
+
get Suggestion(): MJFieldSuggestionEntity | null;
|
|
21
|
+
get Outcome(): FieldSuggestionOutcome;
|
|
22
|
+
get IsPending(): boolean;
|
|
23
|
+
get Source(): FieldSuggestionSource;
|
|
24
|
+
get SourceLabel(): string;
|
|
25
|
+
get SourceIcon(): string;
|
|
26
|
+
get FormattedConfidence(): string | null;
|
|
27
|
+
get OutcomeBadgeLabel(): string;
|
|
28
|
+
get OutcomeBadgeModifier(): string;
|
|
29
|
+
get CurrentValueDisplay(): string;
|
|
30
|
+
get IsClearingSuggestion(): boolean;
|
|
31
|
+
get SuggestedValueDisplay(): string;
|
|
32
|
+
get CanUserActOnSuggestion(): boolean;
|
|
33
|
+
get CanUserDiscuss(): boolean;
|
|
34
|
+
get ActionDisabledReason(): string | null;
|
|
35
|
+
OnAccept(): Promise<void>;
|
|
36
|
+
OnReject(): Promise<void>;
|
|
37
|
+
OnDiscuss(): void;
|
|
38
|
+
private formatScalarForDisplay;
|
|
39
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FieldSuggestionCardComponent, never>;
|
|
40
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FieldSuggestionCardComponent, "mj-field-suggestion-card", never, {}, {}, never, never, false, never>;
|
|
41
|
+
}
|
|
42
|
+
export {};
|
|
43
|
+
//# sourceMappingURL=field-suggestion-card.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"field-suggestion-card.component.d.ts","sourceRoot":"","sources":["../../../src/lib/comments/field-suggestion-card.component.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE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IAAI;IAIxB,OAAO,CAAC,sBAAsB;yCA1MrB,4BAA4B;2CAA5B,4BAA4B;CAoNxC"}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ViewEncapsulation, inject } from '@angular/core';
|
|
8
|
+
import { RegisterClass } from '@memberjunction/global';
|
|
9
|
+
import { EntitySubtypeUIDriverBase } from '../subtype-ui-driver/entity-subtype-ui-driver';
|
|
10
|
+
import * as i0 from "@angular/core";
|
|
11
|
+
import * as i1 from "@memberjunction/ng-ui-components";
|
|
12
|
+
import * as i2 from "@memberjunction/ng-shared-generic";
|
|
13
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_11_Template(rf, ctx) { if (rf & 1) {
|
|
14
|
+
i0.ɵɵelementStart(0, "span", 8);
|
|
15
|
+
i0.ɵɵtext(1);
|
|
16
|
+
i0.ɵɵelementEnd();
|
|
17
|
+
} if (rf & 2) {
|
|
18
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
19
|
+
i0.ɵɵadvance();
|
|
20
|
+
i0.ɵɵtextInterpolate(ctx_r0.FormattedConfidence);
|
|
21
|
+
} }
|
|
22
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
23
|
+
i0.ɵɵelement(0, "mj-loading", 22);
|
|
24
|
+
i0.ɵɵelementStart(1, "span");
|
|
25
|
+
i0.ɵɵtext(2, "Applying...");
|
|
26
|
+
i0.ɵɵelementEnd();
|
|
27
|
+
} if (rf & 2) {
|
|
28
|
+
i0.ɵɵproperty("showText", false);
|
|
29
|
+
} }
|
|
30
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
31
|
+
i0.ɵɵelement(0, "i", 23);
|
|
32
|
+
i0.ɵɵelementStart(1, "span");
|
|
33
|
+
i0.ɵɵtext(2, "Accept");
|
|
34
|
+
i0.ɵɵelementEnd();
|
|
35
|
+
} }
|
|
36
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
37
|
+
i0.ɵɵelement(0, "mj-loading", 22);
|
|
38
|
+
i0.ɵɵelementStart(1, "span");
|
|
39
|
+
i0.ɵɵtext(2, "Rejecting...");
|
|
40
|
+
i0.ɵɵelementEnd();
|
|
41
|
+
} if (rf & 2) {
|
|
42
|
+
i0.ɵɵproperty("showText", false);
|
|
43
|
+
} }
|
|
44
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
45
|
+
i0.ɵɵelement(0, "i", 24);
|
|
46
|
+
i0.ɵɵelementStart(1, "span");
|
|
47
|
+
i0.ɵɵtext(2, "Reject");
|
|
48
|
+
i0.ɵɵelementEnd();
|
|
49
|
+
} }
|
|
50
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_7_Template(rf, ctx) { if (rf & 1) {
|
|
51
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
52
|
+
i0.ɵɵelementStart(0, "button", 25);
|
|
53
|
+
i0.ɵɵlistener("click", function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_7_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r0 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r0.OnDiscuss()); });
|
|
54
|
+
i0.ɵɵelement(1, "i", 26);
|
|
55
|
+
i0.ɵɵelementStart(2, "span");
|
|
56
|
+
i0.ɵɵtext(3, "Discuss");
|
|
57
|
+
i0.ɵɵelementEnd()();
|
|
58
|
+
} if (rf & 2) {
|
|
59
|
+
const ctx_r0 = i0.ɵɵnextContext(3);
|
|
60
|
+
i0.ɵɵproperty("disabled", ctx_r0.ActiveAction !== null);
|
|
61
|
+
} }
|
|
62
|
+
function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Template(rf, ctx) { if (rf & 1) {
|
|
63
|
+
const _r2 = i0.ɵɵgetCurrentView();
|
|
64
|
+
i0.ɵɵelementStart(0, "div", 18)(1, "button", 19);
|
|
65
|
+
i0.ɵɵlistener("click", function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OnAccept()); });
|
|
66
|
+
i0.ɵɵconditionalCreate(2, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_2_Template, 3, 1)(3, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_3_Template, 3, 0);
|
|
67
|
+
i0.ɵɵelementEnd();
|
|
68
|
+
i0.ɵɵelementStart(4, "button", 20);
|
|
69
|
+
i0.ɵɵlistener("click", function FieldSuggestionCardComponent_Conditional_0_Conditional_27_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r2); const ctx_r0 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r0.OnReject()); });
|
|
70
|
+
i0.ɵɵconditionalCreate(5, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_5_Template, 3, 1)(6, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_6_Template, 3, 0);
|
|
71
|
+
i0.ɵɵelementEnd();
|
|
72
|
+
i0.ɵɵconditionalCreate(7, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Conditional_7_Template, 4, 1, "button", 21);
|
|
73
|
+
i0.ɵɵelementEnd();
|
|
74
|
+
} if (rf & 2) {
|
|
75
|
+
const ctx_r0 = i0.ɵɵnextContext(2);
|
|
76
|
+
i0.ɵɵadvance();
|
|
77
|
+
i0.ɵɵproperty("disabled", !ctx_r0.CanUserActOnSuggestion || ctx_r0.ActiveAction !== null)("title", ctx_r0.ActionDisabledReason || "Apply suggested value to this field");
|
|
78
|
+
i0.ɵɵadvance();
|
|
79
|
+
i0.ɵɵconditional(ctx_r0.ActiveAction === "accept" ? 2 : 3);
|
|
80
|
+
i0.ɵɵadvance(2);
|
|
81
|
+
i0.ɵɵproperty("disabled", !ctx_r0.CanUserActOnSuggestion || ctx_r0.ActiveAction !== null)("title", ctx_r0.ActionDisabledReason || "Dismiss this field suggestion");
|
|
82
|
+
i0.ɵɵadvance();
|
|
83
|
+
i0.ɵɵconditional(ctx_r0.ActiveAction === "reject" ? 5 : 6);
|
|
84
|
+
i0.ɵɵadvance(2);
|
|
85
|
+
i0.ɵɵconditional(ctx_r0.CanUserDiscuss ? 7 : -1);
|
|
86
|
+
} }
|
|
87
|
+
function FieldSuggestionCardComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
88
|
+
i0.ɵɵelementStart(0, "div", 1)(1, "div", 2)(2, "div", 3)(3, "span", 4);
|
|
89
|
+
i0.ɵɵelement(4, "i", 5);
|
|
90
|
+
i0.ɵɵelementStart(5, "span");
|
|
91
|
+
i0.ɵɵtext(6, "Suggested value");
|
|
92
|
+
i0.ɵɵelementEnd()();
|
|
93
|
+
i0.ɵɵelementStart(7, "span", 6);
|
|
94
|
+
i0.ɵɵelement(8, "i", 7);
|
|
95
|
+
i0.ɵɵelementStart(9, "span");
|
|
96
|
+
i0.ɵɵtext(10);
|
|
97
|
+
i0.ɵɵelementEnd();
|
|
98
|
+
i0.ɵɵconditionalCreate(11, FieldSuggestionCardComponent_Conditional_0_Conditional_11_Template, 2, 1, "span", 8);
|
|
99
|
+
i0.ɵɵelementEnd()();
|
|
100
|
+
i0.ɵɵelementStart(12, "span", 9);
|
|
101
|
+
i0.ɵɵtext(13);
|
|
102
|
+
i0.ɵɵelementEnd()();
|
|
103
|
+
i0.ɵɵelementStart(14, "div", 10)(15, "div", 11)(16, "span", 12);
|
|
104
|
+
i0.ɵɵtext(17, "Current");
|
|
105
|
+
i0.ɵɵelementEnd();
|
|
106
|
+
i0.ɵɵelementStart(18, "code", 13);
|
|
107
|
+
i0.ɵɵtext(19);
|
|
108
|
+
i0.ɵɵelementEnd()();
|
|
109
|
+
i0.ɵɵelementStart(20, "div", 14);
|
|
110
|
+
i0.ɵɵelement(21, "i", 15);
|
|
111
|
+
i0.ɵɵelementEnd();
|
|
112
|
+
i0.ɵɵelementStart(22, "div", 16)(23, "span", 12);
|
|
113
|
+
i0.ɵɵtext(24, "Proposed");
|
|
114
|
+
i0.ɵɵelementEnd();
|
|
115
|
+
i0.ɵɵelementStart(25, "code", 17);
|
|
116
|
+
i0.ɵɵtext(26);
|
|
117
|
+
i0.ɵɵelementEnd()()();
|
|
118
|
+
i0.ɵɵconditionalCreate(27, FieldSuggestionCardComponent_Conditional_0_Conditional_27_Template, 8, 7, "div", 18);
|
|
119
|
+
i0.ɵɵelementEnd();
|
|
120
|
+
} if (rf & 2) {
|
|
121
|
+
const ctx_r0 = i0.ɵɵnextContext();
|
|
122
|
+
i0.ɵɵclassProp("mj-field-suggestion-card--pending", ctx_r0.IsPending)("mj-field-suggestion-card--accepted", ctx_r0.Outcome === "Accepted")("mj-field-suggestion-card--rejected", ctx_r0.Outcome === "Rejected")("mj-field-suggestion-card--superseded", ctx_r0.Outcome === "Superseded");
|
|
123
|
+
i0.ɵɵadvance(7);
|
|
124
|
+
i0.ɵɵproperty("title", "Suggested by " + ctx_r0.SourceLabel);
|
|
125
|
+
i0.ɵɵadvance();
|
|
126
|
+
i0.ɵɵclassMap(ctx_r0.SourceIcon);
|
|
127
|
+
i0.ɵɵadvance(2);
|
|
128
|
+
i0.ɵɵtextInterpolate(ctx_r0.SourceLabel);
|
|
129
|
+
i0.ɵɵadvance();
|
|
130
|
+
i0.ɵɵconditional(ctx_r0.FormattedConfidence ? 11 : -1);
|
|
131
|
+
i0.ɵɵadvance();
|
|
132
|
+
i0.ɵɵclassMap("mj-field-suggestion-card__outcome-pill mj-field-suggestion-card__outcome-pill--" + ctx_r0.OutcomeBadgeModifier);
|
|
133
|
+
i0.ɵɵadvance();
|
|
134
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.OutcomeBadgeLabel, " ");
|
|
135
|
+
i0.ɵɵadvance(6);
|
|
136
|
+
i0.ɵɵtextInterpolate(ctx_r0.CurrentValueDisplay);
|
|
137
|
+
i0.ɵɵadvance(3);
|
|
138
|
+
i0.ɵɵclassProp("mj-field-suggestion-card__value-box--clearing", ctx_r0.IsClearingSuggestion);
|
|
139
|
+
i0.ɵɵadvance(4);
|
|
140
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r0.SuggestedValueDisplay, " ");
|
|
141
|
+
i0.ɵɵadvance();
|
|
142
|
+
i0.ɵɵconditional(ctx_r0.IsPending ? 27 : -1);
|
|
143
|
+
} }
|
|
144
|
+
/**
|
|
145
|
+
* Built-in {@link EntitySubtypeUIDriverBase} card component for `MJ: Comment Types`
|
|
146
|
+
* rows whose `UIDriverClass` is `'FieldSuggestionCardComponent'`.
|
|
147
|
+
*
|
|
148
|
+
* Displays:
|
|
149
|
+
* - Provenance (`Source` + optional `Confidence` score) and disposition (`Outcome`).
|
|
150
|
+
* - Current live value on `TargetRecord` vs proposed ghost value (`SuggestedValue`).
|
|
151
|
+
* - Interactive **Accept**, **Reject**, and **Discuss** actions for pending suggestions.
|
|
152
|
+
*/
|
|
153
|
+
let FieldSuggestionCardComponent = class FieldSuggestionCardComponent extends EntitySubtypeUIDriverBase {
|
|
154
|
+
cdr = inject(ChangeDetectorRef);
|
|
155
|
+
ActiveAction = null;
|
|
156
|
+
get CardContext() {
|
|
157
|
+
const ctx = this.DriverContext;
|
|
158
|
+
if (!ctx || typeof ctx !== 'object') {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return ctx;
|
|
162
|
+
}
|
|
163
|
+
get Suggestion() {
|
|
164
|
+
return this.ChildRecord;
|
|
165
|
+
}
|
|
166
|
+
get Outcome() {
|
|
167
|
+
return this.Suggestion?.Outcome ?? null;
|
|
168
|
+
}
|
|
169
|
+
get IsPending() {
|
|
170
|
+
return this.Outcome === null;
|
|
171
|
+
}
|
|
172
|
+
get Source() {
|
|
173
|
+
return this.Suggestion?.Source ?? 'Agent';
|
|
174
|
+
}
|
|
175
|
+
get SourceLabel() {
|
|
176
|
+
switch (this.Source) {
|
|
177
|
+
case 'Agent':
|
|
178
|
+
return 'AI Agent';
|
|
179
|
+
case 'Integration':
|
|
180
|
+
return 'Integration';
|
|
181
|
+
case 'LLM':
|
|
182
|
+
return 'AI Model';
|
|
183
|
+
case 'Person':
|
|
184
|
+
return 'Person';
|
|
185
|
+
default:
|
|
186
|
+
return String(this.Source);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
get SourceIcon() {
|
|
190
|
+
switch (this.Source) {
|
|
191
|
+
case 'Agent':
|
|
192
|
+
return 'fa-solid fa-robot';
|
|
193
|
+
case 'Integration':
|
|
194
|
+
return 'fa-solid fa-plug';
|
|
195
|
+
case 'LLM':
|
|
196
|
+
return 'fa-solid fa-microchip';
|
|
197
|
+
case 'Person':
|
|
198
|
+
return 'fa-solid fa-user';
|
|
199
|
+
default:
|
|
200
|
+
return 'fa-solid fa-wand-magic-sparkles';
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
get FormattedConfidence() {
|
|
204
|
+
const conf = this.Suggestion?.Confidence;
|
|
205
|
+
if (conf === null || conf === undefined || !Number.isFinite(conf)) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
const pct = conf <= 1 ? Math.round(conf * 100) : Math.round(conf);
|
|
209
|
+
return `${Math.max(0, Math.min(100, pct))}%`;
|
|
210
|
+
}
|
|
211
|
+
get OutcomeBadgeLabel() {
|
|
212
|
+
switch (this.Outcome) {
|
|
213
|
+
case 'Accepted':
|
|
214
|
+
return 'Accepted';
|
|
215
|
+
case 'Rejected':
|
|
216
|
+
return 'Rejected';
|
|
217
|
+
case 'Superseded':
|
|
218
|
+
return 'Superseded';
|
|
219
|
+
default:
|
|
220
|
+
return 'Pending';
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
get OutcomeBadgeModifier() {
|
|
224
|
+
switch (this.Outcome) {
|
|
225
|
+
case 'Accepted':
|
|
226
|
+
return 'accepted';
|
|
227
|
+
case 'Rejected':
|
|
228
|
+
return 'rejected';
|
|
229
|
+
case 'Superseded':
|
|
230
|
+
return 'superseded';
|
|
231
|
+
default:
|
|
232
|
+
return 'pending';
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
get CurrentValueDisplay() {
|
|
236
|
+
const fromContext = this.CardContext?.CurrentLiveValue;
|
|
237
|
+
if (fromContext !== null && fromContext !== undefined && fromContext.length > 0) {
|
|
238
|
+
return fromContext;
|
|
239
|
+
}
|
|
240
|
+
const fieldName = (this.Suggestion?.AnchorKey ?? '').trim();
|
|
241
|
+
if (fieldName && this.TargetRecord) {
|
|
242
|
+
const field = this.TargetRecord.Fields.find((f) => f.Name.toLowerCase() === fieldName.toLowerCase());
|
|
243
|
+
if (field) {
|
|
244
|
+
const raw = field.Value;
|
|
245
|
+
if (raw !== null && raw !== undefined && String(raw).trim() !== '') {
|
|
246
|
+
return this.formatScalarForDisplay(raw);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
return '(empty)';
|
|
251
|
+
}
|
|
252
|
+
get IsClearingSuggestion() {
|
|
253
|
+
const val = this.Suggestion?.SuggestedValue;
|
|
254
|
+
return val === null || val === undefined || val === '';
|
|
255
|
+
}
|
|
256
|
+
get SuggestedValueDisplay() {
|
|
257
|
+
if (this.IsClearingSuggestion) {
|
|
258
|
+
return '(clear value)';
|
|
259
|
+
}
|
|
260
|
+
return this.formatScalarForDisplay(this.Suggestion.SuggestedValue);
|
|
261
|
+
}
|
|
262
|
+
get CanUserActOnSuggestion() {
|
|
263
|
+
if (!this.IsPending || !this.Suggestion?.ID) {
|
|
264
|
+
return false;
|
|
265
|
+
}
|
|
266
|
+
if (this.CardContext) {
|
|
267
|
+
return this.CardContext.CanUserUpdateTargetField;
|
|
268
|
+
}
|
|
269
|
+
return true;
|
|
270
|
+
}
|
|
271
|
+
get CanUserDiscuss() {
|
|
272
|
+
if (this.CardContext) {
|
|
273
|
+
return this.CardContext.CanUserDiscuss;
|
|
274
|
+
}
|
|
275
|
+
return true;
|
|
276
|
+
}
|
|
277
|
+
get ActionDisabledReason() {
|
|
278
|
+
if (!this.IsPending) {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
if (!this.CanUserActOnSuggestion) {
|
|
282
|
+
return 'You need update permission on this field to accept or reject this suggestion';
|
|
283
|
+
}
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
async OnAccept() {
|
|
287
|
+
const suggestionId = this.Suggestion?.ID;
|
|
288
|
+
const coordinator = this.CardContext?.Coordinator ?? null;
|
|
289
|
+
if (!suggestionId || !coordinator || !this.CanUserActOnSuggestion || this.ActiveAction !== null) {
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
this.ActiveAction = 'accept';
|
|
293
|
+
this.cdr.markForCheck();
|
|
294
|
+
try {
|
|
295
|
+
await coordinator.AcceptFieldSuggestion(suggestionId);
|
|
296
|
+
this.RecordMutated.emit();
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
300
|
+
this.CardContext?.OnError(msg);
|
|
301
|
+
}
|
|
302
|
+
finally {
|
|
303
|
+
this.ActiveAction = null;
|
|
304
|
+
this.cdr.markForCheck();
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
async OnReject() {
|
|
308
|
+
const suggestionId = this.Suggestion?.ID;
|
|
309
|
+
const coordinator = this.CardContext?.Coordinator ?? null;
|
|
310
|
+
if (!suggestionId || !coordinator || !this.CanUserActOnSuggestion || this.ActiveAction !== null) {
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
this.ActiveAction = 'reject';
|
|
314
|
+
this.cdr.markForCheck();
|
|
315
|
+
try {
|
|
316
|
+
await coordinator.RejectFieldSuggestion(suggestionId);
|
|
317
|
+
this.RecordMutated.emit();
|
|
318
|
+
}
|
|
319
|
+
catch (error) {
|
|
320
|
+
const msg = error instanceof Error ? error.message : String(error);
|
|
321
|
+
this.CardContext?.OnError(msg);
|
|
322
|
+
}
|
|
323
|
+
finally {
|
|
324
|
+
this.ActiveAction = null;
|
|
325
|
+
this.cdr.markForCheck();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
OnDiscuss() {
|
|
329
|
+
this.CardContext?.OnDiscuss();
|
|
330
|
+
}
|
|
331
|
+
formatScalarForDisplay(raw) {
|
|
332
|
+
if (raw instanceof Date) {
|
|
333
|
+
return isNaN(raw.getTime()) ? String(raw) : raw.toISOString().slice(0, 10);
|
|
334
|
+
}
|
|
335
|
+
const text = String(raw).trim();
|
|
336
|
+
if (/^\d{4}-\d{2}-\d{2}T00:00:00(?:\.000)?Z?$/.test(text)) {
|
|
337
|
+
return text.slice(0, 10);
|
|
338
|
+
}
|
|
339
|
+
return text;
|
|
340
|
+
}
|
|
341
|
+
static ɵfac = /*@__PURE__*/ (() => { let ɵFieldSuggestionCardComponent_BaseFactory; return function FieldSuggestionCardComponent_Factory(__ngFactoryType__) { return (ɵFieldSuggestionCardComponent_BaseFactory || (ɵFieldSuggestionCardComponent_BaseFactory = i0.ɵɵgetInheritedFactory(FieldSuggestionCardComponent)))(__ngFactoryType__ || FieldSuggestionCardComponent); }; })();
|
|
342
|
+
static ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: FieldSuggestionCardComponent, selectors: [["mj-field-suggestion-card"]], standalone: false, features: [i0.ɵɵInheritDefinitionFeature], decls: 1, vars: 1, consts: [[1, "mj-field-suggestion-card", 3, "mj-field-suggestion-card--pending", "mj-field-suggestion-card--accepted", "mj-field-suggestion-card--rejected", "mj-field-suggestion-card--superseded"], [1, "mj-field-suggestion-card"], [1, "mj-field-suggestion-card__meta-row"], [1, "mj-field-suggestion-card__provenance"], [1, "mj-field-suggestion-card__kind-chip"], ["aria-hidden", "true", 1, "fa-solid", "fa-wand-magic-sparkles"], [1, "mj-field-suggestion-card__source-chip", 3, "title"], ["aria-hidden", "true"], [1, "mj-field-suggestion-card__confidence"], [1, "mj-field-suggestion-card__outcome-pill"], ["role", "group", "aria-label", "Proposed field change", 1, "mj-field-suggestion-card__diff"], [1, "mj-field-suggestion-card__value-box", "mj-field-suggestion-card__value-box--current"], [1, "mj-field-suggestion-card__value-label"], [1, "mj-field-suggestion-card__value-code"], ["aria-hidden", "true", 1, "mj-field-suggestion-card__arrow"], [1, "fa-solid", "fa-arrow-right"], [1, "mj-field-suggestion-card__value-box", "mj-field-suggestion-card__value-box--ghost"], [1, "mj-field-suggestion-card__value-code", "mj-field-suggestion-card__value-code--ghost"], [1, "mj-field-suggestion-card__actions"], ["type", "button", "mjButton", "", "variant", "primary", "size", "sm", 1, "mj-field-suggestion-card__btn--accept", 3, "click", "disabled", "title"], ["type", "button", "mjButton", "", "variant", "outline", "size", "sm", 1, "mj-field-suggestion-card__btn--reject", 3, "click", "disabled", "title"], ["type", "button", "mjButton", "", "variant", "flat", "size", "sm", "title", "Reply in this suggestion's conversation thread", 1, "mj-field-suggestion-card__btn--discuss", 3, "disabled"], ["size", "small", 3, "showText"], ["aria-hidden", "true", 1, "fa-solid", "fa-check"], ["aria-hidden", "true", 1, "fa-solid", "fa-xmark"], ["type", "button", "mjButton", "", "variant", "flat", "size", "sm", "title", "Reply in this suggestion's conversation thread", 1, "mj-field-suggestion-card__btn--discuss", 3, "click", "disabled"], ["aria-hidden", "true", 1, "fa-regular", "fa-comment-dots"]], template: function FieldSuggestionCardComponent_Template(rf, ctx) { if (rf & 1) {
|
|
343
|
+
i0.ɵɵconditionalCreate(0, FieldSuggestionCardComponent_Conditional_0_Template, 28, 21, "div", 0);
|
|
344
|
+
} if (rf & 2) {
|
|
345
|
+
i0.ɵɵconditional(ctx.Suggestion ? 0 : -1);
|
|
346
|
+
} }, dependencies: [i1.MJButtonDirective, i2.LoadingComponent], styles: ["/* ============================================================================\n FIELD SUGGESTION CARD (EntitySubtypeUIDriverBase: FieldSuggestionCardComponent)\n Uses global --mj-* design tokens exclusively.\n ============================================================================ */\n\n.mj-field-suggestion-card {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border: 1px dashed color-mix(in srgb, var(--mj-brand-primary) 42%, var(--mj-border-default));\n}\n\n.mj-field-suggestion-card--accepted {\n border-style: solid;\n border-color: color-mix(in srgb, var(--mj-status-success) 45%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-status-success) 8%, var(--mj-bg-surface-sunken));\n}\n\n.mj-field-suggestion-card--rejected,\n.mj-field-suggestion-card--superseded {\n border-style: solid;\n border-color: var(--mj-border-subtle);\n opacity: 0.85;\n}\n\n.mj-field-suggestion-card__meta-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 6px;\n}\n\n.mj-field-suggestion-card__provenance {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n}\n\n.mj-field-suggestion-card__kind-chip {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n font-size: 11px;\n font-weight: 700;\n color: var(--mj-brand-primary);\n}\n\n.mj-field-suggestion-card__source-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 6px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-field-suggestion-card__confidence {\n padding-left: 4px;\n border-left: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-muted);\n font-variant-numeric: tabular-nums;\n}\n\n.mj-field-suggestion-card__outcome-pill {\n display: inline-flex;\n align-items: center;\n padding: 2px 7px;\n border-radius: var(--mj-radius-full, 9999px);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n}\n\n.mj-field-suggestion-card__outcome-pill--pending {\n background: color-mix(in srgb, var(--mj-brand-primary) 14%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n}\n\n.mj-field-suggestion-card__outcome-pill--accepted {\n background: color-mix(in srgb, var(--mj-status-success) 16%, var(--mj-bg-surface));\n color: var(--mj-status-success);\n}\n\n.mj-field-suggestion-card__outcome-pill--rejected {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error);\n}\n\n.mj-field-suggestion-card__outcome-pill--superseded {\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__diff {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: stretch;\n gap: 8px;\n}\n\n.mj-field-suggestion-card__value-box {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n min-width: 0;\n}\n\n.mj-field-suggestion-card__value-box--ghost {\n border-style: dashed;\n border-color: color-mix(in srgb, var(--mj-brand-primary) 50%, var(--mj-border-default));\n background: color-mix(in srgb, var(--mj-brand-primary) 7%, var(--mj-bg-surface-card));\n}\n\n.mj-field-suggestion-card--accepted .mj-field-suggestion-card__value-box--ghost {\n border-style: solid;\n border-color: color-mix(in srgb, var(--mj-status-success) 45%, var(--mj-border-subtle));\n background: var(--mj-bg-surface-card);\n}\n\n.mj-field-suggestion-card--rejected .mj-field-suggestion-card__value-box--ghost .mj-field-suggestion-card__value-code--ghost,\n.mj-field-suggestion-card--superseded .mj-field-suggestion-card__value-box--ghost .mj-field-suggestion-card__value-code--ghost {\n text-decoration: line-through;\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__value-label {\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__value-code {\n font-family: var(--mj-font-mono, monospace);\n font-size: 12px;\n color: var(--mj-text-secondary);\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.mj-field-suggestion-card__value-code--ghost {\n color: var(--mj-text-primary);\n font-weight: 600;\n}\n\n.mj-field-suggestion-card__value-box--clearing .mj-field-suggestion-card__value-code--ghost {\n font-style: italic;\n color: var(--mj-text-secondary);\n}\n\n.mj-field-suggestion-card__arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-muted);\n font-size: 11px;\n}\n\n.mj-field-suggestion-card__actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n padding-top: 2px;\n}\n\n.mj-field-suggestion-card__btn--discuss {\n margin-left: auto;\n}\n"], encapsulation: 2, changeDetection: 0 });
|
|
347
|
+
};
|
|
348
|
+
FieldSuggestionCardComponent = __decorate([
|
|
349
|
+
RegisterClass(EntitySubtypeUIDriverBase, 'FieldSuggestionCardComponent')
|
|
350
|
+
], FieldSuggestionCardComponent);
|
|
351
|
+
export { FieldSuggestionCardComponent };
|
|
352
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(FieldSuggestionCardComponent, [{
|
|
353
|
+
type: Component,
|
|
354
|
+
args: [{ standalone: false, selector: 'mj-field-suggestion-card', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "@if (Suggestion) {\n <div\n class=\"mj-field-suggestion-card\"\n [class.mj-field-suggestion-card--pending]=\"IsPending\"\n [class.mj-field-suggestion-card--accepted]=\"Outcome === 'Accepted'\"\n [class.mj-field-suggestion-card--rejected]=\"Outcome === 'Rejected'\"\n [class.mj-field-suggestion-card--superseded]=\"Outcome === 'Superseded'\">\n <div class=\"mj-field-suggestion-card__meta-row\">\n <div class=\"mj-field-suggestion-card__provenance\">\n <span class=\"mj-field-suggestion-card__kind-chip\">\n <i class=\"fa-solid fa-wand-magic-sparkles\" aria-hidden=\"true\"></i>\n <span>Suggested value</span>\n </span>\n <span class=\"mj-field-suggestion-card__source-chip\" [title]=\"'Suggested by ' + SourceLabel\">\n <i [class]=\"SourceIcon\" aria-hidden=\"true\"></i>\n <span>{{ SourceLabel }}</span>\n @if (FormattedConfidence) {\n <span class=\"mj-field-suggestion-card__confidence\">{{ FormattedConfidence }}</span>\n }\n </span>\n </div>\n\n <span\n class=\"mj-field-suggestion-card__outcome-pill\"\n [class]=\"'mj-field-suggestion-card__outcome-pill mj-field-suggestion-card__outcome-pill--' + OutcomeBadgeModifier\">\n {{ OutcomeBadgeLabel }}\n </span>\n </div>\n\n <div class=\"mj-field-suggestion-card__diff\" role=\"group\" aria-label=\"Proposed field change\">\n <div class=\"mj-field-suggestion-card__value-box mj-field-suggestion-card__value-box--current\">\n <span class=\"mj-field-suggestion-card__value-label\">Current</span>\n <code class=\"mj-field-suggestion-card__value-code\">{{ CurrentValueDisplay }}</code>\n </div>\n\n <div class=\"mj-field-suggestion-card__arrow\" aria-hidden=\"true\">\n <i class=\"fa-solid fa-arrow-right\"></i>\n </div>\n\n <div\n class=\"mj-field-suggestion-card__value-box mj-field-suggestion-card__value-box--ghost\"\n [class.mj-field-suggestion-card__value-box--clearing]=\"IsClearingSuggestion\">\n <span class=\"mj-field-suggestion-card__value-label\">Proposed</span>\n <code class=\"mj-field-suggestion-card__value-code mj-field-suggestion-card__value-code--ghost\">\n {{ SuggestedValueDisplay }}\n </code>\n </div>\n </div>\n\n @if (IsPending) {\n <div class=\"mj-field-suggestion-card__actions\">\n <button\n type=\"button\"\n mjButton\n variant=\"primary\"\n size=\"sm\"\n class=\"mj-field-suggestion-card__btn--accept\"\n [disabled]=\"!CanUserActOnSuggestion || ActiveAction !== null\"\n [title]=\"ActionDisabledReason || 'Apply suggested value to this field'\"\n (click)=\"OnAccept()\">\n @if (ActiveAction === 'accept') {\n <mj-loading [showText]=\"false\" size=\"small\"></mj-loading>\n <span>Applying...</span>\n } @else {\n <i class=\"fa-solid fa-check\" aria-hidden=\"true\"></i>\n <span>Accept</span>\n }\n </button>\n\n <button\n type=\"button\"\n mjButton\n variant=\"outline\"\n size=\"sm\"\n class=\"mj-field-suggestion-card__btn--reject\"\n [disabled]=\"!CanUserActOnSuggestion || ActiveAction !== null\"\n [title]=\"ActionDisabledReason || 'Dismiss this field suggestion'\"\n (click)=\"OnReject()\">\n @if (ActiveAction === 'reject') {\n <mj-loading [showText]=\"false\" size=\"small\"></mj-loading>\n <span>Rejecting...</span>\n } @else {\n <i class=\"fa-solid fa-xmark\" aria-hidden=\"true\"></i>\n <span>Reject</span>\n }\n </button>\n\n @if (CanUserDiscuss) {\n <button\n type=\"button\"\n mjButton\n variant=\"flat\"\n size=\"sm\"\n class=\"mj-field-suggestion-card__btn--discuss\"\n [disabled]=\"ActiveAction !== null\"\n title=\"Reply in this suggestion's conversation thread\"\n (click)=\"OnDiscuss()\">\n <i class=\"fa-regular fa-comment-dots\" aria-hidden=\"true\"></i>\n <span>Discuss</span>\n </button>\n }\n </div>\n }\n </div>\n}\n", styles: ["/* ============================================================================\n FIELD SUGGESTION CARD (EntitySubtypeUIDriverBase: FieldSuggestionCardComponent)\n Uses global --mj-* design tokens exclusively.\n ============================================================================ */\n\n.mj-field-suggestion-card {\n display: flex;\n flex-direction: column;\n gap: 8px;\n padding: 10px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-sunken);\n border: 1px dashed color-mix(in srgb, var(--mj-brand-primary) 42%, var(--mj-border-default));\n}\n\n.mj-field-suggestion-card--accepted {\n border-style: solid;\n border-color: color-mix(in srgb, var(--mj-status-success) 45%, var(--mj-border-subtle));\n background: color-mix(in srgb, var(--mj-status-success) 8%, var(--mj-bg-surface-sunken));\n}\n\n.mj-field-suggestion-card--rejected,\n.mj-field-suggestion-card--superseded {\n border-style: solid;\n border-color: var(--mj-border-subtle);\n opacity: 0.85;\n}\n\n.mj-field-suggestion-card__meta-row {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n gap: 6px;\n}\n\n.mj-field-suggestion-card__provenance {\n display: inline-flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n}\n\n.mj-field-suggestion-card__kind-chip {\n display: inline-flex;\n align-items: center;\n gap: 5px;\n font-size: 11px;\n font-weight: 700;\n color: var(--mj-brand-primary);\n}\n\n.mj-field-suggestion-card__source-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 1px 6px;\n border-radius: var(--mj-radius-full, 9999px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-secondary);\n font-size: 10px;\n font-weight: 600;\n}\n\n.mj-field-suggestion-card__confidence {\n padding-left: 4px;\n border-left: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-muted);\n font-variant-numeric: tabular-nums;\n}\n\n.mj-field-suggestion-card__outcome-pill {\n display: inline-flex;\n align-items: center;\n padding: 2px 7px;\n border-radius: var(--mj-radius-full, 9999px);\n font-size: 10px;\n font-weight: 700;\n letter-spacing: 0.02em;\n text-transform: uppercase;\n}\n\n.mj-field-suggestion-card__outcome-pill--pending {\n background: color-mix(in srgb, var(--mj-brand-primary) 14%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n}\n\n.mj-field-suggestion-card__outcome-pill--accepted {\n background: color-mix(in srgb, var(--mj-status-success) 16%, var(--mj-bg-surface));\n color: var(--mj-status-success);\n}\n\n.mj-field-suggestion-card__outcome-pill--rejected {\n background: var(--mj-status-error-bg);\n color: var(--mj-status-error);\n}\n\n.mj-field-suggestion-card__outcome-pill--superseded {\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__diff {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);\n align-items: stretch;\n gap: 8px;\n}\n\n.mj-field-suggestion-card__value-box {\n display: flex;\n flex-direction: column;\n gap: 3px;\n padding: 6px 8px;\n border-radius: var(--mj-radius-sm, 6px);\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-subtle);\n min-width: 0;\n}\n\n.mj-field-suggestion-card__value-box--ghost {\n border-style: dashed;\n border-color: color-mix(in srgb, var(--mj-brand-primary) 50%, var(--mj-border-default));\n background: color-mix(in srgb, var(--mj-brand-primary) 7%, var(--mj-bg-surface-card));\n}\n\n.mj-field-suggestion-card--accepted .mj-field-suggestion-card__value-box--ghost {\n border-style: solid;\n border-color: color-mix(in srgb, var(--mj-status-success) 45%, var(--mj-border-subtle));\n background: var(--mj-bg-surface-card);\n}\n\n.mj-field-suggestion-card--rejected .mj-field-suggestion-card__value-box--ghost .mj-field-suggestion-card__value-code--ghost,\n.mj-field-suggestion-card--superseded .mj-field-suggestion-card__value-box--ghost .mj-field-suggestion-card__value-code--ghost {\n text-decoration: line-through;\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__value-label {\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.03em;\n color: var(--mj-text-muted);\n}\n\n.mj-field-suggestion-card__value-code {\n font-family: var(--mj-font-mono, monospace);\n font-size: 12px;\n color: var(--mj-text-secondary);\n word-break: break-word;\n white-space: pre-wrap;\n}\n\n.mj-field-suggestion-card__value-code--ghost {\n color: var(--mj-text-primary);\n font-weight: 600;\n}\n\n.mj-field-suggestion-card__value-box--clearing .mj-field-suggestion-card__value-code--ghost {\n font-style: italic;\n color: var(--mj-text-secondary);\n}\n\n.mj-field-suggestion-card__arrow {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n color: var(--mj-text-muted);\n font-size: 11px;\n}\n\n.mj-field-suggestion-card__actions {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n gap: 6px;\n padding-top: 2px;\n}\n\n.mj-field-suggestion-card__btn--discuss {\n margin-left: auto;\n}\n"] }]
|
|
355
|
+
}], null, null); })();
|
|
356
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(FieldSuggestionCardComponent, { className: "FieldSuggestionCardComponent", filePath: "src/lib/comments/field-suggestion-card.component.ts", lineNumber: 34 }); })();
|
|
357
|
+
//# sourceMappingURL=field-suggestion-card.component.js.map
|