@zohodesk/library-platform 1.1.3 → 1.1.6
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/README.md +3 -3
- package/es/bc/sdk/EventHandlers.js +1 -0
- package/es/bc/sdk/Properties.js +10 -0
- package/es/bc/sdk/ResourceNamesEnum.js +6 -0
- package/es/bc/zform/Symbol.js +1 -0
- package/es/bc/zhttp/Errors.js +14 -0
- package/es/bc/zhttp/index.js +3 -1
- package/es/bc/zlist/Constants.js +8 -1
- package/es/bc/zlist/Events.js +140 -0
- package/es/bc/zlist/index.js +2 -1
- package/es/bc/zrecord/Constants.js +3 -1
- package/es/cc/action-icon/Properties.js +19 -1
- package/es/cc/action-location/Constants.js +5 -3
- package/es/cc/architecture/LifeCycleActionEnum.js +2 -8
- package/es/cc/button/Constants.js +7 -0
- package/es/cc/button/Events.js +5 -0
- package/es/cc/button/Properties.js +77 -0
- package/es/cc/button/index.js +3 -0
- package/es/cc/component/FallbackView.js +1 -0
- package/es/cc/component/LifeCycleEventsEnum.js +9 -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/form/Constants.js +2 -0
- package/es/cc/form/Events.js +20 -0
- package/es/cc/form-connected/Constants.js +13 -0
- package/es/cc/index.js +3 -0
- package/es/cc/link/Properties.js +0 -1
- package/es/cc/list-item/Constants.js +7 -0
- package/es/cc/list-item/Events.js +14 -0
- package/es/cc/list-item/Properties.js +131 -0
- package/es/cc/list-item/index.js +3 -0
- package/es/cc/more-dropdown/Constants.js +7 -0
- package/es/cc/more-dropdown/Events.js +14 -0
- package/es/cc/more-dropdown/Properties.js +66 -0
- package/es/cc/more-dropdown/index.js +3 -0
- package/es/cc/section/Constants.js +2 -0
- package/es/cc/section/Events.js +20 -0
- package/es/cc/table-connected/ErrorEventType.js +32 -0
- package/es/cc/table-connected/Events.js +96 -0
- package/es/cc/table-connected/Properties.js +16 -0
- package/es/cc/table-connected/SdkContract.js +132 -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/Constants.js +4 -0
- package/es/cc/table-list/Properties.js +25 -0
- package/es/cc/table-list/row/Properties.js +44 -0
- package/es/index.js +6 -2
- package/es/library/behaviours/keyboard-controls/applications/usecases/DestructUsecase.js +5 -2
- package/es/library/behaviours/list-selection/frameworks/ActionHandlerFactory.js +4 -3
- package/es/library/custom-component/adapters/gateways/event-manager/EventManager.js +116 -4
- package/es/library/custom-component/applications/entities-factory/BehavioursFactory.js +18 -16
- 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 +6 -2
- package/es/library/custom-component/applications/usecases/UpdateStateUseCase.js +5 -1
- package/es/library/custom-component/domain/entities/Component.js +20 -3
- package/es/library/custom-component/domain/entities/LifeCycleAction.js +14 -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/action-location/frameworks/ui/ActionComponentMapping.js +6 -0
- package/es/library/dot/components/action-location/frameworks/ui/EventHandlersFactory.js +1 -1
- package/es/library/dot/components/form/frameworks/ui/EventHandlerFactory.js +23 -3
- package/es/library/dot/components/form/frameworks/ui/FormView.js +6 -3
- package/es/library/dot/components/form/frameworks/ui/css/Form.module.css +4 -0
- package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +1 -0
- package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +1 -0
- package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +1 -0
- package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +1 -0
- package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +1 -0
- package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +1 -0
- package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +1 -0
- package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +1 -0
- package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +1 -0
- package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +1 -0
- package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +1 -0
- package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +1 -0
- package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +1 -0
- package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +1 -0
- package/es/library/dot/components/section/frameworks/ui/EventHandlerFactory.js +26 -3
- package/es/library/dot/components/table-list/frameworks/hooks/useDropIndicator.js +8 -0
- package/es/library/dot/components/table-list/frameworks/hooks/useRowData.js +15 -0
- package/es/library/dot/components/table-list/frameworks/hooks/useTableRowReorder.js +105 -0
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +85 -15
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +240 -1
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +28 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +25 -9
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +11 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +50 -8
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowSelection.js +7 -1
- 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 +90 -0
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +10 -1
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/css/ActionIconView.module.css +3 -0
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/Button.js +12 -0
- package/es/library/dot/legacy-to-new-arch/button/frameworks/ui/ButtonView.js +41 -0
- package/es/library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItem.js +12 -0
- package/es/library/dot/legacy-to-new-arch/list-item/frameworks/ui/ListItemView.js +122 -0
- package/es/library/dot/legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdown.js +12 -0
- package/es/library/dot/legacy-to-new-arch/more-dropdown/frameworks/ui/MoreDropdownView.js +43 -0
- package/es/library/dot/legacy-to-new-arch/table-column-filter/frameworks/ui/TableColumnFilterView.js +8 -4
- 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 +12 -3
- package/es/platform/client-actions/template-resolver/index.js +1 -0
- package/es/platform/client-actions/translators/client-actions-translator/index.js +5 -2
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +3 -2
- package/es/platform/client-actions/translators/context-resolver/index.js +7 -10
- package/es/platform/components/form-connected/frameworks/EventHandlersFactory.js +91 -0
- package/es/platform/components/form-connected/frameworks/FormConnectedFactory.js +33 -0
- package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormConnectedView.js +1 -1
- package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormSdkFactory.js +3 -14
- package/es/platform/components/table-connected/adapters/controllers/ColumnChooserOpenedController.js +28 -0
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ColumnChooserUpdateController.js +5 -5
- package/es/platform/components/table-connected/adapters/controllers/ReOrderFinishController.js +21 -0
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeByMouseController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeEndController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeFinishController.js +1 -1
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ResizeStartController.js +2 -2
- package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/ScrollController.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 +326 -0
- package/es/platform/components/table-connected/application/interfaces/ISmartTableResource.js +1 -0
- package/es/platform/components/table-connected/frameworks/ErrorEventHandlersFactory.js +126 -0
- package/es/{desk-frameworks → platform/components}/table-connected/frameworks/EventHandlersFactory.js +58 -17
- package/es/platform/components/table-connected/frameworks/ListSdkFactory.js +57 -0
- package/es/platform/components/table-connected/frameworks/TableConnectedFactory.js +78 -0
- package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnectedView.js +10 -4
- package/es/platform/data-source/http-template/reOrderRecord.js +44 -0
- package/es/platform/data-source/index.js +2 -0
- package/es/platform/sdk/adapters/gateways/Repository.js +31 -0
- package/es/platform/sdk/adapters/gateways/Service.js +27 -0
- package/es/platform/sdk/adapters/presenters/Presenter.js +16 -0
- package/es/platform/sdk/application/interfaces/UsecaseDependencies.js +1 -0
- package/es/platform/sdk/application/interfaces/gateways/AbstractResource.js +13 -0
- package/es/platform/sdk/application/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/sdk/application/interfaces/gateways/ISdkManager.js +1 -0
- package/es/platform/sdk/application/interfaces/gateways/IService.js +1 -0
- package/es/platform/sdk/application/interfaces/input/CreateResourceInstanceUseCaseInputModel.js +1 -0
- package/es/platform/sdk/application/interfaces/input/DestructResourceInstanceUseCaseInputModel.js +1 -0
- package/es/platform/sdk/application/interfaces/input/GetResourceInstanceUseCaseInputModel.js +1 -0
- package/es/platform/sdk/application/interfaces/input/RegisterResourceInputModel.js +1 -0
- package/es/platform/sdk/application/interfaces/input/SyncStateWithResourceInputModel.js +1 -0
- package/es/platform/sdk/application/interfaces/output/ISdkPresenter.js +3 -0
- package/es/platform/sdk/application/usecases/AbstractUseCase.js +16 -0
- package/es/platform/sdk/application/usecases/CreateResourceInstanceUseCase.js +16 -0
- package/es/platform/sdk/application/usecases/DestructResourceInstanceUseCase.js +16 -0
- package/es/platform/sdk/application/usecases/GetResourceInstanceUseCase.js +17 -0
- package/es/platform/sdk/application/usecases/RegisterResourceUseCase.js +16 -0
- package/es/platform/sdk/application/usecases/SyncStateWithResourceUseCase.js +25 -0
- package/es/platform/sdk/domain/entities/ResourceManager.js +95 -0
- package/es/platform/sdk/domain/entities/interfaces/IResourceManager.js +1 -0
- package/es/platform/sdk/domain/entities/interfaces/ResourceManagerRestoreModel.js +1 -0
- package/es/platform/sdk/domain/entities/interfaces/SdkResource.js +1 -0
- package/es/platform/sdk/domain/entities/interfaces/SdkResourceDependencies.js +1 -0
- package/es/platform/sdk/domain/entities/interfaces/StateInterface.js +1 -0
- package/es/platform/sdk/frameworks/Sdk.js +11 -0
- package/es/platform/sdk/frameworks/SdkRegistry.js +72 -0
- package/es/platform/sdk-behaviour/adapters/controllers/AbstractController.js +11 -0
- package/es/platform/sdk-behaviour/adapters/controllers/DestructController.js +19 -0
- package/es/platform/sdk-behaviour/adapters/controllers/InitializeController.js +19 -0
- package/es/platform/sdk-behaviour/adapters/controllers/SyncStateWithResourceController.js +24 -0
- package/es/platform/sdk-behaviour/adapters/gateways/Repository.js +25 -0
- package/es/platform/sdk-behaviour/adapters/gateways/ResourceManagerGateWay.js +43 -0
- package/es/platform/sdk-behaviour/adapters/gateways/Service.js +19 -0
- package/es/platform/sdk-behaviour/applications/AbstractUseCase.js +6 -0
- package/es/platform/sdk-behaviour/applications/interfaces/UsecaseDependencies.js +1 -0
- package/es/platform/sdk-behaviour/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/sdk-behaviour/applications/interfaces/gateways/IResourceManagerGateWay.js +3 -0
- package/es/platform/sdk-behaviour/applications/interfaces/gateways/IService.js +1 -0
- package/es/platform/sdk-behaviour/applications/interfaces/input/CreateResourceInstanceUseCaseInputModel.js +1 -0
- package/es/platform/sdk-behaviour/applications/interfaces/input/DestructResourceInstanceUseCaseInputModel.js +1 -0
- package/es/platform/sdk-behaviour/applications/interfaces/input/SyncStateWithResourceUseCaseInputModel.js +1 -0
- package/es/platform/sdk-behaviour/applications/usecases/CreateResourceInstanceUseCase.js +14 -0
- package/es/platform/sdk-behaviour/applications/usecases/DestructResourceInstanceUseCase.js +14 -0
- package/es/platform/sdk-behaviour/applications/usecases/SyncStateWithResourceUseCase.js +22 -0
- package/es/platform/sdk-behaviour/domain/entities/BehaviourResourceConnector.js +49 -0
- package/es/platform/sdk-behaviour/domain/entities/interfaces/IBehaviourResourceConnector.js +1 -0
- package/es/platform/sdk-behaviour/domain/entities/interfaces/IResourceManagerProxy.js +2 -0
- package/es/platform/sdk-behaviour/frameworks/EventHandlerFactory.js +29 -0
- package/es/platform/sdk-behaviour/frameworks/SdkBehaviourFactory.js +16 -0
- 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/controllers/FieldValueChangeController.js +10 -3
- 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/FieldValueChangeRequestUseCase.js +13 -1
- 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/zform/frameworks/ui/EventHandlerFactory.js +10 -4
- 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/controllers/ReOrderController.js +25 -0
- package/es/platform/zlist/adapters/controllers/ReOrderFailedController.js +26 -0
- package/es/platform/zlist/adapters/gateways/Repository.js +12 -2
- package/es/platform/zlist/adapters/gateways/Service.js +8 -0
- package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +3 -1
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +19 -5
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +11 -12
- package/es/platform/zlist/adapters/presenters/translators/EmptyViewModel.js +2 -1
- package/es/platform/zlist/adapters/presenters/translators/Header.js +8 -4
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +3 -2
- package/es/platform/zlist/adapters/presenters/translators/ResizerStateTranslator.js +7 -3
- 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/adapters/presenters/utils/DefaultClientActions.js +1 -1
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -2
- package/es/platform/zlist/applications/interfaces/input/GetContextUseCaseInput.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/ReOrderRecordUseCaseInput.js +1 -0
- package/es/platform/zlist/applications/interfaces/input/UpdateMultipleRecordUseCaseInput.js +1 -0
- package/es/platform/zlist/applications/usecases/DeleteMultipleRecordUseCase.js +23 -2
- package/es/platform/zlist/applications/usecases/DeleteSingleRecordUseCase.js +9 -0
- package/es/platform/zlist/applications/usecases/FetchMoreUseCase.js +1 -1
- package/es/platform/zlist/applications/usecases/GetContextUseCase.js +18 -0
- package/es/platform/zlist/applications/usecases/ReOrderFailedUseCase.js +22 -0
- package/es/platform/zlist/applications/usecases/ReOrderUseCase.js +25 -0
- package/es/platform/zlist/applications/usecases/RecordExecuteFailedUseCase.js +3 -2
- package/es/platform/zlist/applications/usecases/RecordSuccessCallbackUsecase.js +24 -3
- package/es/platform/zlist/applications/usecases/RecordUpdateUseCase.js +9 -0
- package/es/platform/zlist/applications/usecases/UpdateMultipleRecordUseCase.js +34 -0
- package/es/platform/zlist/domain/entities/List.js +73 -48
- package/es/platform/zlist/domain/entities/ListErrorState.js +167 -0
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +16 -6
- package/es/platform/zlist/frameworks/ZListBehaviourFactory.js +6 -0
- package/es/platform/zrecord/applications/interfaces/input/GetMultipleRecordUsecaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/interfaces/input/GetSingleRecordUseCaseInputModel.js +1 -0
- package/es/platform/zrecord/applications/usecases/GetMultipleRecordUseCase.js +16 -0
- package/es/platform/zrecord/applications/usecases/GetSingleRecordUseCase.js +17 -0
- package/es/platform/zrecord/domain/entities/GetReOrderRecordsStrategy.js +40 -0
- package/es/platform/zrecord/domain/entities/Records.js +9 -4
- package/es/platform/zrecord/domain/entities/RecordsManager.js +11 -1
- package/package.json +10 -8
- package/es/desk-frameworks/form-connected/frameworks/EventHandlersFactory.js +0 -24
- package/es/desk-frameworks/form-connected/frameworks/FormConnectedFactory.js +0 -33
- package/es/desk-frameworks/table-connected/adapters/controllers/ColumnChooserOpenedController.js +0 -36
- package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +0 -172
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +0 -56
- /package/es/{desk-frameworks → platform/components}/form-connected/frameworks/FormConnected.js +0 -0
- /package/es/{desk-frameworks → platform/components}/index.js +0 -0
- /package/es/{desk-frameworks → platform/components}/table-connected/adapters/controllers/AbstractController.js +0 -0
- /package/es/{desk-frameworks → platform/components}/table-connected/frameworks/TableConnected.js +0 -0
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
import { ZFORM_FIELD_VALUE_CHANGED } from "../../../../bc/zform/Symbol";
|
|
2
3
|
|
|
3
4
|
class FieldValueChangeRequestUseCase extends AbstractUseCase {
|
|
4
5
|
execute(input) {
|
|
5
6
|
let {
|
|
7
|
+
sectionId,
|
|
6
8
|
fieldName,
|
|
7
|
-
newValue
|
|
9
|
+
newValue,
|
|
10
|
+
dispatch
|
|
8
11
|
} = input;
|
|
9
12
|
let {
|
|
10
13
|
layoutRuleApplier
|
|
@@ -29,6 +32,15 @@ class FieldValueChangeRequestUseCase extends AbstractUseCase {
|
|
|
29
32
|
// zform=zformEntitiy.toObject();
|
|
30
33
|
|
|
31
34
|
this.dependencies.presenter.updateFormResponse(zform);
|
|
35
|
+
dispatch({
|
|
36
|
+
type: ZFORM_FIELD_VALUE_CHANGED,
|
|
37
|
+
payload: {
|
|
38
|
+
sectionId,
|
|
39
|
+
fieldName,
|
|
40
|
+
value: newValue
|
|
41
|
+
},
|
|
42
|
+
metaData: {}
|
|
43
|
+
});
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
}
|
|
@@ -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
|
|
@@ -18,8 +18,11 @@ export default class ZField {
|
|
|
18
18
|
isMandatory,
|
|
19
19
|
value,
|
|
20
20
|
errorMessage,
|
|
21
|
-
|
|
21
|
+
isVisible = true,
|
|
22
22
|
pickListValues,
|
|
23
|
+
toolTip,
|
|
24
|
+
toolTipType,
|
|
25
|
+
defaultValue,
|
|
23
26
|
subType
|
|
24
27
|
} = _ref;
|
|
25
28
|
|
|
@@ -53,7 +56,7 @@ export default class ZField {
|
|
|
53
56
|
|
|
54
57
|
_defineProperty(this, "errorMessage", void 0);
|
|
55
58
|
|
|
56
|
-
_defineProperty(this, "
|
|
59
|
+
_defineProperty(this, "isVisible", void 0);
|
|
57
60
|
|
|
58
61
|
_defineProperty(this, "pickListValues", void 0);
|
|
59
62
|
|
|
@@ -61,6 +64,12 @@ export default class ZField {
|
|
|
61
64
|
|
|
62
65
|
_defineProperty(this, "subType", void 0);
|
|
63
66
|
|
|
67
|
+
_defineProperty(this, "toolTip", void 0);
|
|
68
|
+
|
|
69
|
+
_defineProperty(this, "toolTipType", void 0);
|
|
70
|
+
|
|
71
|
+
_defineProperty(this, "defaultValue", void 0);
|
|
72
|
+
|
|
64
73
|
this.displayLabel = displayLabel;
|
|
65
74
|
this.apiName = apiName;
|
|
66
75
|
this.isCustomField = isCustomField;
|
|
@@ -76,23 +85,53 @@ export default class ZField {
|
|
|
76
85
|
this.isMandatory = isMandatory;
|
|
77
86
|
this.value = value;
|
|
78
87
|
this.errorMessage = errorMessage;
|
|
79
|
-
this.
|
|
88
|
+
this.isVisible = isVisible;
|
|
80
89
|
this.defaultPickListValues = pickListValues;
|
|
81
90
|
this.pickListValues = pickListValues;
|
|
82
91
|
this.subType = subType;
|
|
92
|
+
this.toolTip = toolTip;
|
|
93
|
+
this.toolTipType = toolTipType;
|
|
94
|
+
this.defaultValue = defaultValue; // if(value===undefined){
|
|
95
|
+
// this.setDefaultValue()
|
|
96
|
+
// }
|
|
97
|
+
}
|
|
83
98
|
|
|
84
|
-
|
|
85
|
-
|
|
99
|
+
decideValueForBoolean(defaultValue) {
|
|
100
|
+
if (defaultValue === undefined || defaultValue === null) {
|
|
101
|
+
return false;
|
|
86
102
|
}
|
|
103
|
+
|
|
104
|
+
if (typeof defaultValue === "string") {
|
|
105
|
+
return defaultValue === "true" ? true : false;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
return defaultValue;
|
|
87
109
|
}
|
|
88
110
|
|
|
89
|
-
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
decideValueForMultiselect(defaultValue) {
|
|
112
|
+
if (defaultValue === undefined || defaultValue === null) {
|
|
113
|
+
return [];
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (typeof defaultValue === "string") {
|
|
117
|
+
return defaultValue.split(";");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
return defaultValue;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
decideDefaultValue() {
|
|
124
|
+
switch (this.type) {
|
|
125
|
+
case 'Boolean':
|
|
126
|
+
this.value = this.decideValueForBoolean(this.defaultValue);
|
|
127
|
+
break;
|
|
128
|
+
|
|
129
|
+
case 'Multiselect':
|
|
130
|
+
this.value = this.decideValueForMultiselect(this.defaultValue);
|
|
131
|
+
break;
|
|
132
|
+
|
|
133
|
+
default:
|
|
134
|
+
this.value = this.defaultValue === undefined ? '' : this.defaultValue;
|
|
96
135
|
}
|
|
97
136
|
}
|
|
98
137
|
|
|
@@ -125,15 +164,16 @@ export default class ZField {
|
|
|
125
164
|
}
|
|
126
165
|
|
|
127
166
|
toggleVisibility() {
|
|
128
|
-
this.
|
|
167
|
+
this.isVisible = !this.isVisible;
|
|
129
168
|
}
|
|
130
169
|
|
|
131
170
|
setVisibility(visibility) {
|
|
132
|
-
this.
|
|
171
|
+
this.isVisible = visibility;
|
|
133
172
|
}
|
|
134
173
|
|
|
135
174
|
isVisibile() {
|
|
136
|
-
return this.visibility;
|
|
175
|
+
// return this.visibility;
|
|
176
|
+
return this.isVisible;
|
|
137
177
|
}
|
|
138
178
|
|
|
139
179
|
setMandatory(isMandatory) {
|
|
@@ -161,8 +201,13 @@ export default class ZField {
|
|
|
161
201
|
isMandatory: this.isMandatory,
|
|
162
202
|
value: this.value,
|
|
163
203
|
errorMessage: this.errorMessage,
|
|
164
|
-
|
|
204
|
+
// NOTE: visibility is now isVisible, visibility is deprecated, only for backward compatibility of layout rules
|
|
205
|
+
visibility: this.isVisible,
|
|
206
|
+
isVisible: this.isVisible,
|
|
165
207
|
pickListValues: this.pickListValues,
|
|
208
|
+
toolTip: this.toolTip,
|
|
209
|
+
toolTipType: this.toolTipType,
|
|
210
|
+
defaultValue: this.defaultValue,
|
|
166
211
|
subType: this.subType
|
|
167
212
|
};
|
|
168
213
|
}
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
3
|
export default class ZSection {
|
|
4
|
+
// Optional field for description
|
|
5
|
+
// private visibility:boolean;
|
|
4
6
|
constructor(_ref) {
|
|
5
7
|
let {
|
|
6
8
|
name,
|
|
7
9
|
i18NLabel,
|
|
8
10
|
isCustomSection,
|
|
11
|
+
description,
|
|
9
12
|
id,
|
|
10
13
|
fields,
|
|
11
|
-
visibility
|
|
14
|
+
// visibility
|
|
15
|
+
isVisible
|
|
12
16
|
} = _ref;
|
|
13
17
|
|
|
14
18
|
_defineProperty(this, "name", void 0);
|
|
@@ -17,18 +21,23 @@ export default class ZSection {
|
|
|
17
21
|
|
|
18
22
|
_defineProperty(this, "isCustomSection", void 0);
|
|
19
23
|
|
|
24
|
+
_defineProperty(this, "description", void 0);
|
|
25
|
+
|
|
20
26
|
_defineProperty(this, "id", void 0);
|
|
21
27
|
|
|
22
28
|
_defineProperty(this, "fields", void 0);
|
|
23
29
|
|
|
24
|
-
_defineProperty(this, "
|
|
30
|
+
_defineProperty(this, "isVisible", void 0);
|
|
25
31
|
|
|
26
32
|
this.name = name;
|
|
27
33
|
this.i18NLabel = i18NLabel;
|
|
28
34
|
this.isCustomSection = isCustomSection;
|
|
35
|
+
this.description = description || ''; // Default to empty string if not provided
|
|
36
|
+
|
|
29
37
|
this.id = id;
|
|
30
|
-
this.fields = fields;
|
|
31
|
-
|
|
38
|
+
this.fields = fields; // this.visibility=visibility;
|
|
39
|
+
|
|
40
|
+
this.isVisible = isVisible;
|
|
32
41
|
}
|
|
33
42
|
|
|
34
43
|
getName() {
|
|
@@ -40,7 +49,8 @@ export default class ZSection {
|
|
|
40
49
|
}
|
|
41
50
|
|
|
42
51
|
toggleVisibility() {
|
|
43
|
-
this.visibility
|
|
52
|
+
// this.visibility=!this.visibility
|
|
53
|
+
this.isVisible = !this.isVisible;
|
|
44
54
|
}
|
|
45
55
|
|
|
46
56
|
appendField(field) {
|
|
@@ -74,7 +84,8 @@ export default class ZSection {
|
|
|
74
84
|
}
|
|
75
85
|
|
|
76
86
|
setVisibility(visibility) {
|
|
77
|
-
this.visibility
|
|
87
|
+
// this.visibility=visibility;
|
|
88
|
+
this.isVisible = visibility;
|
|
78
89
|
}
|
|
79
90
|
|
|
80
91
|
setFieldErrorMessage(fieldApiName, errorMessage) {
|
|
@@ -102,11 +113,13 @@ export default class ZSection {
|
|
|
102
113
|
name: this.name,
|
|
103
114
|
i18NLabel: this.i18NLabel,
|
|
104
115
|
isCustomSection: this.isCustomSection,
|
|
116
|
+
description: this.description,
|
|
105
117
|
id: this.id,
|
|
106
118
|
fields: this.fields.map(field => {
|
|
107
119
|
return field.toObject();
|
|
108
120
|
}),
|
|
109
|
-
visibility:
|
|
121
|
+
// visibility:this.visibility
|
|
122
|
+
isVisible: this.isVisible
|
|
110
123
|
};
|
|
111
124
|
}
|
|
112
125
|
|
|
@@ -3,7 +3,7 @@ import FormSubmitController from "../../adapters/controllers/FormSubmitControlle
|
|
|
3
3
|
import FormRepository from "../../adapters/gateway/FormRepository";
|
|
4
4
|
import FormPresenter from "../../adapters/presenter/FormPresenter";
|
|
5
5
|
import Service from "../../adapters/gateway/Service";
|
|
6
|
-
import
|
|
6
|
+
import LifeCycleEvents from "../../../../cc/component/LifeCycleEventsEnum";
|
|
7
7
|
import InitializeController from "../../adapters/controllers/IntializeController";
|
|
8
8
|
import { ZFORM_DEPENDENCY_MAPPINGS_REQUEST, ZFORM_DEPENDENCY_MAPPINGS_SUCCESS, ZFORM_FIELD_VALUE_CHANGE_REQUEST, ZFORM_MY_FORM_REQUEST, ZFORM_MY_FORM_SUCCESS, ZFORM_MY_LAYOUTS_SUCCESS, ZFORM_SET_FIELD_ERROR_MESSAGE, ZFORM_SUBMIT_SUCCESS, ZFORM_VALIDATE_FIELD_REQUEST, ZFORM_VALIDATE_SUBMIT_FIELD_HAS_ERROR_MESSAGE, ZFORM_VALIDATION_ERROR, ZFORM_VALIDATION_RULES_REQUEST, ZFORM_VALIDATION_RULES_SUCCESS } from "../../../../bc/zform/Symbol";
|
|
9
9
|
import MyLayoutSuccessController from "../../adapters/controllers/MyLayoutSuccessController";
|
|
@@ -57,7 +57,7 @@ class EventHandlersFactory {
|
|
|
57
57
|
const setFieldErrorMessageController = new SetFieldErrorMessageController(service);
|
|
58
58
|
const validateErrorMessageController = new ValidateErrorMessageController(service);
|
|
59
59
|
return {
|
|
60
|
-
[
|
|
60
|
+
[LifeCycleEvents.MOUNT]: initializeController.handle,
|
|
61
61
|
[ZFORM_MY_LAYOUTS_SUCCESS]: myLayoutSuccessController.handle,
|
|
62
62
|
[ZFORM_MY_FORM_REQUEST]: myFormRequestController.handle,
|
|
63
63
|
[ZFORM_MY_FORM_SUCCESS]: myFormSuccessController.handle,
|
|
@@ -209,11 +209,17 @@ class EventHandlersFactory {
|
|
|
209
209
|
action,
|
|
210
210
|
dispatch
|
|
211
211
|
} = _ref8;
|
|
212
|
+
const {
|
|
213
|
+
sectionId,
|
|
214
|
+
fieldName,
|
|
215
|
+
value
|
|
216
|
+
} = action.payload;
|
|
212
217
|
dispatch({
|
|
213
218
|
type: ZFORM_FIELD_VALUE_CHANGE_REQUEST,
|
|
214
219
|
payload: {
|
|
215
|
-
|
|
216
|
-
|
|
220
|
+
sectionId,
|
|
221
|
+
fieldName,
|
|
222
|
+
value
|
|
217
223
|
},
|
|
218
224
|
metaData: {}
|
|
219
225
|
});
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
/* eslint-disable @zohodesk/architecturerules/
|
|
2
|
-
|
|
3
|
-
/* eslint-disable max-lines-per-function */
|
|
1
|
+
/* eslint-disable @zohodesk/architecturerules/define-property-schema */
|
|
4
2
|
import { FETCH_FAILED, FETCH_SUCCESS_NO_CONTENT, FETCH_REQUESTED, FETCH_SUCCESS } from "../../../../bc/zhttp/Constants";
|
|
5
3
|
import AbstractUseCase from "./AbstractUseCase";
|
|
4
|
+
import { ZHttpErrorSource, ZHttpErrorCode } from "../../../../bc/zhttp/Errors";
|
|
6
5
|
|
|
7
6
|
class FetchUseCase extends AbstractUseCase {
|
|
8
7
|
async execute(inputModel) {
|
|
9
|
-
const {
|
|
10
|
-
fetchGateWay
|
|
11
|
-
} = this.dependencies;
|
|
12
8
|
const {
|
|
13
9
|
url,
|
|
14
10
|
method = 'GET',
|
|
@@ -17,7 +13,6 @@ class FetchUseCase extends AbstractUseCase {
|
|
|
17
13
|
const {
|
|
18
14
|
metaData,
|
|
19
15
|
dispatch,
|
|
20
|
-
payload,
|
|
21
16
|
headers
|
|
22
17
|
} = inputModel;
|
|
23
18
|
dispatch({
|
|
@@ -28,80 +23,130 @@ class FetchUseCase extends AbstractUseCase {
|
|
|
28
23
|
headers,
|
|
29
24
|
metaData
|
|
30
25
|
}
|
|
31
|
-
});
|
|
26
|
+
}); // NOTE: getResponse is hacky solution to get the data using function call instead of fetch, So any handling added to here needs to be added to fetch and vise versa
|
|
27
|
+
|
|
28
|
+
if (typeof getResponse === 'function') {
|
|
29
|
+
await this.handleGetResponseAsFunction(inputModel);
|
|
30
|
+
} else {
|
|
31
|
+
await this.handleFetchResponse(inputModel);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async handleGetResponseAsFunction(inputModel) {
|
|
36
|
+
const {
|
|
37
|
+
getResponse,
|
|
38
|
+
headers,
|
|
39
|
+
dispatch,
|
|
40
|
+
metaData
|
|
41
|
+
} = inputModel;
|
|
32
42
|
|
|
33
43
|
try {
|
|
34
|
-
|
|
35
|
-
if (typeof getResponse === 'function') {
|
|
36
|
-
const data = await getResponse(headers);
|
|
44
|
+
const data = await getResponse(headers);
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
} else {
|
|
45
|
-
dispatch({
|
|
46
|
-
type: FETCH_SUCCESS,
|
|
47
|
-
payload: {
|
|
48
|
-
response: data
|
|
49
|
-
},
|
|
50
|
-
metaData
|
|
51
|
-
});
|
|
52
|
-
}
|
|
46
|
+
if (data === undefined) {
|
|
47
|
+
dispatch({
|
|
48
|
+
type: FETCH_SUCCESS_NO_CONTENT,
|
|
49
|
+
payload: {},
|
|
50
|
+
metaData
|
|
51
|
+
});
|
|
53
52
|
} else {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
53
|
+
dispatch({
|
|
54
|
+
type: FETCH_SUCCESS,
|
|
55
|
+
payload: {
|
|
56
|
+
response: data
|
|
57
|
+
},
|
|
58
|
+
metaData
|
|
58
59
|
});
|
|
60
|
+
}
|
|
61
|
+
} catch (errorObj) {
|
|
62
|
+
this.dispatchException(inputModel, errorObj, ZHttpErrorSource.GetResponse, ZHttpErrorCode.UnknownError);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
async handleFetchResponse(inputModel) {
|
|
67
|
+
const {
|
|
68
|
+
fetchGateWay
|
|
69
|
+
} = this.dependencies;
|
|
70
|
+
const {
|
|
71
|
+
url,
|
|
72
|
+
method = 'GET',
|
|
73
|
+
headers,
|
|
74
|
+
payload
|
|
75
|
+
} = inputModel;
|
|
76
|
+
|
|
77
|
+
try {
|
|
78
|
+
const response = await fetchGateWay.fetch(url, {
|
|
79
|
+
headers,
|
|
80
|
+
method,
|
|
81
|
+
body: method === 'GET' ? null : payload
|
|
82
|
+
});
|
|
59
83
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
dispatch({
|
|
69
|
-
type: FETCH_SUCCESS,
|
|
70
|
-
payload: {},
|
|
71
|
-
metaData
|
|
72
|
-
});
|
|
73
|
-
} else {
|
|
74
|
-
const data = await response.json();
|
|
75
|
-
dispatch({
|
|
76
|
-
type: FETCH_SUCCESS,
|
|
77
|
-
payload: {
|
|
78
|
-
response: data
|
|
79
|
-
},
|
|
80
|
-
metaData
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
} else {
|
|
84
|
-
const data = await response.json();
|
|
85
|
-
dispatch({
|
|
86
|
-
type: FETCH_FAILED,
|
|
87
|
-
payload: {
|
|
88
|
-
error: data
|
|
89
|
-
},
|
|
90
|
-
metaData
|
|
91
|
-
});
|
|
92
|
-
}
|
|
84
|
+
if (response.ok) {
|
|
85
|
+
await this.handleSuccessResponse(response, inputModel);
|
|
86
|
+
} else {
|
|
87
|
+
const data = await response.json();
|
|
88
|
+
const errorObj = { ...data,
|
|
89
|
+
statusCode: response.status
|
|
90
|
+
};
|
|
91
|
+
this.dispatchException(inputModel, errorObj, ZHttpErrorSource.Fetch, ZHttpErrorCode.ApiError);
|
|
93
92
|
}
|
|
94
|
-
} catch (
|
|
93
|
+
} catch (errorObj) {
|
|
94
|
+
this.dispatchException(inputModel, errorObj, ZHttpErrorSource.Fetch, ZHttpErrorCode.UnknownError);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async handleSuccessResponse(response, inputModel) {
|
|
99
|
+
const {
|
|
100
|
+
method = 'GET',
|
|
101
|
+
dispatch,
|
|
102
|
+
metaData
|
|
103
|
+
} = inputModel;
|
|
104
|
+
const statusCode = response.status;
|
|
105
|
+
|
|
106
|
+
if (statusCode === 204) {
|
|
107
|
+
dispatch({
|
|
108
|
+
type: FETCH_SUCCESS_NO_CONTENT,
|
|
109
|
+
payload: {},
|
|
110
|
+
metaData
|
|
111
|
+
});
|
|
112
|
+
} else if (statusCode === 200 && method === 'DELETE') {
|
|
95
113
|
dispatch({
|
|
96
|
-
type:
|
|
114
|
+
type: FETCH_SUCCESS,
|
|
115
|
+
payload: {},
|
|
116
|
+
metaData
|
|
117
|
+
});
|
|
118
|
+
} else {
|
|
119
|
+
const data = await response.json();
|
|
120
|
+
dispatch({
|
|
121
|
+
type: FETCH_SUCCESS,
|
|
97
122
|
payload: {
|
|
98
|
-
|
|
123
|
+
response: data
|
|
99
124
|
},
|
|
100
125
|
metaData
|
|
101
126
|
});
|
|
102
127
|
}
|
|
103
128
|
}
|
|
104
129
|
|
|
130
|
+
dispatchException(inputModel, errorObj, source, code) {
|
|
131
|
+
const {
|
|
132
|
+
dispatch,
|
|
133
|
+
metaData
|
|
134
|
+
} = inputModel;
|
|
135
|
+
const error = {
|
|
136
|
+
code,
|
|
137
|
+
message: errorObj.message,
|
|
138
|
+
source,
|
|
139
|
+
info: errorObj
|
|
140
|
+
};
|
|
141
|
+
dispatch({
|
|
142
|
+
type: FETCH_FAILED,
|
|
143
|
+
payload: {
|
|
144
|
+
error
|
|
145
|
+
},
|
|
146
|
+
metaData
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
105
150
|
}
|
|
106
151
|
|
|
107
152
|
export default FetchUseCase;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class FieldExecuteFailedController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
payload,
|
|
12
|
+
metaData
|
|
13
|
+
} = action;
|
|
14
|
+
const {
|
|
15
|
+
recordExecuteFailedUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
recordExecuteFailedUseCase.updateDependency(state, updateState);
|
|
18
|
+
recordExecuteFailedUseCase.execute({
|
|
19
|
+
dispatch,
|
|
20
|
+
payload,
|
|
21
|
+
metaData
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class ReOrderController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
newIndex,
|
|
12
|
+
oldIndex
|
|
13
|
+
} = action.payload;
|
|
14
|
+
const {
|
|
15
|
+
reOrderUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
reOrderUseCase.updateDependency(state, updateState);
|
|
18
|
+
reOrderUseCase.execute({
|
|
19
|
+
dispatch,
|
|
20
|
+
newIndex,
|
|
21
|
+
oldIndex
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class ReOrderController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
newIndex,
|
|
12
|
+
oldIndex
|
|
13
|
+
} = action.payload;
|
|
14
|
+
const {
|
|
15
|
+
reOrderFailedUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
reOrderFailedUseCase.updateDependency(state, updateState);
|
|
18
|
+
reOrderFailedUseCase.execute({
|
|
19
|
+
dispatch,
|
|
20
|
+
newIndex,
|
|
21
|
+
oldIndex,
|
|
22
|
+
metaData: action.metaData
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
|
|
3
|
+
import ListErrorState from "../../domain/entities/ListErrorState";
|
|
3
4
|
import ListFactory from "../../applications/entities-factory/ListFactory";
|
|
4
5
|
import SortBy from "../../domain/entities/SortBy";
|
|
5
6
|
|
|
@@ -22,7 +23,8 @@ class Repository {
|
|
|
22
23
|
} = this.state.properties;
|
|
23
24
|
const {
|
|
24
25
|
sortBy,
|
|
25
|
-
|
|
26
|
+
errorState,
|
|
27
|
+
isReOrderLoading
|
|
26
28
|
} = this.getZListState();
|
|
27
29
|
const list = ListFactory.createList({
|
|
28
30
|
context,
|
|
@@ -34,11 +36,19 @@ class Repository {
|
|
|
34
36
|
},
|
|
35
37
|
sortBy: new SortBy(sortBy.id, sortBy.name, sortBy.order),
|
|
36
38
|
limit: 50,
|
|
37
|
-
|
|
39
|
+
isReOrderLoading,
|
|
40
|
+
errorState: new ListErrorState(errorState)
|
|
38
41
|
});
|
|
39
42
|
return list;
|
|
40
43
|
}
|
|
41
44
|
|
|
45
|
+
getRecords() {
|
|
46
|
+
const {
|
|
47
|
+
zrecord
|
|
48
|
+
} = this.state.behaviours;
|
|
49
|
+
return zrecord.records;
|
|
50
|
+
}
|
|
51
|
+
|
|
42
52
|
getZListState() {
|
|
43
53
|
const {
|
|
44
54
|
zlist
|
|
@@ -13,6 +13,8 @@ import RecordExecuteFailedUseCase from "../../applications/usecases/RecordExecut
|
|
|
13
13
|
import UpdateSuccessUseCase from "../../applications/usecases/UpdateSuccessUseCase";
|
|
14
14
|
import DeleteSuccessUseCase from "../../applications/usecases/DeleteSuccessUseCase";
|
|
15
15
|
import RecordSuccessCallbackUsecase from "../../applications/usecases/RecordSuccessCallbackUsecase";
|
|
16
|
+
import ReOrderUseCase from "../../applications/usecases/ReOrderUseCase";
|
|
17
|
+
import ReOrderFailedUseCase from "../../applications/usecases/ReOrderFailedUseCase";
|
|
16
18
|
|
|
17
19
|
class Service {
|
|
18
20
|
constructor(dependencies) {
|
|
@@ -44,6 +46,10 @@ class Service {
|
|
|
44
46
|
|
|
45
47
|
_defineProperty(this, "deleteSuccessUseCase", void 0);
|
|
46
48
|
|
|
49
|
+
_defineProperty(this, "reOrderUseCase", void 0);
|
|
50
|
+
|
|
51
|
+
_defineProperty(this, "reOrderFailedUseCase", void 0);
|
|
52
|
+
|
|
47
53
|
this.initializeUseCase = new InitializeUseCase(this.dependencies);
|
|
48
54
|
this.propertiesChangeUseCase = new PropertiesChangeUseCase(this.dependencies);
|
|
49
55
|
this.fetchMoreUseCase = new FetchMoreUseCase(this.dependencies);
|
|
@@ -57,6 +63,8 @@ class Service {
|
|
|
57
63
|
this.recordUpdateUseCase = new RecordUpdateUseCase(this.dependencies);
|
|
58
64
|
this.updateSuccessUseCase = new UpdateSuccessUseCase(this.dependencies);
|
|
59
65
|
this.deleteSuccessUseCase = new DeleteSuccessUseCase(this.dependencies);
|
|
66
|
+
this.reOrderUseCase = new ReOrderUseCase(this.dependencies);
|
|
67
|
+
this.reOrderFailedUseCase = new ReOrderFailedUseCase(this.dependencies);
|
|
60
68
|
}
|
|
61
69
|
|
|
62
70
|
}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
/* eslint-disable max-lines-per-function */
|
|
4
4
|
import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
|
|
5
5
|
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
6
|
+
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
6
7
|
export default function SelectionTranslator(state) {
|
|
7
8
|
const {
|
|
8
9
|
behaviours,
|
|
@@ -69,7 +70,8 @@ function getColumnChooserProps(columnChooser) {
|
|
|
69
70
|
options: columnChooserOptions,
|
|
70
71
|
searchString,
|
|
71
72
|
hasSearch: searchString !== '' || columnChooserOptions.length > 3,
|
|
72
|
-
errorMessage: isMaxSelectionReached ? "You've reached the limit of 15 columns." : ''
|
|
73
|
+
// errorMessage: isMaxSelectionReached ? "You've reached the limit of 15 columns." : ''
|
|
74
|
+
errorMessage: isMaxSelectionReached ? i18NProviderUtils.getI18NValue("support.ticket.table.max.colmun") : ''
|
|
73
75
|
};
|
|
74
76
|
}
|
|
75
77
|
|