@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
package/README.md CHANGED
@@ -21,7 +21,7 @@ import TableConnectedFactory from '@zohodesk/library-platform/TableConnectedFact
21
21
 
22
22
  const myTableComponent = TableConnectedFactory.create({
23
23
  name: 'MyTableComponent',
24
- dataBroker: myDataBroker,
24
+ dataSource: myDataSource,
25
25
  eventHandlers: {
26
26
  onRowSelect: row => {
27
27
  console.log('Selected row:', row);
@@ -69,7 +69,7 @@ const myComponent = ComponentRegistry.get('MyComponent');
69
69
  The `TableConnectedFactory.create` method accepts the following parameters:
70
70
 
71
71
  - **name**: `string` - The name of the component.
72
- - **dataBroker**: `object` - The data broker instance to manage data fetching and manipulation.
72
+ - **dataSource**: `object` - The data broker instance to manage data fetching and manipulation.
73
73
  - **eventHandlers**: `object` - An object containing event handler functions.
74
74
  - **View**: `React.Component` - Custom view component to render the table.
75
75
 
@@ -1,7 +1,7 @@
1
- import { DATA_BROKER_EXECUTE } from "./Constants";
2
- import { DATA_BROKER_FAILURE, DATA_BROKER_SUCCESS } from "./Symbols";
1
+ import { DATA_SOURCE_EXECUTE } from "./Constants";
2
+ import { DATA_SOURCE_FAILURE, DATA_SOURCE_SUCCESS } from "./Symbols";
3
3
  const Actions = [{
4
- type: DATA_BROKER_EXECUTE,
4
+ type: DATA_SOURCE_EXECUTE,
5
5
  payload: {
6
6
  apiName: {
7
7
  name: 'apiName',
@@ -34,7 +34,7 @@ const Actions = [{
34
34
  schema: {
35
35
  type: 'object',
36
36
  properties: {
37
- [DATA_BROKER_SUCCESS]: {
37
+ [DATA_SOURCE_SUCCESS]: {
38
38
  type: 'object',
39
39
  properties: {
40
40
  type: {
@@ -46,7 +46,7 @@ const Actions = [{
46
46
  },
47
47
  required: ['type', 'payload']
48
48
  },
49
- [DATA_BROKER_FAILURE]: {
49
+ [DATA_SOURCE_FAILURE]: {
50
50
  type: 'object',
51
51
  properties: {
52
52
  type: {
@@ -59,7 +59,7 @@ const Actions = [{
59
59
  required: ['type', 'payload']
60
60
  }
61
61
  },
62
- required: [DATA_BROKER_SUCCESS, DATA_BROKER_FAILURE]
62
+ required: [DATA_SOURCE_SUCCESS, DATA_SOURCE_FAILURE]
63
63
  }
64
64
  }
65
65
  }
@@ -1,10 +1,11 @@
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
- export const DATA_BROKER_REGISTER = 'DATA_BROKER#REGISTER';
4
- export const DATA_BROKER_EXECUTE = 'DATA_BROKER#EXECUTE';
5
- export const DATA_BROKER_EXECUTE_SUCCEEDED = 'DATA_BROKER#EXECUTE_SUCCEEDED';
6
- export const DATA_BROKER_EXECUTE_NO_CONTENT_SUCCEEDED = 'DATA_BROKER#EXECUTE_NO_CONTENT_SUCCEEDED';
7
- export const DATA_BROKER_EXECUTE_FAILED = 'DATA_BROKER#EXECUTE_FAILED';
3
+ export const DATA_SOURCE_REGISTER = 'DATA_SOURCE#REGISTER';
4
+ export const DATA_SOURCE_EXECUTE = 'DATA_SOURCE#EXECUTE';
5
+ export const DATA_SOURCE_EXECUTE_SUCCEEDED = 'DATA_SOURCE#EXECUTE_SUCCEEDED';
6
+ export const DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED = 'DATA_SOURCE#EXECUTE_NO_CONTENT_SUCCEEDED';
7
+ export const DATA_SOURCE_EXECUTE_FAILED = 'DATA_SOURCE#EXECUTE_FAILED'; // REVIEW: This class is not used anywhere in the codebase.
8
+
8
9
  export class DataBrokerActionName {}
9
10
 
10
11
  _defineProperty(DataBrokerActionName, "GET_RECORDS", 'getRecords');
@@ -0,0 +1,2 @@
1
+ import { DATA_SOURCE_EXECUTE, DATA_SOURCE_REGISTER } from "./Constants";
2
+ import { FETCH_FAILED, FETCH_SUCCESS, FETCH_SUCCESS_NO_CONTENT } from "../zhttp/Constants";
@@ -0,0 +1,5 @@
1
+ // Note: We need to properly handle uniqueness, because it is not api response
2
+ export const DATA_SOURCE_SIGNATURE = 'DATA_SOURCE#SIGNATURE';
3
+ export const DATA_SOURCE_FAILURE = 'DATA_SOURCE#FAILURE';
4
+ export const DATA_SOURCE_SUCCESS = 'DATA_SOURCE#SUCCESS';
5
+ export const DATA_SOURCE_NO_CONTENT = 'DATA_SOURCE#NO_CONTENT';
@@ -1,2 +1,2 @@
1
1
  import { FIELD_EXECUTE, FIELD_REFETCH } from "./Constants";
2
- import { DATA_BROKER_EXECUTE_FAILED, DATA_BROKER_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_BROKER_EXECUTE_SUCCEEDED } from "../zdata-broker/Constants";
2
+ import { DATA_SOURCE_EXECUTE_FAILED, DATA_SOURCE_EXECUTE_NO_CONTENT_SUCCEEDED, DATA_SOURCE_EXECUTE_SUCCEEDED } from "../zdata-source/Constants";
@@ -1 +1 @@
1
- import { ZLIST_FETCH_MORE } from "./Constants";
1
+ import { ZLIST_FETCH_MORE, ZLIST_RECORD_DELETE_SUCCEEDED, ZLIST_RECORD_UPDATE_SUCCEEDED } from "./Constants";
@@ -7,50 +7,43 @@ export default {
7
7
  }
8
8
  }
9
9
  },
10
- filter: {
10
+ departmentId: {
11
11
  required: true,
12
12
  typeMetadata: {
13
13
  schema: {
14
- type: 'object',
15
- properties: {
16
- viewId: {
17
- type: 'string'
18
- },
19
- orgId: {
20
- type: 'string'
21
- },
22
- departmentId: {
23
- type: 'string'
24
- }
25
- },
26
- additionalProperties: {
27
- type: 'string'
28
- }
14
+ type: 'string'
29
15
  }
30
16
  }
31
17
  },
32
- pageContext: {
18
+ viewId: {
19
+ required: true,
20
+ typeMetadata: {
21
+ schema: {
22
+ type: 'string'
23
+ }
24
+ }
25
+ },
26
+ context: {
33
27
  required: true,
34
28
  typeMetadata: {
35
29
  schema: {
36
30
  type: 'object',
37
31
  properties: {
38
- orgName: {
32
+ orgId: {
39
33
  type: 'string'
40
34
  },
41
- servicePrefix: {
35
+ orgName: {
42
36
  type: 'string'
43
37
  },
44
38
  departmentName: {
45
39
  type: 'string'
46
40
  },
47
- moduleSanitatedName: {
41
+ servicePrefix: {
48
42
  type: 'string'
49
43
  }
50
44
  },
51
- additionalProperties: {
52
- type: 'string'
53
- }
45
+ required: ['orgId', 'orgName', 'departmentName'],
46
+ additionalProperties: false
54
47
  }
55
48
  }
56
49
  },
@@ -69,14 +62,5 @@ export default {
69
62
  }]
70
63
  }
71
64
  }
72
- },
73
- limit: {
74
- required: false,
75
- defaultValue: 50,
76
- typeMetadata: {
77
- schema: {
78
- type: 'number'
79
- }
80
- }
81
65
  }
82
66
  };
@@ -34,6 +34,37 @@ export default {
34
34
  }
35
35
  }
36
36
  },
37
+ options: {
38
+ // NOTE: This is only a sample for FilterDropdown action component
39
+ required: false,
40
+ defaultValue: [],
41
+ typeMetadata: {
42
+ schema: {
43
+ type: "array",
44
+ items: {
45
+ type: "object",
46
+ properties: {
47
+ label: {
48
+ type: "string"
49
+ },
50
+ value: {
51
+ type: "string"
52
+ }
53
+ }
54
+ }
55
+ }
56
+ }
57
+ },
58
+ isMultiselectable: {
59
+ // NOTE: This is only a sample for FilterDropdown action component
60
+ required: false,
61
+ defaultValue: false,
62
+ typeMetadata: {
63
+ schema: {
64
+ type: "boolean"
65
+ }
66
+ }
67
+ },
37
68
  isVisible: {
38
69
  required: false,
39
70
  defaultValue: true,
@@ -4,7 +4,10 @@ export const actionsSchema = {
4
4
  items: {
5
5
  type: 'object',
6
6
  properties: {
7
- type: {
7
+ component: {
8
+ type: 'string'
9
+ },
10
+ id: {
8
11
  type: 'string'
9
12
  },
10
13
  properties: {
@@ -16,42 +19,24 @@ export const actionsSchema = {
16
19
  items: {
17
20
  type: 'object',
18
21
  properties: {
19
- action: {
20
- type: 'object',
21
- properties: {
22
- id: {
23
- type: 'string'
24
- },
25
- dispatchType: {
26
- type: 'string'
27
- }
28
- },
29
- required: ['id', 'dispatchType']
22
+ id: {
23
+ type: 'string'
30
24
  },
31
- eventType: {
25
+ sourceEvent: {
32
26
  type: 'string'
33
27
  },
34
28
  payload: {
35
29
  type: 'object'
36
30
  }
37
31
  },
38
- required: ['action', 'payload', 'eventType']
32
+ required: ['sourceEvent', 'id']
39
33
  }
40
34
  }
41
35
  },
42
- required: ['type', 'properties']
36
+ required: ['component', 'properties']
43
37
  }
44
38
  };
45
39
  export default {
46
- type: {
47
- required: false,
48
- typeMetadata: {
49
- schema: {
50
- type: 'string'
51
- }
52
- },
53
- defaultValue: ''
54
- },
55
40
  actions: {
56
41
  required: true,
57
42
  typeMetadata: {
@@ -0,0 +1,4 @@
1
+ export const SMART_TABLE_EVENTS = {
2
+ DELETE_RECORDS_SUCCESS: 'SMART_TABLE#RECORD_DELETED',
3
+ UPDATE_RECORDS_SUCCESS: 'SMART_TABLE#RECORD_UPDATED'
4
+ };
@@ -1,16 +1,23 @@
1
1
  import SelectionConfigSchema from "../../bc/list-selection/Properties";
2
2
  export default {
3
- isFlexibleColumns: {
3
+ preferences: {
4
4
  required: false,
5
- defaultValue: false,
5
+ defaultValue: {
6
+ autoColumnSizing: false
7
+ },
6
8
  typeMetadata: {
7
9
  schema: {
8
- type: 'boolean'
10
+ type: 'object',
11
+ properties: {
12
+ autoColumnSizing: {
13
+ type: 'boolean'
14
+ }
15
+ }
9
16
  }
10
17
  }
11
18
  },
12
19
  ...SelectionConfigSchema,
13
- uiMapping: {
20
+ componentMapping: {
14
21
  required: false,
15
22
  defaultValue: {
16
23
  fields: {},
@@ -40,58 +47,5 @@ export default {
40
47
  type: 'string'
41
48
  }
42
49
  }
43
- },
44
- rowActions: {
45
- required: false,
46
- defaultValue: [],
47
- typeMetadata: {
48
- schema: {
49
- type: 'array',
50
- minItems: 0,
51
- items: {
52
- type: 'object',
53
- properties: {
54
- uiType: {
55
- type: 'string'
56
- },
57
- properties: {
58
- type: 'object'
59
- },
60
- eventMappings: {
61
- type: 'array',
62
- minItems: 0,
63
- items: {
64
- type: 'object',
65
- properties: {
66
- id: {
67
- type: 'string'
68
- },
69
- action: {
70
- type: 'object',
71
- properties: {
72
- id: {
73
- type: 'string'
74
- },
75
- dispatchType: {
76
- type: 'string'
77
- }
78
- },
79
- required: ['id', 'dispatchType']
80
- },
81
- eventType: {
82
- type: 'string'
83
- },
84
- payloadMapping: {
85
- type: 'string'
86
- }
87
- },
88
- required: ['id', 'action', 'payloadMapping', 'eventType']
89
- }
90
- }
91
- },
92
- required: ['uiType', 'properties']
93
- }
94
- }
95
- }
96
50
  }
97
51
  };
@@ -1,7 +1,7 @@
1
1
  import { Alignment, SortedBy, Width } from "./data-types/Header";
2
2
  import RowCursor from "./data-types/RowCursor";
3
3
  import ResizerConfigSchema from "../../bc/table-column-resizer/Properties";
4
- import { actionsSchema } from "../action-location/Properties";
4
+ import { actionsSchema } from "../../platform/client-actions/cc/action-event-mediator/Properties";
5
5
  import PropertiesConverter from "../component/properties/PropertiesConverter";
6
6
  import BooleanProperties from "../fields/boolean/Properties";
7
7
  import CurrencyProperties from "../fields/currency/Properties";
@@ -147,7 +147,7 @@ const TableListProperties = {
147
147
  }]
148
148
  },
149
149
  ActionLocation: {
150
- type: 'object',
150
+ renderComponentType: 'object',
151
151
  properties: {
152
152
  type: {
153
153
  type: 'string'
@@ -18,4 +18,10 @@ export let Alignment = /*#__PURE__*/function (Alignment) {
18
18
  Alignment["Center"] = "center";
19
19
  Alignment["Right"] = "right";
20
20
  return Alignment;
21
+ }({});
22
+ export let AlignmentOfFlex = /*#__PURE__*/function (AlignmentOfFlex) {
23
+ AlignmentOfFlex["left"] = "start";
24
+ AlignmentOfFlex["center"] = "center";
25
+ AlignmentOfFlex["right"] = "end";
26
+ return AlignmentOfFlex;
21
27
  }({});
@@ -1,4 +1,5 @@
1
1
  import { ZLIST_DELETE_RECORD, ZLIST_DELETE_RECORDS, ZLIST_RECORD_UPDATE } from "../../../bc/zlist/Constants";
2
+ import { RECORD_LOCAL_MULTIPLE_DELETE, RECORD_LOCAL_UPDATE } from "../../../bc/zrecord/Constants";
2
3
  /* eslint-disable max-lines-per-function */
3
4
 
4
5
  export default class ListSdkFactory {
@@ -21,25 +22,84 @@ export default class ListSdkFactory {
21
22
  return (_state$behaviours2 = state.behaviours) === null || _state$behaviours2 === void 0 ? void 0 : (_state$behaviours2$zr = _state$behaviours2.zrecord.records) === null || _state$behaviours2$zr === void 0 ? void 0 : _state$behaviours2$zr.find(r => r.id === recordId);
22
23
  },
23
24
 
25
+ getContext(variableName) {
26
+ var _state$properties;
27
+
28
+ const {
29
+ departmentId,
30
+ viewId,
31
+ moduleName
32
+ } = state.properties;
33
+ const {
34
+ servicePrefix,
35
+ ...context
36
+ } = (_state$properties = state.properties) === null || _state$properties === void 0 ? void 0 : _state$properties.context;
37
+ const updatedContext = { ...context,
38
+ departmentId,
39
+ viewId,
40
+ moduleName
41
+ };
42
+ return variableName ? context === null || context === void 0 ? void 0 : context[variableName] : updatedContext;
43
+ },
44
+
24
45
  deleteRecord(recordId) {
46
+ let output = {
47
+ "data": [{
48
+ "id": recordId,
49
+ "Success": true,
50
+ "error": null
51
+ }]
52
+ };
25
53
  dispatch({
26
54
  type: ZLIST_DELETE_RECORD,
27
55
  payload: {
28
56
  recordId
29
57
  }
30
58
  });
59
+ return output;
31
60
  },
32
61
 
62
+ // deleteRecords(recordIds) {
63
+ // dispatch({
64
+ // type: ZLIST_DELETE_RECORDS,
65
+ // payload: {
66
+ // recordIds
67
+ // }
68
+ // });
69
+ // },
33
70
  deleteRecords(recordIds) {
71
+ let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
72
+ let output = {
73
+ "data": []
74
+ };
75
+ let DELETE_ACTION = shouldFetch ? ZLIST_DELETE_RECORDS : RECORD_LOCAL_MULTIPLE_DELETE;
34
76
  dispatch({
35
- type: ZLIST_DELETE_RECORDS,
77
+ type: DELETE_ACTION,
36
78
  payload: {
37
79
  recordIds
38
80
  }
39
81
  });
82
+
83
+ for (let recordId of recordIds) {
84
+ let recordUpdateDetail = {
85
+ "id": recordId,
86
+ "Success": true,
87
+ "error": null
88
+ };
89
+ output.data.push(recordUpdateDetail);
90
+ }
91
+
92
+ return output;
40
93
  },
41
94
 
42
95
  updateRecord(recordId, record) {
96
+ let output = {
97
+ "results": [{
98
+ "id": recordId,
99
+ "Success": true,
100
+ "error": null
101
+ }]
102
+ };
43
103
  dispatch({
44
104
  type: ZLIST_RECORD_UPDATE,
45
105
  payload: {
@@ -47,6 +107,33 @@ export default class ListSdkFactory {
47
107
  record
48
108
  }
49
109
  });
110
+ return output;
111
+ },
112
+
113
+ updateRecords(recordsMap) {
114
+ let shouldFetch = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
115
+ let output = {
116
+ "results": []
117
+ };
118
+ let UPDATE_ACTION = shouldFetch ? ZLIST_RECORD_UPDATE : RECORD_LOCAL_UPDATE;
119
+
120
+ for (let record of recordsMap) {
121
+ dispatch({
122
+ type: UPDATE_ACTION,
123
+ payload: {
124
+ recordId: record.id,
125
+ record: record
126
+ }
127
+ });
128
+ let recordUpdateDetail = {
129
+ "id": record.id,
130
+ "Success": true,
131
+ "error": null
132
+ };
133
+ output.results.push(recordUpdateDetail);
134
+ }
135
+
136
+ return output;
50
137
  }
51
138
 
52
139
  }
@@ -7,28 +7,42 @@ import ZListBehaviourFactory from "../../../platform/zlist/frameworks/ZListBehav
7
7
  import RecordBehaviourFactory from "../../../platform/zrecord/frameworks/RecordBehaviourFactory";
8
8
  import EventHandlersFactory from "./EventHandlersFactory";
9
9
  import TableConnectedView from "./TableConnectedView";
10
- import defaultDataBroker from "../../../platform/data-broker";
11
- import DataBrokerBehaviourFactory from "../../../platform/zdata-broker/frameworks/DataBrokerBehaviourFactory";
10
+ import defaultDataSource from "../../../platform/data-source";
11
+ import DataSourceBehaviourFactory from "../../../platform/zdata-source/frameworks/DataBrokerBehaviourFactory";
12
12
  import ClientActionsBehaviourFactory from "../../../platform/client-actions/behaviour/zclient-actions/frameworks/ClientActionsBehaviourFactory";
13
13
  export default class TableConnectedFactory {
14
14
  static create(_ref) {
15
+ var _dataSource2;
16
+
15
17
  let {
16
18
  name,
17
- dataBroker = defaultDataBroker,
19
+ dataBroker,
20
+ dataSource,
18
21
  eventHandlers = {},
19
22
  View = TableConnectedView
20
23
  } = _ref;
24
+
25
+ if (!dataSource) {
26
+ console.warn('Desk Platform Warning: dataBroker is deprecated, use dataSource instead');
27
+ dataSource = dataBroker;
28
+ }
29
+
30
+ const _dataSource = { ...dataSource,
31
+ httpTemplates: { ...defaultDataSource.httpTemplates,
32
+ ...((_dataSource2 = dataSource) === null || _dataSource2 === void 0 ? void 0 : _dataSource2.httpTemplates)
33
+ }
34
+ };
21
35
  return createCustomComponent({
22
36
  name: name,
23
37
  View: View,
24
38
  properties: Properties,
25
39
  eventHandlers: EventHandlersFactory.create(eventHandlers),
26
40
  transformState: TableTranslator.transformState,
27
- behaviours: [ZHttpBehaviourFactory.create(), DataBrokerBehaviourFactory.create(), RecordBehaviourFactory.create(dataBroker.httpTemplates), ClientActionsBehaviourFactory.create({
28
- getClientActions: dataBroker.httpTemplates.getClientActions
41
+ behaviours: [ZHttpBehaviourFactory.create(), DataSourceBehaviourFactory.create(), RecordBehaviourFactory.create(_dataSource.httpTemplates), ClientActionsBehaviourFactory.create({
42
+ getClientActions: _dataSource.httpTemplates.getClientActions
29
43
  }), ZFieldBehaviourFactory.create({
30
- availableFields: dataBroker.httpTemplates.getAvailableFields,
31
- selectedFields: dataBroker.httpTemplates.getSelectedFields
44
+ availableFields: _dataSource.httpTemplates.getAvailableFields,
45
+ selectedFields: _dataSource.httpTemplates.getSelectedFields
32
46
  }), ZListBehaviourFactory.create()]
33
47
  });
34
48
  }
@@ -15,14 +15,17 @@ function View(_ref, ref) {
15
15
  emptyStateUiType
16
16
  } = state;
17
17
  const {
18
- isFlexibleColumns,
18
+ preferences,
19
19
  selectionConfig
20
20
  } = properties;
21
+ const {
22
+ autoColumnSizing
23
+ } = preferences || {};
21
24
  return /*#__PURE__*/React.createElement(TableList, {
22
25
  data: data,
23
26
  rowCursor: rowCursor,
24
27
  getRef: ref,
25
- isFlexibleColumns: isFlexibleColumns,
28
+ isFlexibleColumns: autoColumnSizing,
26
29
  rowActionsConfig: rowActionsConfig,
27
30
  isLoading: isLoading,
28
31
  emptyStateUiType: emptyStateUiType,
@@ -1,5 +1,7 @@
1
- import ActionIcon from "../../../../legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon";
1
+ import ActionIcon, { Button, FilterDropdown } from "../../../../legacy-to-new-arch/action-icon/frameworks/ui/ActionIcon";
2
2
  const ActionComponentMapping = {
3
- 'ActionIcon': ActionIcon
3
+ 'ActionIcon': ActionIcon,
4
+ 'Button': Button,
5
+ 'TableFilterDropdown': FilterDropdown
4
6
  };
5
7
  export default ActionComponentMapping;
@@ -1,5 +1,8 @@
1
1
  import React from 'react';
2
2
  import TableHead from '@zohodesk-private/desk-components/es/table/TableHead/TableHead';
3
+ import { AlignmentOfFlex } from "../../../../../../../../cc/table-list/data-types/Header";
4
+ import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
5
+ import { ActionViewGap } from "../../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
3
6
  import HeaderText from "./HeaderText";
4
7
  import ColumnResizer from "./ColumnResizer";
5
8
 
@@ -19,8 +22,10 @@ function HeaderData(_ref) {
19
22
  text,
20
23
  sortable,
21
24
  width,
22
- alignment
25
+ alignment,
26
+ actions
23
27
  } = header;
28
+ const hasActions = Boolean(actions === null || actions === void 0 ? void 0 : actions.length);
24
29
  return (
25
30
  /*#__PURE__*/
26
31
  // @ts-ignore
@@ -30,7 +35,12 @@ function HeaderData(_ref) {
30
35
  $flag_flexible: isFlexibleColumns,
31
36
  $a11yAttributes_container: {
32
37
  'aria-sort': sortable ? sortedBy : 'none'
33
- }
38
+ },
39
+ $customProps_container: hasActions ? {
40
+ $ui_displayMode: 'flex',
41
+ $ui_alignItems: 'center',
42
+ $ui_justifyContent: AlignmentOfFlex[alignment]
43
+ } : null
34
44
  }, /*#__PURE__*/React.createElement(HeaderText, {
35
45
  id: id,
36
46
  name: name,
@@ -39,7 +49,10 @@ function HeaderData(_ref) {
39
49
  sortedBy: sortedBy,
40
50
  sortTooltip: sortTooltip,
41
51
  dispatch: dispatch
42
- }), /*#__PURE__*/React.createElement(ColumnResizer, {
52
+ }), hasActions ? /*#__PURE__*/React.createElement(ActionEventMediator, {
53
+ actions: actions,
54
+ gap: ActionViewGap.SMALL
55
+ }) : null, /*#__PURE__*/React.createElement(ColumnResizer, {
43
56
  isResizerEnabled: isResizerEnabled,
44
57
  isResizing: isResizing
45
58
  }))
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
2
  import TableAction from '@zohodesk-private/desk-components/es/table/TableAction/TableAction';
3
- import ActionLocation from "../../../../../action-location/frameworks/ui/ActionLocation";
3
+ import ActionEventMediator from "../../../../../../../../platform/client-actions/components/action-event-mediator/frameworks/ui/ActionEventMediator";
4
+ import { ActionViewGap } from "../../../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
4
5
  export default function RowActions(_ref) {
5
6
  let {
6
7
  hasActions,
@@ -13,9 +14,10 @@ export default function RowActions(_ref) {
13
14
  if (hasActions) {
14
15
  return /*#__PURE__*/React.createElement(TableAction, {
15
16
  $data_width: columnWidth
16
- }, /*#__PURE__*/React.createElement(ActionLocation, {
17
- type: type,
18
- actions: actions
17
+ }, /*#__PURE__*/React.createElement(ActionEventMediator, {
18
+ actions: actions,
19
+ renderComponentType: type,
20
+ gap: ActionViewGap.MEDIUM
19
21
  }));
20
22
  }
21
23