@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,7 +1,8 @@
|
|
|
1
1
|
import EmptyViewModel from "./EmptyViewModel";
|
|
2
2
|
import * as FieldTranslators from "./fields";
|
|
3
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
4
|
|
|
4
|
-
function ColumnTranslator(field, record,
|
|
5
|
+
function ColumnTranslator(field, record, fieldComponentMapping, fieldActions) {
|
|
5
6
|
var _record$cf;
|
|
6
7
|
|
|
7
8
|
const {
|
|
@@ -10,25 +11,32 @@ function ColumnTranslator(field, record, fieldUiMapping) {
|
|
|
10
11
|
type
|
|
11
12
|
} = field;
|
|
12
13
|
const value = isCustomField ? (_record$cf = record.cf) === null || _record$cf === void 0 ? void 0 : _record$cf[name] : record[name];
|
|
14
|
+
const actions = ClientActionsTranslator.transform(fieldActions, {
|
|
15
|
+
field,
|
|
16
|
+
record
|
|
17
|
+
});
|
|
13
18
|
|
|
14
19
|
if (!value && value !== false) {
|
|
15
|
-
return EmptyViewModel(
|
|
20
|
+
return EmptyViewModel();
|
|
16
21
|
}
|
|
17
22
|
|
|
18
|
-
if (
|
|
19
|
-
field.uiType =
|
|
23
|
+
if (fieldComponentMapping[name]) {
|
|
24
|
+
field.uiType = fieldComponentMapping[name];
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
const fieldTranslator = FieldTranslators[type];
|
|
23
28
|
|
|
24
29
|
if (!fieldTranslator) {
|
|
25
30
|
console.error(`Field type ${type} not supported`);
|
|
26
|
-
return EmptyViewModel(
|
|
31
|
+
return EmptyViewModel();
|
|
27
32
|
}
|
|
28
33
|
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
return {
|
|
35
|
+
actions,
|
|
36
|
+
...fieldTranslator(field, value, {
|
|
37
|
+
recordId: record.id
|
|
38
|
+
})
|
|
39
|
+
};
|
|
32
40
|
}
|
|
33
41
|
|
|
34
42
|
export default ColumnTranslator;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ColumnSizeTranslator from "./ColumnSizeTranslator";
|
|
2
|
+
import ColumnAlignmentTranslator from "./ColumnAlignmentTranslator";
|
|
3
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
2
4
|
|
|
3
|
-
function HeaderTranslator(field) {
|
|
5
|
+
function HeaderTranslator(field, actions, context) {
|
|
4
6
|
const {
|
|
5
7
|
id,
|
|
6
8
|
name,
|
|
@@ -8,13 +10,17 @@ function HeaderTranslator(field) {
|
|
|
8
10
|
isSortable,
|
|
9
11
|
type
|
|
10
12
|
} = field;
|
|
13
|
+
const transformedActions = ClientActionsTranslator.transform(actions, { ...context,
|
|
14
|
+
field
|
|
15
|
+
});
|
|
11
16
|
return {
|
|
12
17
|
id: id,
|
|
13
18
|
name: name,
|
|
14
19
|
text: displayLabel,
|
|
15
20
|
sortable: isSortable,
|
|
16
|
-
alignment: type
|
|
17
|
-
|
|
21
|
+
alignment: ColumnAlignmentTranslator(type),
|
|
22
|
+
width: ColumnSizeTranslator(type),
|
|
23
|
+
actions: transformedActions
|
|
18
24
|
};
|
|
19
25
|
}
|
|
20
26
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import HeaderTranslator from "./Header";
|
|
2
2
|
export default class HeadersTranslator {
|
|
3
|
-
constructor(fields) {
|
|
3
|
+
constructor(fields, actions, context) {
|
|
4
4
|
this.fields = fields;
|
|
5
|
+
this.actions = actions;
|
|
6
|
+
this.context = context;
|
|
5
7
|
this.pipe = this.pipe.bind(this);
|
|
6
8
|
}
|
|
7
9
|
|
|
@@ -10,7 +12,7 @@ export default class HeadersTranslator {
|
|
|
10
12
|
return [];
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
return this.fields.map(field => HeaderTranslator(field));
|
|
15
|
+
return this.fields.map(field => HeaderTranslator(field, this.actions, this.context));
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
pipe(viewModel) {
|
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import ColumnTranslator from "./ColumnTranslator";
|
|
2
|
-
import
|
|
2
|
+
import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
|
|
3
3
|
export default function RowTranslator(_ref) {
|
|
4
4
|
let {
|
|
5
5
|
record,
|
|
6
6
|
fields,
|
|
7
|
-
|
|
7
|
+
fieldComponentMapping,
|
|
8
8
|
rowActionsUiType,
|
|
9
9
|
rowActions,
|
|
10
|
-
|
|
10
|
+
fieldActions,
|
|
11
|
+
context
|
|
11
12
|
} = _ref;
|
|
13
|
+
const actions = ClientActionsTranslator.transform(rowActions, { ...context,
|
|
14
|
+
record
|
|
15
|
+
});
|
|
12
16
|
return {
|
|
13
17
|
id: record.id,
|
|
14
|
-
columns: fields.map(field => ColumnTranslator(field, record,
|
|
18
|
+
columns: fields.map(field => ColumnTranslator(field, record, fieldComponentMapping, fieldActions)),
|
|
15
19
|
rowActionLocation: {
|
|
16
|
-
type: rowActionsUiType
|
|
17
|
-
actions
|
|
20
|
+
type: rowActionsUiType,
|
|
21
|
+
actions
|
|
18
22
|
}
|
|
19
23
|
};
|
|
20
24
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import TemplateHelpers from "../../../../zdata-
|
|
1
|
+
import TemplateHelpers from "../../../../zdata-source/adapters/gateways/TemplateHelpers";
|
|
2
2
|
const templateHelpers = new TemplateHelpers();
|
|
3
|
-
export default function RowActionTranslator(rowAction, record,
|
|
3
|
+
export default function RowActionTranslator(rowAction, record, context) {
|
|
4
4
|
const templateContext = {
|
|
5
|
-
orgName:
|
|
6
|
-
departmentName:
|
|
7
|
-
moduleSanitatedName:
|
|
5
|
+
orgName: context.orgName,
|
|
6
|
+
departmentName: context.departmentName,
|
|
7
|
+
moduleSanitatedName: context.moduleSanitatedName,
|
|
8
8
|
record,
|
|
9
|
-
moduleName:
|
|
9
|
+
moduleName: context.moduleName,
|
|
10
10
|
recordId: record.id
|
|
11
11
|
};
|
|
12
12
|
const properties = PropertiesTranslator(rowAction.properties, templateContext);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import RowTranslator from "./Row";
|
|
2
2
|
export default class RowsTranslator {
|
|
3
|
-
constructor(records, fields, rowActions,
|
|
3
|
+
constructor(records, fields, rowActions, context, fieldComponentMapping, rowActionsUiType, fieldActions) {
|
|
4
4
|
this.records = records;
|
|
5
5
|
this.fields = fields;
|
|
6
6
|
this.rowActions = rowActions;
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
7
|
+
this.context = context;
|
|
8
|
+
this.fieldComponentMapping = fieldComponentMapping;
|
|
9
9
|
this.rowActionsUiType = rowActionsUiType;
|
|
10
|
+
this.fieldActions = fieldActions;
|
|
10
11
|
this.pipe = this.pipe.bind(this);
|
|
11
12
|
}
|
|
12
13
|
|
|
@@ -18,10 +19,11 @@ export default class RowsTranslator {
|
|
|
18
19
|
return this.records.map(record => RowTranslator({
|
|
19
20
|
record,
|
|
20
21
|
fields: this.fields,
|
|
21
|
-
|
|
22
|
+
fieldComponentMapping: this.fieldComponentMapping,
|
|
22
23
|
rowActionsUiType: this.rowActionsUiType,
|
|
23
24
|
rowActions: this.rowActions,
|
|
24
|
-
|
|
25
|
+
fieldActions: this.fieldActions,
|
|
26
|
+
context: this.context
|
|
25
27
|
}));
|
|
26
28
|
}
|
|
27
29
|
|
|
@@ -0,0 +1,89 @@
|
|
|
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 ClientActionsTranslator from "../../../../../client-actions/translators/client-actions-translator";
|
|
4
|
+
|
|
5
|
+
class ActionsTranslator {
|
|
6
|
+
constructor() {
|
|
7
|
+
let actions = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
8
|
+
let records = arguments.length > 1 ? arguments[1] : undefined;
|
|
9
|
+
let fields = arguments.length > 2 ? arguments[2] : undefined;
|
|
10
|
+
let context = arguments.length > 3 ? arguments[3] : undefined;
|
|
11
|
+
this.records = records;
|
|
12
|
+
this.fields = fields;
|
|
13
|
+
this.context = context;
|
|
14
|
+
|
|
15
|
+
_defineProperty(this, "headerActions", void 0);
|
|
16
|
+
|
|
17
|
+
_defineProperty(this, "fieldActions", void 0);
|
|
18
|
+
|
|
19
|
+
_defineProperty(this, "rowActions", void 0);
|
|
20
|
+
|
|
21
|
+
_defineProperty(this, "noLocation", void 0);
|
|
22
|
+
|
|
23
|
+
this.pipe = this.pipe.bind(this);
|
|
24
|
+
this.headerActions = actions.filter(action => (action === null || action === void 0 ? void 0 : action.location) === 'header_actions');
|
|
25
|
+
this.fieldActions = actions.filter(action => (action === null || action === void 0 ? void 0 : action.location) === 'field_actions');
|
|
26
|
+
this.rowActions = actions.filter(action => (action === null || action === void 0 ? void 0 : action.location) === 'row_actions');
|
|
27
|
+
this.noLocation = actions.filter(action => !(action !== null && action !== void 0 && action.location));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
getTranslator() {
|
|
31
|
+
return {
|
|
32
|
+
name: 'actionsTranslator',
|
|
33
|
+
mapping: this.pipe
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
getField(field_name) {
|
|
38
|
+
return this.fields.find(field => field.name === field_name);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
getRecord(record_id) {
|
|
42
|
+
return this.records.find(record => record.id === record_id);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
translateHeadersActions(headers) {
|
|
46
|
+
return headers.map(header => {
|
|
47
|
+
return { ...header,
|
|
48
|
+
actions: ClientActionsTranslator.transform(this.headerActions, { ...this.context,
|
|
49
|
+
field: this.getField(header.name)
|
|
50
|
+
})
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
translateFieldActions(row) {
|
|
56
|
+
return row.columns.map(column => {
|
|
57
|
+
return { ...column,
|
|
58
|
+
actions: ClientActionsTranslator.transform(this.fieldActions, { ...this.context,
|
|
59
|
+
record: this.getRecord(row.id),
|
|
60
|
+
field: this.getField(column.name)
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
translateRowsActions(data) {
|
|
67
|
+
return data.rows.map(row => {
|
|
68
|
+
return { ...row,
|
|
69
|
+
columns: this.translateFieldActions(row),
|
|
70
|
+
rowActionLocation: {
|
|
71
|
+
actions: ClientActionsTranslator.transform(this.rowActions, { ...this.context,
|
|
72
|
+
record: this.getRecord(row.id)
|
|
73
|
+
})
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
pipe(data) {
|
|
80
|
+
const newModel = { ...data,
|
|
81
|
+
headers: this.translateHeadersActions(data.headers),
|
|
82
|
+
rows: this.translateRowsActions(data)
|
|
83
|
+
};
|
|
84
|
+
return newModel;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export default ActionsTranslator;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class DeleteSuccessUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
dispatch,
|
|
7
|
+
recordId
|
|
8
|
+
} = input;
|
|
9
|
+
const {
|
|
10
|
+
repository
|
|
11
|
+
} = this.dependencies;
|
|
12
|
+
const list = repository.getList();
|
|
13
|
+
const action = list.getDeleteSuccessAction(recordId);
|
|
14
|
+
dispatch(action);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default DeleteSuccessUseCase;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
+
|
|
3
|
+
class UpdateSuccessUseCase extends AbstractUseCase {
|
|
4
|
+
execute(input) {
|
|
5
|
+
const {
|
|
6
|
+
dispatch,
|
|
7
|
+
recordId
|
|
8
|
+
} = input;
|
|
9
|
+
const {
|
|
10
|
+
repository
|
|
11
|
+
} = this.dependencies;
|
|
12
|
+
const list = repository.getList();
|
|
13
|
+
const action = list.getUpdateSuccessAction(recordId);
|
|
14
|
+
dispatch(action);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default UpdateSuccessUseCase;
|
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
import { RECORD_EXECUTE, RECORD_FETCH_MORE, RECORD_REFETCH, RecordApiActionName } from "../../../../bc/zrecord/Constants";
|
|
2
2
|
import { FIELD_EXECUTE, FIELD_REFETCH } from "../../../../bc/zfield/Constants";
|
|
3
3
|
import { ZLIST_RECORD_DELETE_FAILED, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_FAILED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../../bc/zlist/Constants";
|
|
4
|
+
import { CLIENTACTION_BEHAVIOUR_EXECUTE } from "../../../client-actions/bc/zclient-actions/Constants";
|
|
5
|
+
import { SMART_TABLE_EVENTS } from "../../../../cc/table-connected/Constants";
|
|
4
6
|
|
|
5
7
|
class List {
|
|
6
|
-
constructor(limit, sortBy, filter) {
|
|
8
|
+
constructor(limit, sortBy, filter, context) {
|
|
7
9
|
this.limit = limit;
|
|
8
10
|
this.sortBy = sortBy;
|
|
9
11
|
this.filter = filter;
|
|
12
|
+
this.context = context;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
createApiProps() {
|
|
13
16
|
const {
|
|
14
17
|
filter,
|
|
15
18
|
limit,
|
|
16
|
-
sortBy
|
|
19
|
+
sortBy,
|
|
20
|
+
context
|
|
17
21
|
} = this;
|
|
18
22
|
return {
|
|
19
23
|
limit,
|
|
20
24
|
sortBy,
|
|
21
|
-
...filter
|
|
25
|
+
...filter,
|
|
26
|
+
...context
|
|
22
27
|
};
|
|
23
28
|
}
|
|
24
29
|
|
|
@@ -28,30 +33,54 @@ class List {
|
|
|
28
33
|
}
|
|
29
34
|
|
|
30
35
|
getInitialMountFetchActions() {
|
|
31
|
-
return [this.createRecordsFetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction()
|
|
32
|
-
|
|
36
|
+
return [this.createRecordsFetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction(), this.createClientActionsFetchAction()];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
shallowDiff(obj1, obj2) {
|
|
40
|
+
const allKeys = new Set([...Object.keys(obj1), ...Object.keys(obj2)]);
|
|
41
|
+
|
|
42
|
+
for (const key of allKeys) {
|
|
43
|
+
if (obj1[key] !== obj2[key]) {
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return false;
|
|
33
49
|
}
|
|
34
50
|
|
|
35
51
|
getPropertiesChangeRefetchActions(previousProperties, currentProperties) {
|
|
36
52
|
const {
|
|
37
53
|
sortBy: prevSortBy,
|
|
38
|
-
|
|
54
|
+
departmentId: preDepartmentId,
|
|
55
|
+
viewId: preViewId
|
|
39
56
|
} = previousProperties;
|
|
40
57
|
const {
|
|
41
58
|
sortBy: sortBy,
|
|
42
|
-
|
|
59
|
+
departmentId: currentDepartmentId,
|
|
60
|
+
viewId: currentViewId
|
|
43
61
|
} = currentProperties;
|
|
44
62
|
|
|
45
63
|
if (prevSortBy !== sortBy) {
|
|
46
64
|
return [this.createRecordsRefetchAction()];
|
|
47
65
|
}
|
|
48
66
|
|
|
49
|
-
if (
|
|
50
|
-
return [this.createRecordsRefetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction()
|
|
51
|
-
// TODO: this.createSelectedFieldsRefetchAction()
|
|
52
|
-
];
|
|
67
|
+
if (preDepartmentId !== currentDepartmentId) {
|
|
68
|
+
return [this.createRecordsRefetchAction(), this.createAvailableFieldsFetchAction(), this.createSelectedFieldsFetchAction()];
|
|
53
69
|
}
|
|
54
70
|
|
|
71
|
+
if (preViewId !== currentViewId) {
|
|
72
|
+
return [this.createRecordsRefetchAction(), this.createSelectedFieldsFetchAction()];
|
|
73
|
+
} // if (this.shallowDiff(prevFilter, currentFilter)) {
|
|
74
|
+
// return [
|
|
75
|
+
// this.createRecordsRefetchAction(),
|
|
76
|
+
// this.createAvailableFieldsFetchAction(),
|
|
77
|
+
// this.createSelectedFieldsFetchAction()
|
|
78
|
+
// // TODO: this.createAvailableFieldsRefetchAction(),
|
|
79
|
+
// // TODO: this.createSelectedFieldsRefetchAction()
|
|
80
|
+
// ];
|
|
81
|
+
// }
|
|
82
|
+
|
|
83
|
+
|
|
55
84
|
return [];
|
|
56
85
|
}
|
|
57
86
|
|
|
@@ -112,6 +141,20 @@ class List {
|
|
|
112
141
|
};
|
|
113
142
|
}
|
|
114
143
|
|
|
144
|
+
getDeleteSuccessAction(recordIds) {
|
|
145
|
+
return {
|
|
146
|
+
type: SMART_TABLE_EVENTS.DELETE_RECORDS_SUCCESS,
|
|
147
|
+
payload: recordIds
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
getUpdateSuccessAction(recordId) {
|
|
152
|
+
return {
|
|
153
|
+
type: SMART_TABLE_EVENTS.UPDATE_RECORDS_SUCCESS,
|
|
154
|
+
payload: recordId
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
115
158
|
getRecordExecuteSucceededActions(payload, metaData) {
|
|
116
159
|
const {
|
|
117
160
|
actionName
|
|
@@ -234,14 +277,14 @@ class List {
|
|
|
234
277
|
};
|
|
235
278
|
}
|
|
236
279
|
|
|
237
|
-
|
|
280
|
+
createClientActionsFetchAction() {
|
|
238
281
|
const props = this.createApiProps();
|
|
239
282
|
return {
|
|
240
|
-
type:
|
|
283
|
+
type: CLIENTACTION_BEHAVIOUR_EXECUTE,
|
|
241
284
|
payload: {
|
|
242
|
-
actionName: '
|
|
285
|
+
actionName: 'getClientActions',
|
|
243
286
|
props,
|
|
244
|
-
apiName: '
|
|
287
|
+
apiName: 'clientActions'
|
|
245
288
|
}
|
|
246
289
|
};
|
|
247
290
|
}
|
|
@@ -282,18 +325,6 @@ class List {
|
|
|
282
325
|
};
|
|
283
326
|
}
|
|
284
327
|
|
|
285
|
-
createUIActionsRefetchAction() {
|
|
286
|
-
const props = this.createApiProps();
|
|
287
|
-
return {
|
|
288
|
-
type: RECORD_REFETCH,
|
|
289
|
-
payload: {
|
|
290
|
-
actionName: 'getUIActions',
|
|
291
|
-
props,
|
|
292
|
-
apiName: 'uiActions'
|
|
293
|
-
}
|
|
294
|
-
};
|
|
295
|
-
}
|
|
296
|
-
|
|
297
328
|
}
|
|
298
329
|
|
|
299
330
|
export default List;
|
|
@@ -4,7 +4,7 @@ import Service from "../adapters/gateways/Service";
|
|
|
4
4
|
import Repository from "../adapters/gateways/Repository";
|
|
5
5
|
import MountController from "../adapters/controllers/MountController";
|
|
6
6
|
import PropertiesChangeController from "../adapters/controllers/PropertiesChangeController";
|
|
7
|
-
import { ZLIST_DELETE_RECORD, ZLIST_DELETE_RECORDS, ZLIST_FETCH_MORE, ZLIST_FETCH_SORTED, ZLIST_RECORD_UPDATE } from "../../../bc/zlist/Constants";
|
|
7
|
+
import { ZLIST_DELETE_RECORD, ZLIST_DELETE_RECORDS, ZLIST_FETCH_MORE, ZLIST_FETCH_SORTED, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE, ZLIST_RECORD_UPDATE_SUCCEEDED } from "../../../bc/zlist/Constants";
|
|
8
8
|
import FetchMoreController from "../adapters/controllers/FetchMoreController";
|
|
9
9
|
import SortController from "../adapters/controllers/SortController";
|
|
10
10
|
import FieldChangeController from "../adapters/controllers/FieldChangeController";
|
|
@@ -16,6 +16,8 @@ import DeleteSingleRecordController from "../adapters/controllers/DeleteSingleRe
|
|
|
16
16
|
import RecordExecuteFailedController from "../adapters/controllers/RecordExecuteFailedController";
|
|
17
17
|
import RecordExecuteSucceededController from "../adapters/controllers/RecordExecuteSucceededController";
|
|
18
18
|
import { RECORD_EXECUTE_FAILED, RECORD_EXECUTE_SUCCEEDED } from "../../../bc/zrecord/Constants";
|
|
19
|
+
import UpdateSuccessController from "../adapters/controllers/UpdateSuccessController";
|
|
20
|
+
import DeleteSuccessController from "../adapters/controllers/DeleteSuccessController";
|
|
19
21
|
export default class ActionHandlersFactory {
|
|
20
22
|
static create() {
|
|
21
23
|
const repository = new Repository();
|
|
@@ -24,29 +26,21 @@ export default class ActionHandlersFactory {
|
|
|
24
26
|
repository,
|
|
25
27
|
sortBy: sortByGateway
|
|
26
28
|
});
|
|
27
|
-
const controller = {
|
|
28
|
-
mount: new MountController(service).handle,
|
|
29
|
-
update: new PropertiesChangeController(service).handle,
|
|
30
|
-
fetchMore: new FetchMoreController(service).handle,
|
|
31
|
-
fieldChange: new FieldChangeController(service).handle,
|
|
32
|
-
recordUpdate: new RecordUpdateController(service).handle,
|
|
33
|
-
deleteMultipleRecord: new DeleteMultipleRecordController(service).handle,
|
|
34
|
-
deleteRecord: new DeleteSingleRecordController(service).handle,
|
|
35
|
-
recordExecuteSucceeded: new RecordExecuteSucceededController(service).handle,
|
|
36
|
-
recordExecuteFailed: new RecordExecuteFailedController(service).handle,
|
|
37
|
-
sort: new SortController(service).handle
|
|
38
|
-
};
|
|
39
29
|
return {
|
|
40
|
-
[LifeCycleAction.MOUNT]:
|
|
41
|
-
[LifeCycleAction.UPDATE_PROPERTIES]:
|
|
42
|
-
[
|
|
43
|
-
[
|
|
44
|
-
[
|
|
45
|
-
[
|
|
46
|
-
[
|
|
47
|
-
[RECORD_EXECUTE_SUCCEEDED]:
|
|
48
|
-
[RECORD_EXECUTE_FAILED]:
|
|
49
|
-
[ZLIST_FETCH_SORTED]:
|
|
30
|
+
[LifeCycleAction.MOUNT]: new MountController(service).handle,
|
|
31
|
+
[LifeCycleAction.UPDATE_PROPERTIES]: new PropertiesChangeController(service).handle,
|
|
32
|
+
[ZLIST_FETCH_MORE]: new FetchMoreController(service).handle,
|
|
33
|
+
[ZLIST_RECORD_UPDATE]: new RecordUpdateController(service).handle,
|
|
34
|
+
[ZLIST_DELETE_RECORD]: new DeleteSingleRecordController(service).handle,
|
|
35
|
+
[ZLIST_DELETE_RECORDS]: new DeleteMultipleRecordController(service).handle,
|
|
36
|
+
[TableListConstants.TABLE_LIST_FIELD_CHANGED]: new FieldChangeController(service).handle,
|
|
37
|
+
[RECORD_EXECUTE_SUCCEEDED]: new RecordExecuteSucceededController(service).handle,
|
|
38
|
+
[RECORD_EXECUTE_FAILED]: new RecordExecuteFailedController(service).handle,
|
|
39
|
+
[ZLIST_FETCH_SORTED]: new SortController(service).handle,
|
|
40
|
+
[ZLIST_RECORD_UPDATE_SUCCEEDED]: new UpdateSuccessController(service).handle,
|
|
41
|
+
// ({ dispatch, action }) => dispatch({ type: 'SMART_TABLE#RECORD_UPDATED', payload: action.payload }),
|
|
42
|
+
[ZLIST_RECORD_DELETE_SUCCEEDED]: new DeleteSuccessController(service).handle // ({ dispatch, action }) => dispatch({ type: 'SMART_TABLE#RECORD_DELETED', payload: { id: action.payload.id } })
|
|
43
|
+
|
|
50
44
|
};
|
|
51
45
|
}
|
|
52
46
|
|
|
@@ -25,7 +25,7 @@ class ExecuteActionUseCase extends AbstractUseCase {
|
|
|
25
25
|
presenter.updateRecord(recordManager.toObject());
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
dispatch(recordManager.
|
|
28
|
+
dispatch(recordManager.createDataSourceExecuteEvent(props, actionName, metaData));
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
}
|
|
@@ -21,7 +21,7 @@ class FetchMoreUseCase extends AbstractUseCase {
|
|
|
21
21
|
const metaData = recordManager.createFetchMoreRecordMeta(actionName, apiName, props);
|
|
22
22
|
recordManager.fetchingStarted();
|
|
23
23
|
presenter.updateRecord(recordManager.toObject());
|
|
24
|
-
dispatch(recordManager.
|
|
24
|
+
dispatch(recordManager.createDataSourceExecuteEvent(props, actionName, metaData));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import AbstractUseCase from "./AbstractUseCase";
|
|
2
|
-
import {
|
|
2
|
+
import { DATA_SOURCE_REGISTER } from "../../../../bc/zdata-source/Constants";
|
|
3
3
|
export default class InitializeUseCase extends AbstractUseCase {
|
|
4
4
|
execute(input) {
|
|
5
5
|
const {
|
|
@@ -7,7 +7,7 @@ export default class InitializeUseCase extends AbstractUseCase {
|
|
|
7
7
|
dispatch
|
|
8
8
|
} = input;
|
|
9
9
|
dispatch({
|
|
10
|
-
type:
|
|
10
|
+
type: DATA_SOURCE_REGISTER,
|
|
11
11
|
payload: {
|
|
12
12
|
apiTemplates
|
|
13
13
|
}
|
|
@@ -21,7 +21,7 @@ export default class RefetchUseCase extends AbstractUseCase {
|
|
|
21
21
|
const metaData = recordManager.createFetchRecordMeta(actionName, apiName, props);
|
|
22
22
|
recordManager.fetchingStarted();
|
|
23
23
|
presenter.updateRecord(recordManager.toObject());
|
|
24
|
-
dispatch(recordManager.
|
|
24
|
+
dispatch(recordManager.createDataSourceExecuteEvent(props, actionName, metaData));
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RecordApiActionName, RECORD_EXECUTE_SUCCESS_CALLBACK, RECORD_EXECUTE_SUCCESS_NO_CONTENT_CALLBACK, RECORD_EXECUTE_FAIL_CALLBACK } from "../../../../bc/zrecord/Constants";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from "../../../../bc/zdata-source/Symbols";
|
|
3
|
+
import { DATA_SOURCE_EXECUTE } from "../../../../bc/zdata-source/Constants";
|
|
4
4
|
import UpdateRecordStrategy from "./UpdateRecordStrategy";
|
|
5
5
|
import DeleteRecordStrategy from "./DeleteRecordStrategy";
|
|
6
6
|
import DeleteMultipleRecordStrategy from "./DeleteMultipleRecordStrategy";
|
|
@@ -16,9 +16,9 @@ export default class RecordsManager {
|
|
|
16
16
|
this.records = records;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
createDataSourceExecuteEvent(props, actionName, metaData) {
|
|
20
20
|
return {
|
|
21
|
-
type:
|
|
21
|
+
type: DATA_SOURCE_EXECUTE,
|
|
22
22
|
payload: {
|
|
23
23
|
props,
|
|
24
24
|
actionName
|
|
@@ -27,7 +27,7 @@ export default class RecordsManager {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
createDataSourceMeta(_ref) {
|
|
31
31
|
let {
|
|
32
32
|
actionName,
|
|
33
33
|
successMeta,
|
|
@@ -36,9 +36,9 @@ export default class RecordsManager {
|
|
|
36
36
|
} = _ref;
|
|
37
37
|
return {
|
|
38
38
|
actionName,
|
|
39
|
-
[
|
|
40
|
-
[
|
|
41
|
-
[
|
|
39
|
+
[DATA_SOURCE_NO_CONTENT]: successNoContentMeta,
|
|
40
|
+
[DATA_SOURCE_FAILURE]: failureMeta,
|
|
41
|
+
[DATA_SOURCE_SUCCESS]: successMeta
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -69,7 +69,7 @@ export default class RecordsManager {
|
|
|
69
69
|
type: RECORD_EXECUTE_FAIL_CALLBACK,
|
|
70
70
|
metaData: recordExecuteStrategyMeta
|
|
71
71
|
};
|
|
72
|
-
return this.
|
|
72
|
+
return this.createDataSourceMeta({
|
|
73
73
|
actionName,
|
|
74
74
|
successNoContentMeta,
|
|
75
75
|
failureMeta,
|
|
@@ -101,7 +101,7 @@ export default class RecordsManager {
|
|
|
101
101
|
type: RECORD_EXECUTE_FAIL_CALLBACK,
|
|
102
102
|
metaData: fetchMoreStrategyMeta
|
|
103
103
|
};
|
|
104
|
-
return this.
|
|
104
|
+
return this.createDataSourceMeta({
|
|
105
105
|
actionName,
|
|
106
106
|
successNoContentMeta,
|
|
107
107
|
failureMeta,
|