@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
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import TableData from '@zohodesk-private/desk-components/es/table/TableData/TableData';
|
|
3
|
+
import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
|
|
4
|
+
import { ActionViewGap } from "../../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
|
|
5
|
+
import { AlignmentOfFlex } from "../../../../../../../../cc/table-list/data-types/Header";
|
|
3
6
|
import FieldComponent from "../field/FieldComponent";
|
|
4
7
|
export default function RowData(_ref) {
|
|
5
8
|
let {
|
|
6
9
|
field,
|
|
7
|
-
|
|
10
|
+
width,
|
|
8
11
|
alignment,
|
|
9
|
-
resizedWidth,
|
|
10
12
|
isFlexibleColumns
|
|
11
13
|
} = _ref;
|
|
12
14
|
let {
|
|
13
15
|
type,
|
|
16
|
+
actions,
|
|
14
17
|
...props
|
|
15
18
|
} = field;
|
|
19
|
+
const hasActions = Boolean(actions === null || actions === void 0 ? void 0 : actions.length);
|
|
16
20
|
return /*#__PURE__*/React.createElement(TableData, {
|
|
17
|
-
$
|
|
18
|
-
$
|
|
19
|
-
$
|
|
20
|
-
$
|
|
21
|
+
$ui_align: hasActions ? null : alignment,
|
|
22
|
+
$data_width: width,
|
|
23
|
+
$flag_flexible: isFlexibleColumns,
|
|
24
|
+
$customProps_container: hasActions ? {
|
|
25
|
+
$ui_displayMode: 'flex',
|
|
26
|
+
$ui_alignItems: 'center',
|
|
27
|
+
$ui_justifyContent: AlignmentOfFlex[alignment]
|
|
28
|
+
} : null
|
|
21
29
|
}, /*#__PURE__*/React.createElement(FieldComponent, {
|
|
22
30
|
type: type,
|
|
23
31
|
fieldProps: props
|
|
24
|
-
})
|
|
32
|
+
}), hasActions ? /*#__PURE__*/React.createElement(ActionEventMediator, {
|
|
33
|
+
actions: actions,
|
|
34
|
+
gap: ActionViewGap.SMALL
|
|
35
|
+
}) : null);
|
|
25
36
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createCustomComponent } from "../../../../../custom-component";
|
|
2
2
|
import Properties from "../../../../../../cc/action-icon/Properties";
|
|
3
|
-
import ActionIconView from "./ActionIconView";
|
|
3
|
+
import ActionIconView, { ButtonView, FilterDropdownView } from "./ActionIconView";
|
|
4
4
|
const ActionIcon = createCustomComponent({
|
|
5
5
|
name: 'ActionIcon',
|
|
6
6
|
View: ActionIconView,
|
|
@@ -8,4 +8,20 @@ const ActionIcon = createCustomComponent({
|
|
|
8
8
|
events: [],
|
|
9
9
|
eventHandlers: {}
|
|
10
10
|
});
|
|
11
|
-
export default ActionIcon;
|
|
11
|
+
export default ActionIcon; // NOTE: This is a sample of Button action component
|
|
12
|
+
|
|
13
|
+
export const Button = createCustomComponent({
|
|
14
|
+
name: 'Button',
|
|
15
|
+
View: ButtonView,
|
|
16
|
+
properties: Properties,
|
|
17
|
+
events: [],
|
|
18
|
+
eventHandlers: {}
|
|
19
|
+
}); // NOTE: This is a sample of FilterDropdown action component
|
|
20
|
+
|
|
21
|
+
export const FilterDropdown = createCustomComponent({
|
|
22
|
+
name: 'FilterDropdown',
|
|
23
|
+
View: FilterDropdownView,
|
|
24
|
+
properties: Properties,
|
|
25
|
+
events: [],
|
|
26
|
+
eventHandlers: {}
|
|
27
|
+
});
|
|
@@ -24,7 +24,6 @@ export default function ActionIconView(_ref, ref) {
|
|
|
24
24
|
}, /*#__PURE__*/React.createElement(ActionIcon, {
|
|
25
25
|
$ui_iconName: icon,
|
|
26
26
|
$ui_hoverVariant: hoverVariant,
|
|
27
|
-
$flag_gap: true,
|
|
28
27
|
$flag_disabled: isDisabled,
|
|
29
28
|
$i18n_tooltip: label,
|
|
30
29
|
$event_onClick: !isDisabled ? () => {
|
|
@@ -33,4 +32,79 @@ export default function ActionIconView(_ref, ref) {
|
|
|
33
32
|
});
|
|
34
33
|
} : null
|
|
35
34
|
}));
|
|
35
|
+
} // NOTE: This is a sample of Button action component
|
|
36
|
+
|
|
37
|
+
export function ButtonView(_ref2, ref) {
|
|
38
|
+
let {
|
|
39
|
+
state,
|
|
40
|
+
helpers
|
|
41
|
+
} = _ref2;
|
|
42
|
+
const {
|
|
43
|
+
dispatch
|
|
44
|
+
} = helpers;
|
|
45
|
+
const {
|
|
46
|
+
sourceEvent,
|
|
47
|
+
payload
|
|
48
|
+
} = state.properties.appendToActionPayload.eventMappings[0];
|
|
49
|
+
const {
|
|
50
|
+
value
|
|
51
|
+
} = payload;
|
|
52
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
53
|
+
"data-title": value,
|
|
54
|
+
onClick: () => dispatch({
|
|
55
|
+
type: sourceEvent
|
|
56
|
+
}),
|
|
57
|
+
ref: ref
|
|
58
|
+
}, value);
|
|
59
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
60
|
+
ref: ref,
|
|
61
|
+
onClick: () => {
|
|
62
|
+
dispatch({
|
|
63
|
+
type: sourceEvent
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}, value);
|
|
67
|
+
} // NOTE: This is a sample of FilterDropdown action component
|
|
68
|
+
|
|
69
|
+
export function FilterDropdownView(_ref3, ref) {
|
|
70
|
+
let {
|
|
71
|
+
state,
|
|
72
|
+
helpers
|
|
73
|
+
} = _ref3;
|
|
74
|
+
const {
|
|
75
|
+
dispatch
|
|
76
|
+
} = helpers;
|
|
77
|
+
const {
|
|
78
|
+
options,
|
|
79
|
+
isMultiselectable
|
|
80
|
+
} = state.properties;
|
|
81
|
+
const {
|
|
82
|
+
sourceEvent,
|
|
83
|
+
payload
|
|
84
|
+
} = state.properties.appendToActionPayload.eventMappings[0];
|
|
85
|
+
const {
|
|
86
|
+
fieldName: value
|
|
87
|
+
} = payload;
|
|
88
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
89
|
+
"data-title": value,
|
|
90
|
+
onClick: () => dispatch({
|
|
91
|
+
type: sourceEvent
|
|
92
|
+
}),
|
|
93
|
+
ref: ref
|
|
94
|
+
}, value);
|
|
95
|
+
return /*#__PURE__*/React.createElement("select", {
|
|
96
|
+
"data-title": '',
|
|
97
|
+
ref: ref,
|
|
98
|
+
onChange: e => dispatch({
|
|
99
|
+
type: sourceEvent,
|
|
100
|
+
payload: {
|
|
101
|
+
sourcePayload: {
|
|
102
|
+
selectedValue: e.target.value
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
})
|
|
106
|
+
}, options.map((option, index) => /*#__PURE__*/React.createElement("option", {
|
|
107
|
+
key: index,
|
|
108
|
+
value: option.value
|
|
109
|
+
}, option.label)));
|
|
36
110
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import
|
|
2
|
+
import Tag from '@zohodesk/components/es/Tag/Tag';
|
|
3
3
|
export function LookupFieldView(_ref, ref) {
|
|
4
4
|
let {
|
|
5
5
|
state
|
|
@@ -8,11 +8,12 @@ export function LookupFieldView(_ref, ref) {
|
|
|
8
8
|
name,
|
|
9
9
|
photoURL
|
|
10
10
|
} = state.properties.value;
|
|
11
|
-
return /*#__PURE__*/React.createElement(
|
|
11
|
+
return /*#__PURE__*/React.createElement(Tag, {
|
|
12
12
|
getRef: ref,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
text: name,
|
|
14
|
+
hasAvatar: true,
|
|
15
|
+
initial: name,
|
|
16
|
+
imageURL: photoURL,
|
|
17
|
+
tooltip: name
|
|
17
18
|
});
|
|
18
19
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
This package contains all elements regarding the CLIENT ACTIONS module.
|
|
2
|
+
|
|
3
|
+
The module contains three main parts
|
|
4
|
+
|
|
5
|
+
1. Behaviour - Contains the behaviours exposed by Client Actions
|
|
6
|
+
|
|
7
|
+
2. Components - Contains the component exposed by Client Actions
|
|
8
|
+
|
|
9
|
+
3. Translator - Contains the translators exposed by Client Actions
|
|
10
|
+
|
|
11
|
+
-----------------------------------------------------------------------------
|
|
12
|
+
|
|
13
|
+
1. Behaviour
|
|
14
|
+
a. ClientActionBehaviour -> This behaviour is used to fetch the required client actions and returns the value to state
|
|
15
|
+
|
|
16
|
+
2. Components
|
|
17
|
+
a. ActionEventMediator -> The main component that is exposed and need to be used by the components in order to render and execute client actions
|
|
18
|
+
- Inputs : actions, renderComponentType
|
|
19
|
+
- Renders the rendercomponent based on the value (default renders row actions)
|
|
20
|
+
|
|
21
|
+
b. RowActionsRenderer -> This component renders the actions in Row wise.
|
|
22
|
+
|
|
23
|
+
c. DynamicActionComponent -> Renders the action component dynamically
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
3. Translators
|
|
27
|
+
a. action-translator -> the main translator the is used to translate the client actions, resolve them and get them in component action object format
|
|
28
|
+
|
|
29
|
+
b. condition-resolver -> Resolved the conditions cases in the client actiosn. Returns only the actions that are passed
|
|
30
|
+
|
|
31
|
+
c. context-resover -> Resolved the context in all keys of client actions.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export const SET_CLIENTACTIONS = 'CLIENTACTION#SET_CLIENTACTIONS';
|
|
2
|
+
export const CLIENTACTION_BEHAVIOUR_EXECUTE = 'CLIENTACTION_BEHAVIOUR#EXECUTE';
|
|
3
|
+
export const CLIENTACTION_EXECUTE_SUCCEEDED = 'CLIENTACTION#EXECUTE_SUCCEEDED';
|
|
4
|
+
export const CLIENTACTION_EXECUTE_FAILED = 'CLIENTACTION#EXECUTE_FAILED';
|
|
5
|
+
export const CLIENTACTION_EXECUTE_SUCCEEDED_NO_CONTENT = 'CLIENTACTION#EXECUTE_SUCCEEDED_NO_CONTENT';
|
|
6
|
+
export const CLIENTACTION_EXECUTE_SUCCESS_CALLBACK = 'CLIENTACTION#EXECUTE_SUCCESS_CALLBACK';
|
|
7
|
+
export const CLIENTACTION_EXECUTE_SUCCESS_NO_CONTENT_CALLBACK = 'CLIENTACTION#EXECUTE_SUCCESS_NO_CONTENT_CALLBACK';
|
|
8
|
+
export const CLIENTACTION_EXECUTE_FAIL_CALLBACK = 'CLIENTACTION#EXECUTE_FAIL_CALLBACK';
|
|
9
|
+
export const ClientActionApiActionName = {
|
|
10
|
+
GET_CLIENTACTIONS: "getClientActions"
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { CLIENTACTION_BEHAVIOUR_EXECUTE, CLIENTACTION_EXECUTE_FAIL_CALLBACK, CLIENTACTION_EXECUTE_FAILED, CLIENTACTION_EXECUTE_SUCCEEDED, CLIENTACTION_EXECUTE_SUCCEEDED_NO_CONTENT, CLIENTACTION_EXECUTE_SUCCESS_CALLBACK, CLIENTACTION_EXECUTE_SUCCESS_NO_CONTENT_CALLBACK } from "./Constants";
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Client Actions Behaviour
|
|
2
|
+
|
|
3
|
+
This behaviour will allows your library components to fetch client actions for your users.
|
|
4
|
+
|
|
5
|
+
# Implementation
|
|
6
|
+
|
|
7
|
+
ClientActionsBehaviourFactory.create({ getClientActions: dataSource.httpTemplates.getClientActions })
|
|
8
|
+
|
|
9
|
+
This above class should be implemeted in the behaviour props of your library components
|
|
10
|
+
|
|
11
|
+
The user needs to passdown the dataSource into the behaviour in the format,
|
|
12
|
+
|
|
13
|
+
1. getClientActions => Client Actions GET data broker template
|
|
14
|
+
|
|
15
|
+
# Integration inside component
|
|
16
|
+
|
|
17
|
+
We need to initialize or mount our behaviour with the component. Refer the eg used in List component below
|
|
18
|
+
|
|
19
|
+
private createClientActionsFetchAction(): ActionModel {
|
|
20
|
+
const props = this.createApiProps();
|
|
21
|
+
return {
|
|
22
|
+
type: CLIENTACTION_BEHAVIOUR_EXECUTE,
|
|
23
|
+
payload: {
|
|
24
|
+
actionName: 'getClientActions',
|
|
25
|
+
props,
|
|
26
|
+
apiName: 'clientActions'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
The function createClientActionsFetchAction is called at Library component mount, which will mount client action behaviour and do the necessary processing.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class ClientActionBehaviourExecutorController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
actionName,
|
|
12
|
+
props,
|
|
13
|
+
apiName
|
|
14
|
+
} = action.payload;
|
|
15
|
+
const {
|
|
16
|
+
executeActionBehaviourUseCase
|
|
17
|
+
} = this.service;
|
|
18
|
+
executeActionBehaviourUseCase.updateDependency(state, updateState);
|
|
19
|
+
executeActionBehaviourUseCase.execute({
|
|
20
|
+
dispatch,
|
|
21
|
+
apiName,
|
|
22
|
+
actionName,
|
|
23
|
+
props
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class FailureController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
metaData,
|
|
12
|
+
payload
|
|
13
|
+
} = action;
|
|
14
|
+
const {
|
|
15
|
+
error
|
|
16
|
+
} = payload;
|
|
17
|
+
const {
|
|
18
|
+
failureUseCase
|
|
19
|
+
} = this.service;
|
|
20
|
+
failureUseCase.updateDependency(state, updateState);
|
|
21
|
+
failureUseCase.execute({
|
|
22
|
+
dispatch,
|
|
23
|
+
error,
|
|
24
|
+
metaData
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class FetchStateStopController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action
|
|
8
|
+
} = event;
|
|
9
|
+
const {
|
|
10
|
+
metaData
|
|
11
|
+
} = action;
|
|
12
|
+
const {
|
|
13
|
+
fetchStateStopUseCase
|
|
14
|
+
} = this.service;
|
|
15
|
+
fetchStateStopUseCase.updateDependency(state, updateState);
|
|
16
|
+
fetchStateStopUseCase.execute({
|
|
17
|
+
metaData
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
package/es/platform/client-actions/behaviour/zclient-actions/adapters/controllers/MountController.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
|
|
3
|
+
export default class MountController {
|
|
4
|
+
constructor(recordApis, service) {
|
|
5
|
+
this.recordApis = recordApis;
|
|
6
|
+
this.service = service;
|
|
7
|
+
|
|
8
|
+
_defineProperty(this, "handle", event => {
|
|
9
|
+
const {
|
|
10
|
+
state,
|
|
11
|
+
updateState,
|
|
12
|
+
dispatch
|
|
13
|
+
} = event;
|
|
14
|
+
const {
|
|
15
|
+
initializeUseCase
|
|
16
|
+
} = this.service;
|
|
17
|
+
initializeUseCase.updateDependency(state, updateState);
|
|
18
|
+
initializeUseCase.execute({
|
|
19
|
+
dispatch,
|
|
20
|
+
apiTemplates: this.recordApis
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class NoContentController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
metaData
|
|
12
|
+
} = action;
|
|
13
|
+
const {
|
|
14
|
+
noContentUseCase
|
|
15
|
+
} = this.service;
|
|
16
|
+
noContentUseCase.updateDependency(state, updateState);
|
|
17
|
+
noContentUseCase.execute({
|
|
18
|
+
dispatch,
|
|
19
|
+
metaData
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class SetClientActionsController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action
|
|
8
|
+
} = event;
|
|
9
|
+
const {
|
|
10
|
+
payload
|
|
11
|
+
} = action;
|
|
12
|
+
const {
|
|
13
|
+
clientActions
|
|
14
|
+
} = payload;
|
|
15
|
+
const {
|
|
16
|
+
setClientActionsUseCase
|
|
17
|
+
} = this.service;
|
|
18
|
+
setClientActionsUseCase.updateDependency(state, updateState);
|
|
19
|
+
setClientActionsUseCase.execute({
|
|
20
|
+
clientActions
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import AbstractController from "./AbstractController";
|
|
2
|
+
export default class SuccessController extends AbstractController {
|
|
3
|
+
handle(event) {
|
|
4
|
+
const {
|
|
5
|
+
state,
|
|
6
|
+
updateState,
|
|
7
|
+
action,
|
|
8
|
+
dispatch
|
|
9
|
+
} = event;
|
|
10
|
+
const {
|
|
11
|
+
metaData,
|
|
12
|
+
payload
|
|
13
|
+
} = action;
|
|
14
|
+
const {
|
|
15
|
+
response
|
|
16
|
+
} = payload;
|
|
17
|
+
const {
|
|
18
|
+
successUseCase
|
|
19
|
+
} = this.service;
|
|
20
|
+
successUseCase.updateDependency(state, updateState);
|
|
21
|
+
successUseCase.execute({
|
|
22
|
+
dispatch,
|
|
23
|
+
response,
|
|
24
|
+
metaData
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
|
|
3
|
+
import ClientActionManagerFactory from "../../applications/entities-factory/ClientActionManagerFactory";
|
|
4
|
+
export default class Repository {
|
|
5
|
+
constructor() {
|
|
6
|
+
_defineProperty(this, "state", void 0);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
init(state) {
|
|
10
|
+
this.state = state;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
getClientActionsManagerEntity() {
|
|
14
|
+
const {
|
|
15
|
+
zclientAction
|
|
16
|
+
} = this.state.behaviours;
|
|
17
|
+
const {
|
|
18
|
+
clientActions = [],
|
|
19
|
+
isFetching
|
|
20
|
+
} = zclientAction;
|
|
21
|
+
const clientActionManager = ClientActionManagerFactory.create({
|
|
22
|
+
data: clientActions,
|
|
23
|
+
isFetching
|
|
24
|
+
});
|
|
25
|
+
return clientActionManager;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
|
|
3
|
+
import InitializeUseCase from "../../applications/usecases/InitializeUseCase";
|
|
4
|
+
import ExecuteActionBehaviourUseCase from "../../applications/usecases/ExecuteActionBehaviourUseCase";
|
|
5
|
+
import FailureUseCase from "../../applications/usecases/FailureUseCase";
|
|
6
|
+
import SuccessUseCase from "../../applications/usecases/SuccessUseCase";
|
|
7
|
+
import NoContentUseCase from "../../applications/usecases/NoContentUseCase";
|
|
8
|
+
import SetClientActionsUseCase from "../../applications/usecases/SetClientActionsUseCase";
|
|
9
|
+
import FetchStateStopUseCase from "../../applications/usecases/FetchStateStopUseCase";
|
|
10
|
+
export default class Service {
|
|
11
|
+
constructor(dependencies) {
|
|
12
|
+
_defineProperty(this, "initializeUseCase", void 0);
|
|
13
|
+
|
|
14
|
+
_defineProperty(this, "executeActionBehaviourUseCase", void 0);
|
|
15
|
+
|
|
16
|
+
_defineProperty(this, "failureUseCase", void 0);
|
|
17
|
+
|
|
18
|
+
_defineProperty(this, "successUseCase", void 0);
|
|
19
|
+
|
|
20
|
+
_defineProperty(this, "fetchStateStopUseCase", void 0);
|
|
21
|
+
|
|
22
|
+
_defineProperty(this, "noContentUseCase", void 0);
|
|
23
|
+
|
|
24
|
+
_defineProperty(this, "setClientActionsUseCase", void 0);
|
|
25
|
+
|
|
26
|
+
this.initializeUseCase = new InitializeUseCase(dependencies);
|
|
27
|
+
this.executeActionBehaviourUseCase = new ExecuteActionBehaviourUseCase(dependencies);
|
|
28
|
+
this.failureUseCase = new FailureUseCase(dependencies);
|
|
29
|
+
this.successUseCase = new SuccessUseCase(dependencies);
|
|
30
|
+
this.fetchStateStopUseCase = new FetchStateStopUseCase(dependencies);
|
|
31
|
+
this.noContentUseCase = new NoContentUseCase(dependencies);
|
|
32
|
+
this.setClientActionsUseCase = new SetClientActionsUseCase(dependencies);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
|
|
3
|
+
export default class Presenter {
|
|
4
|
+
constructor() {
|
|
5
|
+
_defineProperty(this, "updateState", void 0);
|
|
6
|
+
|
|
7
|
+
_defineProperty(this, "state", void 0);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
updateDependencies(state, updateState) {
|
|
11
|
+
this.updateState = updateState;
|
|
12
|
+
this.state = state;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
updateClientAction(zclientAction) {
|
|
16
|
+
this.state = { ...this.state,
|
|
17
|
+
behaviours: { ...this.state.behaviours,
|
|
18
|
+
zclientAction
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
this.updateState(this.state);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import ClientAction from "../../domain/entities/ClientAction";
|
|
2
|
+
export default class ClientActionFactory {
|
|
3
|
+
static createSingleClientAction(clientActionModel) {
|
|
4
|
+
const clientAction = new ClientAction(clientActionModel);
|
|
5
|
+
return clientAction;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
static createMultipleClientActions(data) {
|
|
9
|
+
return data.map(clientActionModel => new ClientAction(clientActionModel));
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import ClientActionManager from "../../domain/entities/ClientActionManager";
|
|
2
|
+
import ClientActions from "../../domain/entities/ClientActions";
|
|
3
|
+
export default class ClientActionManagerFactory {
|
|
4
|
+
static create(clientActionsModel) {
|
|
5
|
+
const clientActions = new ClientActions(clientActionsModel);
|
|
6
|
+
const clientActionManager = new ClientActionManager(clientActions);
|
|
7
|
+
return clientActionManager;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class ExecuteActionBehaviourUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
repository,
|
|
7
|
+
presenter
|
|
8
|
+
} = this.dependencies;
|
|
9
|
+
const {
|
|
10
|
+
props,
|
|
11
|
+
dispatch,
|
|
12
|
+
apiName,
|
|
13
|
+
actionName
|
|
14
|
+
} = input;
|
|
15
|
+
const recordManager = repository.getClientActionsManagerEntity();
|
|
16
|
+
|
|
17
|
+
if (!recordManager.isClientActionApiName(apiName)) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const metaData = recordManager.createFetchClientActionMeta(actionName, apiName, props);
|
|
22
|
+
|
|
23
|
+
if (recordManager.isGetClientActionsApi(actionName)) {
|
|
24
|
+
recordManager.fetchingStarted();
|
|
25
|
+
presenter.updateClientAction(recordManager.toObject());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
dispatch(recordManager.createDataSourceExecuteEvent(props, actionName, metaData));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default ExecuteActionBehaviourUseCase;
|
package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/FailureUseCase.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class FailureUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
repository
|
|
7
|
+
} = this.dependencies;
|
|
8
|
+
const {
|
|
9
|
+
dispatch,
|
|
10
|
+
metaData,
|
|
11
|
+
error
|
|
12
|
+
} = input;
|
|
13
|
+
const recordManager = repository.getClientActionsManagerEntity();
|
|
14
|
+
const events = recordManager.createFailureEvents(error, metaData);
|
|
15
|
+
events.forEach(event => {
|
|
16
|
+
dispatch(event);
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default FailureUseCase;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class FetchStateStopUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
repository,
|
|
7
|
+
presenter
|
|
8
|
+
} = this.dependencies;
|
|
9
|
+
const {
|
|
10
|
+
metaData
|
|
11
|
+
} = input;
|
|
12
|
+
const {
|
|
13
|
+
actionName
|
|
14
|
+
} = metaData;
|
|
15
|
+
const recordManager = repository.getClientActionsManagerEntity();
|
|
16
|
+
|
|
17
|
+
if (recordManager.isGetClientActionsApi(actionName)) {
|
|
18
|
+
recordManager.fetchingFinished();
|
|
19
|
+
presenter.updateClientAction(recordManager.toObject());
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default FetchStateStopUseCase;
|