@yoobic/yobi 7.7.94 → 7.7.98
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/cjs/{index-541062cd.js → index-621e23cc.js} +11 -3
- package/dist/cjs/yoo-ag-grid_96.cjs.entry.js +1 -1
- package/dist/cjs/yoo-card-list-image_12.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-choice_4.cjs.entry.js +2 -3
- package/dist/cjs/yoo-form-creator-block-expandable.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-creator-block-simple_4.cjs.entry.js +2 -2
- package/dist/cjs/yoo-form-creator-card_2.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-creator-field-selector_8.cjs.entry.js +5 -4
- package/dist/cjs/yoo-form-creator-translate-dialog.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-creator.cjs.entry.js +18 -20
- package/dist/cjs/yoo-form-range.cjs.entry.js +1 -1
- package/dist/cjs/yoo-mission-detail.cjs.entry.js +8 -2
- package/dist/collection/components/app-operations/mission-detail/mission-detail.js +15 -0
- package/dist/collection/components/form/form-carousel/form-carousel.js +2 -2
- package/dist/collection/components/form/form-document-dialog/form-document-dialog.js +2 -2
- package/dist/collection/components/form/form-feedback/form-feedback.js +3 -2
- package/dist/collection/components/form/form-range/form-range.js +2 -2
- package/dist/collection/components/form-creator/form-creator/form-creator.js +9 -11
- package/dist/collection/components/form-creator/form-creator-page-card-list/form-creator-page-card-list.js +1 -1
- package/dist/collection/components/form-creator/helpers/index.js +11 -3
- package/dist/collection/components/form-creator/workflow/workflow.js +4 -3
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/design-system/{p-5a82b3da.entry.js → p-202031a2.entry.js} +1 -1
- package/dist/design-system/{p-5c6ef130.js → p-349cb8cd.js} +1 -1
- package/dist/design-system/{p-02385015.entry.js → p-3d5d0597.entry.js} +1 -1
- package/dist/design-system/{p-eb421ff4.entry.js → p-44b19de9.entry.js} +1 -1
- package/dist/design-system/{p-f2acba12.entry.js → p-4ef0efa6.entry.js} +2 -2
- package/dist/design-system/p-55d4560c.entry.js +1 -0
- package/dist/design-system/p-59f99c7c.entry.js +1 -0
- package/dist/design-system/p-6bc1375d.entry.js +1 -0
- package/dist/design-system/{p-1f8cfec7.entry.js → p-80aded97.entry.js} +1 -1
- package/dist/design-system/{p-332efa96.entry.js → p-9ed3a063.entry.js} +1 -1
- package/dist/design-system/p-a09b181a.entry.js +1 -0
- package/dist/design-system/p-c8e49847.entry.js +1 -0
- package/dist/esm/{index-70924cfc.js → index-350d88b9.js} +11 -3
- package/dist/esm/yoo-ag-grid_96.entry.js +2 -2
- package/dist/esm/yoo-card-list-image_12.entry.js +2 -2
- package/dist/esm/yoo-form-choice_4.entry.js +2 -3
- package/dist/esm/yoo-form-creator-block-expandable.entry.js +1 -1
- package/dist/esm/yoo-form-creator-block-simple_4.entry.js +2 -2
- package/dist/esm/yoo-form-creator-card_2.entry.js +1 -1
- package/dist/esm/yoo-form-creator-field-selector_8.entry.js +5 -4
- package/dist/esm/yoo-form-creator-translate-dialog.entry.js +1 -1
- package/dist/esm/yoo-form-creator.entry.js +10 -12
- package/dist/esm/yoo-form-range.entry.js +1 -1
- package/dist/esm/yoo-mission-detail.entry.js +8 -2
- package/dist/types/components/app-operations/mission-detail/mission-detail.d.ts +1 -0
- package/dist/types/components/form-creator/helpers/index.d.ts +4 -1
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/condition/condition.interface.d.ts +1 -1
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/form-field/form-field.interface.d.ts +1 -0
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/mission/mission.interface.d.ts +1 -1
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/workflow/workflow.interface.d.ts +1 -0
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/ui/app/app.interface.d.ts +1 -0
- package/package.json +1 -1
- package/dist/design-system/p-03dbb1fa.entry.js +0 -1
- package/dist/design-system/p-67582664.entry.js +0 -1
- package/dist/design-system/p-6e516cc5.entry.js +0 -1
- package/dist/design-system/p-c047c9ba.entry.js +0 -1
- package/dist/design-system/p-d5a28cee.entry.js +0 -1
|
@@ -899,6 +899,8 @@ function setChildFields(parentConditions, itemIndex) {
|
|
|
899
899
|
function addNewIdsToSlide(slide) {
|
|
900
900
|
var _a, _b;
|
|
901
901
|
const ids = [];
|
|
902
|
+
if (slide)
|
|
903
|
+
slide._id = index.getUUID();
|
|
902
904
|
(_a = slide === null || slide === void 0 ? void 0 : slide.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
903
905
|
const newId = index.getUUID();
|
|
904
906
|
ids.push({ oldId: item.name, newId });
|
|
@@ -1148,10 +1150,16 @@ function cleanCustomFormFieldSlides(selectedFields, translations) {
|
|
|
1148
1150
|
});
|
|
1149
1151
|
return { cleanedFields: selectedFields, removedConditionIds };
|
|
1150
1152
|
}
|
|
1151
|
-
function createNewIdsForCustomFields(customFields) {
|
|
1152
|
-
const cleanedFields = customFields.map((field) => {
|
|
1153
|
+
function createNewIdsForCustomFields(customFields, isCustomDataSet, fieldLocation) {
|
|
1154
|
+
const cleanedFields = customFields.map((field, fIndex) => {
|
|
1153
1155
|
const cleanedField = cloneDeep.cloneDeep(field);
|
|
1154
|
-
|
|
1156
|
+
if (isCustomDataSet) {
|
|
1157
|
+
cleanedField.name = formCreatorHelpers.getCustomName(cleanedField.title, fieldLocation.slideIndex, fieldLocation.itemIndex + fIndex);
|
|
1158
|
+
cleanedField.customName = index.getUUID();
|
|
1159
|
+
}
|
|
1160
|
+
else {
|
|
1161
|
+
cleanedField.name = index.getUUID();
|
|
1162
|
+
}
|
|
1155
1163
|
return cleanedField;
|
|
1156
1164
|
});
|
|
1157
1165
|
cleanedFields.forEach((cleanedFeild) => {
|
|
@@ -123457,7 +123457,7 @@ const YooFormDocumentDialogComponent = class {
|
|
|
123457
123457
|
icon: 'email',
|
|
123458
123458
|
iconColor: 'dark-to-light',
|
|
123459
123459
|
cssClass: rrule.isWeb(this.host) ? 'bg-royal-hover' : 'bg-royal light',
|
|
123460
|
-
isVisible: () => index$1.isDocumentEmailSupported(this.document),
|
|
123460
|
+
isVisible: () => index$1.isDocumentEmailSupported(this.document) && rrule.getPermissions().canShareByEmail,
|
|
123461
123461
|
handler: () => {
|
|
123462
123462
|
rrule.getAsyncExtraData({
|
|
123463
123463
|
type: 'email-dialog',
|
|
@@ -303,7 +303,7 @@ const YooFormCarouselComponent = class {
|
|
|
303
303
|
text: rrule.translate('EMAIL'),
|
|
304
304
|
icon: 'email',
|
|
305
305
|
color: 'dark',
|
|
306
|
-
isVisible: () => { var _a; return !!item && !((_a = rrule.getSession()) === null || _a === void 0 ? void 0 : _a.isExternal); },
|
|
306
|
+
isVisible: () => { var _a; return !!item && !((_a = rrule.getSession()) === null || _a === void 0 ? void 0 : _a.isExternal) && rrule.getPermissions().canShareByEmail; },
|
|
307
307
|
handler: () => {
|
|
308
308
|
const filename = (item === null || item === void 0 ? void 0 : item._filename) || new Date().getTime().toString();
|
|
309
309
|
rrule.getAsyncExtraData({
|
|
@@ -14,7 +14,7 @@ const shuffle = require('./shuffle-8d86ba89.js');
|
|
|
14
14
|
const findIndex = require('./findIndex-cb2c4f23.js');
|
|
15
15
|
const isString = require('./isString-ecd0cbf4.js');
|
|
16
16
|
const index$2 = require('./index-7d3c7ee7.js');
|
|
17
|
-
const index$1 = require('./index-
|
|
17
|
+
const index$1 = require('./index-621e23cc.js');
|
|
18
18
|
const boostHelpers = require('./boost-helpers-0fe0ab90.js');
|
|
19
19
|
const isNumber = require('./isNumber-4c1ace60.js');
|
|
20
20
|
require('./isUndefined-8f9cfd10.js');
|
|
@@ -763,8 +763,7 @@ const YooFormFeedbackComponent = class {
|
|
|
763
763
|
});
|
|
764
764
|
}
|
|
765
765
|
renderReadonly() {
|
|
766
|
-
return index.h("div", { class: "readonly" }, this.isConfidenceQuiz
|
|
767
|
-
: isNumber.isNumber(this.value) && this.emojis[this.value]);
|
|
766
|
+
return index.h("div", { class: "readonly" }, this.isConfidenceQuiz && this.renderFormChoice(), !this.isConfidenceQuiz && isNumber.isNumber(this.value) && this.emojis[this.value - 1]);
|
|
768
767
|
}
|
|
769
768
|
renderEditable() {
|
|
770
769
|
return ([
|
|
@@ -7,7 +7,7 @@ const inputBar_interface = require('./input-bar.interface-b96b7107.js');
|
|
|
7
7
|
const rrule = require('./rrule-f8e7fec2.js');
|
|
8
8
|
const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
|
|
9
9
|
const index$2 = require('./index-77d54324.js');
|
|
10
|
-
const index$1 = require('./index-
|
|
10
|
+
const index$1 = require('./index-621e23cc.js');
|
|
11
11
|
require('./isNumber-4c1ace60.js');
|
|
12
12
|
require('./isEqual-35c41499.js');
|
|
13
13
|
require('./_baseIsEqual-ea3c1968.js');
|
|
@@ -9,7 +9,7 @@ require('./ResizeObserver.es-2edf4ecd.js');
|
|
|
9
9
|
const commonHelpers = require('./common-helpers-797be2a6.js');
|
|
10
10
|
const index$1 = require('./index-f0c2575c.js');
|
|
11
11
|
const sortable_esm = require('./sortable.esm-71f9713d.js');
|
|
12
|
-
const index$2 = require('./index-
|
|
12
|
+
const index$2 = require('./index-621e23cc.js');
|
|
13
13
|
const entitiesHelpers$1 = require('./entities-helpers-e377d30b.js');
|
|
14
14
|
const entitiesHelpers = require('./entities-helpers-c6ed72dc.js');
|
|
15
15
|
require('./isUndefined-8f9cfd10.js');
|
|
@@ -252,7 +252,7 @@ const YooFormCreatorPageCardListComponent = class {
|
|
|
252
252
|
if (this.workflowVisibility) {
|
|
253
253
|
pageEntry.pageWorkflowState = this.workflowVisibility;
|
|
254
254
|
if ((_a = this.pagePermissions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
255
|
-
const pagePermission = this.pagePermissions.find((permission) => permission.name === slide.title);
|
|
255
|
+
const pagePermission = this.pagePermissions.find((permission) => permission.name === slide._id || permission.name === slide.title);
|
|
256
256
|
pageEntry.pageWorkflowState = index$2.getWorkflowFieldState(pagePermission, this.workflowVisibility);
|
|
257
257
|
}
|
|
258
258
|
}
|
|
@@ -6,7 +6,7 @@ const index = require('./index-fd52e687.js');
|
|
|
6
6
|
const rrule = require('./rrule-f8e7fec2.js');
|
|
7
7
|
require('./input-bar.interface-b96b7107.js');
|
|
8
8
|
const index$2 = require('./index-f0c2575c.js');
|
|
9
|
-
const index$1 = require('./index-
|
|
9
|
+
const index$1 = require('./index-621e23cc.js');
|
|
10
10
|
require('./index-e2b47ee9.js');
|
|
11
11
|
require('./document-b4cc3315.js');
|
|
12
12
|
require('./validate-f2c2f205.js');
|
|
@@ -13,7 +13,7 @@ const device_interface = require('./device.interface-44ea5b01.js');
|
|
|
13
13
|
const cardVideo_interface = require('./card-video.interface-284b7b92.js');
|
|
14
14
|
const sortable_esm = require('./sortable.esm-71f9713d.js');
|
|
15
15
|
const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
|
|
16
|
-
const index$2 = require('./index-
|
|
16
|
+
const index$2 = require('./index-621e23cc.js');
|
|
17
17
|
const isEqual = require('./isEqual-35c41499.js');
|
|
18
18
|
const remove = require('./remove-41707d5a.js');
|
|
19
19
|
const index$3 = require('./index-f0c2575c.js');
|
|
@@ -1242,7 +1242,7 @@ const YooWorkflowComponent = class {
|
|
|
1242
1242
|
onPageStateChange(ev) {
|
|
1243
1243
|
var _a, _b, _c, _d;
|
|
1244
1244
|
if (this.internalMissionDescription.slides[ev.detail.index]) {
|
|
1245
|
-
const pageName = this.internalMissionDescription.slides[ev.detail.index].title;
|
|
1245
|
+
const pageName = this.internalMissionDescription.slides[ev.detail.index]._id || this.internalMissionDescription.slides[ev.detail.index].title;
|
|
1246
1246
|
const fieldPermission = { name: pageName };
|
|
1247
1247
|
switch (ev.detail.newState.title) {
|
|
1248
1248
|
case 'EDITABLE':
|
|
@@ -1347,8 +1347,9 @@ const YooWorkflowComponent = class {
|
|
|
1347
1347
|
selected: this.isFieldsAccordionOpen
|
|
1348
1348
|
}
|
|
1349
1349
|
], iconPairLeft: index$1.ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (ev) => (this.isFieldsAccordionOpen = ev.detail.selected) }, index.h("div", { slot: "CONTENTS" }, (_e = (_d = (_c = this.internalMissionDescription) === null || _c === void 0 ? void 0 : _c.slides[this.currentPageSelected]) === null || _d === void 0 ? void 0 : _d.items) === null || _e === void 0 ? void 0 : _e.map((item) => {
|
|
1350
|
-
var _a, _b;
|
|
1351
|
-
const
|
|
1350
|
+
var _a, _b, _c, _d;
|
|
1351
|
+
const slideName = ((_a = this.internalMissionDescription) === null || _a === void 0 ? void 0 : _a.slides[this.currentPageSelected]._id) || ((_b = this.internalMissionDescription) === null || _b === void 0 ? void 0 : _b.slides[this.currentPageSelected].title);
|
|
1352
|
+
const pagePermission = (_d = (_c = this.currentWorkflowStep) === null || _c === void 0 ? void 0 : _c.pagesPermission) === null || _d === void 0 ? void 0 : _d.find((permission) => permission.name === slideName);
|
|
1352
1353
|
const pageState = index$2.getWorkflowFieldState(pagePermission, this.defaultFieldState);
|
|
1353
1354
|
return this.renderSimpleBlock(item, pageState);
|
|
1354
1355
|
}))));
|
|
@@ -7,7 +7,7 @@ const inputBar_interface = require('./input-bar.interface-b96b7107.js');
|
|
|
7
7
|
const rrule = require('./rrule-f8e7fec2.js');
|
|
8
8
|
const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
|
|
9
9
|
const stringHelpers = require('./string-helpers-4852718a.js');
|
|
10
|
-
const index$1 = require('./index-
|
|
10
|
+
const index$1 = require('./index-621e23cc.js');
|
|
11
11
|
const cloneDeep = require('./cloneDeep-e00dc6ae.js');
|
|
12
12
|
const isEmpty = require('./isEmpty-1723db8b.js');
|
|
13
13
|
const isString = require('./isString-ecd0cbf4.js');
|
|
@@ -6,13 +6,13 @@ const index = require('./index-fd52e687.js');
|
|
|
6
6
|
const inputBar_interface = require('./input-bar.interface-b96b7107.js');
|
|
7
7
|
const cardVideo_interface = require('./card-video.interface-284b7b92.js');
|
|
8
8
|
const rrule = require('./rrule-f8e7fec2.js');
|
|
9
|
-
const index$
|
|
9
|
+
const index$2 = require('./index-e2b47ee9.js');
|
|
10
10
|
const formCreatorHelpers = require('./form-creator-helpers-ed0a88b0.js');
|
|
11
11
|
require('./ResizeObserver.es-2edf4ecd.js');
|
|
12
12
|
const commonHelpers = require('./common-helpers-797be2a6.js');
|
|
13
13
|
const sortable_esm = require('./sortable.esm-71f9713d.js');
|
|
14
|
-
const index$
|
|
15
|
-
const index$1 = require('./index-
|
|
14
|
+
const index$3 = require('./index-77d54324.js');
|
|
15
|
+
const index$1 = require('./index-621e23cc.js');
|
|
16
16
|
const cloneDeep = require('./cloneDeep-e00dc6ae.js');
|
|
17
17
|
const orderBy = require('./orderBy-18003c1b.js');
|
|
18
18
|
require('./document-b4cc3315.js');
|
|
@@ -896,6 +896,7 @@ const YooFormCreatorComponent = class {
|
|
|
896
896
|
this.selectedPageIndex = index;
|
|
897
897
|
}
|
|
898
898
|
async addNewPage(newPage, index) {
|
|
899
|
+
newPage = Object.assign({ _id: index$2.getUUID() }, newPage);
|
|
899
900
|
this.currentSlides.splice(index, 0, newPage);
|
|
900
901
|
this.selectedPageIndex = index;
|
|
901
902
|
this.hasPageChanged = index;
|
|
@@ -1424,7 +1425,7 @@ const YooFormCreatorComponent = class {
|
|
|
1424
1425
|
condition = index$1.getDefaultCondition(type, this.currentSlides[slideIndex].items[itemIndex]);
|
|
1425
1426
|
}
|
|
1426
1427
|
if (type === 'field') {
|
|
1427
|
-
if (!index$
|
|
1428
|
+
if (!index$3.NON_CONDITION_CATEGORIES.includes(this.currentSlides[slideIndex].items[itemIndex].category)) {
|
|
1428
1429
|
const { slides, unattachedParentConditions } = index$1.addNewParentCondition(this.currentSlides, this.unattachedParentConditions, slideIndex, itemIndex, condition);
|
|
1429
1430
|
this.currentSlides = slides;
|
|
1430
1431
|
this.unattachedParentConditions = unattachedParentConditions;
|
|
@@ -1707,26 +1708,23 @@ const YooFormCreatorComponent = class {
|
|
|
1707
1708
|
}
|
|
1708
1709
|
}
|
|
1709
1710
|
onCustomFieldAdded(customFieldId, selectedCustomFormField, indexToAdd) {
|
|
1710
|
-
var _a, _b, _c, _d;
|
|
1711
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1711
1712
|
if (!this.currentSlides[this.selectedPageIndex]) {
|
|
1712
1713
|
return;
|
|
1713
1714
|
}
|
|
1715
|
+
indexToAdd = rrule.isNullOrUndefined(indexToAdd) ? (_b = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length : indexToAdd;
|
|
1714
1716
|
if (!selectedCustomFormField) {
|
|
1715
|
-
selectedCustomFormField = (
|
|
1717
|
+
selectedCustomFormField = (_c = this.customFormFields) === null || _c === void 0 ? void 0 : _c.find((customField) => customField._id === customFieldId);
|
|
1716
1718
|
}
|
|
1717
|
-
const newFields = index$1.createNewIdsForCustomFields(selectedCustomFormField.fields);
|
|
1719
|
+
const newFields = index$1.createNewIdsForCustomFields(selectedCustomFormField.fields, ((_d = this.missionDescription) === null || _d === void 0 ? void 0 : _d.type) === 'dataset', { slideIndex: this.selectedPageIndex, itemIndex: indexToAdd });
|
|
1718
1720
|
newFields === null || newFields === void 0 ? void 0 : newFields.forEach((field) => {
|
|
1719
|
-
var _a;
|
|
1721
|
+
var _a, _b;
|
|
1720
1722
|
field.slideIndex = this.selectedPageIndex;
|
|
1721
1723
|
field.slideTitle = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.title;
|
|
1724
|
+
field.slideId = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b._id;
|
|
1722
1725
|
});
|
|
1723
|
-
if (((
|
|
1724
|
-
|
|
1725
|
-
this.currentSlides[this.selectedPageIndex].items = [...(_d = this.currentSlides[this.selectedPageIndex]) === null || _d === void 0 ? void 0 : _d.items, ...newFields];
|
|
1726
|
-
}
|
|
1727
|
-
else {
|
|
1728
|
-
this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
|
|
1729
|
-
}
|
|
1726
|
+
if (((_f = (_e = this.currentSlides[this.selectedPageIndex]) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
1727
|
+
this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
|
|
1730
1728
|
}
|
|
1731
1729
|
else {
|
|
1732
1730
|
this.currentSlides[this.selectedPageIndex].items = newFields;
|
|
@@ -1778,7 +1776,7 @@ const YooFormCreatorComponent = class {
|
|
|
1778
1776
|
}
|
|
1779
1777
|
if (((_e = this.missionDescription) === null || _e === void 0 ? void 0 : _e.type) === 'dataset') {
|
|
1780
1778
|
newField.name = newField.title.split(' ').join('_').toLowerCase();
|
|
1781
|
-
newField.customName = index$
|
|
1779
|
+
newField.customName = index$2.getUUID();
|
|
1782
1780
|
if (!formCreatorHelpers.isFieldNameUnique(newField, this.currentSlides)) {
|
|
1783
1781
|
newField.name = formCreatorHelpers.getCustomName(newField.title, this.selectedPageIndex, indexToAdd);
|
|
1784
1782
|
}
|
|
@@ -1905,7 +1903,7 @@ const YooFormCreatorComponent = class {
|
|
|
1905
1903
|
{ title: 'ADDCONDITION', selected: true, subTitle: 'FIELDTOOLTIP', blurContent: !rrule.isNullOrUndefined(this.newRestrictionCondition) },
|
|
1906
1904
|
{ title: 'ADDRESTRICTION', selected: true, subTitle: 'RESTRICTIONTOOLTIP' }
|
|
1907
1905
|
];
|
|
1908
|
-
return (index.h("div", { class: "logic-container" }, index.h("yoo-ion-scroll", { forceOverscroll: false, onClick: (ev) => ev.stopPropagation() }, index.h("yoo-accordion", { maxTitleCharacters: 18, entries: entries, iconPairLeft: index$
|
|
1906
|
+
return (index.h("div", { class: "logic-container" }, index.h("yoo-ion-scroll", { forceOverscroll: false, onClick: (ev) => ev.stopPropagation() }, index.h("yoo-accordion", { maxTitleCharacters: 18, entries: entries, iconPairLeft: index$3.ARROW_PAIR, allowMultipleSelection: true }, inputBar_interface.CONDITION_TYPES.map((condition, conditionIndex) => (index.h("div", { slot: entries[conditionIndex].title }, index.h("div", { class: "condition-block-selection", ref: (el) => (this.newFieldContainerBlocks[conditionIndex] = el) }, condition === 'conditions' && this.renderNewConditionBlocks(condition), condition === 'restrictions' && this.renderRestrictionConditions(condition)))))))));
|
|
1909
1907
|
}
|
|
1910
1908
|
renderNewConditionBlocks(condition) {
|
|
1911
1909
|
return cardVideo_interface.conditionBlocksConfig.map((blockConfig) => {
|
|
@@ -1942,7 +1940,7 @@ const YooFormCreatorComponent = class {
|
|
|
1942
1940
|
icon: 'info',
|
|
1943
1941
|
category: inputBar_interface.FormFieldCategory.information
|
|
1944
1942
|
};
|
|
1945
|
-
return (index.h("yoo-accordion", { class: "sub-accordion", entries: entries, iconPairLeft: index$
|
|
1943
|
+
return (index.h("yoo-accordion", { class: "sub-accordion", entries: entries, iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, index.h("div", { slot: "TRANSLATE" }, index.h("yoo-form-creator-block-expandable", { mode: "new", formField: formField, options: this.options }))));
|
|
1946
1944
|
}
|
|
1947
1945
|
renderTranslateContent() {
|
|
1948
1946
|
var _a;
|
|
@@ -2127,7 +2125,7 @@ const YooFormCreatorComponent = class {
|
|
|
2127
2125
|
selected: this.isPagesAccordionOpen,
|
|
2128
2126
|
actionButtons
|
|
2129
2127
|
}
|
|
2130
|
-
], iconPairLeft: index$
|
|
2128
|
+
], iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (event) => this.onPagesAccordionSelected(event) }, index.h("div", { slot: "PAGES" }, index.h("yoo-form-creator-page-card-list", { ref: (el) => (this.pageCardList = el), scoringMode: index$1.isScoring(this.selectedLeftMenuOption) ? this.selectedScoring : null, missionSlides: this.currentSlides, selectedPageIndex: this.selectedPageIndex, onPageClicked: this.onPageClicked, onDuplicatePageClicked: this.onDuplicatePageClicked, onInsertPageAfterClicked: this.onInsertPageAfterClicked, onDeletePageClicked: this.onDeletePageClicked, onEditPageClicked: this.onEditPageClicked, onAddSiteTagRestrictionClicked: this.onAddSiteTagRestrictionClicked, onAddUserGroupRestrictionClicked: this.onAddUserGroupRestrictionClicked, itemList: this.itemList, isSortable: this.selectedLeftMenuOption === 'fields' }))));
|
|
2131
2129
|
const selectionModeEl = (index.h("yoo-toast", { class: "bg-light-to-dark global-actions form-creator", message: message, extraButtons: extraButtons, count: this.selectedFields.length || 0, showBackdrop: false }));
|
|
2132
2130
|
return (index.h("div", { class: "form-content" }, this.showPagesSection && pageSectionEl, this.renderFormContentBlocksContainer(), ((_a = this.newUndefinedCondition) === null || _a === void 0 ? void 0 : _a.pageCondition) && index.h("div", { class: "page-condition-overlay", onClick: () => this.removeOverlays() }), this.selectionMode && selectionModeEl));
|
|
2133
2131
|
}
|
|
@@ -2230,7 +2228,7 @@ const YooFormCreatorComponent = class {
|
|
|
2230
2228
|
selected: true,
|
|
2231
2229
|
actionButtons: index$1.isScoring(this.selectedLeftMenuOption) ? [] : [...actionButtons]
|
|
2232
2230
|
}
|
|
2233
|
-
], iconPairLeft: index$
|
|
2231
|
+
], iconPairLeft: index$3.ARROW_PAIR, showBottomBorder: true, allowMultipleSelection: true }, this.currentSlides.map((slide, index$2) => (index.h("div", { slot: index$2 === this.selectedPageIndex ? 'CONTENT' : 'HIDDEN-CONTENT' }, index.h("yoo-ion-scroll", { ref: (el) => {
|
|
2234
2232
|
if (index$2 === this.selectedPageIndex) {
|
|
2235
2233
|
this.mainContentScrollElement = el;
|
|
2236
2234
|
}
|
|
@@ -105,7 +105,7 @@ const YooFormRangeComponent = class {
|
|
|
105
105
|
}
|
|
106
106
|
renderReadonly() {
|
|
107
107
|
var _a, _b;
|
|
108
|
-
return (index.h("div", { class: "readonly" }, index.h("div", null, isNumber.isNumber(this.value) ? this.value : null), index.h("div", null, rrule.isArray(this.value) && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
108
|
+
return (index.h("div", { class: "readonly" }, index.h("div", null, isNumber.isNumber(this.value) ? this.value : null), index.h("div", null, rrule.isArray(this.value) && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0] : null), index.h("div", null, rrule.isArray(this.value) && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 1 ? this.value[1] : null)));
|
|
109
109
|
}
|
|
110
110
|
renderEditable() {
|
|
111
111
|
const iterable = this.isRangeSlider ? [1, 2] : [1];
|
|
@@ -138,6 +138,12 @@ const YooMissionDetailComponent = class {
|
|
|
138
138
|
return (user &&
|
|
139
139
|
(user.email || user.firstName || user.lastName) && (index.h("li", { class: "menu-item", onClick: () => this.showUser.emit(user) }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { size: "medium", color: "app-color", iconOnlyColor: "light", icon: icon }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate(title)), index.h("div", { class: "menu-content menu-requestor" }, index.h("div", { class: "menu-inner-container" }, index.h("yoo-avatar", { size: "small", user: user }), index.h("span", { class: "text" }, user.firstName + ' ' + user.lastName), date && index.h("div", { class: "mission-date" }, pipe.pipes.dateFormat.transform(date, 'L'))), withExtraActions && ((_a = this.extraActions) === null || _a === void 0 ? void 0 : _a.length) > 0 && user && this.renderExtraActions(user))))));
|
|
140
140
|
}
|
|
141
|
+
renderDuration() {
|
|
142
|
+
var _a;
|
|
143
|
+
if ((_a = this.mission) === null || _a === void 0 ? void 0 : _a.duration) {
|
|
144
|
+
return (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("span", { class: "menu-icon" }, index.h("yoo-tag", { size: "medium", icon: "ongoing", color: "app-color" })), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('MISSIONDURATION')), index.h("div", { class: "menu-content" }, this.mission.duration))));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
141
147
|
renderWorkflowHistory() {
|
|
142
148
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
143
149
|
return (index.h("yoo-workflow-state", { steps: (_c = (_b = (_a = this.mission) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.workflow) === null || _c === void 0 ? void 0 : _c.steps, history: (_d = this.mission) === null || _d === void 0 ? void 0 : _d.workflowHistory, state: (_e = this.mission) === null || _e === void 0 ? void 0 : _e.workflowState, status: (_f = this.mission) === null || _f === void 0 ? void 0 : _f.status, owner: (_g = this.mission) === null || _g === void 0 ? void 0 : _g.owner }));
|
|
@@ -162,7 +168,7 @@ const YooMissionDetailComponent = class {
|
|
|
162
168
|
web: !this.isMobile
|
|
163
169
|
} }, index.h("yoo-ion-content", { class: "bg-light-to-dark no-scrollbar", scrollEvents: true }, index.h("div", null, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value ? this.progress.value : null }), index.h("ul", { class: "menu" }, this.mission.description &&
|
|
164
170
|
this.mission.description.distanceMin &&
|
|
165
|
-
this.renderSimpleSection(this.mission.description.distanceMin.toLocaleString(), 'GEOFENCINGDISTANCEMIN', 'pin-selected'), this.renderPriority(), description && description.text && this.renderSimpleSection(description.text, descriptionTitle, 'lesson'), this.mission.address && !isStoreManager && this.renderMissionLocation(), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), index.h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }), location && (location.contactname || location.contactphone || location.contactemail) && (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('CONTACT')), index.h("div", { class: "menu-content" }, location.contactname && index.h("div", { class: "menu-content-contact", innerHTML: location.contactname }), location.contactemail && index.h("div", { class: "menu-content-contact", innerHTML: location.contactemail }), location.contactphone && index.h("div", { class: "menu-content-contact", innerHTML: location.contactphone }))))), this.mission.comments && this.renderSimpleSection(this.mission.comments, 'NOTES', 'note'), location && location.info && this.renderSimpleSection(location.info, 'YOOBICINFO', 'info'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment'), this.renderUserSection(creator, 'REQUESTOR', 'author', this.mission._ect), this.mission.hasWorkflow && ((_d = (_c = (_b = this.mission) === null || _b === void 0 ? void 0 : _b.description) === null || _c === void 0 ? void 0 : _c.workflow) === null || _d === void 0 ? void 0 : _d.steps) && this.renderWorkflowHistory(), !((_e = this.mission) === null || _e === void 0 ? void 0 : _e.hasWorkflow) &&
|
|
171
|
+
this.renderSimpleSection(this.mission.description.distanceMin.toLocaleString(), 'GEOFENCINGDISTANCEMIN', 'pin-selected'), this.renderPriority(), description && description.text && this.renderSimpleSection(description.text, descriptionTitle, 'lesson'), this.mission.address && !isStoreManager && this.renderMissionLocation(), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), index.h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }), this.renderDuration(), location && (location.contactname || location.contactphone || location.contactemail) && (index.h("li", { class: "menu-item" }, index.h("div", { class: "menu-left" }, index.h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }), index.h("div", { class: "border" })), index.h("div", { class: "menu-right" }, index.h("div", { class: "menu-title" }, rrule.translate('CONTACT')), index.h("div", { class: "menu-content" }, location.contactname && index.h("div", { class: "menu-content-contact", innerHTML: location.contactname }), location.contactemail && index.h("div", { class: "menu-content-contact", innerHTML: location.contactemail }), location.contactphone && index.h("div", { class: "menu-content-contact", innerHTML: location.contactphone }))))), this.mission.comments && this.renderSimpleSection(this.mission.comments, 'NOTES', 'note'), location && location.info && this.renderSimpleSection(location.info, 'YOOBICINFO', 'info'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment'), this.renderUserSection(creator, 'REQUESTOR', 'author', this.mission._ect), this.mission.hasWorkflow && ((_d = (_c = (_b = this.mission) === null || _b === void 0 ? void 0 : _b.description) === null || _c === void 0 ? void 0 : _c.workflow) === null || _d === void 0 ? void 0 : _d.steps) && this.renderWorkflowHistory(), !((_e = this.mission) === null || _e === void 0 ? void 0 : _e.hasWorkflow) &&
|
|
166
172
|
owner &&
|
|
167
173
|
owner._id &&
|
|
168
174
|
owner._id !== rrule.getSession().userId &&
|
|
@@ -182,7 +188,7 @@ const YooMissionDetailComponent = class {
|
|
|
182
188
|
renderTodo() {
|
|
183
189
|
var _a;
|
|
184
190
|
const isStoreManager = rrule.getSession().user && rrule.getSession().user.locationRef && rrule.getSession().user.locationRef === this.mission.locationRef;
|
|
185
|
-
return (this.mission && (index.h("div", { class: 'mission-detail mission-todo ' + (this.isMobile ? '' : 'web') }, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value && this.progress.value }), index.h("ul", { class: "menu" }, this.mission.todo && this.mission.todo.field && this.mission.todo.fieldValue && this.renderMenuItem('LINKEDTO', true), this.mission.todo && this.mission.todo.priority && this.renderMenuItem('PRIORITY', false), this.renderUserSection(this.mission.creator, 'CREATEDBY', 'user', this.mission._ect, true), this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true), this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')), index.h("slot", null)))));
|
|
191
|
+
return (this.mission && (index.h("div", { class: 'mission-detail mission-todo ' + (this.isMobile ? '' : 'web') }, index.h("div", { class: "mission-content" }, index.h("yoo-mission-heading", { animated: this.animated, mission: this.mission, progress: this.progress && this.progress.value && this.progress.value }), index.h("ul", { class: "menu" }, this.mission.todo && this.mission.todo.field && this.mission.todo.fieldValue && this.renderMenuItem('LINKEDTO', true), this.mission.todo && this.mission.todo.priority && this.renderMenuItem('PRIORITY', false), this.renderUserSection(this.mission.creator, 'CREATEDBY', 'user', this.mission._ect, true), this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true), this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'), ((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'), this.renderDuration(), this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')), index.h("slot", null)))));
|
|
186
192
|
}
|
|
187
193
|
renderBasedOnType() {
|
|
188
194
|
if (this.mission && this.mission.type) {
|
|
@@ -142,6 +142,19 @@ export class YooMissionDetailComponent {
|
|
|
142
142
|
date && h("div", { class: "mission-date" }, pipes.dateFormat.transform(date, 'L'))),
|
|
143
143
|
withExtraActions && ((_a = this.extraActions) === null || _a === void 0 ? void 0 : _a.length) > 0 && user && this.renderExtraActions(user))))));
|
|
144
144
|
}
|
|
145
|
+
renderDuration() {
|
|
146
|
+
var _a;
|
|
147
|
+
if ((_a = this.mission) === null || _a === void 0 ? void 0 : _a.duration) {
|
|
148
|
+
return (h("li", { class: "menu-item" },
|
|
149
|
+
h("div", { class: "menu-left" },
|
|
150
|
+
h("span", { class: "menu-icon" },
|
|
151
|
+
h("yoo-tag", { size: "medium", icon: "ongoing", color: "app-color" })),
|
|
152
|
+
h("div", { class: "border" })),
|
|
153
|
+
h("div", { class: "menu-right" },
|
|
154
|
+
h("div", { class: "menu-title" }, translate('MISSIONDURATION')),
|
|
155
|
+
h("div", { class: "menu-content" }, this.mission.duration))));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
145
158
|
renderWorkflowHistory() {
|
|
146
159
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
147
160
|
return (h("yoo-workflow-state", { steps: (_c = (_b = (_a = this.mission) === null || _a === void 0 ? void 0 : _a.description) === null || _b === void 0 ? void 0 : _b.workflow) === null || _c === void 0 ? void 0 : _c.steps, history: (_d = this.mission) === null || _d === void 0 ? void 0 : _d.workflowHistory, state: (_e = this.mission) === null || _e === void 0 ? void 0 : _e.workflowState, status: (_f = this.mission) === null || _f === void 0 ? void 0 : _f.status, owner: (_g = this.mission) === null || _g === void 0 ? void 0 : _g.owner }));
|
|
@@ -178,6 +191,7 @@ export class YooMissionDetailComponent {
|
|
|
178
191
|
this.mission.address && !isStoreManager && this.renderMissionLocation(),
|
|
179
192
|
((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'),
|
|
180
193
|
h("yoo-mission-contents", { slidesNumber: this.slidesNumber, photosNumber: this.photosNumber, questionsNumber: this.questionsNumber }),
|
|
194
|
+
this.renderDuration(),
|
|
181
195
|
location && (location.contactname || location.contactphone || location.contactemail) && (h("li", { class: "menu-item" },
|
|
182
196
|
h("div", { class: "menu-left" },
|
|
183
197
|
h("yoo-tag", { icon: "contact", iconOnlyColor: "light", size: "medium", color: "app-color" }),
|
|
@@ -236,6 +250,7 @@ export class YooMissionDetailComponent {
|
|
|
236
250
|
this.renderUserSection(this.mission.owner, 'ASSIGNTO', 'user', null, true),
|
|
237
251
|
this.mission.address && !isStoreManager && this.renderSimpleSection(this.mission.address, 'ADDRESS', 'map'),
|
|
238
252
|
((_a = this.mission.aisle) === null || _a === void 0 ? void 0 : _a.title) && !isStoreManager && this.renderSimpleSection(this.mission.aisle.title, 'AISLE', 'aisles'),
|
|
253
|
+
this.renderDuration(),
|
|
239
254
|
this.mission.originalUnvalidatedReason && this.renderSimpleSection(this.mission.originalUnvalidatedReason, 'COMMENTS', 'comment')),
|
|
240
255
|
h("slot", null)))));
|
|
241
256
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { closeModal, downloadFile, findParent, getAsyncExtraData, getSession, isChromatic, isCloudinaryLink, isNativeMobile, isNullOrUndefined, isPdf, isWeb, showActionSheet, showContextMenu, translate } from '@shared/utils';
|
|
1
|
+
import { closeModal, downloadFile, findParent, getAsyncExtraData, getPermissions, getSession, isChromatic, isCloudinaryLink, isNativeMobile, isNullOrUndefined, isPdf, isWeb, showActionSheet, showContextMenu, translate } from '@shared/utils';
|
|
2
2
|
import { Component, Element, Event, h, Host, Listen, Method, Prop, State, Watch } from '@stencil/core';
|
|
3
3
|
import { getAppContext, intersectionObserve, isIntersectionObserverSupported, lockSwipes, showSlidesMedia } from '@utils';
|
|
4
4
|
import { isArray } from 'lodash-es';
|
|
@@ -117,7 +117,7 @@ export class YooFormCarouselComponent {
|
|
|
117
117
|
text: translate('EMAIL'),
|
|
118
118
|
icon: 'email',
|
|
119
119
|
color: 'dark',
|
|
120
|
-
isVisible: () => { var _a; return !!item && !((_a = getSession()) === null || _a === void 0 ? void 0 : _a.isExternal); },
|
|
120
|
+
isVisible: () => { var _a; return !!item && !((_a = getSession()) === null || _a === void 0 ? void 0 : _a.isExternal) && getPermissions().canShareByEmail; },
|
|
121
121
|
handler: () => {
|
|
122
122
|
const filename = (item === null || item === void 0 ? void 0 : item._filename) || new Date().getTime().toString();
|
|
123
123
|
getAsyncExtraData({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ScreenOrientation } from '@ionic-native/screen-orientation';
|
|
2
|
-
import { changeExtension, closeModal, Cloudinary, dispatchCustomEvent, downloadFile, downloadFileToDevice, fileNativeCheckFile, getAsyncExtraData, getExtension, getNativeDirectory, getType, isAndroid, isAudio, isCurrentLanguageChinese, isDateBefore, isDocumentDownloadSupported, isDocumentEmailSupported, isFile, isNativeMobile, isOffline, isVideo, isWeb, pipes, showActionSheet, showPdfOnDevice, translate } from '@shared/utils';
|
|
2
|
+
import { changeExtension, closeModal, Cloudinary, dispatchCustomEvent, downloadFile, downloadFileToDevice, fileNativeCheckFile, getAsyncExtraData, getExtension, getNativeDirectory, getPermissions, getType, isAndroid, isAudio, isCurrentLanguageChinese, isDateBefore, isDocumentDownloadSupported, isDocumentEmailSupported, isFile, isNativeMobile, isOffline, isVideo, isWeb, pipes, showActionSheet, showPdfOnDevice, translate } from '@shared/utils';
|
|
3
3
|
import { Component, Element, h, Host, Prop, State } from '@stencil/core';
|
|
4
4
|
import { getAppContext } from '@utils';
|
|
5
5
|
import { isString } from 'lodash-es';
|
|
@@ -50,7 +50,7 @@ export class YooFormDocumentDialogComponent {
|
|
|
50
50
|
icon: 'email',
|
|
51
51
|
iconColor: 'dark-to-light',
|
|
52
52
|
cssClass: isWeb(this.host) ? 'bg-royal-hover' : 'bg-royal light',
|
|
53
|
-
isVisible: () => isDocumentEmailSupported(this.document),
|
|
53
|
+
isVisible: () => isDocumentEmailSupported(this.document) && getPermissions().canShareByEmail,
|
|
54
54
|
handler: () => {
|
|
55
55
|
getAsyncExtraData({
|
|
56
56
|
type: 'email-dialog',
|
|
@@ -63,8 +63,9 @@ export class YooFormFeedbackComponent {
|
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
65
|
renderReadonly() {
|
|
66
|
-
return h("div", { class: "readonly" },
|
|
67
|
-
|
|
66
|
+
return h("div", { class: "readonly" },
|
|
67
|
+
this.isConfidenceQuiz && this.renderFormChoice(),
|
|
68
|
+
!this.isConfidenceQuiz && isNumber(this.value) && this.emojis[this.value - 1]);
|
|
68
69
|
}
|
|
69
70
|
renderEditable() {
|
|
70
71
|
return ([
|
|
@@ -85,8 +85,8 @@ export class YooFormRangeComponent {
|
|
|
85
85
|
var _a, _b;
|
|
86
86
|
return (h("div", { class: "readonly" },
|
|
87
87
|
h("div", null, isNumber(this.value) ? this.value : null),
|
|
88
|
-
h("div", null, isArray(this.value) && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0
|
|
89
|
-
h("div", null, isArray(this.value) && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 1
|
|
88
|
+
h("div", null, isArray(this.value) && ((_a = this.value) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.value[0] : null),
|
|
89
|
+
h("div", null, isArray(this.value) && ((_b = this.value) === null || _b === void 0 ? void 0 : _b.length) > 1 ? this.value[1] : null)));
|
|
90
90
|
}
|
|
91
91
|
renderEditable() {
|
|
92
92
|
const iterable = this.isRangeSlider ? [1, 2] : [1];
|
|
@@ -782,6 +782,7 @@ export class YooFormCreatorComponent {
|
|
|
782
782
|
this.selectedPageIndex = index;
|
|
783
783
|
}
|
|
784
784
|
async addNewPage(newPage, index) {
|
|
785
|
+
newPage = Object.assign({ _id: getUUID() }, newPage);
|
|
785
786
|
this.currentSlides.splice(index, 0, newPage);
|
|
786
787
|
this.selectedPageIndex = index;
|
|
787
788
|
this.hasPageChanged = index;
|
|
@@ -1596,26 +1597,23 @@ export class YooFormCreatorComponent {
|
|
|
1596
1597
|
}
|
|
1597
1598
|
}
|
|
1598
1599
|
onCustomFieldAdded(customFieldId, selectedCustomFormField, indexToAdd) {
|
|
1599
|
-
var _a, _b, _c, _d;
|
|
1600
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1600
1601
|
if (!this.currentSlides[this.selectedPageIndex]) {
|
|
1601
1602
|
return;
|
|
1602
1603
|
}
|
|
1604
|
+
indexToAdd = isNullOrUndefined(indexToAdd) ? (_b = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.length : indexToAdd;
|
|
1603
1605
|
if (!selectedCustomFormField) {
|
|
1604
|
-
selectedCustomFormField = (
|
|
1606
|
+
selectedCustomFormField = (_c = this.customFormFields) === null || _c === void 0 ? void 0 : _c.find((customField) => customField._id === customFieldId);
|
|
1605
1607
|
}
|
|
1606
|
-
const newFields = createNewIdsForCustomFields(selectedCustomFormField.fields);
|
|
1608
|
+
const newFields = createNewIdsForCustomFields(selectedCustomFormField.fields, ((_d = this.missionDescription) === null || _d === void 0 ? void 0 : _d.type) === 'dataset', { slideIndex: this.selectedPageIndex, itemIndex: indexToAdd });
|
|
1607
1609
|
newFields === null || newFields === void 0 ? void 0 : newFields.forEach((field) => {
|
|
1608
|
-
var _a;
|
|
1610
|
+
var _a, _b;
|
|
1609
1611
|
field.slideIndex = this.selectedPageIndex;
|
|
1610
1612
|
field.slideTitle = (_a = this.currentSlides[this.selectedPageIndex]) === null || _a === void 0 ? void 0 : _a.title;
|
|
1613
|
+
field.slideId = (_b = this.currentSlides[this.selectedPageIndex]) === null || _b === void 0 ? void 0 : _b._id;
|
|
1611
1614
|
});
|
|
1612
|
-
if (((
|
|
1613
|
-
|
|
1614
|
-
this.currentSlides[this.selectedPageIndex].items = [...(_d = this.currentSlides[this.selectedPageIndex]) === null || _d === void 0 ? void 0 : _d.items, ...newFields];
|
|
1615
|
-
}
|
|
1616
|
-
else {
|
|
1617
|
-
this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
|
|
1618
|
-
}
|
|
1615
|
+
if (((_f = (_e = this.currentSlides[this.selectedPageIndex]) === null || _e === void 0 ? void 0 : _e.items) === null || _f === void 0 ? void 0 : _f.length) > 0) {
|
|
1616
|
+
this.currentSlides[this.selectedPageIndex].items.splice(indexToAdd, 0, ...newFields);
|
|
1619
1617
|
}
|
|
1620
1618
|
else {
|
|
1621
1619
|
this.currentSlides[this.selectedPageIndex].items = newFields;
|
|
@@ -153,7 +153,7 @@ export class YooFormCreatorPageCardListComponent {
|
|
|
153
153
|
if (this.workflowVisibility) {
|
|
154
154
|
pageEntry.pageWorkflowState = this.workflowVisibility;
|
|
155
155
|
if ((_a = this.pagePermissions) === null || _a === void 0 ? void 0 : _a.length) {
|
|
156
|
-
const pagePermission = this.pagePermissions.find((permission) => permission.name === slide.title);
|
|
156
|
+
const pagePermission = this.pagePermissions.find((permission) => permission.name === slide._id || permission.name === slide.title);
|
|
157
157
|
pageEntry.pageWorkflowState = getWorkflowFieldState(pagePermission, this.workflowVisibility);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
@@ -896,6 +896,8 @@ export function setChildFields(parentConditions, itemIndex) {
|
|
|
896
896
|
export function addNewIdsToSlide(slide) {
|
|
897
897
|
var _a, _b;
|
|
898
898
|
const ids = [];
|
|
899
|
+
if (slide)
|
|
900
|
+
slide._id = getUUID();
|
|
899
901
|
(_a = slide === null || slide === void 0 ? void 0 : slide.items) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
|
|
900
902
|
const newId = getUUID();
|
|
901
903
|
ids.push({ oldId: item.name, newId });
|
|
@@ -1145,10 +1147,16 @@ export function cleanCustomFormFieldSlides(selectedFields, translations) {
|
|
|
1145
1147
|
});
|
|
1146
1148
|
return { cleanedFields: selectedFields, removedConditionIds };
|
|
1147
1149
|
}
|
|
1148
|
-
export function createNewIdsForCustomFields(customFields) {
|
|
1149
|
-
const cleanedFields = customFields.map((field) => {
|
|
1150
|
+
export function createNewIdsForCustomFields(customFields, isCustomDataSet, fieldLocation) {
|
|
1151
|
+
const cleanedFields = customFields.map((field, fIndex) => {
|
|
1150
1152
|
const cleanedField = cloneDeep(field);
|
|
1151
|
-
|
|
1153
|
+
if (isCustomDataSet) {
|
|
1154
|
+
cleanedField.name = getCustomName(cleanedField.title, fieldLocation.slideIndex, fieldLocation.itemIndex + fIndex);
|
|
1155
|
+
cleanedField.customName = getUUID();
|
|
1156
|
+
}
|
|
1157
|
+
else {
|
|
1158
|
+
cleanedField.name = getUUID();
|
|
1159
|
+
}
|
|
1152
1160
|
return cleanedField;
|
|
1153
1161
|
});
|
|
1154
1162
|
cleanedFields.forEach((cleanedFeild) => {
|
|
@@ -245,7 +245,7 @@ export class YooWorkflowComponent {
|
|
|
245
245
|
onPageStateChange(ev) {
|
|
246
246
|
var _a, _b, _c, _d;
|
|
247
247
|
if (this.internalMissionDescription.slides[ev.detail.index]) {
|
|
248
|
-
const pageName = this.internalMissionDescription.slides[ev.detail.index].title;
|
|
248
|
+
const pageName = this.internalMissionDescription.slides[ev.detail.index]._id || this.internalMissionDescription.slides[ev.detail.index].title;
|
|
249
249
|
const fieldPermission = { name: pageName };
|
|
250
250
|
switch (ev.detail.newState.title) {
|
|
251
251
|
case 'EDITABLE':
|
|
@@ -388,8 +388,9 @@ export class YooWorkflowComponent {
|
|
|
388
388
|
}
|
|
389
389
|
], iconPairLeft: ARROW_PAIR, showBottomBorder: true, forceEntryUpdate: true, allowMultipleSelection: true, onAccordionSelected: (ev) => (this.isFieldsAccordionOpen = ev.detail.selected) },
|
|
390
390
|
h("div", { slot: "CONTENTS" }, (_e = (_d = (_c = this.internalMissionDescription) === null || _c === void 0 ? void 0 : _c.slides[this.currentPageSelected]) === null || _d === void 0 ? void 0 : _d.items) === null || _e === void 0 ? void 0 : _e.map((item) => {
|
|
391
|
-
var _a, _b;
|
|
392
|
-
const
|
|
391
|
+
var _a, _b, _c, _d;
|
|
392
|
+
const slideName = ((_a = this.internalMissionDescription) === null || _a === void 0 ? void 0 : _a.slides[this.currentPageSelected]._id) || ((_b = this.internalMissionDescription) === null || _b === void 0 ? void 0 : _b.slides[this.currentPageSelected].title);
|
|
393
|
+
const pagePermission = (_d = (_c = this.currentWorkflowStep) === null || _c === void 0 ? void 0 : _c.pagesPermission) === null || _d === void 0 ? void 0 : _d.find((permission) => permission.name === slideName);
|
|
393
394
|
const pageState = getWorkflowFieldState(pagePermission, this.defaultFieldState);
|
|
394
395
|
return this.renderSimpleBlock(item, pageState);
|
|
395
396
|
}))));
|