@zohodesk/library-platform 1.1.0-exp.1 → 1.1.0
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 +2 -2
- package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
- package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
- package/es/bc/zdata-source/EventHandlers.js +2 -0
- package/es/bc/zdata-source/Symbols.js +5 -0
- package/es/bc/zfield/ActionHandlers.js +1 -1
- package/es/bc/zlist/EventHandlers.js +1 -1
- package/es/bc/zlist/Properties.js +17 -30
- package/es/bc/zrecord/Constants.js +3 -1
- package/es/cc/action-icon/Properties.js +31 -0
- package/es/cc/action-location/Properties.js +9 -24
- package/es/cc/table-connected/Constants.js +4 -0
- package/es/cc/table-connected/Properties.js +14 -57
- package/es/cc/table-list/Properties.js +34 -10
- package/es/cc/table-list/data-types/Header.js +14 -7
- package/es/cc/table-list/data-types/RowCursor.js +8 -0
- package/es/cc/table-list/row/Properties.js +16 -3
- package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +88 -1
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +23 -6
- package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +9 -4
- package/es/library/behaviours/list-selection/domain/entities/ListItemSelection.js +29 -9
- package/es/library/custom-component/domain/entities/Component.js +8 -4
- package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
- package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +16 -6
- package/es/library/dot/components/table-list/frameworks/ui/css/TableList.module.css +10 -0
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +8 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/Rows.js +9 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/ActionColumn.js +3 -2
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +18 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/Headers.js +0 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/SelectAll.js +4 -4
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Columns.js +2 -6
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +13 -7
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +8 -5
- package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +18 -7
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
- package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
- package/es/library/dot/legacy-to-new-arch/table-field-components/lookup-field/frameworks/ui/LookupFieldView.js +7 -6
- package/es/platform/client-actions/Readme.md +31 -0
- package/es/platform/client-actions/bc/zclient-actions/Constants.js +11 -0
- package/es/platform/client-actions/bc/zclient-actions/EventHandlers.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/Readme.md +31 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/ClientActionBehaviourExecutorController.js +27 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/FailureController.js +28 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/FetchStateStopController.js +21 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/MountController.js +25 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/NoContentController.js +23 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/SetClientActionsController.js +24 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/SuccessController.js +28 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Repository.js +28 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/gateways/Service.js +35 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/Presenter.js +24 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/entities-factory/ClientActionFactory.js +12 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/entities-factory/ClientActionManagerFactory.js +10 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/SetClientActionsInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/input/SuccessInputModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/ExecuteActionBehaviourUseCase.js +33 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/FailureUseCase.js +22 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/FetchStateStopUseCase.js +25 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/InitializeUseCase.js +17 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/NoContentUseCase.js +27 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/SetClientActionsUseCase.js +21 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/SuccessUseCase.js +22 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientAction.js +65 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +141 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActions.js +50 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMapping.js +36 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/EventMappings.js +15 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/GetClientActionsStrategy.js +44 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/UIComponentMapping.js +41 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/BehaviourState.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ClientActionsModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ComponentPropertiesModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionFieldModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/ConditionModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventMappingModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/EventModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IAction.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientActionExecuteStrategy.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientActionManager.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientActions.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IError.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEvent.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEventMapping.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IEventMappings.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IPayload.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/IUIComponentMapping.js +0 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/PayloadValueMappingModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/PropsMeta.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/State.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/StrategyMeta.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/SubMeta.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/UIComponentMappingModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/interfaces/UserDetailsModel.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/ActionsHandlersFactory.js +47 -0
- package/es/platform/client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory.js +12 -0
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +34 -0
- package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +51 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/MountController.js +18 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/PropertiesChangeController.js +26 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/controllers/UnmountController.js +18 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/gateway/Repository.js +36 -0
- package/es/platform/client-actions/components/action-event-mediator/adapters/presenters/Presenter.js +22 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/interfaces/UseCaseDependencies.js +1 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/interfaces/gateways/IRepository.js +0 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/interfaces/input/PropertiesChangeUseCaseInputModel.js +1 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/interfaces/output/IPresenter.js +0 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/AbstractUseCase.js +15 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/DestroyUseCase.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/InitializeUseCase.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/applications/usecases/PropertiesChangeUseCase.js +17 -0
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/ActionEventMediatorEntity.js +108 -0
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/interfaces/IActionLocation.js +1 -0
- package/es/platform/client-actions/components/action-event-mediator/domain/entities/interfaces/IState.js +1 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator.js +13 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +19 -0
- package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +30 -0
- package/es/platform/client-actions/components/dynamic-component/domain/entities/interfaces/IState.js +1 -0
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponent.js +9 -0
- package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +34 -0
- package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
- package/es/platform/client-actions/components/interfaces/EventMappingViewModel.js +0 -0
- package/es/platform/client-actions/components/row-actions-renderer/domain/entities/interfaces/IState.js +1 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.js +12 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
- package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +30 -0
- package/es/platform/client-actions/template-resolver/index.js +44 -0
- package/es/platform/client-actions/template-resolver/interfaces/ITemplate.js +1 -0
- package/es/platform/client-actions/translators/client-actions-translator/index.js +29 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEmptyString.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEndsWith.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThan.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalGreaterThanOrEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIn.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsEmpty.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalIsNotEmpty.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThan.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLessThanOrEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalLike.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotEquals.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalNotLike.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/EvalStartsWith.js +4 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/GetResolvedContextFieldValue.js +8 -0
- package/es/platform/client-actions/translators/condition-resolver/field-evaluators/index.js +58 -0
- package/es/platform/client-actions/translators/condition-resolver/index.js +33 -0
- package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/PatternValidator.js +86 -0
- package/es/platform/client-actions/translators/condition-resolver/pattern-evaluator/index.js +96 -0
- package/es/platform/client-actions/translators/context-resolver/index.js +54 -0
- package/es/platform/client-actions/translators/interfaces/IContext.js +1 -0
- package/es/platform/client-actions/translators/interfaces/IState.js +1 -0
- package/es/platform/data-source/dbc/index.js +1 -0
- package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +1 -1
- package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +1 -1
- package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
- package/es/platform/data-source/http-template/getClientActions.js +23 -0
- package/es/platform/{data-broker → data-source}/http-template/getRecords.js +1 -1
- package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
- package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +1 -1
- package/es/platform/{data-broker → data-source}/index.js +5 -5
- package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
- package/es/platform/zdata-source/adapters/controllers/AbstractController.js +8 -0
- package/es/platform/{zdata-broker/adapters/controllers/ActionExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
- package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
- package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
- package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
- package/es/platform/zdata-source/applications/interfaces/InputDependencies.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/IRepository.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/IService.js +0 -0
- package/es/platform/zdata-source/applications/interfaces/gateways/State.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/ExecuteActionInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/FailureInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/NoContentInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/RegisterInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/input/SuccessInputModel.js +1 -0
- package/es/platform/zdata-source/applications/interfaces/output/IPresenter.js +1 -0
- package/es/platform/zdata-source/applications/usecases/AbstractUseCase.js +17 -0
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
- package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
- package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
- package/es/platform/zdata-source/domain/entities/interfaces/APIDetailsModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/APITemplateModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/APITemplatesModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/BehaviourState.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/EventModel.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplate.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IAPITemplates.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/IDataSource.js +0 -0
- package/es/platform/zdata-source/domain/entities/interfaces/ITemplateHelpers.js +1 -0
- package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
- package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
- package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
- package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
- package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
- package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
- package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
- package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
- package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
- package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
- package/es/platform/zlist/adapters/gateways/Repository.js +9 -8
- package/es/platform/zlist/adapters/gateways/Service.js +8 -0
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +54 -13
- package/es/platform/zlist/adapters/presenters/translators/ColumnAlignmentTranslator.js +11 -0
- package/es/platform/zlist/adapters/presenters/translators/ColumnSizeTranslator.js +23 -0
- package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
- package/es/platform/zlist/adapters/presenters/translators/Header.js +10 -4
- package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
- package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
- package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
- package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
- package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
- package/es/platform/zlist/adapters/presenters/translators/interfaces/Context.js +1 -0
- package/es/platform/zlist/adapters/presenters/translators/interfaces/FieldComponentMapping.js +1 -0
- package/es/platform/zlist/applications/entities-factory/ListFactory.js +3 -2
- package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
- package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
- package/es/platform/zlist/domain/entities/List.js +58 -27
- package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
- package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
- package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
- package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
- package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
- package/package.json +24 -22
- package/es/bc/zdata-broker/EventHandlers.js +0 -2
- package/es/bc/zdata-broker/Symbols.js +0 -5
- package/es/platform/data-broker/http-template/getUIActions.js +0 -22
- package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
- /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
- /package/es/{platform/data-broker/dbc/index.js → cc/table-list/data-types/RowActionsConfig.js} +0 -0
- /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/adapters/controllers/AbstractController.js +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/InputDependencies.js → client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/gateways/IRepository.js → client-actions/behaviour/zclient-actions/applications/interfaces/ComponentPropertiesModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/gateways/State.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionFieldModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/ExecuteActionInputModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/ConditionModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/FailureInputModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/EventMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/NoContentInputModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/IError.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/RegisterInputModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/InputDependencies.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/input/SuccessInputModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/PayloadValueMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker/applications/interfaces/output/IPresenter.js → client-actions/behaviour/zclient-actions/applications/interfaces/PropsMeta.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APIDetailsModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/StrategyMeta.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplateModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/UIComponentMappingModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/APITemplatesModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/UserDetailsModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/BehaviourState.js → client-actions/behaviour/zclient-actions/applications/interfaces/gateways/IRepository.js} +0 -0
- /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/interfaces/gateways/IService.js +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/EventModel.js → client-actions/behaviour/zclient-actions/applications/interfaces/gateways/State.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplate.js → client-actions/behaviour/zclient-actions/applications/interfaces/input/ExecuteActionBehaviourInputModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IAPITemplates.js → client-actions/behaviour/zclient-actions/applications/interfaces/input/FailureInputModel.js} +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/ITemplateHelpers.js → client-actions/behaviour/zclient-actions/applications/interfaces/input/FetchStateStopInputModel.js} +0 -0
- /package/es/platform/{zlist/adapters/presenters/translators/interfaces/FieldUiMapping.js → client-actions/behaviour/zclient-actions/applications/interfaces/input/InitializeInputModel.js} +0 -0
- /package/es/platform/{zlist/adapters/presenters/translators/interfaces/PageContext.js → client-actions/behaviour/zclient-actions/applications/interfaces/input/NoContentInputModel.js} +0 -0
- /package/es/platform/{zdata-broker → client-actions/behaviour/zclient-actions}/applications/usecases/AbstractUseCase.js +0 -0
- /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → client-actions/behaviour/zclient-actions/domain/entities/interfaces/IClientAction.js} +0 -0
- /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
- /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ApiEnum.js +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
class AbstractUseCase {
|
|
2
|
+
constructor(dependencies) {
|
|
3
|
+
this.dependencies = dependencies;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
updateDependency(state, updateState) {
|
|
7
|
+
const {
|
|
8
|
+
repository,
|
|
9
|
+
presenter
|
|
10
|
+
} = this.dependencies;
|
|
11
|
+
repository.init(state);
|
|
12
|
+
presenter.updateDependencies(state, updateState);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AbstractUseCase;
|
package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js
RENAMED
|
@@ -12,9 +12,9 @@ class ExecuteActionUseCase extends AbstractUseCase {
|
|
|
12
12
|
metaData,
|
|
13
13
|
actionName
|
|
14
14
|
} = input;
|
|
15
|
-
const
|
|
16
|
-
const apiDetails =
|
|
17
|
-
dispatch(
|
|
15
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
16
|
+
const apiDetails = dataSource.getApiDetails(actionName, props);
|
|
17
|
+
dispatch(dataSource.createFetchEvent(apiDetails, metaData));
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
}
|
|
@@ -11,10 +11,10 @@ class FailureUseCase extends AbstractUseCase {
|
|
|
11
11
|
metaData,
|
|
12
12
|
error
|
|
13
13
|
} = input;
|
|
14
|
-
const
|
|
14
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
15
15
|
|
|
16
|
-
if (
|
|
17
|
-
const events =
|
|
16
|
+
if (dataSource.isMetaHasDataSourceSignature(metaData)) {
|
|
17
|
+
const events = dataSource.createFailureEvents(error, metaData);
|
|
18
18
|
events.forEach(action => {
|
|
19
19
|
dispatch(action);
|
|
20
20
|
});
|
|
@@ -10,10 +10,10 @@ class NoContentUseCase extends AbstractUseCase {
|
|
|
10
10
|
dispatch,
|
|
11
11
|
metaData
|
|
12
12
|
} = input;
|
|
13
|
-
const
|
|
13
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
14
14
|
|
|
15
|
-
if (
|
|
16
|
-
const events =
|
|
15
|
+
if (dataSource.isMetaHasDataSourceSignature(metaData)) {
|
|
16
|
+
const events = dataSource.createNoContentEvents(metaData);
|
|
17
17
|
events.forEach(action => {
|
|
18
18
|
dispatch(action);
|
|
19
19
|
});
|
|
@@ -14,12 +14,12 @@ class SuccessUseCase extends AbstractUseCase {
|
|
|
14
14
|
const {
|
|
15
15
|
actionName
|
|
16
16
|
} = metaData;
|
|
17
|
-
const
|
|
17
|
+
const dataSource = repository.getDataSourceEntity(templateHelpers);
|
|
18
18
|
|
|
19
|
-
if (
|
|
20
|
-
const transformer =
|
|
19
|
+
if (dataSource.isMetaHasDataSourceSignature(metaData)) {
|
|
20
|
+
const transformer = dataSource.getTransformer(actionName);
|
|
21
21
|
const transformedResponse = transformer(response);
|
|
22
|
-
const events =
|
|
22
|
+
const events = dataSource.createSuccessEvents(transformedResponse, metaData);
|
|
23
23
|
events.forEach(action => {
|
|
24
24
|
dispatch(action);
|
|
25
25
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FETCH } from "../../../../bc/zhttp/Constants";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export default class
|
|
2
|
+
import { DATA_SOURCE_EXECUTE_FAILED, DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_SOURCE_EXECUTE_SUCCEEDED } from "../../../../bc/zdata-source/Constants";
|
|
3
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SIGNATURE, DATA_SOURCE_SUCCESS } from "../../../../bc/zdata-source/Symbols";
|
|
4
|
+
export default class DataSource {
|
|
5
5
|
constructor(apiTemplates) {
|
|
6
6
|
this.apiTemplates = apiTemplates;
|
|
7
7
|
}
|
|
@@ -11,14 +11,14 @@ export default class DataBroker {
|
|
|
11
11
|
type: FETCH,
|
|
12
12
|
payload: apiDetails,
|
|
13
13
|
metaData: {
|
|
14
|
-
signature:
|
|
14
|
+
signature: DATA_SOURCE_SIGNATURE,
|
|
15
15
|
...metaData
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
return metaData.signature ===
|
|
20
|
+
isMetaHasDataSourceSignature(metaData) {
|
|
21
|
+
return metaData.signature === DATA_SOURCE_SIGNATURE;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
createSuccessEvents(transformedResponse, fullMetaData) {
|
|
@@ -28,7 +28,7 @@ export default class DataBroker {
|
|
|
28
28
|
const {
|
|
29
29
|
type,
|
|
30
30
|
metaData
|
|
31
|
-
} = fullMetaData[
|
|
31
|
+
} = fullMetaData[DATA_SOURCE_SUCCESS];
|
|
32
32
|
const actions = [];
|
|
33
33
|
type && actions.push({
|
|
34
34
|
type,
|
|
@@ -38,7 +38,7 @@ export default class DataBroker {
|
|
|
38
38
|
}
|
|
39
39
|
});
|
|
40
40
|
actions.push({
|
|
41
|
-
type:
|
|
41
|
+
type: DATA_SOURCE_EXECUTE_SUCCEEDED,
|
|
42
42
|
metaData,
|
|
43
43
|
payload: {
|
|
44
44
|
actionName,
|
|
@@ -55,7 +55,7 @@ export default class DataBroker {
|
|
|
55
55
|
const {
|
|
56
56
|
type,
|
|
57
57
|
metaData
|
|
58
|
-
} = fullMetaData[
|
|
58
|
+
} = fullMetaData[DATA_SOURCE_NO_CONTENT];
|
|
59
59
|
const actions = [];
|
|
60
60
|
type && actions.push({
|
|
61
61
|
type,
|
|
@@ -63,7 +63,7 @@ export default class DataBroker {
|
|
|
63
63
|
payload: {}
|
|
64
64
|
});
|
|
65
65
|
actions.push({
|
|
66
|
-
type:
|
|
66
|
+
type: DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED,
|
|
67
67
|
metaData,
|
|
68
68
|
payload: {
|
|
69
69
|
actionName
|
|
@@ -79,7 +79,7 @@ export default class DataBroker {
|
|
|
79
79
|
const {
|
|
80
80
|
type,
|
|
81
81
|
metaData
|
|
82
|
-
} = fullMetaData[
|
|
82
|
+
} = fullMetaData[DATA_SOURCE_FAILURE];
|
|
83
83
|
const actions = [];
|
|
84
84
|
type && actions.push({
|
|
85
85
|
type,
|
|
@@ -89,7 +89,7 @@ export default class DataBroker {
|
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
actions.push({
|
|
92
|
-
type:
|
|
92
|
+
type: DATA_SOURCE_EXECUTE_FAILED,
|
|
93
93
|
metaData,
|
|
94
94
|
payload: {
|
|
95
95
|
actionName,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from "../../../../../bc/zdata-source/Symbols";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import EventHandlersFactory from "./EventHandlersFactory";
|
|
2
|
-
export default class
|
|
2
|
+
export default class DataSourceBehaviourFactory {
|
|
3
3
|
static create() {
|
|
4
4
|
return {
|
|
5
|
-
name: '
|
|
5
|
+
name: 'dataSource',
|
|
6
6
|
eventHandlers: EventHandlersFactory.create(),
|
|
7
7
|
properties: {},
|
|
8
8
|
setInitialState: () => ({})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DATA_SOURCE_EXECUTE, DATA_SOURCE_REGISTER } from "../../../bc/zdata-source/Constants";
|
|
2
2
|
import { FETCH_FAILED, FETCH_SUCCESS, FETCH_SUCCESS_NO_CONTENT } from "../../../bc/zhttp/Constants";
|
|
3
3
|
import Presenter from "../adapters/presenters/Presenter";
|
|
4
4
|
import Repository from "../adapters/gateways/Repository";
|
|
5
5
|
import RegisterController from "../adapters/controllers/RegisterController";
|
|
6
|
-
import
|
|
6
|
+
import DataSourceExecutorController from "../adapters/controllers/DataSourceExecutorController";
|
|
7
7
|
import FailureController from "../adapters/controllers/FailureController";
|
|
8
8
|
import SuccessController from "../adapters/controllers/SuccessController";
|
|
9
9
|
import NoContentController from "../adapters/controllers/NoContentController";
|
|
@@ -25,17 +25,12 @@ export default class EventHandlersFactory {
|
|
|
25
25
|
|
|
26
26
|
static create() {
|
|
27
27
|
const service = this.createService();
|
|
28
|
-
const registerController = new RegisterController(service);
|
|
29
|
-
const executeController = new ActionExecutorController(service);
|
|
30
|
-
const failureController = new FailureController(service);
|
|
31
|
-
const successController = new SuccessController(service);
|
|
32
|
-
const noContentController = new NoContentController(service);
|
|
33
28
|
return {
|
|
34
|
-
[
|
|
35
|
-
[
|
|
36
|
-
[FETCH_FAILED]:
|
|
37
|
-
[FETCH_SUCCESS]:
|
|
38
|
-
[FETCH_SUCCESS_NO_CONTENT]:
|
|
29
|
+
[DATA_SOURCE_REGISTER]: new RegisterController(service).handle,
|
|
30
|
+
[DATA_SOURCE_EXECUTE]: new DataSourceExecutorController(service).handle,
|
|
31
|
+
[FETCH_FAILED]: new FailureController(service).handle,
|
|
32
|
+
[FETCH_SUCCESS]: new SuccessController(service).handle,
|
|
33
|
+
[FETCH_SUCCESS_NO_CONTENT]: new NoContentController(service).handle
|
|
39
34
|
};
|
|
40
35
|
}
|
|
41
36
|
|
|
@@ -12,7 +12,7 @@ class ExecuteActionUseCase extends AbstractUseCase {
|
|
|
12
12
|
} = input;
|
|
13
13
|
const fieldManager = repository.getFieldManager();
|
|
14
14
|
fieldManager.startFetching(apiName);
|
|
15
|
-
dispatch(fieldManager.
|
|
15
|
+
dispatch(fieldManager.createDataSourceExecuteEvent(props, apiName));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DATA_SOURCE_REGISTER } from "../../../../bc/zdata-source/Constants";
|
|
2
2
|
import AbstractUseCase from "./AbstractUseCase";
|
|
3
3
|
|
|
4
4
|
class InitializeUseCase extends AbstractUseCase {
|
|
@@ -8,7 +8,7 @@ class InitializeUseCase extends AbstractUseCase {
|
|
|
8
8
|
dispatch
|
|
9
9
|
} = input;
|
|
10
10
|
dispatch({
|
|
11
|
-
type:
|
|
11
|
+
type: DATA_SOURCE_REGISTER,
|
|
12
12
|
payload: {
|
|
13
13
|
apiTemplates
|
|
14
14
|
}
|
|
@@ -12,7 +12,7 @@ class RefetchUseCase extends AbstractUseCase {
|
|
|
12
12
|
} = input;
|
|
13
13
|
const fieldManager = repository.getFieldManager();
|
|
14
14
|
fieldManager.startFetching(apiName);
|
|
15
|
-
dispatch(fieldManager.
|
|
15
|
+
dispatch(fieldManager.createDataSourceExecuteEvent(props, apiName));
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
}
|
|
@@ -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
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { DATA_SOURCE_EXECUTE } from "../../../../../bc/zdata-source/Constants";
|
|
4
|
+
import { DATA_SOURCE_SUCCESS } from "../../../../../bc/zdata-source/Symbols";
|
|
5
5
|
|
|
6
6
|
class FieldManager {
|
|
7
7
|
constructor(fields, selectedFields, isFieldsFetching, isSelectedFieldsFetching) {
|
|
@@ -39,16 +39,16 @@ class FieldManager {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
createDataSourceExecuteEvent(props, apiName) {
|
|
43
43
|
return {
|
|
44
|
-
type:
|
|
44
|
+
type: DATA_SOURCE_EXECUTE,
|
|
45
45
|
payload: {
|
|
46
46
|
props,
|
|
47
47
|
actionName: apiName
|
|
48
48
|
},
|
|
49
49
|
metaData: {
|
|
50
50
|
actionName: apiName,
|
|
51
|
-
[
|
|
51
|
+
[DATA_SOURCE_SUCCESS]: {
|
|
52
52
|
metaData: {
|
|
53
53
|
apiName
|
|
54
54
|
}
|
|
@@ -10,7 +10,7 @@ import FetchFailureController from "../adapters/controllers/FetchFailureControll
|
|
|
10
10
|
import FetchNoContentController from "../adapters/controllers/FetchNoContentController";
|
|
11
11
|
import RefetchController from "../adapters/controllers/RefetchController";
|
|
12
12
|
import Presenter from "../adapters/presenters/Presenter";
|
|
13
|
-
import {
|
|
13
|
+
import { DATA_SOURCE_EXECUTE_FAILED, DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_SOURCE_EXECUTE_SUCCEEDED } from "../../../bc/zdata-source/Constants";
|
|
14
14
|
|
|
15
15
|
class ActionHandlerFactory {
|
|
16
16
|
static create(apiTemplates) {
|
|
@@ -32,9 +32,9 @@ class ActionHandlerFactory {
|
|
|
32
32
|
MOUNT: new InitializeController(service, apiTemplates).handle,
|
|
33
33
|
[FIELD_EXECUTE]: new ExecuteActionController(service).handle,
|
|
34
34
|
[FIELD_REFETCH]: new RefetchController(service).handle,
|
|
35
|
-
[
|
|
36
|
-
[
|
|
37
|
-
[
|
|
35
|
+
[DATA_SOURCE_EXECUTE_SUCCEEDED]: new FetchSuccessController(service).handle,
|
|
36
|
+
[DATA_SOURCE_EXECUTE_FAILED]: new FetchFailureController(service).handle,
|
|
37
|
+
[DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED]: new FetchNoContentController(service).handle
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class DeleteSuccessController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
recordId
|
|
12
|
+
} = action.payload;
|
|
13
|
+
const {
|
|
14
|
+
deleteSuccessUseCase
|
|
15
|
+
} = this.service;
|
|
16
|
+
deleteSuccessUseCase.updateDependency(state);
|
|
17
|
+
deleteSuccessUseCase.execute({
|
|
18
|
+
dispatch,
|
|
19
|
+
recordId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default DeleteSuccessController;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
|
|
3
|
+
class UpdateSuccessController extends AbstractController {
|
|
4
|
+
handle(event) {
|
|
5
|
+
const {
|
|
6
|
+
state,
|
|
7
|
+
dispatch,
|
|
8
|
+
action
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
recordId
|
|
12
|
+
} = action.payload;
|
|
13
|
+
const {
|
|
14
|
+
updateSuccessUseCase
|
|
15
|
+
} = this.service;
|
|
16
|
+
updateSuccessUseCase.updateDependency(state);
|
|
17
|
+
updateSuccessUseCase.execute({
|
|
18
|
+
dispatch,
|
|
19
|
+
recordId
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default UpdateSuccessController;
|
|
@@ -13,20 +13,21 @@ class Repository {
|
|
|
13
13
|
|
|
14
14
|
getList() {
|
|
15
15
|
const {
|
|
16
|
-
limit,
|
|
17
16
|
sortBy,
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
departmentId,
|
|
18
|
+
viewId,
|
|
19
|
+
moduleName,
|
|
20
|
+
context
|
|
20
21
|
} = this.state.properties;
|
|
21
22
|
const list = ListFactory.createList({
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
context,
|
|
24
|
+
filter: {
|
|
25
|
+
departmentId,
|
|
26
|
+
viewId,
|
|
26
27
|
moduleName
|
|
27
28
|
},
|
|
28
29
|
sortBy,
|
|
29
|
-
limit
|
|
30
|
+
limit: 50
|
|
30
31
|
});
|
|
31
32
|
return list;
|
|
32
33
|
}
|
|
@@ -10,6 +10,8 @@ import RecordUpdateUseCase from "../../applications/usecases/RecordUpdateUseCase
|
|
|
10
10
|
import DeleteSingleRecordUseCase from "../../applications/usecases/DeleteSingleRecordUseCase";
|
|
11
11
|
import RecordExecuteSucceededUseCase from "../../applications/usecases/RecordExecuteSucceededUseCase";
|
|
12
12
|
import RecordExecuteFailedUseCase from "../../applications/usecases/RecordExecuteFailedUseCase";
|
|
13
|
+
import UpdateSuccessUseCase from "../../applications/usecases/UpdateSuccessUseCase";
|
|
14
|
+
import DeleteSuccessUseCase from "../../applications/usecases/DeleteSuccessUseCase";
|
|
13
15
|
|
|
14
16
|
class Service {
|
|
15
17
|
constructor(dependencies) {
|
|
@@ -35,6 +37,10 @@ class Service {
|
|
|
35
37
|
|
|
36
38
|
_defineProperty(this, "recordUpdateUseCase", void 0);
|
|
37
39
|
|
|
40
|
+
_defineProperty(this, "updateSuccessUseCase", void 0);
|
|
41
|
+
|
|
42
|
+
_defineProperty(this, "deleteSuccessUseCase", void 0);
|
|
43
|
+
|
|
38
44
|
this.initializeUseCase = new InitializeUseCase(this.dependencies);
|
|
39
45
|
this.propertiesChangeUseCase = new PropertiesChangeUseCase(this.dependencies);
|
|
40
46
|
this.fetchMoreUseCase = new FetchMoreUseCase(this.dependencies);
|
|
@@ -45,6 +51,8 @@ class Service {
|
|
|
45
51
|
this.recordExecuteSucceededUseCase = new RecordExecuteSucceededUseCase(this.dependencies);
|
|
46
52
|
this.recordExecuteFailedUseCase = new RecordExecuteFailedUseCase(this.dependencies);
|
|
47
53
|
this.recordUpdateUseCase = new RecordUpdateUseCase(this.dependencies);
|
|
54
|
+
this.updateSuccessUseCase = new UpdateSuccessUseCase(this.dependencies);
|
|
55
|
+
this.deleteSuccessUseCase = new DeleteSuccessUseCase(this.dependencies);
|
|
48
56
|
}
|
|
49
57
|
|
|
50
58
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/* eslint-disable max-lines-per-function */
|
|
2
|
+
import { Width as ColumnWidth } from "../../../../cc/table-list/data-types/Header";
|
|
2
3
|
import HeadersTranslator from "./translators/HeadersTranslator";
|
|
3
4
|
import RowsTranslator from "./translators/RowsTranslator";
|
|
4
5
|
import Pipeline from "./utils/Pipeline";
|
|
6
|
+
import RowCursor from "../../../../cc/table-list/data-types/RowCursor";
|
|
7
|
+
import { TableListConstants } from "../../../../cc/table-list";
|
|
5
8
|
|
|
6
9
|
const fallbackToDefault = (value, defaultValue) => [undefined, null].includes(value) ? defaultValue : value;
|
|
7
10
|
|
|
@@ -12,22 +15,29 @@ export default class TableTranslator {
|
|
|
12
15
|
properties
|
|
13
16
|
} = state;
|
|
14
17
|
const {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
pageContext
|
|
18
|
+
componentMapping,
|
|
19
|
+
context
|
|
18
20
|
} = properties;
|
|
21
|
+
context['servicePrefix'] = 'supportapi/zd'; // FIX: servicePrefix defaultValue should be available from properties
|
|
22
|
+
|
|
19
23
|
const {
|
|
20
24
|
zrecord,
|
|
21
|
-
zfield
|
|
25
|
+
zfield,
|
|
26
|
+
zclientAction
|
|
22
27
|
} = fallbackToDefault(behaviours, {}); // FIX: behaviours should be available by default
|
|
23
28
|
|
|
24
29
|
const {
|
|
25
30
|
records,
|
|
26
31
|
isFetching: isRecordsFetching
|
|
27
|
-
} = fallbackToDefault(zrecord, {}); // FIX: zrecord should be available by
|
|
32
|
+
} = fallbackToDefault(zrecord, {}); // FIX: zrecord should be available by defau
|
|
33
|
+
|
|
34
|
+
const {
|
|
35
|
+
clientActions,
|
|
36
|
+
isFetching: isClientActionsFetching
|
|
37
|
+
} = fallbackToDefault(zclientAction, {}); // FIX: zclientAction should be available by defaultlt
|
|
28
38
|
|
|
29
|
-
const
|
|
30
|
-
const rowActionsUiType =
|
|
39
|
+
const fieldComponentMapping = componentMapping.fields;
|
|
40
|
+
const rowActionsUiType = componentMapping.rowActionsComponentName;
|
|
31
41
|
const {
|
|
32
42
|
fields: availableFields,
|
|
33
43
|
selectedFields,
|
|
@@ -37,18 +47,49 @@ export default class TableTranslator {
|
|
|
37
47
|
|
|
38
48
|
const isLoading = !!(isRecordsFetching || isAvailableFieldsFetching || isSelectedFieldsFetching);
|
|
39
49
|
const fields = selectedFields === null || selectedFields === void 0 ? void 0 : selectedFields.map(selectedField => availableFields === null || availableFields === void 0 ? void 0 : availableFields.find(availableField => availableField.name === selectedField)).filter(f => f != undefined);
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
50
|
+
const {
|
|
51
|
+
headerActions,
|
|
52
|
+
fieldActions,
|
|
53
|
+
rowActions,
|
|
54
|
+
noLocation
|
|
55
|
+
} = mapClientActions(clientActions || []);
|
|
56
|
+
const isRowClickable = noLocation.some(action => action.uiComponentMapping.eventMappings.some(mapping => mapping.sourceEvent === TableListConstants.TABLE_LIST_ROW_CLICKED));
|
|
57
|
+
const rowCursor = isRowClickable ? RowCursor.Pointer : RowCursor.Default;
|
|
58
|
+
const headersTranslator = new HeadersTranslator(fields, headerActions, context);
|
|
59
|
+
const rowsTranslator = new RowsTranslator(records, fields, rowActions, context, fieldComponentMapping, rowActionsUiType, fieldActions); // const actionTranslator = new ClientActionsTranslator(clientActions, records, fields, pageContext);
|
|
60
|
+
// const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator(), actionTranslator.getTranslator()];
|
|
61
|
+
|
|
62
|
+
const translators = [headersTranslator.getTranslator(), rowsTranslator.getTranslator()];
|
|
63
|
+
const data = Pipeline.run(translators, {}); // TODO: Implement ModuleTableModel, and move data and isLoading to tableViewModel Object
|
|
43
64
|
|
|
44
65
|
return {
|
|
45
66
|
properties,
|
|
46
67
|
behaviours,
|
|
47
|
-
|
|
68
|
+
rowCursor,
|
|
69
|
+
rowActionsConfig: {
|
|
70
|
+
hasActions: Boolean(rowActions === null || rowActions === void 0 ? void 0 : rowActions.length),
|
|
71
|
+
// Boolean(newRowActions?.length),
|
|
72
|
+
columnWidth: ColumnWidth.XSmall
|
|
73
|
+
},
|
|
48
74
|
isLoading,
|
|
49
|
-
emptyStateUiType:
|
|
50
|
-
data
|
|
75
|
+
emptyStateUiType: componentMapping.emptyState || '',
|
|
76
|
+
data
|
|
51
77
|
};
|
|
52
78
|
}
|
|
53
79
|
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function mapClientActions(clientActions) {
|
|
83
|
+
const allowedActingLocations = ['header_actions', 'field_actions', 'row_actions', null];
|
|
84
|
+
clientActions.forEach(action => {
|
|
85
|
+
if (!allowedActingLocations.includes(action.location)) {
|
|
86
|
+
console.warn('Client action without location:', action.location);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
headerActions: clientActions.filter(action => action.location && action.location === 'header_actions'),
|
|
91
|
+
fieldActions: clientActions.filter(action => action.location && action.location === 'field_actions'),
|
|
92
|
+
rowActions: clientActions.filter(action => action.location && action.location === 'row_actions'),
|
|
93
|
+
noLocation: clientActions.filter(action => !action.location)
|
|
94
|
+
};
|
|
54
95
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Alignment } from "../../../../../cc/table-list/data-types/Header";
|
|
2
|
+
|
|
3
|
+
function ColumnAlignmentTranslator(type) {
|
|
4
|
+
if (type === 'Boolean') {
|
|
5
|
+
return Alignment.Center;
|
|
6
|
+
} else {
|
|
7
|
+
return Alignment.Left;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default ColumnAlignmentTranslator;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Width } from "../../../../../cc/table-list/data-types/Header";
|
|
2
|
+
const columnSizeMapping = {
|
|
3
|
+
Multiselect: Width.XXLarge,
|
|
4
|
+
Email: Width.XLarge,
|
|
5
|
+
Boolean: Width.Medium,
|
|
6
|
+
Number: Width.Medium,
|
|
7
|
+
Decimal: Width.Medium,
|
|
8
|
+
Currency: Width.Medium,
|
|
9
|
+
Date: Width.Medium,
|
|
10
|
+
Percent: Width.Medium
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
function ColumnSizeTranslator(type) {
|
|
14
|
+
const columnSize = columnSizeMapping[type];
|
|
15
|
+
|
|
16
|
+
if (columnSize) {
|
|
17
|
+
return columnSize;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return Width.Large;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default ColumnSizeTranslator;
|