@umbraco-engage/backoffice 17.0.0-rc3 → 17.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ab-testing/test/workspace/views/edit/ab-testing-test-editor.element.js +30 -6
- package/dist/ab-testing/test/workspace/views/scoring/ab-testing-test-scoring.element.js +5 -5
- package/dist/analytics/analytics-context.js +4 -0
- package/dist/analytics/components/heatmap/heatmap.element.d.ts +0 -2
- package/dist/analytics/components/heatmap/heatmap.element.js +24 -29
- package/dist/analytics/screens/heatmap-screen.element.js +23 -3
- package/dist/core/components/group-box/group-box.element.js +12 -5
- package/dist/core/components/scoring/entities.d.ts +4 -0
- package/dist/core/components/scoring/scoring-base.element.d.ts +3 -2
- package/dist/core/components/scoring/scoring-base.element.js +147 -25
- package/dist/core/components/tooltip/tooltip-element.js +2 -2
- package/dist/core/context/entities.d.ts +1 -0
- package/dist/core/context/workspace-context-base.js +8 -4
- package/dist/core/entities.d.ts +1 -0
- package/dist/core/lang/{en-us.js → en.js} +5 -1
- package/dist/core/lang/manifests.js +1 -1
- package/dist/core/property/property-dataset-renderer.controller.d.ts +4 -0
- package/dist/core/property/property-dataset-renderer.controller.js +9 -0
- package/dist/generated/client.gen.js +1 -4
- package/dist/generated/sdk.gen.js +134 -804
- package/dist/generated/types.gen.d.ts +24 -6
- package/dist/index.js +4 -4
- package/dist/personalization/components/grouped-item/grouped-item-list-editor-base.element.js +1 -1
- package/dist/personalization/content-scoring/workspace/content-scoring-workspace-editor.element.d.ts +2 -2
- package/dist/personalization/content-scoring/workspace/content-scoring-workspace-editor.element.js +56 -130
- package/dist/personalization/content-scoring/workspace/content-scoring-workspace.context.d.ts +5 -5
- package/dist/personalization/content-scoring/workspace/content-scoring-workspace.context.js +25 -34
- package/dist/personalization/personalized-variants/editor-view/personalized-variants-editor-view.element.js +2 -2
- package/dist/personalization/personalized-variants/workspace/personalized-variant-workspace.context.js +3 -7
- package/dist/personalization/personas/repository/detail/persona-group-detail-server.data-source.js +0 -2
- package/dist/profiles/insights/campaigns/campaigns-list.element.d.ts +1 -0
- package/dist/profiles/insights/campaigns/campaigns-list.element.js +9 -1
- package/dist/profiles/insights/customer-journeys/customer-journeys.element.js +3 -2
- package/dist/profiles/insights/engage-profile-insight.interface.js +7 -1
- package/dist/profiles/insights/goals/goals-table-collection-view.element.js +1 -1
- package/dist/profiles/insights/manifests.js +2 -0
- package/dist/profiles/insights/persona-groups/persona-groups.element.js +3 -2
- package/dist/reporting/components/reporting-chart-card/reporting-chart-card.element.d.ts +1 -0
- package/dist/reporting/components/reporting-chart-card/reporting-chart-card.element.js +5 -1
- package/dist/reporting/components/segment-selector/reporting-segment-selector.element.js +10 -20
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/umbraco-package.json +1 -1
- package/package.json +2 -2
- /package/dist/core/lang/{en-us.d.ts → en.d.ts} +0 -0
|
@@ -335,7 +335,7 @@ export type AnnotationModel = {
|
|
|
335
335
|
createdByUsername: string;
|
|
336
336
|
visibility: AnnotationVisibilityModel;
|
|
337
337
|
invalid: boolean;
|
|
338
|
-
pageVariants
|
|
338
|
+
pageVariants: Array<AnnotationPageVariantModel>;
|
|
339
339
|
};
|
|
340
340
|
export type AnnotationPageVariantModel = {
|
|
341
341
|
unique: string;
|
|
@@ -810,6 +810,18 @@ export type NumberOfSessionsRuleConfigModel = {
|
|
|
810
810
|
sessions: number;
|
|
811
811
|
};
|
|
812
812
|
export type OperatorModel = 'eq' | 'gt' | 'lt';
|
|
813
|
+
export type OrderCompletedRangeTypeModel = 'Any' | 'Days';
|
|
814
|
+
export type OrderCompletedRuleConfigModel = {
|
|
815
|
+
hasCompletedOrder: boolean;
|
|
816
|
+
settings?: OrderCompletedRuleSettingsModel | null;
|
|
817
|
+
};
|
|
818
|
+
export type OrderCompletedRuleSettingsModel = {
|
|
819
|
+
range?: OrderCompletedRuleSettingsRangeModel | null;
|
|
820
|
+
};
|
|
821
|
+
export type OrderCompletedRuleSettingsRangeModel = {
|
|
822
|
+
type: OrderCompletedRangeTypeModel;
|
|
823
|
+
maximum: number;
|
|
824
|
+
};
|
|
813
825
|
export type PackageStatusResultModel = {
|
|
814
826
|
readonly tierName: string;
|
|
815
827
|
readonly domains: Array<string>;
|
|
@@ -910,6 +922,9 @@ export type PreviewUrlResponseModel = {
|
|
|
910
922
|
errorMessage?: string | null;
|
|
911
923
|
previewUrl?: string | null;
|
|
912
924
|
};
|
|
925
|
+
export type ProductsInCartRuleConfigModel = {
|
|
926
|
+
hasProductsInCart: boolean;
|
|
927
|
+
};
|
|
913
928
|
export type ProfileCustomerJourneyStepScoreDtoModel = {
|
|
914
929
|
customerJourneyStepId: number;
|
|
915
930
|
score: number;
|
|
@@ -1249,6 +1264,11 @@ export type TimeOfDayRangeModel = {
|
|
|
1249
1264
|
export type TimeOfDaySegmentRuleConfigModel = {
|
|
1250
1265
|
TimeRanges: Array<TimeOfDayRangeModel>;
|
|
1251
1266
|
};
|
|
1267
|
+
export type UmbracoFormsGoalTypeModel = {
|
|
1268
|
+
readonly configurationEditorAlias: string;
|
|
1269
|
+
readonly id: string;
|
|
1270
|
+
readonly name: string;
|
|
1271
|
+
};
|
|
1252
1272
|
export type UmbracoPageInfoDtoModel = {
|
|
1253
1273
|
status?: string | null;
|
|
1254
1274
|
documentType?: string | null;
|
|
@@ -1314,7 +1334,7 @@ export type AbTestDetailModelWritable = {
|
|
|
1314
1334
|
};
|
|
1315
1335
|
export type AbTestDetailVariantInfoModelWritable = {
|
|
1316
1336
|
id: number;
|
|
1317
|
-
|
|
1337
|
+
unique: string;
|
|
1318
1338
|
abTestId: number;
|
|
1319
1339
|
name?: string | null;
|
|
1320
1340
|
description?: string | null;
|
|
@@ -1776,9 +1796,7 @@ export type GetAbTestResponse = GetAbTestResponses[keyof GetAbTestResponses];
|
|
|
1776
1796
|
export type PostAbTestData = {
|
|
1777
1797
|
body?: AbTestDetailModelWritable;
|
|
1778
1798
|
path?: never;
|
|
1779
|
-
query?:
|
|
1780
|
-
validate?: boolean;
|
|
1781
|
-
};
|
|
1799
|
+
query?: never;
|
|
1782
1800
|
url: '/umbraco/engage/management/api/v1/ab-test';
|
|
1783
1801
|
};
|
|
1784
1802
|
export type PostAbTestErrors = {
|
|
@@ -2951,7 +2969,7 @@ export type GetGoalAllTypesResponses = {
|
|
|
2951
2969
|
/**
|
|
2952
2970
|
* OK
|
|
2953
2971
|
*/
|
|
2954
|
-
200: Array<CustomGoalTypeModel | PageEventGoalTypeModel | PageviewGoalTypeModel>;
|
|
2972
|
+
200: Array<CustomGoalTypeModel | PageEventGoalTypeModel | PageviewGoalTypeModel | UmbracoFormsGoalTypeModel>;
|
|
2955
2973
|
};
|
|
2956
2974
|
export type GetGoalAllTypesResponse = GetGoalAllTypesResponses[keyof GetGoalAllTypesResponses];
|
|
2957
2975
|
export type GetGoalDetailsData = {
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,11 @@ export const onInit = (host, extensionRegistry) => {
|
|
|
19
19
|
host.consumeContext(UMB_AUTH_CONTEXT, async (auth) => {
|
|
20
20
|
if (!auth)
|
|
21
21
|
return;
|
|
22
|
-
const config = auth
|
|
22
|
+
const config = auth?.getOpenApiConfiguration();
|
|
23
23
|
client.setConfig({
|
|
24
|
-
baseUrl: config
|
|
25
|
-
auth:
|
|
26
|
-
credentials: config
|
|
24
|
+
baseUrl: config?.base ?? "",
|
|
25
|
+
auth: config?.token ?? undefined,
|
|
26
|
+
credentials: config?.credentials ?? "same-origin",
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
29
|
};
|
package/dist/personalization/components/grouped-item/grouped-item-list-editor-base.element.js
CHANGED
|
@@ -85,7 +85,7 @@ export class UeGroupedItemListEditorBaseElement extends UmbLitElement {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
#items > ue-group-box:not(:first-of-type) {
|
|
88
|
-
margin-top: var(--uui-size-
|
|
88
|
+
margin-top: var(--uui-size-space-5);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
:host([sortable]) #items > ue-group-box {
|
package/dist/personalization/content-scoring/workspace/content-scoring-workspace-editor.element.d.ts
CHANGED
|
@@ -3,10 +3,10 @@ declare const elementName = "ue-content-scoring-workspace-editor";
|
|
|
3
3
|
export declare class UeContentScoringWorkspaceEditorElement extends UmbLitElement {
|
|
4
4
|
#private;
|
|
5
5
|
protected readonly defaultUpperScoreLimit = 10;
|
|
6
|
-
private _personas?;
|
|
7
|
-
private _journeys?;
|
|
8
6
|
private _data?;
|
|
9
7
|
private _buttonState;
|
|
8
|
+
private _journeys?;
|
|
9
|
+
private _personas?;
|
|
10
10
|
constructor();
|
|
11
11
|
render(): import("lit-html").TemplateResult<1> | undefined;
|
|
12
12
|
static styles: import("lit").CSSResult;
|
package/dist/personalization/content-scoring/workspace/content-scoring-workspace-editor.element.js
CHANGED
|
@@ -13,147 +13,91 @@ let UeContentScoringWorkspaceEditorElement = class UeContentScoringWorkspaceEdit
|
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
this.defaultUpperScoreLimit = 10;
|
|
16
|
-
this._buttonState = {
|
|
17
|
-
None: undefined,
|
|
18
|
-
Persona: undefined,
|
|
19
|
-
Journey: undefined,
|
|
20
|
-
};
|
|
21
16
|
this.consumeContext(ENGAGE_CONTENT_SCORING_WORKSPACE_CONTEXT, (context) => {
|
|
22
17
|
if (!context)
|
|
23
18
|
return;
|
|
24
19
|
this.#workspaceContext = context;
|
|
25
20
|
this.observe(this.#workspaceContext.data, (data) => {
|
|
26
|
-
if (data
|
|
21
|
+
if (!data)
|
|
27
22
|
return;
|
|
28
23
|
this._data = data;
|
|
29
24
|
});
|
|
30
|
-
this.observe(this.#workspaceContext.personas, (personas) => {
|
|
31
|
-
this._personas = personas;
|
|
32
|
-
});
|
|
33
25
|
this.observe(this.#workspaceContext.journeys, (journeys) => {
|
|
34
26
|
this._journeys = journeys;
|
|
35
27
|
});
|
|
28
|
+
this.observe(this.#workspaceContext.personas, (personas) => {
|
|
29
|
+
this._personas = personas;
|
|
30
|
+
});
|
|
36
31
|
});
|
|
37
32
|
}
|
|
33
|
+
#itemsOfType(type) {
|
|
34
|
+
return this._data?.items?.filter((x) => x.type === type) ?? [];
|
|
35
|
+
}
|
|
38
36
|
#renderJourneys() {
|
|
39
37
|
if (!this._journeys?.length)
|
|
40
38
|
return;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
const journeys = this.#itemsOfType("Journey");
|
|
40
|
+
return html `<uui-box
|
|
41
|
+
.headline=${this.localize.term("engage_availableCustomerJourneys")}
|
|
42
|
+
>
|
|
43
|
+
<ue-customer-journey-scoring
|
|
44
|
+
.config=${{ hideDivider: true }}
|
|
45
|
+
.value=${journeys.map((p) => ({
|
|
46
|
+
...p,
|
|
47
|
+
unique: p.unique,
|
|
48
|
+
})) ?? []}
|
|
49
|
+
@change=${(e) => this.#onChange(e, "Journey")}
|
|
50
|
+
></ue-customer-journey-scoring
|
|
51
|
+
></uui-box>`;
|
|
45
52
|
}
|
|
46
53
|
#renderPersonas() {
|
|
47
54
|
if (!this._personas?.length)
|
|
48
55
|
return;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
await this.#workspaceContext?.setItem(e.target.value, item);
|
|
56
|
+
const personas = this.#itemsOfType("Persona");
|
|
57
|
+
return html `<uui-box
|
|
58
|
+
.headline=${this.localize.term("engage_availablePersonaGroups")}
|
|
59
|
+
>
|
|
60
|
+
<ue-persona-group-scoring
|
|
61
|
+
.config=${{ hideDivider: true }}
|
|
62
|
+
.value=${personas.map((p) => ({
|
|
63
|
+
...p,
|
|
64
|
+
unique: p.id.toString(),
|
|
65
|
+
})) ?? []}
|
|
66
|
+
@change=${(e) => this.#onChange(e, "Persona")}
|
|
67
|
+
>
|
|
68
|
+
</ue-persona-group-scoring
|
|
69
|
+
></uui-box>`;
|
|
65
70
|
}
|
|
66
|
-
#
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
async #onSave(entityType) {
|
|
71
|
-
this._buttonState = { ...this._buttonState, [entityType]: "waiting" };
|
|
72
|
-
try {
|
|
73
|
-
await this.#workspaceContext?.requestSave();
|
|
74
|
-
this._buttonState = { ...this._buttonState, [entityType]: "success" };
|
|
75
|
-
}
|
|
76
|
-
catch {
|
|
77
|
-
this._buttonState = { ...this._buttonState, [entityType]: "failed" };
|
|
78
|
-
}
|
|
71
|
+
#onChange(e, type) {
|
|
72
|
+
const value = e.target.value;
|
|
73
|
+
this.#workspaceContext?.updateScores(value, type);
|
|
79
74
|
}
|
|
80
75
|
async #onSaveAll() {
|
|
81
|
-
|
|
82
|
-
this._buttonState = {
|
|
83
|
-
...this._buttonState,
|
|
84
|
-
None: "waiting",
|
|
85
|
-
Persona: "waiting",
|
|
86
|
-
Journey: "waiting",
|
|
87
|
-
};
|
|
76
|
+
this._buttonState = "waiting";
|
|
88
77
|
try {
|
|
89
78
|
await this.#workspaceContext?.requestSave();
|
|
90
|
-
this._buttonState =
|
|
91
|
-
...this._buttonState,
|
|
92
|
-
None: "success",
|
|
93
|
-
Persona: "success",
|
|
94
|
-
Journey: "success",
|
|
95
|
-
};
|
|
79
|
+
this._buttonState = "success";
|
|
96
80
|
}
|
|
97
81
|
catch {
|
|
98
|
-
this._buttonState =
|
|
99
|
-
...this._buttonState,
|
|
100
|
-
None: "failed",
|
|
101
|
-
Persona: "failed",
|
|
102
|
-
Journey: "failed",
|
|
103
|
-
};
|
|
82
|
+
this._buttonState = "failed";
|
|
104
83
|
}
|
|
105
84
|
}
|
|
106
|
-
#renderGroup(group) {
|
|
107
|
-
//Hide groups without items
|
|
108
|
-
if (!group.items?.length)
|
|
109
|
-
return;
|
|
110
|
-
return html `<uui-box .headline=${group.title ?? ""}>
|
|
111
|
-
${when(group.upperScoreLimit !== this.defaultUpperScoreLimit, () => html ` <div slot="header-actions">
|
|
112
|
-
${this.localize.term("engage_scoreFromTo", group.upperScoreLimit)}
|
|
113
|
-
</div>`)}
|
|
114
|
-
${group.items.map((item) => html `<ue-group-box
|
|
115
|
-
style=${`--engage-bar-color: ${item.color?.value}`}
|
|
116
|
-
.name=${item.title}
|
|
117
|
-
.description=${item.description}
|
|
118
|
-
.iconUrl=${item.iconUrl}
|
|
119
|
-
>
|
|
120
|
-
${group.upperScoreLimit && group.upperScoreLimit > 10
|
|
121
|
-
? html `<uui-input
|
|
122
|
-
type="number"
|
|
123
|
-
max=${group.upperScoreLimit}
|
|
124
|
-
min="0"
|
|
125
|
-
@change=${(e) => this.#onValueChange(e, item, group)}
|
|
126
|
-
.value=${this.#getValue(item).toString()}
|
|
127
|
-
></uui-input>`
|
|
128
|
-
: html `<umb-input-slider
|
|
129
|
-
.max=${group.upperScoreLimit ?? 10}
|
|
130
|
-
@change=${(e) => this.#onValueChange(e, item, group)}
|
|
131
|
-
.valueLow=${this.#getValue(item)}
|
|
132
|
-
></umb-input-slider>`}
|
|
133
|
-
</ue-group-box>`)}
|
|
134
|
-
</uui-box>`;
|
|
135
|
-
}
|
|
136
85
|
render() {
|
|
137
86
|
if (!this._data)
|
|
138
87
|
return;
|
|
139
|
-
const hasAnyGroups = (this._personas?.some((p) => p.items?.length > 0) ||
|
|
140
|
-
this._journeys?.some((j) => j.items?.length > 0));
|
|
141
88
|
return html `
|
|
142
|
-
${this.#renderPersonas()}
|
|
143
|
-
${this
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
</div>
|
|
155
|
-
`
|
|
156
|
-
: ""}
|
|
89
|
+
${this.#renderPersonas()} ${this.#renderJourneys()}
|
|
90
|
+
${when(this._data.items.length > 0, () => html `
|
|
91
|
+
<div class="workspace-footer">
|
|
92
|
+
<uui-button
|
|
93
|
+
look="primary"
|
|
94
|
+
color="positive"
|
|
95
|
+
@click=${this.#onSaveAll}
|
|
96
|
+
.state=${this._buttonState}
|
|
97
|
+
.label=${this.localize.term("engage_saveScoring")}
|
|
98
|
+
></uui-button>
|
|
99
|
+
</div>
|
|
100
|
+
`)}
|
|
157
101
|
`;
|
|
158
102
|
}
|
|
159
103
|
static { this.styles = css `
|
|
@@ -161,24 +105,6 @@ let UeContentScoringWorkspaceEditorElement = class UeContentScoringWorkspaceEdit
|
|
|
161
105
|
margin-top: var(--uui-size-layout-1);
|
|
162
106
|
}
|
|
163
107
|
|
|
164
|
-
ue-group-box + ue-group-box {
|
|
165
|
-
margin-top: var(--uui-size-5);
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
umb-input-slider {
|
|
169
|
-
width: 100%;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
ue-divider:first-child {
|
|
173
|
-
margin-top: 0;
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
.box-footer {
|
|
177
|
-
display: flex;
|
|
178
|
-
justify-content: flex-end;
|
|
179
|
-
margin-top: var(--uui-size-3);
|
|
180
|
-
}
|
|
181
|
-
|
|
182
108
|
.workspace-footer {
|
|
183
109
|
display: flex;
|
|
184
110
|
justify-content: flex-end;
|
|
@@ -188,16 +114,16 @@ let UeContentScoringWorkspaceEditorElement = class UeContentScoringWorkspaceEdit
|
|
|
188
114
|
};
|
|
189
115
|
__decorate([
|
|
190
116
|
state()
|
|
191
|
-
], UeContentScoringWorkspaceEditorElement.prototype, "
|
|
117
|
+
], UeContentScoringWorkspaceEditorElement.prototype, "_data", void 0);
|
|
192
118
|
__decorate([
|
|
193
119
|
state()
|
|
194
|
-
], UeContentScoringWorkspaceEditorElement.prototype, "
|
|
120
|
+
], UeContentScoringWorkspaceEditorElement.prototype, "_buttonState", void 0);
|
|
195
121
|
__decorate([
|
|
196
122
|
state()
|
|
197
|
-
], UeContentScoringWorkspaceEditorElement.prototype, "
|
|
123
|
+
], UeContentScoringWorkspaceEditorElement.prototype, "_journeys", void 0);
|
|
198
124
|
__decorate([
|
|
199
125
|
state()
|
|
200
|
-
], UeContentScoringWorkspaceEditorElement.prototype, "
|
|
126
|
+
], UeContentScoringWorkspaceEditorElement.prototype, "_personas", void 0);
|
|
201
127
|
UeContentScoringWorkspaceEditorElement = __decorate([
|
|
202
128
|
customElement(elementName)
|
|
203
129
|
], UeContentScoringWorkspaceEditorElement);
|
package/dist/personalization/content-scoring/workspace/content-scoring-workspace.context.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { type UeContentScoringDetailModel } from "../entities.js";
|
|
2
2
|
import type { UeContentScoringDetailRepository } from "../repository/detail/index.js";
|
|
3
|
-
import type { UePersonaGroupDetailModel, UeCustomerJourneyDetailModel, UeScoringGroupEntityItemUnionModel } from "../../entities.js";
|
|
4
3
|
import type { UmbControllerHost } from "@umbraco-cms/backoffice/controller-api";
|
|
5
|
-
import { UeWorkspaceContextBase } from "../../../core/index.js";
|
|
4
|
+
import { UeEntityScoreModel, UeWorkspaceContextBase } from "../../../core/index.js";
|
|
5
|
+
import { ContentScoringEntityTypeModel } from "../../../generated/index.js";
|
|
6
|
+
import { UePersonaGroupDetailModel, UeCustomerJourneyDetailModel } from "src/personalization/entities.js";
|
|
6
7
|
export declare class UeContentScoringWorkspaceContext extends UeWorkspaceContextBase<UeContentScoringDetailModel, UeContentScoringDetailRepository> {
|
|
7
8
|
#private;
|
|
8
9
|
readonly IS_CONTENT_SCORING_WORKSPACE_CONTEXT = true;
|
|
@@ -10,8 +11,7 @@ export declare class UeContentScoringWorkspaceContext extends UeWorkspaceContext
|
|
|
10
11
|
personas: import("rxjs").Observable<UePersonaGroupDetailModel[]>;
|
|
11
12
|
journeys: import("rxjs").Observable<UeCustomerJourneyDetailModel[]>;
|
|
12
13
|
constructor(host: UmbControllerHost, hostUnique: string);
|
|
13
|
-
hostConnected(): Promise<
|
|
14
|
-
|
|
14
|
+
hostConnected(): Promise<void>;
|
|
15
|
+
updateScores(value: UeEntityScoreModel[], typeMatch: ContentScoringEntityTypeModel): void;
|
|
15
16
|
requestSave(): Promise<void>;
|
|
16
|
-
destroy(): void;
|
|
17
17
|
}
|
|
@@ -2,9 +2,8 @@ import { ENGAGE_CONTENT_SCORE_ENTITY_TYPE, ENGAGE_CONTENT_SCORE_WORKSPACE_ALIAS,
|
|
|
2
2
|
import { ENGAGE_CONTENT_SCORING_DETAIL_REPOSITORY_ALIAS } from "../repository/detail/constants.js";
|
|
3
3
|
import { UmbId } from "@umbraco-cms/backoffice/id";
|
|
4
4
|
import { appendToFrozenArray, UmbArrayState, } from "@umbraco-cms/backoffice/observable-api";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { UeWorkspaceContextBase } from "../../../core/index.js";
|
|
5
|
+
import { UeWorkspaceContextBase, } from "../../../core/index.js";
|
|
6
|
+
import { UeCustomerJourneyDetailRepository, UePersonaGroupDetailRepository, } from "../../index.js";
|
|
8
7
|
export class UeContentScoringWorkspaceContext extends UeWorkspaceContextBase {
|
|
9
8
|
#personaRepository;
|
|
10
9
|
#journeyRepository;
|
|
@@ -21,12 +20,6 @@ export class UeContentScoringWorkspaceContext extends UeWorkspaceContextBase {
|
|
|
21
20
|
this.IS_CONTENT_SCORING_WORKSPACE_CONTEXT = true;
|
|
22
21
|
this.#personaRepository = new UePersonaGroupDetailRepository(this);
|
|
23
22
|
this.#journeyRepository = new UeCustomerJourneyDetailRepository(this);
|
|
24
|
-
this.items = this._data.createObservablePartOfCurrent((x) => x?.items);
|
|
25
|
-
this.#personas = new UmbArrayState([], (x) => x.unique);
|
|
26
|
-
this.personas = this.#personas.asObservable();
|
|
27
|
-
this.#journeys = new UmbArrayState([], (x) => x.unique);
|
|
28
|
-
this.journeys = this.#journeys.asObservable();
|
|
29
|
-
this.#hostUnique = hostUnique;
|
|
30
23
|
this.#init = Promise.all([
|
|
31
24
|
this.#personaRepository
|
|
32
25
|
.requestAll()
|
|
@@ -35,43 +28,41 @@ export class UeContentScoringWorkspaceContext extends UeWorkspaceContextBase {
|
|
|
35
28
|
.requestAll()
|
|
36
29
|
.then((resp) => this.#journeys.setValue(resp.data ?? [])),
|
|
37
30
|
]);
|
|
31
|
+
this.items = this._data.createObservablePartOfCurrent((x) => x?.items);
|
|
32
|
+
this.#personas = new UmbArrayState([], (x) => x.unique);
|
|
33
|
+
this.personas = this.#personas.asObservable();
|
|
34
|
+
this.#journeys = new UmbArrayState([], (x) => x.unique);
|
|
35
|
+
this.journeys = this.#journeys.asObservable();
|
|
36
|
+
this.#hostUnique = hostUnique;
|
|
38
37
|
}
|
|
39
38
|
async hostConnected() {
|
|
40
39
|
super.hostConnected();
|
|
41
40
|
await this.#init;
|
|
42
|
-
|
|
41
|
+
this.load(this.#hostUnique);
|
|
43
42
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
items: appendToFrozenArray(items, {
|
|
57
|
-
score: Number(value),
|
|
58
|
-
entityId: item.id,
|
|
59
|
-
entityUnique: item.unique,
|
|
43
|
+
updateScores(value, typeMatch) {
|
|
44
|
+
let items = this._data.getCurrent()?.items ?? [];
|
|
45
|
+
value.forEach((scoreModel) => {
|
|
46
|
+
const existing = items.find((x) => x.id === scoreModel.id && x.type === typeMatch);
|
|
47
|
+
if (existing) {
|
|
48
|
+
items = appendToFrozenArray(items, { ...existing, ...{ score: scoreModel.score } }, (x) => x.id === existing.id && x.type === typeMatch);
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
items = appendToFrozenArray(items, {
|
|
52
|
+
score: scoreModel.score,
|
|
53
|
+
entityId: scoreModel.entityId,
|
|
54
|
+
entityUnique: scoreModel.entityId.toString(),
|
|
60
55
|
documentUnique: this.#hostUnique,
|
|
61
56
|
type: typeMatch,
|
|
62
57
|
id: 0,
|
|
63
58
|
unique: UmbId.new(),
|
|
64
|
-
})
|
|
65
|
-
}
|
|
66
|
-
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
this._data.updateCurrent({ items });
|
|
67
63
|
}
|
|
68
64
|
async requestSave() {
|
|
69
65
|
this._data.updateCurrent({ unique: this.#hostUnique });
|
|
70
66
|
super.requestSave();
|
|
71
67
|
}
|
|
72
|
-
destroy() {
|
|
73
|
-
this.#personaRepository.destroy();
|
|
74
|
-
this.#journeyRepository.destroy();
|
|
75
|
-
super.destroy();
|
|
76
|
-
}
|
|
77
68
|
}
|
|
@@ -63,10 +63,10 @@ let UePersonalizedVariantsEditorViewElement = class UePersonalizedVariantsEditor
|
|
|
63
63
|
},
|
|
64
64
|
}))
|
|
65
65
|
.onReject(async () => {
|
|
66
|
-
|
|
66
|
+
this.#workspaceContext?.requestItems();
|
|
67
67
|
})
|
|
68
68
|
.onSubmit(async () => {
|
|
69
|
-
|
|
69
|
+
document.location.reload();
|
|
70
70
|
})
|
|
71
71
|
.observeRouteBuilder((routeBuilder) => {
|
|
72
72
|
this.#modalPath = routeBuilder({});
|
|
@@ -25,6 +25,7 @@ export class UePersonalizedVariantWorkspaceContext extends UeWorkspaceContextBas
|
|
|
25
25
|
edit: UePersonalizedVariantWorkspaceEditorElement,
|
|
26
26
|
create: UePersonalizedVariantWorkspaceEditorElement,
|
|
27
27
|
},
|
|
28
|
+
withRedirectOnCreate: false,
|
|
28
29
|
actions: [UeWorkspaceActions.SAVE, UeWorkspaceActions.SUBMIT],
|
|
29
30
|
});
|
|
30
31
|
this.IS_PERSONALIZED_VARIANT_WORKSPACE_CONTEXT = true;
|
|
@@ -99,9 +100,9 @@ export class UePersonalizedVariantWorkspaceContext extends UeWorkspaceContextBas
|
|
|
99
100
|
}
|
|
100
101
|
async requestSave() {
|
|
101
102
|
await super.requestSave();
|
|
102
|
-
await this.#afterUpdate(
|
|
103
|
+
await this.#afterUpdate();
|
|
103
104
|
}
|
|
104
|
-
async #afterUpdate(
|
|
105
|
+
async #afterUpdate() {
|
|
105
106
|
if (!this.documentWorkspace)
|
|
106
107
|
return;
|
|
107
108
|
const segmentAlias = this.getData()?.umbracoSegmentAlias;
|
|
@@ -119,11 +120,6 @@ export class UePersonalizedVariantWorkspaceContext extends UeWorkspaceContextBas
|
|
|
119
120
|
segment: segmentAlias,
|
|
120
121
|
},
|
|
121
122
|
}));
|
|
122
|
-
// TODO => this is unavoidable as we need to re-request segments, which
|
|
123
|
-
// only happens in the document workspace ctor.
|
|
124
|
-
if (skipReload)
|
|
125
|
-
return;
|
|
126
|
-
document.location.reload();
|
|
127
123
|
}
|
|
128
124
|
destroy() {
|
|
129
125
|
this.#segmentsRepository.destroy();
|
package/dist/personalization/personas/repository/detail/persona-group-detail-server.data-source.js
CHANGED
|
@@ -67,10 +67,8 @@ export class UePersonaGroupDetailServerDataSource {
|
|
|
67
67
|
return {
|
|
68
68
|
...data,
|
|
69
69
|
entityType: ENGAGE_PERSONA_GROUP_ENTITY_TYPE,
|
|
70
|
-
unique: data.id.toString(),
|
|
71
70
|
items: data.personas?.map((p) => ({
|
|
72
71
|
...p,
|
|
73
|
-
unique: p.id.toString(),
|
|
74
72
|
entityType: ENGAGE_PERSONA_ENTITY_TYPE,
|
|
75
73
|
color: { value: p.color, label: p.color },
|
|
76
74
|
})) ?? [],
|
|
@@ -32,6 +32,10 @@ let UeProfileDetailsCampaignsElement = class UeProfileDetailsCampaignsElement ex
|
|
|
32
32
|
},
|
|
33
33
|
];
|
|
34
34
|
this._tableItems = [];
|
|
35
|
+
this._tableConfig = {
|
|
36
|
+
allowSelection: false,
|
|
37
|
+
hideIcon: true,
|
|
38
|
+
};
|
|
35
39
|
}
|
|
36
40
|
async connectedCallback() {
|
|
37
41
|
super.connectedCallback();
|
|
@@ -80,10 +84,11 @@ let UeProfileDetailsCampaignsElement = class UeProfileDetailsCampaignsElement ex
|
|
|
80
84
|
#renderCampaignsTable() {
|
|
81
85
|
return when(this._tableItems.length, () => html `
|
|
82
86
|
<umb-table
|
|
87
|
+
.config=${this._tableConfig}
|
|
83
88
|
.columns=${this._tableColumns}
|
|
84
89
|
.items=${this._tableItems}
|
|
85
90
|
></umb-table>
|
|
86
|
-
`, () => html `<ue-empty-state>
|
|
91
|
+
`, () => html `<ue-empty-state style="padding: var(--uui-size-space-5);">
|
|
87
92
|
${this.localize.term("engage_profile_details_noCampaigns")}
|
|
88
93
|
</ue-empty-state>`);
|
|
89
94
|
}
|
|
@@ -97,6 +102,9 @@ __decorate([
|
|
|
97
102
|
__decorate([
|
|
98
103
|
state()
|
|
99
104
|
], UeProfileDetailsCampaignsElement.prototype, "_tableItems", void 0);
|
|
105
|
+
__decorate([
|
|
106
|
+
state()
|
|
107
|
+
], UeProfileDetailsCampaignsElement.prototype, "_tableConfig", void 0);
|
|
100
108
|
UeProfileDetailsCampaignsElement = __decorate([
|
|
101
109
|
customElement(elementName)
|
|
102
110
|
], UeProfileDetailsCampaignsElement);
|
|
@@ -30,13 +30,14 @@ let UeProfileDetailsCustomerJourneysElement = class UeProfileDetailsCustomerJour
|
|
|
30
30
|
#renderCustomerJourneyGroups() {
|
|
31
31
|
return html `
|
|
32
32
|
<ue-customer-journey-scoring
|
|
33
|
-
|
|
33
|
+
readonly
|
|
34
34
|
.config=${{ hideDivider: true }}
|
|
35
35
|
.value=${this.customerJourneyScore?.map((p) => ({
|
|
36
36
|
entityId: p.customerJourneyStepId,
|
|
37
37
|
score: p.score,
|
|
38
38
|
unique: "",
|
|
39
39
|
id: 0,
|
|
40
|
+
isActive: p.isActive,
|
|
40
41
|
})) ?? []}
|
|
41
42
|
>
|
|
42
43
|
</ue-customer-journey-scoring>
|
|
@@ -51,7 +52,7 @@ let UeProfileDetailsCustomerJourneysElement = class UeProfileDetailsCustomerJour
|
|
|
51
52
|
|
|
52
53
|
display: grid;
|
|
53
54
|
grid-template-columns: 1fr 1fr 1fr;
|
|
54
|
-
gap: var(--uui-size-space-
|
|
55
|
+
gap: var(--uui-size-space-6);
|
|
55
56
|
}
|
|
56
57
|
`; }
|
|
57
58
|
};
|
|
@@ -20,7 +20,13 @@ export class UeProfileInsightElement extends UmbLitElement {
|
|
|
20
20
|
return this._profileId;
|
|
21
21
|
}
|
|
22
22
|
render() {
|
|
23
|
-
return when(this.loading, () => html `<
|
|
23
|
+
return when(this.loading, () => html `<div
|
|
24
|
+
style=${this.manifest?.meta.noPadding
|
|
25
|
+
? "padding: var(--uui-size-space-5);"
|
|
26
|
+
: ""}
|
|
27
|
+
>
|
|
28
|
+
<uui-loader-bar></uui-loader-bar>
|
|
29
|
+
</div>`, () => this.renderInsight());
|
|
24
30
|
}
|
|
25
31
|
}
|
|
26
32
|
__decorate([
|
|
@@ -97,7 +97,7 @@ let UeProfileDetailGoalsTableElement = class UeProfileDetailGoalsTableElement ex
|
|
|
97
97
|
>
|
|
98
98
|
</umb-table>
|
|
99
99
|
`, () => html `
|
|
100
|
-
<ue-empty-state>
|
|
100
|
+
<ue-empty-state style="padding: var(--uui-size-space-5);">
|
|
101
101
|
${this.localize.term("engage_profile_details_noGoals")}
|
|
102
102
|
</ue-empty-state>
|
|
103
103
|
`);
|
|
@@ -3,10 +3,12 @@ const insights = [
|
|
|
3
3
|
{
|
|
4
4
|
name: "Goals",
|
|
5
5
|
js: () => import("./goals/goals-table-collection-view.element.js"),
|
|
6
|
+
noPadding: true,
|
|
6
7
|
},
|
|
7
8
|
{
|
|
8
9
|
name: "Campaigns",
|
|
9
10
|
js: () => import("./campaigns/campaigns-list.element.js"),
|
|
11
|
+
noPadding: true,
|
|
10
12
|
},
|
|
11
13
|
{
|
|
12
14
|
name: "Potential",
|