project-booster-vue 9.42.3 → 9.42.5
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/package.json
CHANGED
|
@@ -111,7 +111,7 @@ export default defineComponent({
|
|
|
111
111
|
created() {
|
|
112
112
|
this.$store.dispatch('products/loadProduct', {
|
|
113
113
|
payload: this.payload.viewModel.defaultProduct,
|
|
114
|
-
|
|
114
|
+
storeId: this.metadata.storeId || '',
|
|
115
115
|
});
|
|
116
116
|
},
|
|
117
117
|
methods: {
|
|
@@ -50,13 +50,7 @@
|
|
|
50
50
|
:label="button.label"
|
|
51
51
|
@click="callAction(button.action)"
|
|
52
52
|
:theme="button.bordered ? 'bordered' : 'solid'"
|
|
53
|
-
v-if="
|
|
54
|
-
/>
|
|
55
|
-
<m-button
|
|
56
|
-
:label="button.label"
|
|
57
|
-
@click="callAction(button.action)"
|
|
58
|
-
:theme="button.bordered ? 'bordered' : 'solid'"
|
|
59
|
-
v-if="checkConditional(button.conditions) && button.conditions"
|
|
53
|
+
v-if="areConditionsValid(button.conditions)"
|
|
60
54
|
/>
|
|
61
55
|
</div>
|
|
62
56
|
<div class="pb-restitution-list__footer__save">
|
|
@@ -145,7 +139,7 @@ import MLink from '../mozaic/link/MLink.vue';
|
|
|
145
139
|
import PbProjectItemSave from '../projects/project-item-save/PbProjectItemSave.vue';
|
|
146
140
|
import MNotification from '../mozaic/notifications/MNotification.vue';
|
|
147
141
|
import { NotificationOptions } from '@/types/pb/Notification';
|
|
148
|
-
import { RestitutionPayload, RestitutionPayloadAction } from '@/types/pb/Restitution';
|
|
142
|
+
import { RestitutionPayload, RestitutionPayloadAction, RestitutionPayloadCallToAction } from '@/types/pb/Restitution';
|
|
149
143
|
import { ScenarioStepAnswer } from '@/types/pb/Scenario';
|
|
150
144
|
import PbRestitutionListBlock from './PbRestitutionListBlock.vue';
|
|
151
145
|
import { Project } from '../../types/pb/Project';
|
|
@@ -169,6 +163,7 @@ export default defineComponent({
|
|
|
169
163
|
dialogContent: null,
|
|
170
164
|
showSaveProjectItem: false,
|
|
171
165
|
notifications: [] as NotificationOptions[],
|
|
166
|
+
displayedCta: [] as RestitutionPayloadCallToAction[],
|
|
172
167
|
};
|
|
173
168
|
},
|
|
174
169
|
// eslint-disable-next-line vue/order-in-components
|
|
@@ -220,22 +215,10 @@ export default defineComponent({
|
|
|
220
215
|
},
|
|
221
216
|
created() {
|
|
222
217
|
if (this.payload?.callToActions) {
|
|
223
|
-
|
|
224
|
-
const saveAction = Object.values(this.payload.callToActions).find((cta) => {
|
|
225
|
-
return (
|
|
226
|
-
areConditionsValid(cta.conditions!, this.answers, this.runtimeOptions) &&
|
|
227
|
-
cta.action?.type === 'MODAL' &&
|
|
228
|
-
cta.action?.component === 'PbProjectItemSave'
|
|
229
|
-
);
|
|
230
|
-
});
|
|
231
|
-
this.showSaveProjectItem = this.showSaveEstimate;
|
|
232
|
-
}
|
|
218
|
+
this.showSaveProjectItem = this.showSaveEstimate;
|
|
233
219
|
}
|
|
234
220
|
},
|
|
235
221
|
methods: {
|
|
236
|
-
checkConditional(cta: any) {
|
|
237
|
-
return areConditionsValid(cta, this.answers, this.runtimeOptions);
|
|
238
|
-
},
|
|
239
222
|
handleShowDialog(content: any) {
|
|
240
223
|
this.dialogContent = content;
|
|
241
224
|
this.showDialog = !this.showDialog;
|
|
@@ -264,7 +247,7 @@ export default defineComponent({
|
|
|
264
247
|
handleDialogClose() {
|
|
265
248
|
this.showSaveProjectItem = false;
|
|
266
249
|
},
|
|
267
|
-
callAction(action:
|
|
250
|
+
callAction(action: any) {
|
|
268
251
|
if (action.type === 'MODAL') {
|
|
269
252
|
if (action.component === 'PbProjectItemSave') {
|
|
270
253
|
if (this.runtimeOptions.isLoggedIn === true) {
|
|
@@ -275,19 +258,17 @@ export default defineComponent({
|
|
|
275
258
|
answers: [],
|
|
276
259
|
action: action,
|
|
277
260
|
});
|
|
278
|
-
} else
|
|
279
|
-
this.$emit('
|
|
261
|
+
} else {
|
|
262
|
+
this.$emit('step-completed', {
|
|
280
263
|
answers: [],
|
|
281
|
-
|
|
264
|
+
nextStep: action,
|
|
282
265
|
});
|
|
283
266
|
}
|
|
284
|
-
} else {
|
|
285
|
-
this.$emit('step-completed', {
|
|
286
|
-
answers: [],
|
|
287
|
-
nextStep: action,
|
|
288
|
-
});
|
|
289
267
|
}
|
|
290
268
|
},
|
|
269
|
+
areConditionsValid(conditions: string[]) {
|
|
270
|
+
return areConditionsValid(conditions, this.answers, this.runtimeOptions);
|
|
271
|
+
},
|
|
291
272
|
},
|
|
292
273
|
});
|
|
293
274
|
</script>
|
package/src/types/pb/Scenario.ts
CHANGED
|
@@ -118,8 +118,8 @@ export interface ScenarioStepPayload {
|
|
|
118
118
|
skippable?: ScenarioStepSkippableOptions[];
|
|
119
119
|
multiSelect?: ScenarioStepMultiSelectOptions;
|
|
120
120
|
defaultDecoratorValue?: string;
|
|
121
|
-
code
|
|
122
|
-
helpArea
|
|
121
|
+
code?: string;
|
|
122
|
+
helpArea?: {
|
|
123
123
|
label: string;
|
|
124
124
|
type: string;
|
|
125
125
|
action: string;
|
|
@@ -137,7 +137,7 @@ export interface ScenarioStepViewModel {
|
|
|
137
137
|
forceBackButton?: string;
|
|
138
138
|
forceOneCardPerLineOnMobile?: boolean;
|
|
139
139
|
alwaysDisplaySkippable?: boolean;
|
|
140
|
-
decoratorStripe
|
|
140
|
+
decoratorStripe?: {
|
|
141
141
|
length: string;
|
|
142
142
|
};
|
|
143
143
|
video?: {
|
|
@@ -153,7 +153,7 @@ export interface ScenarioStepViewModel {
|
|
|
153
153
|
};
|
|
154
154
|
sortBy?: ScenarioStepAnswerSortOptions;
|
|
155
155
|
showMore?: ScenarioStepShowMoreOptions;
|
|
156
|
-
footer
|
|
156
|
+
footer?: ScenarioStepFooterOptions;
|
|
157
157
|
widthFromM?: string;
|
|
158
158
|
widthFromL?: string;
|
|
159
159
|
}
|