@zohodesk/library-platform 1.1.3-exp.2 → 1.1.3-exp.4
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/es/bc/zhttp/Errors.js +14 -0
- package/es/bc/zhttp/index.js +3 -1
- package/es/bc/zlist/Constants.js +6 -1
- package/es/bc/zlist/Events.js +140 -0
- package/es/bc/zlist/index.js +2 -1
- package/es/cc/component/FallbackView.js +1 -0
- package/es/cc/fields/currency/Model.js +2 -0
- package/es/cc/fields/field/Properties.js +1 -1
- package/es/cc/fields/formula/Model.js +5 -0
- package/es/cc/index.js +1 -0
- package/es/cc/link/Properties.js +0 -1
- package/es/cc/table-connected/ErrorEventType.js +32 -0
- package/es/cc/table-connected/Events.js +96 -0
- package/es/cc/table-connected/SdkContract.js +120 -0
- package/es/cc/table-connected/constants/Events.js +2 -0
- package/es/cc/table-connected/index.js +3 -1
- package/es/cc/table-list/Properties.js +9 -0
- package/es/cc/table-list/row/Properties.js +9 -0
- package/es/index.js +2 -1
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +116 -4
- package/es/library/custom-component/applications/interfaces/gateways/ISchemaValidator.js +1 -0
- package/es/library/custom-component/applications/usecases/InitializeUseCase.js +3 -2
- package/es/library/custom-component/applications/usecases/UpdatePropertyUseCase.js +3 -2
- package/es/library/custom-component/domain/entities/Component.js +16 -3
- package/es/library/custom-component/domain/entities/Properties.js +19 -1
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +36 -1
- package/es/library/custom-component/frameworks/ui/CreateCustomComponent.js +23 -11
- package/es/library/custom-component/frameworks/ui/DependencyFactory.js +4 -3
- package/es/library/dot/components/table-list/frameworks/hooks/useRowData.js +12 -5
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +17 -5
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +35 -26
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +152 -56
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +22 -16
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +7 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -13
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +31 -34
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +3 -8
- package/es/library/dot/components/table-list/frameworks/utils/getHeaderClasses.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/getTableListClassName.js +37 -0
- package/es/library/dot/components/table-list/frameworks/utils/reOrder.js +28 -14
- package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +96 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +11 -3
- package/es/platform/client-actions/template-resolver/index.js +1 -0
- package/es/platform/client-actions/translators/context-resolver/index.js +6 -6
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +1 -1
- package/es/platform/components/table-connected/adapters/resources/ErrorPrinter.js +20 -0
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +71 -0
- package/es/platform/components/table-connected/frameworks/ErrorEventHandlersFactory.js +126 -0
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +34 -1
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +2 -0
- package/es/platform/components/table-connected/frameworks/TableConnectedView.js +5 -1
- package/es/platform/zdata-source/domain/entities/DataSource.js +18 -12
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +7 -1
- package/es/platform/zform/adapters/presenter/FormTranslator.js +6 -127
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +32 -0
- package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +20 -0
- package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +20 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +21 -0
- package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +29 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +27 -0
- package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +30 -0
- package/es/platform/zform/adapters/presenter/translators/fields/index.js +15 -0
- package/es/platform/zform/applications/usecases/MyFormSuccessUseCase.js +3 -1
- package/es/platform/zform/domain/ZField.js +61 -16
- package/es/platform/zform/domain/ZSection.js +20 -7
- package/es/platform/zhttp/applications/usecases/FetchUseCase.js +111 -66
- package/es/platform/zlist/adapters/controllers/FieldExecuteFailedController.js +25 -0
- package/es/platform/zlist/adapters/gateways/Repository.js +5 -2
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +12 -5
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +2 -2
- package/es/platform/zlist/adapters/presenters/translators/EmptyViewModel.js +2 -1
- package/es/platform/zlist/adapters/presenters/translators/Header.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/fields/CurrencyFieldTranslator.js +1 -0
- package/es/platform/zlist/adapters/presenters/translators/fields/FormulaFieldTranslator.js +3 -0
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -2
- package/es/platform/zlist/applications/usecases/FetchMoreUseCase.js +1 -1
- package/es/platform/zlist/applications/usecases/RecordExecuteFailedUseCase.js +3 -2
- package/es/platform/zlist/domain/entities/List.js +12 -63
- package/es/platform/zlist/domain/entities/ListErrorState.js +167 -0
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +6 -0
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +6 -1
- package/package.json +3 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FIELD_FETCH_FAILURE, FIELD_FETCH_NO_CONTENT, FIELD_FETCH_SUCCESS } from "../../../../../bc/zfield/Constants";
|
|
2
2
|
import FieldApiName from "../interfaces/FieldApiName";
|
|
3
3
|
import { DATA_SOURCE_EXECUTE } from "../../../../../bc/zdata-source/Constants";
|
|
4
|
-
import { DATA_SOURCE_SUCCESS } from "../../../../../bc/zdata-source/Symbols";
|
|
4
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_SUCCESS } from "../../../../../bc/zdata-source/Symbols";
|
|
5
5
|
|
|
6
6
|
class FieldManager {
|
|
7
7
|
constructor(fields, selectedFields, isFieldsFetching, isSelectedFieldsFetching) {
|
|
@@ -52,6 +52,12 @@ class FieldManager {
|
|
|
52
52
|
metaData: {
|
|
53
53
|
apiName
|
|
54
54
|
}
|
|
55
|
+
},
|
|
56
|
+
[DATA_SOURCE_FAILURE]: {
|
|
57
|
+
metaData: {
|
|
58
|
+
apiName,
|
|
59
|
+
actionName: apiName
|
|
60
|
+
}
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import SectionTranslator from "./translators/SectionTranslator";
|
|
1
2
|
let fieldTypeToUIType = {
|
|
2
3
|
Text: 'TextBox',
|
|
3
4
|
Textarea: 'TextArea',
|
|
@@ -45,133 +46,11 @@ export default class FormTranslator {
|
|
|
45
46
|
}
|
|
46
47
|
};
|
|
47
48
|
} else {
|
|
48
|
-
let sections =
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
description: '',
|
|
54
|
-
//section.description,
|
|
55
|
-
isVisible: section.visibility,
|
|
56
|
-
fields: section.fields.map(field => {
|
|
57
|
-
let type = uiMapping.fields[field.apiName] || fieldTypeToUIType[field.type];
|
|
58
|
-
|
|
59
|
-
if (field.type == 'DateTime' || field.type == 'Date') {
|
|
60
|
-
let value = field.value;
|
|
61
|
-
return {
|
|
62
|
-
id: field.id,
|
|
63
|
-
label: field.i18NLabel,
|
|
64
|
-
type,
|
|
65
|
-
value: value || '',
|
|
66
|
-
//state.behaviours.zform.values[field.apiName],
|
|
67
|
-
name: field.apiName,
|
|
68
|
-
// placeholder: field.i18NLabel,//field.placeholder,
|
|
69
|
-
required: field.isMandatory,
|
|
70
|
-
isVisible: field.visibility
|
|
71
|
-
};
|
|
72
|
-
} else if (field.type == 'Picklist') {
|
|
73
|
-
let value = field.value;
|
|
74
|
-
let errorMessage = field.errorMessage || '';
|
|
75
|
-
return {
|
|
76
|
-
id: field.id,
|
|
77
|
-
label: field.i18NLabel,
|
|
78
|
-
options: field.pickListValues.map(picklistValue => {
|
|
79
|
-
return {
|
|
80
|
-
value: picklistValue.value,
|
|
81
|
-
label: picklistValue.value
|
|
82
|
-
};
|
|
83
|
-
}),
|
|
84
|
-
type,
|
|
85
|
-
subType: field.subType.toLowerCase(),
|
|
86
|
-
value: value || '',
|
|
87
|
-
//state.behaviours.zform.values[field.apiName],
|
|
88
|
-
name: field.apiName,
|
|
89
|
-
// placeholder: field.i18NLabel,//field.placeholder,
|
|
90
|
-
required: field.isMandatory,
|
|
91
|
-
isVisible: field.visibility,
|
|
92
|
-
errorMessage
|
|
93
|
-
};
|
|
94
|
-
} else if (field.type == 'Multiselect') {
|
|
95
|
-
let value = field.value;
|
|
96
|
-
let errorMessage = field.errorMessage || '';
|
|
97
|
-
return {
|
|
98
|
-
id: field.id,
|
|
99
|
-
label: field.i18NLabel,
|
|
100
|
-
options: field.pickListValues ? field.pickListValues.map(picklistValue => {
|
|
101
|
-
return {
|
|
102
|
-
value: picklistValue.value,
|
|
103
|
-
label: picklistValue.value
|
|
104
|
-
};
|
|
105
|
-
}) : [],
|
|
106
|
-
type,
|
|
107
|
-
subType: field.subType,
|
|
108
|
-
value: value || [],
|
|
109
|
-
//state.behaviours.zform.values[field.apiName],
|
|
110
|
-
name: field.apiName,
|
|
111
|
-
// placeholder: field.i18NLabel,//field.placeholder,
|
|
112
|
-
required: field.isMandatory,
|
|
113
|
-
isVisible: field.visibility,
|
|
114
|
-
errorMessage
|
|
115
|
-
};
|
|
116
|
-
} else if (field.type == 'Boolean') {
|
|
117
|
-
let value = field.value;
|
|
118
|
-
return {
|
|
119
|
-
id: field.id,
|
|
120
|
-
label: field.i18NLabel,
|
|
121
|
-
type,
|
|
122
|
-
value: value || false,
|
|
123
|
-
name: field.apiName,
|
|
124
|
-
// placeholder: field.i18NLabel,//field.placeholder,
|
|
125
|
-
required: field.isMandatory,
|
|
126
|
-
isVisible: field.visibility
|
|
127
|
-
};
|
|
128
|
-
} else if (field.type == 'Text') {
|
|
129
|
-
let value = field.value;
|
|
130
|
-
let errorMessage = field.errorMessage || '';
|
|
131
|
-
return {
|
|
132
|
-
type,
|
|
133
|
-
value: value || '',
|
|
134
|
-
//state.behaviours.zform.values[field.apiName],
|
|
135
|
-
name: field.apiName,
|
|
136
|
-
id: field.id,
|
|
137
|
-
label: field.i18NLabel,
|
|
138
|
-
tooltip: '',
|
|
139
|
-
//field.tooltip,
|
|
140
|
-
ePHI: false,
|
|
141
|
-
//field.ePHI,
|
|
142
|
-
placeholder: field.i18NLabel,
|
|
143
|
-
//field.placeholder,
|
|
144
|
-
required: field.isMandatory,
|
|
145
|
-
isVisible: field.visibility,
|
|
146
|
-
errorMessage
|
|
147
|
-
};
|
|
148
|
-
} else {
|
|
149
|
-
let value = field.value;
|
|
150
|
-
let errorMessage = field.errorMessage || '';
|
|
151
|
-
const fieldModified = {
|
|
152
|
-
type,
|
|
153
|
-
value: value || '',
|
|
154
|
-
//state.behaviours.zform.values[field.apiName],
|
|
155
|
-
name: field.apiName,
|
|
156
|
-
id: field.id,
|
|
157
|
-
label: field.i18NLabel,
|
|
158
|
-
tooltip: '',
|
|
159
|
-
//field.tooltip,
|
|
160
|
-
placeholder: field.i18NLabel,
|
|
161
|
-
//field.placeholder,
|
|
162
|
-
required: field.isMandatory,
|
|
163
|
-
isVisible: field.visibility,
|
|
164
|
-
errorMessage
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
if (ePHIFields[field.type]) {
|
|
168
|
-
fieldModified.ePHI = true;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
return fieldModified;
|
|
172
|
-
}
|
|
173
|
-
})
|
|
174
|
-
};
|
|
49
|
+
let sections = SectionTranslator({
|
|
50
|
+
state,
|
|
51
|
+
fieldTypeToUIType,
|
|
52
|
+
ePHIFields,
|
|
53
|
+
uiMapping
|
|
175
54
|
});
|
|
176
55
|
return { ...state,
|
|
177
56
|
viewModel: {
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as FieldTranslators from "./fields";
|
|
2
|
+
|
|
3
|
+
const SectionTranslator = _ref => {
|
|
4
|
+
let {
|
|
5
|
+
state,
|
|
6
|
+
fieldTypeToUIType,
|
|
7
|
+
ePHIFields,
|
|
8
|
+
uiMapping
|
|
9
|
+
} = _ref;
|
|
10
|
+
let sections = state.behaviours.zform.sections.map(section => {
|
|
11
|
+
return {
|
|
12
|
+
type: uiMapping.sections[section.id],
|
|
13
|
+
id: section.id + '',
|
|
14
|
+
title: section.i18NLabel,
|
|
15
|
+
description: section.description,
|
|
16
|
+
//section.description,
|
|
17
|
+
// isVisible: section.visibility,
|
|
18
|
+
isVisible: section.isVisible,
|
|
19
|
+
fields: section.fields.map(field => {
|
|
20
|
+
const fieldTranslator = FieldTranslators[field.type];
|
|
21
|
+
let type = uiMapping.fields[field.apiName] || fieldTypeToUIType[field.type];
|
|
22
|
+
return fieldTranslator({
|
|
23
|
+
field,
|
|
24
|
+
type
|
|
25
|
+
});
|
|
26
|
+
})
|
|
27
|
+
};
|
|
28
|
+
});
|
|
29
|
+
return sections;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export default SectionTranslator;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const BooleanFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
id: field.id,
|
|
8
|
+
label: field.i18NLabel,
|
|
9
|
+
type,
|
|
10
|
+
value: field.value,
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
13
|
+
required: field.isMandatory,
|
|
14
|
+
readonly: field.isReadOnly,
|
|
15
|
+
// visibility: field.isVisible
|
|
16
|
+
isVisible: field.isVisible
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default BooleanFieldTranslator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const CurrencyFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
isVisible: field.isVisible,
|
|
21
|
+
errorMessage: field.errorMessage || ''
|
|
22
|
+
}; // if (ePHIFields[field.type]) {
|
|
23
|
+
// fieldModified.ePHI = true;
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
return fieldModified;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default CurrencyFieldTranslator;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const DateFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
id: field.id,
|
|
8
|
+
label: field.i18NLabel,
|
|
9
|
+
type,
|
|
10
|
+
value: field.value || '',
|
|
11
|
+
//state.behaviours.zform.values[field.apiName],
|
|
12
|
+
name: field.apiName,
|
|
13
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
14
|
+
required: field.isMandatory,
|
|
15
|
+
readonly: field.isReadOnly,
|
|
16
|
+
isVisible: field.isVisible
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default DateFieldTranslator;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const DateTimeFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
id: field.id,
|
|
8
|
+
label: field.i18NLabel,
|
|
9
|
+
type,
|
|
10
|
+
value: field.value || '',
|
|
11
|
+
//state.behaviours.zform.values[field.apiName],
|
|
12
|
+
name: field.apiName,
|
|
13
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
14
|
+
required: field.isMandatory,
|
|
15
|
+
readonly: field.isReadOnly,
|
|
16
|
+
// visibility: field.isVisible
|
|
17
|
+
isVisible: field.isVisible
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default DateTimeFieldTranslator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const DecimalFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
isVisible: field.isVisible,
|
|
21
|
+
errorMessage: field.errorMessage || ''
|
|
22
|
+
}; // if (ePHIFields[field.type]) {
|
|
23
|
+
// fieldModified.ePHI = true;
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
return fieldModified;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default DecimalFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const EmailFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default EmailFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const LookUpFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
tooltip: '',
|
|
15
|
+
//field.tooltip,
|
|
16
|
+
placeholder: field.i18NLabel,
|
|
17
|
+
//field.placeholder,
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default LookUpFieldTranslator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const MultiSelectFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
id: field.id,
|
|
8
|
+
label: field.i18NLabel,
|
|
9
|
+
options: field.pickListValues ? field.pickListValues.map(picklistValue => {
|
|
10
|
+
return {
|
|
11
|
+
value: picklistValue.value,
|
|
12
|
+
label: picklistValue.value
|
|
13
|
+
};
|
|
14
|
+
}) : [],
|
|
15
|
+
type,
|
|
16
|
+
subType: field.subType,
|
|
17
|
+
value: field.value,
|
|
18
|
+
//state.behaviours.zform.values[field.apiName],
|
|
19
|
+
name: field.apiName,
|
|
20
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
21
|
+
required: field.isMandatory,
|
|
22
|
+
readonly: field.isReadOnly,
|
|
23
|
+
// visibility: field.isVisible,
|
|
24
|
+
isVisible: field.isVisible,
|
|
25
|
+
errorMessage: field.errorMessage || ''
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default MultiSelectFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const NumberFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default NumberFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const PercentageFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default PercentageFieldTranslator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const PhoneFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
isVisible: field.isVisible,
|
|
21
|
+
errorMessage: field.errorMessage || ''
|
|
22
|
+
}; // if (ePHIFields[field.type]) {
|
|
23
|
+
// fieldModified.ePHI = true;
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
return fieldModified;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default PhoneFieldTranslator;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const PickListFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
id: field.id,
|
|
8
|
+
label: field.i18NLabel,
|
|
9
|
+
options: field.pickListValues.map(picklistValue => {
|
|
10
|
+
return {
|
|
11
|
+
value: picklistValue.value,
|
|
12
|
+
label: picklistValue.value
|
|
13
|
+
};
|
|
14
|
+
}),
|
|
15
|
+
type,
|
|
16
|
+
subType: field.subType.toLowerCase(),
|
|
17
|
+
value: field.value,
|
|
18
|
+
//state.behaviours.zform.values[field.apiName],
|
|
19
|
+
name: field.apiName,
|
|
20
|
+
// placeholder: field.i18NLabel,//field.placeholder,
|
|
21
|
+
required: field.isMandatory,
|
|
22
|
+
readonly: field.isReadOnly,
|
|
23
|
+
// visibility: field.isVisible,
|
|
24
|
+
isVisible: field.isVisible,
|
|
25
|
+
errorMessage: field.errorMessage || ''
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default PickListFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const TextAreaFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default TextAreaFieldTranslator;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const TextFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
type,
|
|
4
|
+
field
|
|
5
|
+
} = _ref;
|
|
6
|
+
return {
|
|
7
|
+
type,
|
|
8
|
+
value: field.value || '',
|
|
9
|
+
//state.behaviours.zform.values[field.apiName],
|
|
10
|
+
name: field.apiName,
|
|
11
|
+
id: field.id,
|
|
12
|
+
label: field.i18NLabel,
|
|
13
|
+
// toolTip: field.tooltip || '',
|
|
14
|
+
// toolTipType: field.toolTipType || '',
|
|
15
|
+
// placeholder: field.toolTip || '',
|
|
16
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
17
|
+
ePHI: false,
|
|
18
|
+
//field.ePHI,
|
|
19
|
+
required: field.isMandatory,
|
|
20
|
+
readonly: field.isReadOnly,
|
|
21
|
+
// visibility: field.isVisible,
|
|
22
|
+
isVisible: field.isVisible,
|
|
23
|
+
errorMessage: field.errorMessage || ''
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default TextFieldTranslator;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
const URLFieldTranslator = _ref => {
|
|
2
|
+
let {
|
|
3
|
+
field,
|
|
4
|
+
type,
|
|
5
|
+
ePHIFields
|
|
6
|
+
} = _ref;
|
|
7
|
+
const fieldModified = {
|
|
8
|
+
type,
|
|
9
|
+
value: field.value || '',
|
|
10
|
+
//state.behaviours.zform.values[field.apiName],
|
|
11
|
+
name: field.apiName,
|
|
12
|
+
id: field.id,
|
|
13
|
+
label: field.i18NLabel,
|
|
14
|
+
// toolTip: field.tooltip || '',
|
|
15
|
+
// toolTipType: field.toolTipType || '',
|
|
16
|
+
// placeholder: field.toolTip || '',
|
|
17
|
+
placeholder: field.toolTipType === "placeholder" ? field.toolTip : "",
|
|
18
|
+
required: field.isMandatory,
|
|
19
|
+
readonly: field.isReadOnly,
|
|
20
|
+
// visibility: field.isVisible,
|
|
21
|
+
isVisible: field.isVisible,
|
|
22
|
+
errorMessage: field.errorMessage || ''
|
|
23
|
+
}; // if (ePHIFields[field.type]) {
|
|
24
|
+
// fieldModified.ePHI = true;
|
|
25
|
+
// }
|
|
26
|
+
|
|
27
|
+
return fieldModified;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default URLFieldTranslator;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export { default as Date } from "./DateFieldTranslator";
|
|
2
|
+
export { default as DateTime } from "./DateTimeFieldTranslator";
|
|
3
|
+
export { default as Multiselect } from "./MultiselectFieldTranslator";
|
|
4
|
+
export { default as Text } from "./TextFieldTranslator";
|
|
5
|
+
export { default as Picklist } from "./PicklistFieldTranslator";
|
|
6
|
+
export { default as Boolean } from "./BooleanFieldTranslator";
|
|
7
|
+
export { default as Email } from "./EmailFieldTranslator";
|
|
8
|
+
export { default as Phone } from "./PhoneFieldTranslator";
|
|
9
|
+
export { default as Decimal } from "./DecimalFieldTranslator";
|
|
10
|
+
export { default as Number } from "./NumberFieldTranslator";
|
|
11
|
+
export { default as Currency } from "./CurrencyFieldTranslator";
|
|
12
|
+
export { default as Percent } from "./PercentageFieldTranslator";
|
|
13
|
+
export { default as URL } from "./URLFieldTranslator";
|
|
14
|
+
export { default as Textarea } from "./TextAreaFieldTranslator";
|
|
15
|
+
export { default as LookUp } from "./LookUpFieldTranslator";
|
|
@@ -15,7 +15,9 @@ class MyFormSuccessUseCase extends AbstractUseCase {
|
|
|
15
15
|
let layoutRuleApplier = this.dependencies.layoutRuleApplier;
|
|
16
16
|
let sectionEntities = sections.map(section => {
|
|
17
17
|
let fields = section.fields.map(field => {
|
|
18
|
-
|
|
18
|
+
const entity = new ZField(field);
|
|
19
|
+
entity.decideDefaultValue();
|
|
20
|
+
return entity;
|
|
19
21
|
});
|
|
20
22
|
let sectionWithFields = { ...section,
|
|
21
23
|
fields
|