@zohodesk/library-platform 1.0.2-exp.3 → 1.0.2-exp.4

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.
Files changed (130) hide show
  1. package/README.md +2 -2
  2. package/es/bc/{zdata-broker → zdata-source}/Actions.js +6 -6
  3. package/es/bc/{zdata-broker → zdata-source}/Constants.js +6 -5
  4. package/es/bc/zdata-source/EventHandlers.js +2 -0
  5. package/es/bc/zdata-source/Symbols.js +5 -0
  6. package/es/bc/zfield/ActionHandlers.js +1 -1
  7. package/es/bc/zlist/EventHandlers.js +1 -1
  8. package/es/bc/zlist/Properties.js +16 -32
  9. package/es/cc/action-icon/Properties.js +31 -0
  10. package/es/cc/action-location/Properties.js +9 -24
  11. package/es/cc/table-connected/Constants.js +4 -0
  12. package/es/cc/table-connected/Properties.js +11 -57
  13. package/es/cc/table-list/Properties.js +2 -2
  14. package/es/cc/table-list/data-types/Header.js +6 -0
  15. package/es/desk-frameworks/table-connected/frameworks/ListSdkFactory.js +88 -1
  16. package/es/desk-frameworks/table-connected/frameworks/TableConnectedFactory.js +21 -7
  17. package/es/desk-frameworks/table-connected/frameworks/TableConnectedView.js +5 -2
  18. package/es/library/dot/components/action-location/frameworks/ui/ActionComponentMapping.js +4 -2
  19. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +16 -3
  20. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +6 -4
  21. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +16 -3
  22. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon.js +18 -2
  23. package/es/library/dot/legacy-to-new-arch/action-icon/frameworks/ui/ActionIconView.js +75 -1
  24. package/es/platform/client-actions/behaviour/zclient-actions/Readme.md +14 -21
  25. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/ExecuteActionBehaviourUseCase.js +1 -1
  26. package/es/platform/client-actions/behaviour/zclient-actions/applications/usecases/InitializeUseCase.js +2 -2
  27. package/es/platform/client-actions/behaviour/zclient-actions/domain/entities/ClientActionManager.js +9 -9
  28. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +11 -0
  29. package/es/platform/client-actions/cc/dynamic-action-component/Properties.js +1 -1
  30. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediatorView.js +3 -1
  31. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/EventHandlersFactory.js +3 -3
  32. package/es/platform/client-actions/components/dynamic-component/frameworks/ui/DynamicActionComponentView.js +2 -2
  33. package/es/platform/client-actions/components/interfaces/ActionViewModel.js +7 -0
  34. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRenderer.module.css +17 -0
  35. package/es/platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActionsRendererView.js +7 -2
  36. package/es/platform/{data-broker → data-source}/http-template/getAvailableFields.js +5 -5
  37. package/es/platform/{data-broker → data-source}/http-template/getClientActions.js +4 -4
  38. package/es/platform/{data-broker → data-source}/http-template/getSelectedFields.js +5 -5
  39. package/es/platform/{data-broker → data-source}/index.js +2 -2
  40. package/es/platform/{data-broker → data-source}/utils/transformer/CreateCf.js +1 -1
  41. package/es/platform/{zdata-broker/adapters/controllers/DataBrokerExecutorController.js → zdata-source/adapters/controllers/DataSourceExecutorController.js} +1 -1
  42. package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Repository.js +5 -5
  43. package/es/platform/{zdata-broker → zdata-source}/adapters/presenters/Presenter.js +4 -4
  44. package/es/platform/{zdata-broker/applications/entities-factory/DataBrokerFactory.js → zdata-source/applications/entities-factory/DataSourceFactory.js} +3 -4
  45. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/ExecuteActionUseCase.js +3 -3
  46. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/FailureUseCase.js +3 -3
  47. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/NoContentUseCase.js +3 -3
  48. package/es/platform/{zdata-broker → zdata-source}/applications/usecases/SuccessUseCase.js +4 -4
  49. package/es/platform/{zdata-broker/domain/entities/DataBroker.js → zdata-source/domain/entities/DataSource.js} +12 -12
  50. package/es/platform/zdata-source/domain/entities/interfaces/MetaData.js +1 -0
  51. package/es/platform/{zdata-broker → zdata-source}/frameworks/DataBrokerBehaviourFactory.js +2 -2
  52. package/es/platform/{zdata-broker → zdata-source}/frameworks/EventHandlersFactory.js +7 -12
  53. package/es/platform/zfield/applications/usecases/ExecuteActionUseCase.js +1 -1
  54. package/es/platform/zfield/applications/usecases/InitializeUseCase.js +2 -2
  55. package/es/platform/zfield/applications/usecases/RefetchUseCase.js +1 -1
  56. package/es/platform/zfield/domain/entities/fields-manager/FieldsManager.js +5 -5
  57. package/es/platform/zfield/frameworks/ActionHandlerFactory.js +4 -4
  58. package/es/platform/zlist/adapters/controllers/DeleteSuccessController.js +25 -0
  59. package/es/platform/zlist/adapters/controllers/UpdateSuccessController.js +25 -0
  60. package/es/platform/zlist/adapters/gateways/Repository.js +8 -9
  61. package/es/platform/zlist/adapters/gateways/Service.js +8 -0
  62. package/es/platform/zlist/adapters/presenters/TableTranslator.js +46 -34
  63. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +16 -8
  64. package/es/platform/zlist/adapters/presenters/translators/Header.js +7 -2
  65. package/es/platform/zlist/adapters/presenters/translators/HeadersTranslator.js +4 -2
  66. package/es/platform/zlist/adapters/presenters/translators/Row.js +10 -6
  67. package/es/platform/zlist/adapters/presenters/translators/RowActionTranslator.js +6 -6
  68. package/es/platform/zlist/adapters/presenters/translators/RowsTranslator.js +7 -5
  69. package/es/platform/zlist/adapters/presenters/translators/actions/ActionsTranslator.js +89 -0
  70. package/es/platform/zlist/applications/entities-factory/ListFactory.js +2 -2
  71. package/es/platform/zlist/applications/usecases/DeleteSuccessUseCase.js +19 -0
  72. package/es/platform/zlist/applications/usecases/UpdateSuccessUseCase.js +19 -0
  73. package/es/platform/zlist/domain/entities/List.js +38 -10
  74. package/es/platform/zlist/frameworks/EventHandlersFactory.js +17 -23
  75. package/es/platform/zrecord/applications/usecases/ExecuteActionUseCase.js +1 -1
  76. package/es/platform/zrecord/applications/usecases/FetchMoreUseCase.js +1 -1
  77. package/es/platform/zrecord/applications/usecases/InitializeUseCase.js +2 -2
  78. package/es/platform/zrecord/applications/usecases/RefetchUseCase.js +1 -1
  79. package/es/platform/zrecord/domain/entities/RecordsManager.js +10 -10
  80. package/package.json +4 -4
  81. package/es/bc/zdata-broker/EventHandlers.js +0 -2
  82. package/es/bc/zdata-broker/Symbols.js +0 -5
  83. package/es/desk-frameworks/table-connected/frameworks/__tests__/TableConnectedFactory.spec.js +0 -453
  84. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getAvailableFields.js +0 -86
  85. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getRecords.js +0 -81
  86. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/http-template/getSelectedFields.js +0 -32
  87. package/es/desk-frameworks/table-connected/frameworks/__tests__/mock/data-broker/index.js +0 -11
  88. package/es/platform/zdata-broker/domain/entities/interfaces/MetaData.js +0 -1
  89. /package/es/bc/{zdata-broker → zdata-source}/Properties.js +0 -0
  90. /package/es/platform/{data-broker → data-source}/dbc/index.js +0 -0
  91. /package/es/platform/{data-broker → data-source}/http-template/deleteRecord.js +0 -0
  92. /package/es/platform/{data-broker → data-source}/http-template/deleteRecords.js +0 -0
  93. /package/es/platform/{data-broker → data-source}/http-template/getRecords.js +0 -0
  94. /package/es/platform/{data-broker → data-source}/http-template/updateRecord.js +0 -0
  95. /package/es/platform/{data-broker → data-source}/utils/transformer/Transformer.js +0 -0
  96. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/AbstractController.js +0 -0
  97. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/FailureController.js +0 -0
  98. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/NoContentController.js +0 -0
  99. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/RegisterController.js +0 -0
  100. /package/es/platform/{zdata-broker → zdata-source}/adapters/controllers/SuccessController.js +0 -0
  101. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/Service.js +0 -0
  102. /package/es/platform/{zdata-broker → zdata-source}/adapters/gateways/TemplateHelpers.js +0 -0
  103. /package/es/platform/{zdata-broker → zdata-source}/applications/entities-factory/APITemplatesFactory.js +0 -0
  104. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/InputDependencies.js +0 -0
  105. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/IRepository.js +0 -0
  106. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/IService.js +0 -0
  107. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/ITemplateHelpers.js +0 -0
  108. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/gateways/State.js +0 -0
  109. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/input/ExecuteActionInputModel.js +0 -0
  110. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/input/FailureInputModel.js +0 -0
  111. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/input/NoContentInputModel.js +0 -0
  112. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/input/RegisterInputModel.js +0 -0
  113. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/input/SuccessInputModel.js +0 -0
  114. /package/es/platform/{zdata-broker → zdata-source}/applications/interfaces/output/IPresenter.js +0 -0
  115. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/AbstractUseCase.js +0 -0
  116. /package/es/platform/{zdata-broker → zdata-source}/applications/usecases/RegisterUseCase.js +0 -0
  117. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplate.js +0 -0
  118. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/APITemplates.js +0 -0
  119. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/APIDetailsModel.js +0 -0
  120. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/APITemplateModel.js +0 -0
  121. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/APITemplatesModel.js +0 -0
  122. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ApiEnum.js +0 -0
  123. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/BehaviourState.js +0 -0
  124. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/EventModel.js +0 -0
  125. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/IAPITemplate.js +0 -0
  126. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/IAPITemplates.js +0 -0
  127. /package/es/platform/{zdata-broker/domain/entities/interfaces/IDataBroker.js → zdata-source/domain/entities/interfaces/IDataSource.js} +0 -0
  128. /package/es/platform/{zdata-broker → zdata-source}/domain/entities/interfaces/ITemplateHelpers.js +0 -0
  129. /package/es/platform/zlist/adapters/presenters/translators/interfaces/{FieldUiMapping.js → Context.js} +0 -0
  130. /package/es/platform/zlist/adapters/presenters/translators/interfaces/{PageContext.js → FieldComponentMapping.js} +0 -0
@@ -1,5 +1,8 @@
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 {
@@ -10,14 +13,24 @@ export default function RowData(_ref) {
10
13
  } = _ref;
11
14
  let {
12
15
  type,
16
+ actions,
13
17
  ...props
14
18
  } = field;
19
+ const hasActions = Boolean(actions === null || actions === void 0 ? void 0 : actions.length);
15
20
  return /*#__PURE__*/React.createElement(TableData, {
16
- $ui_align: alignment,
21
+ $ui_align: hasActions ? null : alignment,
17
22
  $data_width: width,
18
- $flag_flexible: isFlexibleColumns
23
+ $flag_flexible: isFlexibleColumns,
24
+ $customProps_container: hasActions ? {
25
+ $ui_displayMode: 'flex',
26
+ $ui_alignItems: 'center',
27
+ $ui_justifyContent: AlignmentOfFlex[alignment]
28
+ } : null
19
29
  }, /*#__PURE__*/React.createElement(FieldComponent, {
20
30
  type: type,
21
31
  fieldProps: props
22
- }));
32
+ }), hasActions ? /*#__PURE__*/React.createElement(ActionEventMediator, {
33
+ actions: actions,
34
+ gap: ActionViewGap.SMALL
35
+ }) : null);
23
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,38 +1,31 @@
1
1
  Client Actions Behaviour
2
2
 
3
-
4
3
  This behaviour will allows your library components to fetch client actions for your users.
5
4
 
6
5
  # Implementation
7
6
 
8
- ClientActionsBehaviourFactory.create({ getClientActions: dataBroker.httpTemplates.getClientActions })
7
+ ClientActionsBehaviourFactory.create({ getClientActions: dataSource.httpTemplates.getClientActions })
9
8
 
10
9
  This above class should be implemeted in the behaviour props of your library components
11
10
 
12
- The user needs to passdown the databroker into the behaviour in the format,
11
+ The user needs to passdown the dataSource into the behaviour in the format,
13
12
 
14
13
  1. getClientActions => Client Actions GET data broker template
15
14
 
16
-
17
-
18
15
  # Integration inside component
19
16
 
20
- We need to initialize or mount our behaviour with the component. Refer the eg used in List component below
17
+ We need to initialize or mount our behaviour with the component. Refer the eg used in List component below
21
18
 
22
- private createClientActionsFetchAction(): ActionModel {
23
- const props = this.createApiProps();
24
- return {
25
- type: CLIENTACTION_BEHAVIOUR_EXECUTE,
26
- payload: {
27
- actionName: 'getClientActions',
28
- props,
29
- apiName: 'clientActions'
30
- }
31
- };
32
- }
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
+ }
33
30
 
34
31
  The function createClientActionsFetchAction is called at Library component mount, which will mount client action behaviour and do the necessary processing.
35
-
36
-
37
-
38
-
@@ -25,7 +25,7 @@ class ExecuteActionBehaviourUseCase extends AbstractUseCase {
25
25
  presenter.updateClientAction(recordManager.toObject());
26
26
  }
27
27
 
28
- dispatch(recordManager.createDataBrokerExecuteEvent(props, actionName, metaData));
28
+ dispatch(recordManager.createDataSourceExecuteEvent(props, actionName, metaData));
29
29
  }
30
30
 
31
31
  }
@@ -1,5 +1,5 @@
1
1
  import AbstractUseCase from "./AbstractUseCase";
2
- import { DATA_BROKER_REGISTER } from "../../../../../../bc/zdata-broker/Constants";
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: DATA_BROKER_REGISTER,
10
+ type: DATA_SOURCE_REGISTER,
11
11
  payload: {
12
12
  apiTemplates
13
13
  }
@@ -1,5 +1,5 @@
1
- import { DATA_BROKER_FAILURE, DATA_BROKER_NO_CONTENT, DATA_BROKER_SUCCESS } from "../../../../../../bc/zdata-broker/Symbols";
2
- import { DATA_BROKER_EXECUTE } from "../../../../../../bc/zdata-broker/Constants";
1
+ import { DATA_SOURCE_FAILURE, DATA_SOURCE_NO_CONTENT, DATA_SOURCE_SUCCESS } from "../../../../../../bc/zdata-source/Symbols";
2
+ import { DATA_SOURCE_EXECUTE } from "../../../../../../bc/zdata-source/Constants";
3
3
  import { CLIENTACTION_EXECUTE_FAIL_CALLBACK, CLIENTACTION_EXECUTE_SUCCESS_CALLBACK, CLIENTACTION_EXECUTE_SUCCESS_NO_CONTENT_CALLBACK, ClientActionApiActionName } from "../../../../bc/zclient-actions/Constants";
4
4
  import GetClientActionsStrategy from "./GetClientActionsStrategy";
5
5
  const clientActionExecuteStrategiesMap = {
@@ -10,7 +10,7 @@ export default class ClientActionManager {
10
10
  this.clientActions = clientActions;
11
11
  }
12
12
 
13
- createDataBrokerMeta(_ref) {
13
+ createDataSourceMeta(_ref) {
14
14
  let {
15
15
  actionName,
16
16
  successMeta,
@@ -19,15 +19,15 @@ export default class ClientActionManager {
19
19
  } = _ref;
20
20
  return {
21
21
  actionName,
22
- [DATA_BROKER_NO_CONTENT]: successNoContentMeta,
23
- [DATA_BROKER_FAILURE]: failureMeta,
24
- [DATA_BROKER_SUCCESS]: successMeta
22
+ [DATA_SOURCE_NO_CONTENT]: successNoContentMeta,
23
+ [DATA_SOURCE_FAILURE]: failureMeta,
24
+ [DATA_SOURCE_SUCCESS]: successMeta
25
25
  };
26
26
  }
27
27
 
28
- createDataBrokerExecuteEvent(props, actionName, metaData) {
28
+ createDataSourceExecuteEvent(props, actionName, metaData) {
29
29
  return {
30
- type: DATA_BROKER_EXECUTE,
30
+ type: DATA_SOURCE_EXECUTE,
31
31
  payload: {
32
32
  props,
33
33
  actionName
@@ -59,7 +59,7 @@ export default class ClientActionManager {
59
59
  type: CLIENTACTION_EXECUTE_FAIL_CALLBACK,
60
60
  metaData: clientActionExecuteStrategyMeta
61
61
  };
62
- return this.createDataBrokerMeta({
62
+ return this.createDataSourceMeta({
63
63
  actionName,
64
64
  successNoContentMeta,
65
65
  failureMeta,
@@ -1,3 +1,4 @@
1
+ import { ActionViewGap } from "../../components/interfaces/ActionViewModel";
1
2
  import { actionSchema } from "../dynamic-action-component/Properties";
2
3
  export const actionsSchema = {
3
4
  type: 'array',
@@ -19,5 +20,15 @@ export default {
19
20
  }
20
21
  },
21
22
  defaultValue: ''
23
+ },
24
+ gap: {
25
+ required: false,
26
+ defaultValue: ActionViewGap.NONE,
27
+ typeMetadata: {
28
+ schema: {
29
+ type: 'string',
30
+ enum: Object.values(ActionViewGap)
31
+ }
32
+ }
22
33
  }
23
34
  };
@@ -35,7 +35,7 @@ export const actionSchema = {
35
35
  type: 'string'
36
36
  }
37
37
  },
38
- required: ['action', 'sourceEvent', 'id']
38
+ required: ['sourceEvent', 'id']
39
39
  }
40
40
  }
41
41
  },
@@ -7,11 +7,13 @@ export default function ActionEventMediatorView(_ref, ref) {
7
7
  } = _ref;
8
8
  const {
9
9
  actions,
10
- renderComponentType
10
+ renderComponentType,
11
+ gap
11
12
  } = state.properties;
12
13
  const ActionRenderComponent = ComponentRegistry.get(renderComponentType) || RowActionsRenderer;
13
14
  return /*#__PURE__*/React.createElement(ActionRenderComponent, {
14
15
  actions: actions,
16
+ gap: gap,
15
17
  getRef: ref
16
18
  });
17
19
  }
@@ -21,9 +21,9 @@ export default class EventHandlersFactory {
21
21
  const unmountController = new UnmountController(destroyUseCase);
22
22
  const propertiesChangeController = new PropertiesChangeController(propertiesChangeUseCase);
23
23
  return {
24
- MOUNT: initializeController.handle,
25
- UPDATE_PROPERTIES: propertiesChangeController.handle,
26
- UNMOUNT: unmountController.handle
24
+ ['ActionEventMediator#MOUNT']: initializeController.handle,
25
+ ['ActionEventMediator#UPDATE_PROPERTIES']: propertiesChangeController.handle,
26
+ ['ActionEventMediator#UNMOUNT']: unmountController.handle
27
27
  };
28
28
  }
29
29
 
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
2
  import ComponentRegistry from "../../../../../../library/custom-component/frameworks/ui/ComponentRegistry";
3
+ import ActionComponentMapping from "../../../../../../library/dot/components/action-location/frameworks/ui/ActionComponentMapping";
3
4
 
4
5
  function DynamicComponentView(_ref, ref) {
5
6
  let {
@@ -13,7 +14,7 @@ function DynamicComponentView(_ref, ref) {
13
14
  properties,
14
15
  eventMappings
15
16
  } = action;
16
- const Component = ComponentRegistry.get(component);
17
+ const Component = ComponentRegistry.get(component) || ActionComponentMapping[component];
17
18
 
18
19
  if (!Component) {
19
20
  return /*#__PURE__*/React.createElement("div", {
@@ -30,5 +31,4 @@ function DynamicComponentView(_ref, ref) {
30
31
  });
31
32
  }
32
33
 
33
- ;
34
34
  export default DynamicComponentView;
@@ -0,0 +1,7 @@
1
+ export let ActionViewGap = /*#__PURE__*/function (ActionViewGap) {
2
+ ActionViewGap["NONE"] = "none";
3
+ ActionViewGap["SMALL"] = "small";
4
+ ActionViewGap["MEDIUM"] = "medium";
5
+ ActionViewGap["LARGE"] = "large";
6
+ return ActionViewGap;
7
+ }({});
@@ -0,0 +1,17 @@
1
+ [dir=ltr] .actions {
2
+ padding-left: var(--zd_size4)
3
+ }[dir=rtl] .actions {
4
+ padding-right: var(--zd_size4)
5
+ }
6
+
7
+ .gap_small {
8
+ gap: var(--zd_size4)
9
+ }
10
+
11
+ .gap_medium {
12
+ gap: var(--zd_size8)
13
+ }
14
+
15
+ .gap_large {
16
+ gap: var(--zd_size12)
17
+ }
@@ -1,18 +1,23 @@
1
1
  import React from 'react';
2
2
  import Flex from '@zohodesk/layout/es/Flex/Flex';
3
3
  import DynamicActionComponent from "../../../dynamic-component/frameworks/ui/DynamicActionComponent";
4
+ import { ActionViewGap } from "../../../interfaces/ActionViewModel";
5
+ // @ts-ignore
6
+ import style from "./RowActionsRenderer.module.css";
4
7
 
5
8
  function RowActionsRendererView(_ref, ref) {
6
9
  let {
7
10
  state
8
11
  } = _ref;
9
12
  const {
10
- actions
13
+ actions,
14
+ gap
11
15
  } = state.properties;
12
16
  return /*#__PURE__*/React.createElement(Flex, {
13
17
  ref: ref,
14
18
  $ui_displayMode: "inline",
15
- $ui_alignItems: "center"
19
+ $ui_alignItems: "center",
20
+ $ui_className: `${style.actions} ${gap !== ActionViewGap.NONE ? style[`gap_${gap}`] : ''}`
16
21
  }, actions.map((action, index) => {
17
22
  return /*#__PURE__*/React.createElement(DynamicActionComponent, {
18
23
  action: action,
@@ -1,18 +1,18 @@
1
1
  let getAvailableFields = {
2
- name: "availableFields",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/views/availableFields",
2
+ name: 'availableFields',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/views/availableFields',
4
4
  parameters: `{
5
5
  "departmentId":"{{departmentId}}",
6
6
  "module":"{{moduleName}}"
7
7
  }`,
8
- type: "GET",
8
+ type: 'GET',
9
9
  transformer: res => res.fields,
10
10
  properties: {
11
11
  moduleName: {
12
12
  required: true,
13
13
  typeMetadata: {
14
14
  schema: {
15
- type: "string"
15
+ type: 'string'
16
16
  }
17
17
  }
18
18
  },
@@ -20,7 +20,7 @@ let getAvailableFields = {
20
20
  required: true,
21
21
  typeMetadata: {
22
22
  schema: {
23
- type: "string"
23
+ type: 'string'
24
24
  }
25
25
  }
26
26
  }
@@ -1,20 +1,20 @@
1
1
  let getClientActions = {
2
- name: "uiActions",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/clientActions",
2
+ name: 'uiActions',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/clientActions',
4
4
  parameters: `{
5
5
  "from":{{from}},
6
6
  "limit":{{limit}},
7
7
  "library": "{{library}}",
8
8
  "module": "{{moduleName}}"
9
9
  }`,
10
- type: "GET",
10
+ type: 'GET',
11
11
  transformer: data => data,
12
12
  properties: {
13
13
  modelName: {
14
14
  required: true,
15
15
  typeMetadata: {
16
16
  schema: {
17
- type: "string"
17
+ type: 'string'
18
18
  }
19
19
  }
20
20
  }
@@ -1,17 +1,17 @@
1
1
  let getSelectedFields = {
2
- name: "selectedFields",
3
- api: "/{{servicePrefix}}/{{orgName}}/api/v1/views/{{viewId}}/selectedFields",
2
+ name: 'selectedFields',
3
+ api: '/{{servicePrefix}}/{{orgName}}/api/v1/views/{{viewId}}/selectedFields',
4
4
  parameters: `{
5
5
  "departmentId":"{{departmentId}}"
6
6
  }`,
7
- type: "GET",
7
+ type: 'GET',
8
8
  transformer: res => res.fields,
9
9
  properties: {
10
10
  viewId: {
11
11
  required: true,
12
12
  typeMetadata: {
13
13
  schema: {
14
- type: "string"
14
+ type: 'string'
15
15
  }
16
16
  }
17
17
  },
@@ -20,7 +20,7 @@ let getSelectedFields = {
20
20
  defaultValue: 1,
21
21
  typeMetadata: {
22
22
  schema: {
23
- type: "number"
23
+ type: 'number'
24
24
  }
25
25
  }
26
26
  }
@@ -7,7 +7,7 @@ import getSelectedFields from "./http-template/getSelectedFields";
7
7
  import getClientActions from "./http-template/getClientActions";
8
8
  import { RecordApiActionName } from "../../bc/zrecord/Constants";
9
9
  import deleteRecord from "./http-template/deleteRecord";
10
- let record = {
10
+ let dataSource = {
11
11
  httpTemplates: {
12
12
  [RecordApiActionName.GET_RECORDS]: getRecords,
13
13
  [RecordApiActionName.UPDATE_RECORD]: updateRecord,
@@ -18,5 +18,5 @@ let record = {
18
18
  getSelectedFields
19
19
  }
20
20
  };
21
- export default record; // let ticketsRecordSerice = createRecord(tickets, () => {});
21
+ export default dataSource; // let ticketsRecordSerice = createRecord(tickets, () => {});
22
22
  // export default ticketsRecordSerice;
@@ -1,7 +1,7 @@
1
1
  // REVIEW: Function never used
2
2
  function createCf(item, key) {
3
3
  return Object.keys(item).reduce((res, next) => {
4
- if ([key, "id", "createdTime"].includes(next)) {
4
+ if ([key, 'id', 'createdTime'].includes(next)) {
5
5
  return res;
6
6
  } else {
7
7
  res[next] = item[next];
@@ -1,5 +1,5 @@
1
1
  import AbstractController from "./AbstractController";
2
- export default class DataBrokerExecutorController extends AbstractController {
2
+ export default class DataSourceExecutorController extends AbstractController {
3
3
  handle(event) {
4
4
  const {
5
5
  state,
@@ -1,6 +1,6 @@
1
1
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
2
2
 
3
- import DataBrokerFactory from "../../applications/entities-factory/DataBrokerFactory";
3
+ import DataSourceFactory from "../../applications/entities-factory/DataSourceFactory";
4
4
  export default class Repository {
5
5
  constructor() {
6
6
  _defineProperty(this, "state", void 0);
@@ -10,14 +10,14 @@ export default class Repository {
10
10
  this.state = state;
11
11
  }
12
12
 
13
- getDataBrokerEntity(templateHelpers) {
13
+ getDataSourceEntity(templateHelpers) {
14
14
  const {
15
- dataBroker
15
+ dataSource
16
16
  } = this.state.behaviours;
17
17
  const {
18
18
  apiTemplates
19
- } = dataBroker;
20
- const recordManager = DataBrokerFactory.create(apiTemplates, templateHelpers);
19
+ } = dataSource;
20
+ const recordManager = DataSourceFactory.create(apiTemplates, templateHelpers);
21
21
  return recordManager;
22
22
  }
23
23
 
@@ -12,10 +12,10 @@ export default class Presenter {
12
12
  this.state = state;
13
13
  }
14
14
 
15
- updateBehaviourState(dataBrokerBehaviourState) {
15
+ updateBehaviourState(dataSourceBehaviourState) {
16
16
  this.state = { ...this.state,
17
17
  behaviours: { ...this.state.behaviours,
18
- dataBroker: dataBrokerBehaviourState
18
+ dataSource: dataSourceBehaviourState
19
19
  }
20
20
  };
21
21
  this.updateState(this.state);
@@ -23,10 +23,10 @@ export default class Presenter {
23
23
 
24
24
  updateAPITemplates(apiTemplates) {
25
25
  const {
26
- dataBroker
26
+ dataSource
27
27
  } = this.state.behaviours;
28
28
  this.updateBehaviourState({
29
- apiTemplates: { ...(dataBroker === null || dataBroker === void 0 ? void 0 : dataBroker.apiTemplates),
29
+ apiTemplates: { ...(dataSource === null || dataSource === void 0 ? void 0 : dataSource.apiTemplates),
30
30
  ...apiTemplates
31
31
  }
32
32
  });
@@ -1,10 +1,9 @@
1
1
  import APITemplatesFactory from "./APITemplatesFactory";
2
- import DataBroker from "../../domain/entities/DataBroker";
3
- export default class DataBrokerFactory {
2
+ import DataSource from "../../domain/entities/DataSource";
3
+ export default class DataSourceFactory {
4
4
  static create(httpTemplates, templateHelpers) {
5
5
  const apiTemplates = APITemplatesFactory.create(httpTemplates, templateHelpers);
6
- const dataBroker = new DataBroker(apiTemplates);
7
- return dataBroker;
6
+ return new DataSource(apiTemplates);
8
7
  }
9
8
 
10
9
  }
@@ -12,9 +12,9 @@ class ExecuteActionUseCase extends AbstractUseCase {
12
12
  metaData,
13
13
  actionName
14
14
  } = input;
15
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
16
- const apiDetails = dataBroker.getApiDetails(actionName, props);
17
- dispatch(dataBroker.createFetchEvent(apiDetails, metaData));
15
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
16
+ const apiDetails = dataSource.getApiDetails(actionName, props);
17
+ dispatch(dataSource.createFetchEvent(apiDetails, metaData));
18
18
  }
19
19
 
20
20
  }
@@ -11,10 +11,10 @@ class FailureUseCase extends AbstractUseCase {
11
11
  metaData,
12
12
  error
13
13
  } = input;
14
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
14
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
15
15
 
16
- if (dataBroker.isMetaHasDataBrokerSignature(metaData)) {
17
- const events = dataBroker.createFailureEvents(error, metaData);
16
+ if (dataSource.isMetaHasDataSourceSignature(metaData)) {
17
+ const events = dataSource.createFailureEvents(error, metaData);
18
18
  events.forEach(action => {
19
19
  dispatch(action);
20
20
  });
@@ -10,10 +10,10 @@ class NoContentUseCase extends AbstractUseCase {
10
10
  dispatch,
11
11
  metaData
12
12
  } = input;
13
- const dataBroker = repository.getDataBrokerEntity(templateHelpers);
13
+ const dataSource = repository.getDataSourceEntity(templateHelpers);
14
14
 
15
- if (dataBroker.isMetaHasDataBrokerSignature(metaData)) {
16
- const events = dataBroker.createNoContentEvents(metaData);
15
+ if (dataSource.isMetaHasDataSourceSignature(metaData)) {
16
+ const events = dataSource.createNoContentEvents(metaData);
17
17
  events.forEach(action => {
18
18
  dispatch(action);
19
19
  });