@zohodesk/library-platform 1.1.6 → 1.1.7-exp.2
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/sdk/ResourceNamesEnum.js +2 -0
- package/es/bc/zform/Properties.js +3 -26
- package/es/bc/zform/Symbol.js +2 -0
- package/es/bc/zlist/Constants.js +3 -1
- package/es/bc/zrecord/Constants.js +1 -0
- package/es/cc/breadcrumb/Constants.js +7 -0
- package/es/cc/breadcrumb/Events.js +14 -0
- package/es/cc/breadcrumb/Properties.js +35 -0
- package/es/cc/breadcrumb/index.js +3 -0
- package/es/cc/fields/field/FormDefaultUIType.js +37 -0
- package/es/cc/fields/index.js +2 -1
- package/es/cc/form/Properties.js +54 -0
- package/es/cc/form-connected/Constants.js +8 -0
- package/es/cc/form-connected/Properties.js +95 -1
- package/es/cc/form-connected/SdkContract.js +159 -0
- package/es/cc/icon-button/Constants.js +7 -0
- package/es/cc/icon-button/Events.js +5 -0
- package/es/cc/icon-button/Properties.js +86 -0
- package/es/cc/icon-button/index.js +3 -0
- package/es/cc/index.js +1 -0
- package/es/cc/section/Properties.js +25 -0
- package/es/cc/table-connected/Properties.js +8 -0
- package/es/cc/table-connected/constants/Events.js +1 -0
- package/es/index.js +6 -1
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +5 -1
- package/es/library/dot/components/action-location/usecases/interactors/PropertiesChangeUseCase.js +1 -1
- package/es/library/dot/components/form/adapters/presenter/TransformState.js +70 -3
- package/es/library/dot/components/form/frameworks/ui/DefaultComponentRegister.js +28 -0
- package/es/library/dot/components/form/frameworks/ui/Form.js +2 -0
- package/es/library/dot/components/form/frameworks/ui/FormView.js +47 -26
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +8 -4
- package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +9 -9
- package/es/library/dot/components/section/frameworks/ui/RenderField.js +19 -0
- package/es/library/dot/components/section/frameworks/ui/Section.js +13 -4
- package/es/library/dot/components/section/frameworks/ui/SectionView.js +7 -28
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +72 -40
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +7 -13
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +2 -2
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/Breadcrumb.js +12 -0
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/BreadcrumbView.js +47 -0
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/css/Breadcrumb.module.css +19 -0
- package/es/library/dot/legacy-to-new-arch/breadcrumb/frameworks/ui/sub-components/BreadcrumbItem.js +58 -0
- package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButton.js +12 -0
- package/es/library/dot/legacy-to-new-arch/icon-button/frameworks/ui/IconButtonView.js +43 -0
- package/es/platform/client-actions/bc/zclient-actions/SdkContract.js +35 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionResource.js +105 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionResource.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionLocationInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionUIComponentPropertiesInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/GetClientActionsInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/UpdateClientActionUIComponentPropertiesInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionLocationUseCase.js +20 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionUIComponentPropertiesUseCase.js +20 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/GetClientActionsUseCase.js +18 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/UpdateClientActionUIComponentPropertiesUseCase.js +32 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +12 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +45 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +10 -0
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/sdk/ClientActionsSDKFactory.js +29 -0
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +9 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +1 -1
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +7 -3
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +3 -1
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +4 -2
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +4 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +5 -2
- package/es/platform/components/form-connected/adapters/resources/SmartFormResources.js +210 -0
- package/es/platform/components/form-connected/application/interfaces/ISmartFormResources.js +1 -0
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +16 -8
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +27 -3
- package/es/platform/components/form-connected/frameworks/FormConnectedView.js +14 -2
- package/es/platform/components/form-connected/frameworks/FormSdkFactory.js +33 -13
- package/es/platform/components/table-connected/adapters/resources/SmartTableResource.js +0 -52
- package/es/platform/components/table-connected/frameworks/EventHandlersFactory.js +15 -1
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +6 -1
- package/es/platform/data-source/http-template/getClientActions.js +2 -2
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +52 -1
- package/es/platform/sdk/frameworks/Sdk.js +14 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +90 -46
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +51 -26
- package/es/platform/zform/adapters/presenter/translators/interfaces/ComponentMapping.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/FieldContract.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/FormTranslatorState.js +1 -0
- package/es/platform/zform/adapters/presenter/translators/interfaces/SectionContract.js +1 -0
- package/es/platform/zform/adapters/presenter/utils/DefaultClientActions.js +59 -0
- package/es/platform/zform/applications/interfaces/input/DeleteFieldUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/GetFieldValueUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/HideFieldUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/HideSectionUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/InsertFieldUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/SetFieldValueUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/SetFieldsValuesUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ShowFieldUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/ShowSectionUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/SubmitUseCaseInput.js +1 -0
- package/es/platform/zform/applications/interfaces/input/UpdateFieldUseCaseInput.js +1 -0
- package/es/platform/zform/applications/usecases/DeleteFieldUseCase.js +22 -0
- package/es/platform/zform/applications/usecases/GetFieldValueUseCase.js +23 -0
- package/es/platform/zform/applications/usecases/HideFieldUseCase.js +19 -0
- package/es/platform/zform/applications/usecases/HideSectionUseCase.js +19 -0
- package/es/platform/zform/applications/usecases/InitializeUseCase.js +16 -0
- package/es/platform/zform/applications/usecases/InsertFieldUseCase.js +28 -0
- package/es/platform/zform/applications/usecases/SetFieldValueUseCase.js +44 -0
- package/es/platform/zform/applications/usecases/SetFieldsValuesUseCase.js +51 -0
- package/es/platform/zform/applications/usecases/ShowFieldUseCase.js +19 -0
- package/es/platform/zform/applications/usecases/ShowSectionUseCase.js +19 -0
- package/es/platform/zform/applications/usecases/SubmitUseCase.js +29 -0
- package/es/platform/zform/applications/usecases/UpdateFieldUseCase.js +22 -0
- package/es/platform/zform/domain/ZField.js +14 -0
- package/es/platform/zform/domain/ZForm.js +85 -3
- package/es/platform/zform/domain/ZSection.js +6 -0
- package/es/platform/zform/frameworks/layout-rules/calculateLayoutRulesResult.js +1 -1
- package/es/platform/zform/frameworks/layout-rules/runSingleFieldCondition.js +1 -1
- package/es/platform/zform/frameworks/layout-rules/validator.js +0 -1
- package/es/platform/zform/frameworks/ui/EventHandlerFactory.js +37 -15
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +3 -2
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +4 -1
- package/es/platform/zlist/domain/entities/List.js +9 -3
- package/es/platform/zrecord/adapters/controllers/CreateRecordController.js +5 -1
- package/es/platform/zrecord/adapters/controllers/SetRecordsController.js +7 -3
- package/es/platform/zrecord/applications/usecases/CreateRecordUseCase.js +5 -3
- package/es/platform/zrecord/applications/usecases/SetRecordsUseCase.js +11 -1
- package/package.json +8 -6
- package/es/library/dot/components/section/adapters/presenter/TransFormState.js +0 -26
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class ShowFieldUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
fieldName
|
|
7
|
+
} = input;
|
|
8
|
+
const {
|
|
9
|
+
repository,
|
|
10
|
+
presenter
|
|
11
|
+
} = this.dependencies;
|
|
12
|
+
const form = repository.getFormEntity();
|
|
13
|
+
form.setFieldVisibility(fieldName, true);
|
|
14
|
+
presenter.updateFormResponse(form.toObject());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default ShowFieldUseCase;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class ShowSectionUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
sectionName
|
|
7
|
+
} = input;
|
|
8
|
+
const {
|
|
9
|
+
repository,
|
|
10
|
+
presenter
|
|
11
|
+
} = this.dependencies;
|
|
12
|
+
const form = repository.getFormEntity();
|
|
13
|
+
form.setSectionVisibility(sectionName, true);
|
|
14
|
+
presenter.updateFormResponse(form.toObject());
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default ShowSectionUseCase;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ZFORM_SUBMIT } from "../../../../bc/zform/Symbol";
|
|
2
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
3
|
+
|
|
4
|
+
class SubmitUseCase extends AbstractUseCase {
|
|
5
|
+
execute(input) {
|
|
6
|
+
const {
|
|
7
|
+
dispatch
|
|
8
|
+
} = input;
|
|
9
|
+
const {
|
|
10
|
+
repository,
|
|
11
|
+
presenter
|
|
12
|
+
} = this.dependencies;
|
|
13
|
+
const zformEntity = repository.getFormEntity(); // let zform = zformEntitiy.toObject();
|
|
14
|
+
// presenter.updateFormResponse(zform);
|
|
15
|
+
|
|
16
|
+
const context = { ...zformEntity.getContext()
|
|
17
|
+
};
|
|
18
|
+
dispatch({
|
|
19
|
+
type: ZFORM_SUBMIT,
|
|
20
|
+
payload: {
|
|
21
|
+
props: context
|
|
22
|
+
},
|
|
23
|
+
metaData: {}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default SubmitUseCase;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class UpdateFieldUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
fieldName,
|
|
7
|
+
fieldProperties,
|
|
8
|
+
dispatch
|
|
9
|
+
} = input;
|
|
10
|
+
const {
|
|
11
|
+
repository,
|
|
12
|
+
presenter
|
|
13
|
+
} = this.dependencies;
|
|
14
|
+
const zformEntitiy = repository.getFormEntity();
|
|
15
|
+
zformEntitiy.updateFieldProperties(fieldName, fieldProperties);
|
|
16
|
+
let zform = zformEntitiy.toObject();
|
|
17
|
+
presenter.updateFormResponse(zform);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default UpdateFieldUseCase;
|
|
@@ -159,6 +159,20 @@ export default class ZField {
|
|
|
159
159
|
return this.errorMessage;
|
|
160
160
|
}
|
|
161
161
|
|
|
162
|
+
setProperties(fieldProperties) {
|
|
163
|
+
this.displayLabel = fieldProperties.displayLabel !== undefined ? fieldProperties.displayLabel : this.displayLabel;
|
|
164
|
+
this.i18NLabel = fieldProperties.i18NLabel !== undefined ? fieldProperties.i18NLabel : this.i18NLabel;
|
|
165
|
+
this.isMandatory = fieldProperties.isMandatory !== undefined ? fieldProperties.isMandatory : this.isMandatory;
|
|
166
|
+
this.isReadOnly = fieldProperties.isReadOnly !== undefined ? fieldProperties.isReadOnly : this.isReadOnly;
|
|
167
|
+
this.maxLength = fieldProperties.maxLength !== undefined ? fieldProperties.maxLength : this.maxLength;
|
|
168
|
+
this.isVisible = fieldProperties.isVisible !== undefined ? fieldProperties.isVisible : this.isVisible;
|
|
169
|
+
this.value = fieldProperties.value !== undefined ? fieldProperties.value : this.value;
|
|
170
|
+
this.errorMessage = fieldProperties.errorMessage !== undefined ? fieldProperties.errorMessage : this.errorMessage;
|
|
171
|
+
this.pickListValues = fieldProperties.pickListValues !== undefined ? fieldProperties.pickListValues : this.pickListValues;
|
|
172
|
+
this.defaultPickListValues = fieldProperties.defaultPickListValues !== undefined ? fieldProperties.defaultPickListValues : this.defaultPickListValues;
|
|
173
|
+
this.toolTip = fieldProperties.toolTip !== undefined ? fieldProperties.toolTip : this.toolTip;
|
|
174
|
+
}
|
|
175
|
+
|
|
162
176
|
setErrorMessage(errorMessage) {
|
|
163
177
|
this.errorMessage = errorMessage;
|
|
164
178
|
}
|
|
@@ -146,6 +146,29 @@ export default class ZForm {
|
|
|
146
146
|
this.isValidationRulesFetching = isValidationRulesFetching;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
+
getSectionId(_ref2) {
|
|
150
|
+
let {
|
|
151
|
+
fieldName,
|
|
152
|
+
sectionName
|
|
153
|
+
} = _ref2;
|
|
154
|
+
|
|
155
|
+
if (sectionName) {
|
|
156
|
+
for (let section of this.sections) {
|
|
157
|
+
if (section.getName() === sectionName) {
|
|
158
|
+
return section.getId();
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
for (let section of this.sections) {
|
|
164
|
+
for (let field of section.getFields()) {
|
|
165
|
+
if (field.getApiName() === fieldName) {
|
|
166
|
+
return section.getId();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
149
172
|
setSections(sections) {
|
|
150
173
|
this.sections = sections;
|
|
151
174
|
}
|
|
@@ -164,6 +187,42 @@ export default class ZForm {
|
|
|
164
187
|
});
|
|
165
188
|
}
|
|
166
189
|
|
|
190
|
+
getFieldValue(fieldName) {
|
|
191
|
+
let sectionId = this.getSectionId({
|
|
192
|
+
fieldName
|
|
193
|
+
});
|
|
194
|
+
let fieldValue = null;
|
|
195
|
+
this.sections.forEach(s => {
|
|
196
|
+
if (s.getId() === sectionId) {
|
|
197
|
+
s.getFields().forEach(f => {
|
|
198
|
+
if (f.getApiName() === fieldName) {
|
|
199
|
+
fieldValue = f.getValue();
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return fieldValue;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
updateFieldProperties(fieldName, fieldProperties) {
|
|
208
|
+
let sectionId = this.getSectionId({
|
|
209
|
+
fieldName
|
|
210
|
+
});
|
|
211
|
+
this.sections = this.sections.map(s => {
|
|
212
|
+
if (s.getId() === sectionId) {
|
|
213
|
+
s.getFields().map(f => {
|
|
214
|
+
if (f.getApiName() === fieldName) {
|
|
215
|
+
f.setProperties(fieldProperties);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
return f;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return s;
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
|
|
167
226
|
insertSectionAtPosition(section, position) {
|
|
168
227
|
this.sections = [...this.sections.slice(0, position), section, ...this.sections.slice(position)];
|
|
169
228
|
}
|
|
@@ -174,16 +233,29 @@ export default class ZForm {
|
|
|
174
233
|
});
|
|
175
234
|
}
|
|
176
235
|
|
|
177
|
-
|
|
236
|
+
setSectionVisibility(sectionName, isVisible) {
|
|
178
237
|
this.sections = this.sections.map(s => {
|
|
179
|
-
if (s.
|
|
180
|
-
s.
|
|
238
|
+
if (s.getName() === sectionName) {
|
|
239
|
+
s.setVisibility(isVisible);
|
|
181
240
|
}
|
|
182
241
|
|
|
183
242
|
return s;
|
|
184
243
|
});
|
|
185
244
|
}
|
|
186
245
|
|
|
246
|
+
setFieldVisibility(fieldName, isVisible) {
|
|
247
|
+
this.sections = this.sections.map(s => {
|
|
248
|
+
s.getFields().map(f => {
|
|
249
|
+
if (f.getApiName() === fieldName) {
|
|
250
|
+
f.setVisibility(isVisible);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
return f;
|
|
254
|
+
});
|
|
255
|
+
return s;
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
|
|
187
259
|
appendFieldInSection(sectionId, field) {
|
|
188
260
|
this.sections = this.sections.map(s => {
|
|
189
261
|
if (s.getId() === sectionId) {
|
|
@@ -204,6 +276,16 @@ export default class ZForm {
|
|
|
204
276
|
});
|
|
205
277
|
}
|
|
206
278
|
|
|
279
|
+
getFieldId(fieldName) {
|
|
280
|
+
for (let section of this.sections) {
|
|
281
|
+
for (let field of section.getFields()) {
|
|
282
|
+
if (field.getApiName() === fieldName) {
|
|
283
|
+
return field.getId();
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
207
289
|
deleteFields(fieldIds) {
|
|
208
290
|
this.sections = this.sections.map(s => {
|
|
209
291
|
s.deleteFields(fieldIds);
|
|
@@ -9,6 +9,7 @@ export default class ZSection {
|
|
|
9
9
|
i18NLabel,
|
|
10
10
|
isCustomSection,
|
|
11
11
|
description,
|
|
12
|
+
isCollapsed,
|
|
12
13
|
id,
|
|
13
14
|
fields,
|
|
14
15
|
// visibility
|
|
@@ -23,6 +24,8 @@ export default class ZSection {
|
|
|
23
24
|
|
|
24
25
|
_defineProperty(this, "description", void 0);
|
|
25
26
|
|
|
27
|
+
_defineProperty(this, "isCollapsed", void 0);
|
|
28
|
+
|
|
26
29
|
_defineProperty(this, "id", void 0);
|
|
27
30
|
|
|
28
31
|
_defineProperty(this, "fields", void 0);
|
|
@@ -34,6 +37,8 @@ export default class ZSection {
|
|
|
34
37
|
this.isCustomSection = isCustomSection;
|
|
35
38
|
this.description = description || ''; // Default to empty string if not provided
|
|
36
39
|
|
|
40
|
+
this.isCollapsed = isCollapsed || false; // Default to false if not provided
|
|
41
|
+
|
|
37
42
|
this.id = id;
|
|
38
43
|
this.fields = fields; // this.visibility=visibility;
|
|
39
44
|
|
|
@@ -114,6 +119,7 @@ export default class ZSection {
|
|
|
114
119
|
i18NLabel: this.i18NLabel,
|
|
115
120
|
isCustomSection: this.isCustomSection,
|
|
116
121
|
description: this.description,
|
|
122
|
+
isCollapsed: this.isCollapsed,
|
|
117
123
|
id: this.id,
|
|
118
124
|
fields: this.fields.map(field => {
|
|
119
125
|
return field.toObject();
|
|
@@ -191,7 +191,7 @@ export function calculateLayoutRulesResult(state, formValues) {
|
|
|
191
191
|
clearNotExistingData(hideFieldIds, isFieldExists);
|
|
192
192
|
clearNotExistingData(showFieldIds, isFieldExists);
|
|
193
193
|
clearNotExistingData(hideSectionIds, isSectionExists);
|
|
194
|
-
clearNotExistingData(
|
|
194
|
+
clearNotExistingData(showSectionIds, isSectionExists);
|
|
195
195
|
clearNotExistingData(removeMandatoryFieldIds, isFieldExists);
|
|
196
196
|
clearNotExistingData(setMandatoryFieldIds, isFieldExists);
|
|
197
197
|
return {
|
|
@@ -29,9 +29,9 @@ export function runSingleFieldCondition(_ref) {
|
|
|
29
29
|
conditions.forEach((conditionObj, i) => {
|
|
30
30
|
const {
|
|
31
31
|
condition,
|
|
32
|
-
value,
|
|
33
32
|
fieldName
|
|
34
33
|
} = conditionObj;
|
|
34
|
+
const value = 'value' in conditionObj ? conditionObj.value : undefined;
|
|
35
35
|
|
|
36
36
|
if (!fields[fieldName]) {
|
|
37
37
|
isSomeFiledMissing = true;
|
|
@@ -24,7 +24,8 @@ import { FIELD_VALIDATION_RESULT, VALIDATE_FIELDS_RESULT } from "../../../../bc/
|
|
|
24
24
|
import SetFieldErrorMessageController from "../../adapters/controllers/SetFieldErrorMessageController";
|
|
25
25
|
import LayoutRuleApplier from "../layout-rules/LayoutRuleApplier";
|
|
26
26
|
import ValidateErrorMessageController from "../../adapters/controllers/ValidateErrorMessageController";
|
|
27
|
-
import { CREATE_RECORD } from "../../../../bc/zrecord/Constants";
|
|
27
|
+
import { CREATE_RECORD, RECORD_EXECUTE_FAIL_CALLBACK, RECORD_EXECUTE_SUCCESS_CALLBACK } from "../../../../bc/zrecord/Constants";
|
|
28
|
+
import SmartFormConstants from "../../../../cc/form-connected/Constants";
|
|
28
29
|
|
|
29
30
|
class EventHandlersFactory {
|
|
30
31
|
static create(_ref) {
|
|
@@ -59,6 +60,26 @@ class EventHandlersFactory {
|
|
|
59
60
|
return {
|
|
60
61
|
[LifeCycleEvents.MOUNT]: initializeController.handle,
|
|
61
62
|
[ZFORM_MY_LAYOUTS_SUCCESS]: myLayoutSuccessController.handle,
|
|
63
|
+
[RECORD_EXECUTE_SUCCESS_CALLBACK]: _ref2 => {
|
|
64
|
+
let {
|
|
65
|
+
action,
|
|
66
|
+
dispatch
|
|
67
|
+
} = _ref2;
|
|
68
|
+
dispatch({
|
|
69
|
+
type: "SMART_FORM#SUBMIT_SUCCESS",
|
|
70
|
+
payload: action.payload
|
|
71
|
+
});
|
|
72
|
+
},
|
|
73
|
+
[RECORD_EXECUTE_FAIL_CALLBACK]: _ref3 => {
|
|
74
|
+
let {
|
|
75
|
+
action,
|
|
76
|
+
dispatch
|
|
77
|
+
} = _ref3;
|
|
78
|
+
dispatch({
|
|
79
|
+
type: "SMART_FORM#SUBMIT_FAILED",
|
|
80
|
+
payload: action.payload
|
|
81
|
+
});
|
|
82
|
+
},
|
|
62
83
|
[ZFORM_MY_FORM_REQUEST]: myFormRequestController.handle,
|
|
63
84
|
[ZFORM_MY_FORM_SUCCESS]: myFormSuccessController.handle,
|
|
64
85
|
[ZFORM_DEPENDENCY_MAPPINGS_REQUEST]: dependenciesRequestController.handle,
|
|
@@ -70,14 +91,15 @@ class EventHandlersFactory {
|
|
|
70
91
|
[ZFORM_FIELD_VALUE_CHANGE_REQUEST]: fieldValueChangeController.handle,
|
|
71
92
|
[ZFORM_SET_FIELD_ERROR_MESSAGE]: setFieldErrorMessageController.handle,
|
|
72
93
|
[ZFORM_VALIDATE_FIELD_REQUEST]: validateFieldRequestController.handle,
|
|
94
|
+
[SmartFormConstants.SMART_FORM_SUBMIT_CLICKED]: formSubmitController.handle,
|
|
73
95
|
[ZFORM_SUBMIT]: formSubmitController.handle,
|
|
74
|
-
[ZFORM_SUBMIT_SUCCESS]:
|
|
96
|
+
[ZFORM_SUBMIT_SUCCESS]: _ref4 => {
|
|
75
97
|
let {
|
|
76
98
|
action,
|
|
77
99
|
state,
|
|
78
100
|
updateState,
|
|
79
101
|
dispatch
|
|
80
|
-
} =
|
|
102
|
+
} = _ref4;
|
|
81
103
|
let formData = action.payload.formData;
|
|
82
104
|
let moduleName = state.properties.moduleName;
|
|
83
105
|
let record = {
|
|
@@ -98,13 +120,13 @@ class EventHandlersFactory {
|
|
|
98
120
|
}
|
|
99
121
|
});
|
|
100
122
|
},
|
|
101
|
-
[ZFORM_VALIDATION_ERROR]:
|
|
123
|
+
[ZFORM_VALIDATION_ERROR]: _ref5 => {
|
|
102
124
|
let {
|
|
103
125
|
action,
|
|
104
126
|
state,
|
|
105
127
|
updateState,
|
|
106
128
|
dispatch
|
|
107
|
-
} =
|
|
129
|
+
} = _ref5;
|
|
108
130
|
let formData = { ...state.behaviours.zform.formData
|
|
109
131
|
};
|
|
110
132
|
Object.keys(action.payload).forEach(key => {
|
|
@@ -118,13 +140,13 @@ class EventHandlersFactory {
|
|
|
118
140
|
});
|
|
119
141
|
},
|
|
120
142
|
[ZFORM_VALIDATE_SUBMIT_FIELD_HAS_ERROR_MESSAGE]: validateErrorMessageController.handle,
|
|
121
|
-
[FIELD_VALIDATION_RESULT]:
|
|
143
|
+
[FIELD_VALIDATION_RESULT]: _ref6 => {
|
|
122
144
|
let {
|
|
123
145
|
action,
|
|
124
146
|
state,
|
|
125
147
|
updateState,
|
|
126
148
|
dispatch
|
|
127
|
-
} =
|
|
149
|
+
} = _ref6;
|
|
128
150
|
let {
|
|
129
151
|
validationResult,
|
|
130
152
|
field
|
|
@@ -148,13 +170,13 @@ class EventHandlersFactory {
|
|
|
148
170
|
});
|
|
149
171
|
}
|
|
150
172
|
},
|
|
151
|
-
[VALIDATE_FIELDS_RESULT]:
|
|
173
|
+
[VALIDATE_FIELDS_RESULT]: _ref7 => {
|
|
152
174
|
let {
|
|
153
175
|
action,
|
|
154
176
|
state,
|
|
155
177
|
updateState,
|
|
156
178
|
dispatch
|
|
157
|
-
} =
|
|
179
|
+
} = _ref7;
|
|
158
180
|
let {
|
|
159
181
|
validationResults,
|
|
160
182
|
fields
|
|
@@ -183,20 +205,20 @@ class EventHandlersFactory {
|
|
|
183
205
|
}
|
|
184
206
|
});
|
|
185
207
|
},
|
|
186
|
-
[FormConstants.FORM_SUBMIT]:
|
|
208
|
+
[FormConstants.FORM_SUBMIT]: _ref8 => {
|
|
187
209
|
let {
|
|
188
210
|
action,
|
|
189
211
|
dispatch
|
|
190
|
-
} =
|
|
212
|
+
} = _ref8;
|
|
191
213
|
dispatch({
|
|
192
214
|
type: ZFORM_SUBMIT
|
|
193
215
|
});
|
|
194
216
|
},
|
|
195
|
-
[FormConstants.FORM_FIELD_BLURRED]:
|
|
217
|
+
[FormConstants.FORM_FIELD_BLURRED]: _ref9 => {
|
|
196
218
|
let {
|
|
197
219
|
action,
|
|
198
220
|
dispatch
|
|
199
|
-
} =
|
|
221
|
+
} = _ref9;
|
|
200
222
|
dispatch({
|
|
201
223
|
type: ZFORM_VALIDATE_FIELD_REQUEST,
|
|
202
224
|
payload: {
|
|
@@ -204,11 +226,11 @@ class EventHandlersFactory {
|
|
|
204
226
|
}
|
|
205
227
|
});
|
|
206
228
|
},
|
|
207
|
-
[FormConstants.FORM_FIELD_VALUE_CHANGE_REQUEST]:
|
|
229
|
+
[FormConstants.FORM_FIELD_VALUE_CHANGE_REQUEST]: _ref10 => {
|
|
208
230
|
let {
|
|
209
231
|
action,
|
|
210
232
|
dispatch
|
|
211
|
-
} =
|
|
233
|
+
} = _ref10;
|
|
212
234
|
const {
|
|
213
235
|
sectionId,
|
|
214
236
|
fieldName,
|
|
@@ -18,7 +18,7 @@ const fallbackToDefault = (value, defaultValue) => [undefined, null].includes(va
|
|
|
18
18
|
|
|
19
19
|
export default class TableTranslator {
|
|
20
20
|
static transformState(state) {
|
|
21
|
-
var _localStorageBehaviou, _localStorageBehaviou2;
|
|
21
|
+
var _preferences$rowActio, _localStorageBehaviou, _localStorageBehaviou2;
|
|
22
22
|
|
|
23
23
|
const {
|
|
24
24
|
behaviours,
|
|
@@ -92,6 +92,7 @@ export default class TableTranslator {
|
|
|
92
92
|
} = mapClientActions(newClientActions || EMPTY_ARRAY);
|
|
93
93
|
const isRowClickable = noLocation.some(action => action.uiComponentMapping.eventMappings.some(mapping => mapping.sourceEvent === TableListConstants.TABLE_LIST_ROW_CLICKED));
|
|
94
94
|
const rowCursor = isRowClickable ? RowCursor.Pointer : RowCursor.Default;
|
|
95
|
+
const rowActionsWidth = preferences === null || preferences === void 0 ? void 0 : (_preferences$rowActio = preferences.rowActions) === null || _preferences$rowActio === void 0 ? void 0 : _preferences$rowActio.width;
|
|
95
96
|
const {
|
|
96
97
|
moduleName,
|
|
97
98
|
viewId
|
|
@@ -126,7 +127,7 @@ export default class TableTranslator {
|
|
|
126
127
|
rowActionsConfig: {
|
|
127
128
|
hasActions: Boolean(rowActions === null || rowActions === void 0 ? void 0 : rowActions.length),
|
|
128
129
|
// Boolean(newRowActions?.length),
|
|
129
|
-
columnWidth: ColumnWidth.XSmall
|
|
130
|
+
columnWidth: typeof rowActionsWidth === 'number' ? rowActionsWidth : ColumnWidth.XSmall
|
|
130
131
|
},
|
|
131
132
|
keyboardControlsConfig,
|
|
132
133
|
isLoading,
|
|
@@ -30,8 +30,11 @@ class RecordSuccessCallbackUsecase extends AbstractUseCase {
|
|
|
30
30
|
type: SET_RECORDS,
|
|
31
31
|
payload: {
|
|
32
32
|
records: reordered
|
|
33
|
+
},
|
|
34
|
+
metaData: {
|
|
35
|
+
isReOrder: true
|
|
33
36
|
}
|
|
34
|
-
});
|
|
37
|
+
}); // dispatch({ type: "SMART_TABLE#RECORD_REORDER_SUCCESSED", payload: { records: reordered } });
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
if (list.isAcknowledgeBySortBy(metaData)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RECORD_EXECUTE, RECORD_FETCH_MORE, RECORD_REFETCH, RecordApiActionName } from "../../../../bc/zrecord/Constants";
|
|
2
2
|
import { FIELD_EXECUTE, FIELD_REFETCH } from "../../../../bc/zfield/Constants";
|
|
3
|
-
import { ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../../bc/zlist/Constants";
|
|
3
|
+
import { CLIENT_ACTION_TABLE_LIST_COMPONENT_NAME, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../../bc/zlist/Constants";
|
|
4
4
|
import { CLIENTACTION_BEHAVIOUR_EXECUTE } from "../../../client-actions/bc/zclient-actions/Constants";
|
|
5
5
|
import { SmartTableConstants } from "../../../../cc/table-connected";
|
|
6
6
|
import SortBy from "./SortBy";
|
|
@@ -184,14 +184,18 @@ class List {
|
|
|
184
184
|
getDeleteSuccessAction(recordIds) {
|
|
185
185
|
return {
|
|
186
186
|
type: SmartTableConstants.Events.DELETE_RECORDS_SUCCESS,
|
|
187
|
-
payload:
|
|
187
|
+
payload: {
|
|
188
|
+
recordIds: [recordIds]
|
|
189
|
+
}
|
|
188
190
|
};
|
|
189
191
|
}
|
|
190
192
|
|
|
191
193
|
getUpdateSuccessAction(recordId) {
|
|
192
194
|
return {
|
|
193
195
|
type: SmartTableConstants.Events.UPDATE_RECORDS_SUCCESS,
|
|
194
|
-
payload:
|
|
196
|
+
payload: {
|
|
197
|
+
recordId: recordId
|
|
198
|
+
}
|
|
195
199
|
};
|
|
196
200
|
}
|
|
197
201
|
|
|
@@ -316,6 +320,8 @@ class List {
|
|
|
316
320
|
|
|
317
321
|
createClientActionsFetchAction() {
|
|
318
322
|
const props = this.createApiProps();
|
|
323
|
+
props.components = CLIENT_ACTION_TABLE_LIST_COMPONENT_NAME;
|
|
324
|
+
props.modules = props.moduleName;
|
|
319
325
|
return {
|
|
320
326
|
type: CLIENTACTION_BEHAVIOUR_EXECUTE,
|
|
321
327
|
payload: {
|
|
@@ -7,6 +7,9 @@ export default class CreateRecordController extends AbstractController {
|
|
|
7
7
|
action,
|
|
8
8
|
dispatch
|
|
9
9
|
} = event;
|
|
10
|
+
const {
|
|
11
|
+
properties
|
|
12
|
+
} = state;
|
|
10
13
|
const {
|
|
11
14
|
payload
|
|
12
15
|
} = action;
|
|
@@ -21,7 +24,8 @@ export default class CreateRecordController extends AbstractController {
|
|
|
21
24
|
createRecordUseCase.execute({
|
|
22
25
|
record,
|
|
23
26
|
moduleName,
|
|
24
|
-
dispatch
|
|
27
|
+
dispatch,
|
|
28
|
+
context: properties.context
|
|
25
29
|
});
|
|
26
30
|
}
|
|
27
31
|
|
|
@@ -8,10 +8,12 @@ export default class SetRecordsController {
|
|
|
8
8
|
const {
|
|
9
9
|
state,
|
|
10
10
|
updateState,
|
|
11
|
-
action
|
|
11
|
+
action,
|
|
12
|
+
dispatch
|
|
12
13
|
} = event;
|
|
13
14
|
const {
|
|
14
|
-
payload
|
|
15
|
+
payload,
|
|
16
|
+
metaData
|
|
15
17
|
} = action;
|
|
16
18
|
const {
|
|
17
19
|
records
|
|
@@ -21,7 +23,9 @@ export default class SetRecordsController {
|
|
|
21
23
|
} = this.service;
|
|
22
24
|
setRecordsUseCase.updateDependency(state, updateState);
|
|
23
25
|
setRecordsUseCase.execute({
|
|
24
|
-
records
|
|
26
|
+
records,
|
|
27
|
+
metaData,
|
|
28
|
+
dispatch
|
|
25
29
|
});
|
|
26
30
|
});
|
|
27
31
|
}
|
|
@@ -11,14 +11,16 @@ class CreateRecordUseCase extends AbstractUseCase {
|
|
|
11
11
|
const {
|
|
12
12
|
record,
|
|
13
13
|
dispatch,
|
|
14
|
-
moduleName
|
|
14
|
+
moduleName,
|
|
15
|
+
context
|
|
15
16
|
} = input;
|
|
16
17
|
const recordManager = repository.getRecordsManagerEntity();
|
|
17
18
|
const recordEntity = RecordFactory.createSingleRecord(record);
|
|
18
19
|
let meta = recordManager.createRecordMeta(recordEntity);
|
|
19
|
-
dispatch(recordManager.
|
|
20
|
+
dispatch(recordManager.createDataSourceExecuteEvent({
|
|
20
21
|
record: recordEntity.toObject(),
|
|
21
|
-
moduleName
|
|
22
|
+
moduleName,
|
|
23
|
+
...context
|
|
22
24
|
}, RecordApiActionName.CREATE_RECORD, meta));
|
|
23
25
|
presenter.updateRecord(recordManager.toObject());
|
|
24
26
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import AbstractUseCase from "./AbstractUseCase";
|
|
2
2
|
import RecordFactory from "../entities-factory/RecordFactory";
|
|
3
|
+
import { SET_RECORDS_SUCCESS } from "../../../../bc/zrecord/Constants";
|
|
3
4
|
|
|
4
5
|
class SetRecordsUseCase extends AbstractUseCase {
|
|
5
6
|
execute(input) {
|
|
@@ -8,12 +9,21 @@ class SetRecordsUseCase extends AbstractUseCase {
|
|
|
8
9
|
repository
|
|
9
10
|
} = this.dependencies;
|
|
10
11
|
const {
|
|
11
|
-
records
|
|
12
|
+
records,
|
|
13
|
+
metaData,
|
|
14
|
+
dispatch
|
|
12
15
|
} = input;
|
|
13
16
|
const recordManager = repository.getRecordsManagerEntity();
|
|
14
17
|
const recordsEntity = RecordFactory.createMultipleRecords(records);
|
|
15
18
|
recordManager.setRecords(recordsEntity);
|
|
16
19
|
presenter.updateRecord(recordManager.toObject());
|
|
20
|
+
dispatch({
|
|
21
|
+
type: SET_RECORDS_SUCCESS,
|
|
22
|
+
metaData,
|
|
23
|
+
payload: {
|
|
24
|
+
records
|
|
25
|
+
}
|
|
26
|
+
});
|
|
17
27
|
}
|
|
18
28
|
|
|
19
29
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/library-platform",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.7-exp.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
"cssVariableConvert": "react-cli variableConverter ./es ./es",
|
|
17
17
|
"clean": "react-cli clean ./es",
|
|
18
18
|
"build": "npm run clean && react-cli build:library:es",
|
|
19
|
+
"build:css": "npm run build && npm run rtl && npm run cssVariableConvert",
|
|
19
20
|
"build:watch": "npm run clean && npm run build -- -w",
|
|
20
21
|
"test": "jest",
|
|
21
|
-
"prepare": "npm run clean && npm run build
|
|
22
|
+
"prepare": "npm run clean && npm run build:css",
|
|
22
23
|
"publish:alpha": "npm publish --tag alpha",
|
|
23
24
|
"publish:beta": "npm publish --tag beta",
|
|
24
25
|
"publish:exp": "npm publish --tag experimental",
|
|
@@ -43,7 +44,7 @@
|
|
|
43
44
|
"@types/react": "18.2.55",
|
|
44
45
|
"@typescript-eslint/parser": "^7.11.0",
|
|
45
46
|
"@zoho/SecurityJS": "5.0.2",
|
|
46
|
-
"@zohodesk-private/css-variable-migrator": "^1.0.
|
|
47
|
+
"@zohodesk-private/css-variable-migrator": "^1.0.8",
|
|
47
48
|
"@zohodesk-private/desk-components": "1.0.0-temp-53.3",
|
|
48
49
|
"@zohodesk-private/node-plugins": "1.1.9",
|
|
49
50
|
"@zohodesk/a11y": "2.2.6",
|
|
@@ -51,8 +52,8 @@
|
|
|
51
52
|
"@zohodesk/codestandard-validator": "0.0.4",
|
|
52
53
|
"@zohodesk/components": "1.2.62",
|
|
53
54
|
"@zohodesk/dot": "1.7.8",
|
|
54
|
-
"@zohodesk/eslint-plugin-architecturerules": "0.0.
|
|
55
|
-
"@zohodesk/eslint-plugin-no-hardcoding": "1.0.6",
|
|
55
|
+
"@zohodesk/eslint-plugin-architecturerules": "0.0.6-exp-4",
|
|
56
|
+
"@zohodesk/eslint-plugin-no-hardcoding": "1.0.6-platform-1",
|
|
56
57
|
"@zohodesk/hooks": "2.0.5",
|
|
57
58
|
"@zohodesk/icons": "1.0.72",
|
|
58
59
|
"@zohodesk/layout": "3.1.0",
|
|
@@ -72,6 +73,7 @@
|
|
|
72
73
|
"jsep": "^0.3.5",
|
|
73
74
|
"prettier": "3.3.3",
|
|
74
75
|
"react-sortable-hoc": "1.11.0",
|
|
76
|
+
"stylelint-config-standard": "^38.0.0",
|
|
75
77
|
"ts-jest": "29.2.6",
|
|
76
78
|
"typescript": "4.9.5"
|
|
77
79
|
},
|
|
@@ -96,4 +98,4 @@
|
|
|
96
98
|
"jsep": "0.3.5",
|
|
97
99
|
"object-path-immutable": "4.1.2"
|
|
98
100
|
}
|
|
99
|
-
}
|
|
101
|
+
}
|