@zohodesk/library-platform 1.2.0-exp.4 → 1.2.2

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 (75) hide show
  1. package/es/cc/date/Properties.js +0 -15
  2. package/es/cc/fields/field/Properties.js +1 -8
  3. package/es/cc/form/Properties.js +0 -8
  4. package/es/cc/label/Properties.js +5 -12
  5. package/es/cc/multi-select/Properties.js +1 -8
  6. package/es/cc/section/Properties.js +1 -8
  7. package/es/cc/select/Properties.js +1 -8
  8. package/es/cc/textarea/Properties.js +0 -15
  9. package/es/cc/textbox/Properties.js +1 -8
  10. package/es/index.js +6 -4
  11. package/es/library/dot/components/form/adapters/presenter/TransformState.js +1 -3
  12. package/es/library/dot/components/form/frameworks/ui/FormView.js +3 -6
  13. package/es/library/dot/components/form/frameworks/ui/sub-components/Footer.js +6 -16
  14. package/es/library/dot/components/form/frameworks/ui/sub-components/Header.js +6 -16
  15. package/es/library/dot/components/form/frameworks/ui/sub-components/Sections.js +2 -4
  16. package/es/library/dot/components/form-fields/checkbox/frameworks/ui/CheckboxView.js +3 -6
  17. package/es/library/dot/components/form-fields/currency/frameworks/ui/CurrencyView.js +3 -6
  18. package/es/library/dot/components/form-fields/date/frameworks/ui/DateView.js +3 -6
  19. package/es/library/dot/components/form-fields/datetime/frameworks/ui/DateTimeView.js +3 -6
  20. package/es/library/dot/components/form-fields/decimal/frameworks/ui/DecimalView.js +3 -6
  21. package/es/library/dot/components/form-fields/email/frameworks/ui/EmailView.js +3 -6
  22. package/es/library/dot/components/form-fields/field/FieldItem.js +2 -4
  23. package/es/library/dot/components/form-fields/lookup/frameworks/ui/LookupView.js +3 -6
  24. package/es/library/dot/components/form-fields/multi-select/frameworks/ui/MultiSelectView.js +4 -7
  25. package/es/library/dot/components/form-fields/number/frameworks/ui/NumberView.js +3 -6
  26. package/es/library/dot/components/form-fields/percentage/frameworks/ui/PercentageView.js +4 -7
  27. package/es/library/dot/components/form-fields/phone/frameworks/ui/PhoneView.js +3 -6
  28. package/es/library/dot/components/form-fields/pick-list/frameworks/ui/PickListView.js +4 -7
  29. package/es/library/dot/components/form-fields/textarea/frameworks/ui/TextAreaView.js +3 -6
  30. package/es/library/dot/components/form-fields/textbox/frameworks/ui/TextBoxView.js +3 -6
  31. package/es/library/dot/components/form-fields/url/frameworks/ui/UrlView.js +3 -6
  32. package/es/library/dot/components/section/frameworks/ui/RenderField.js +1 -3
  33. package/es/library/dot/components/section/frameworks/ui/SectionView.js +8 -14
  34. package/es/library/dot/components/table-list/frameworks/ui/TableListView.js +4 -8
  35. package/es/library/dot/components/table-list/frameworks/ui/sub-components/Header.js +4 -6
  36. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/HeaderData.js +5 -11
  37. package/es/library/dot/components/table-list/frameworks/ui/sub-components/header/MassAction.js +5 -11
  38. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/Row.js +4 -8
  39. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowActions.js +5 -12
  40. package/es/library/dot/components/table-list/frameworks/ui/sub-components/row/RowData.js +4 -12
  41. package/es/library/dot/legacy-to-new-arch/date/frameworks/ui/DateView.js +4 -10
  42. package/es/library/dot/legacy-to-new-arch/label/frameworks/ui/LabelView.js +5 -11
  43. package/es/library/dot/legacy-to-new-arch/multi-select/frameworks/ui/MultiSelectView.js +8 -21
  44. package/es/library/dot/legacy-to-new-arch/select/frameworks/ui/SelectView.js +8 -18
  45. package/es/library/dot/legacy-to-new-arch/text-area/frameworks/ui/TextAreaView.js +4 -10
  46. package/es/library/dot/legacy-to-new-arch/textbox/frameworks/ui/TextBoxView.js +4 -10
  47. package/es/platform/client-actions/cc/action-event-mediator/Properties.js +43 -0
  48. package/es/platform/client-actions/components/action-event-mediator/frameworks/ui/ClientActionsAdapter.js +2 -1
  49. package/es/platform/client-scripts/cc/zclient-scripts-execution/clientScriptsSchema.js +1 -4
  50. package/es/platform/components/form-connected/frameworks/FormConnectedView.js +0 -2
  51. package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +10 -7
  52. package/es/platform/components/smart-action-band/frameworks/SmartActionBandView.js +5 -18
  53. package/es/platform/zform/adapters/presenter/FormTranslator.js +12 -8
  54. package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +14 -10
  55. package/es/platform/zform/adapters/presenter/translators/fields/BooleanFieldTranslator.js +2 -4
  56. package/es/platform/zform/adapters/presenter/translators/fields/CurrencyFieldTranslator.js +1 -2
  57. package/es/platform/zform/adapters/presenter/translators/fields/DateFieldTranslator.js +2 -4
  58. package/es/platform/zform/adapters/presenter/translators/fields/DateTimeFieldTranslator.js +2 -4
  59. package/es/platform/zform/adapters/presenter/translators/fields/DecimalFieldTranslator.js +2 -4
  60. package/es/platform/zform/adapters/presenter/translators/fields/EmailFieldTranslator.js +2 -4
  61. package/es/platform/zform/adapters/presenter/translators/fields/LookUpFieldTranslator.js +2 -4
  62. package/es/platform/zform/adapters/presenter/translators/fields/MultiselectFieldTranslator.js +8 -13
  63. package/es/platform/zform/adapters/presenter/translators/fields/NumberFieldTranslator.js +2 -4
  64. package/es/platform/zform/adapters/presenter/translators/fields/PercentageFieldTranslator.js +2 -4
  65. package/es/platform/zform/adapters/presenter/translators/fields/PhoneFieldTranslator.js +2 -4
  66. package/es/platform/zform/adapters/presenter/translators/fields/PicklistFieldTranslator.js +12 -11
  67. package/es/platform/zform/adapters/presenter/translators/fields/TextAreaFieldTranslator.js +2 -4
  68. package/es/platform/zform/adapters/presenter/translators/fields/TextFieldTranslator.js +2 -4
  69. package/es/platform/zform/adapters/presenter/translators/fields/URLFieldTranslator.js +2 -4
  70. package/es/platform/zlist/adapters/presenters/SelectionTranslator.js +4 -2
  71. package/es/platform/zlist/adapters/presenters/TableTranslator.js +1 -6
  72. package/es/platform/zlist/adapters/presenters/translators/ColumnTranslator.js +1 -7
  73. package/es/platform/zlist/adapters/presenters/translators/Header.js +6 -7
  74. package/es/platform/zlist/adapters/presenters/translators/Row.js +5 -6
  75. package/package.json +1 -1
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
  import MultiSelect from "@zohodesk/components/es/MultiSelect/MultiSelect";
3
3
  import { MultiSelectConstants } from "../../../../../../cc/multi-select";
4
+ import RowActionsRenderer from "../../../../../../platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
4
5
  import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
5
6
 
6
7
  import style from "./css/MultiSelectView.module.css";
7
- import ClientActionsRenderer from "../../../../../../platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer";
8
- import { Layout } from "../../../../../../platform/client-actions/components/client-actions-renderer/domain/entities/State";
9
8
 
10
9
  function MultiSelectView(_ref, ref) {
11
10
  let {
@@ -25,26 +24,18 @@ function MultiSelectView(_ref, ref) {
25
24
  disabled,
26
25
  readonly,
27
26
  actions,
28
- clientScripts,
29
- context
27
+ clientScripts
30
28
  } = state.properties;
31
29
  const transformedOptions = options.map(option => {
32
- const {
33
- context
34
- } = option;
35
30
  const baseOption = option;
36
31
 
37
32
  if (option.optionActions && option.optionActions.length !== 0) {
38
33
  return { ...option,
39
34
  listItemCustomProps: {
40
- renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement(ClientActionsRenderer, {
35
+ renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement(RowActionsRenderer, {
41
36
  actions: option.optionActions,
42
- clientScripts: clientScripts,
43
- context: context,
44
- viewMeta: {
45
- layout: Layout.HORIZONTAL,
46
- gap: ActionViewGap.SMALL
47
- }
37
+ gap: ActionViewGap.SMALL,
38
+ clientScripts: clientScripts
48
39
  }),
49
40
  customClass: {
50
41
  customValueRightPlaceholder: style.optionActionsContainer
@@ -60,14 +51,10 @@ function MultiSelectView(_ref, ref) {
60
51
  if (!actions?.length) return null;
61
52
  return /*#__PURE__*/React.createElement("div", {
62
53
  className: style.fieldActionsContainer
63
- }, /*#__PURE__*/React.createElement(ClientActionsRenderer, {
54
+ }, /*#__PURE__*/React.createElement(RowActionsRenderer, {
64
55
  actions: actions,
65
- clientScripts: clientScripts,
66
- context: context,
67
- viewMeta: {
68
- layout: Layout.HORIZONTAL,
69
- gap: ActionViewGap.SMALL
70
- }
56
+ gap: ActionViewGap.SMALL,
57
+ clientScripts: clientScripts
71
58
  }));
72
59
  };
73
60
 
@@ -1,11 +1,10 @@
1
1
  import React from "react";
2
2
  import Select from '@zohodesk/components/es/Select/Select';
3
3
  import SelectConstants from "../../../../../../cc/select/Constants";
4
+ import RowActionsRenderer from "../../../../../../platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
4
5
  import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel"; // @ts-ignore
5
6
 
6
7
  import style from "./css/Select.module.css";
7
- import ClientActionsRenderer from "../../../../../../platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer";
8
- import { Layout } from "../../../../../../platform/client-actions/components/client-actions-renderer/domain/entities/State";
9
8
 
10
9
  function SelectView(_ref, ref) {
11
10
  let {
@@ -24,8 +23,7 @@ function SelectView(_ref, ref) {
24
23
  disabled,
25
24
  readonly,
26
25
  actions,
27
- clientScripts,
28
- context
26
+ clientScripts
29
27
  } = state.properties;
30
28
  const transformedOptions = options.map(option => {
31
29
  const baseOption = {
@@ -36,14 +34,10 @@ function SelectView(_ref, ref) {
36
34
  if (option.optionActions && option.optionActions.length !== 0) {
37
35
  return { ...baseOption,
38
36
  listItemCustomProps: {
39
- renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement(ClientActionsRenderer, {
37
+ renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement(RowActionsRenderer, {
40
38
  actions: option.optionActions,
41
- clientScripts: clientScripts,
42
- context: context,
43
- viewMeta: {
44
- layout: Layout.HORIZONTAL,
45
- gap: ActionViewGap.SMALL
46
- }
39
+ gap: ActionViewGap.SMALL,
40
+ clientScripts: clientScripts
47
41
  }),
48
42
  customClass: {
49
43
  customValueRightPlaceholder: style.optionActionsContainer
@@ -56,14 +50,10 @@ function SelectView(_ref, ref) {
56
50
  });
57
51
 
58
52
  const renderRightFieldActions = () => {
59
- return actions?.length ? /*#__PURE__*/React.createElement(ClientActionsRenderer, {
53
+ return actions?.length ? /*#__PURE__*/React.createElement(RowActionsRenderer, {
60
54
  actions: actions,
61
- clientScripts: clientScripts,
62
- context: context,
63
- viewMeta: {
64
- layout: Layout.HORIZONTAL,
65
- gap: ActionViewGap.SMALL
66
- }
55
+ gap: ActionViewGap.SMALL,
56
+ clientScripts: clientScripts
67
57
  }) : null;
68
58
  };
69
59
 
@@ -3,9 +3,8 @@ import Textarea from '@zohodesk/components/es/Textarea/Textarea';
3
3
  import TextAreaConstants from "../../../../../../cc/textarea/Constants"; // @ts-ignore
4
4
 
5
5
  import style from "./css/TextAreaView.module.css";
6
+ import RowActionsRenderer from "../../../../../../platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
6
7
  import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
7
- import ClientActionsRenderer from "../../../../../../platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer";
8
- import { Layout } from "../../../../../../platform/client-actions/components/client-actions-renderer/domain/entities/State";
9
8
 
10
9
  function TextAreaView(_ref, ref) {
11
10
  let {
@@ -24,8 +23,7 @@ function TextAreaView(_ref, ref) {
24
23
  disabled,
25
24
  readonly,
26
25
  actions,
27
- clientScripts,
28
- context
26
+ clientScripts
29
27
  } = state.properties;
30
28
  const textAreaRenderer = /*#__PURE__*/React.createElement(Textarea, {
31
29
  getRef: ref,
@@ -66,14 +64,10 @@ function TextAreaView(_ref, ref) {
66
64
  className: style.hasChildren
67
65
  }, textAreaRenderer, /*#__PURE__*/React.createElement("div", {
68
66
  className: style.rightPlaceholder
69
- }, /*#__PURE__*/React.createElement(ClientActionsRenderer, {
67
+ }, /*#__PURE__*/React.createElement(RowActionsRenderer, {
70
68
  actions: actions,
71
69
  clientScripts: clientScripts,
72
- context: context,
73
- viewMeta: {
74
- layout: Layout.HORIZONTAL,
75
- gap: ActionViewGap.SMALL
76
- }
70
+ gap: ActionViewGap.SMALL
77
71
  })));
78
72
  }
79
73
 
@@ -1,9 +1,8 @@
1
1
  import React from "react";
2
2
  import TextBox from "@zohodesk/components/es/TextBoxIcon/TextBoxIcon";
3
3
  import TextBoxConstants from "../../../../../../cc/textbox/Constants";
4
+ import RowActionsRenderer from "../../../../../../platform/client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
4
5
  import { ActionViewGap } from "../../../../../../platform/client-actions/components/interfaces/ActionViewModel";
5
- import ClientActionsRenderer from "../../../../../../platform/client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer";
6
- import { Layout } from "../../../../../../platform/client-actions/components/client-actions-renderer/domain/entities/State";
7
6
 
8
7
  function TextBoxView(_ref, ref) {
9
8
  let {
@@ -24,19 +23,14 @@ function TextBoxView(_ref, ref) {
24
23
  disabled,
25
24
  readonly,
26
25
  actions,
27
- clientScripts,
28
- context
26
+ clientScripts
29
27
  } = state.properties;
30
28
 
31
29
  const renderRightFieldActions = () => {
32
- return actions?.length ? /*#__PURE__*/React.createElement(ClientActionsRenderer, {
30
+ return actions?.length ? /*#__PURE__*/React.createElement(RowActionsRenderer, {
33
31
  actions: actions,
34
32
  clientScripts: clientScripts,
35
- context: context,
36
- viewMeta: {
37
- layout: Layout.HORIZONTAL,
38
- gap: ActionViewGap.SMALL
39
- }
33
+ gap: ActionViewGap.SMALL
40
34
  }) : null;
41
35
  };
42
36
 
@@ -1,3 +1,4 @@
1
+ import { ActionViewGap } from "../../components/interfaces/ActionViewModel";
1
2
  import { clientScriptsSchema } from "../../../client-scripts/cc/zclient-scripts-execution/clientScriptsSchema";
2
3
  export const actionSchema = {
3
4
  type: 'object',
@@ -69,4 +70,46 @@ export const ActionEventMediatorProperties = {
69
70
  }
70
71
  }
71
72
  }
73
+ };
74
+ export default {
75
+ testId: {
76
+ required: false,
77
+ typeMetadata: {
78
+ schema: {
79
+ type: 'string'
80
+ }
81
+ },
82
+ defaultValue: ''
83
+ },
84
+ actions: {
85
+ required: true,
86
+ typeMetadata: {
87
+ schema: actionsSchema
88
+ }
89
+ },
90
+ clientScripts: {
91
+ required: false,
92
+ typeMetadata: {
93
+ schema: clientScriptsSchema
94
+ }
95
+ },
96
+ renderComponentType: {
97
+ required: false,
98
+ typeMetadata: {
99
+ schema: {
100
+ type: 'string'
101
+ }
102
+ },
103
+ defaultValue: ''
104
+ },
105
+ gap: {
106
+ required: false,
107
+ defaultValue: ActionViewGap.NONE,
108
+ typeMetadata: {
109
+ schema: {
110
+ type: 'string',
111
+ enum: Object.values(ActionViewGap)
112
+ }
113
+ }
114
+ }
72
115
  };
@@ -40,7 +40,8 @@ const ClientActionsAdapter = {
40
40
  if (response.errorCode) {
41
41
  return Promise.reject(response);
42
42
  } else {
43
- return Promise.resolve(response);
43
+ const actions = ClientActionsAdapterUtils.transform(response);
44
+ return Promise.resolve(actions);
44
45
  }
45
46
  });
46
47
  }
@@ -4,14 +4,11 @@ export const clientScriptsSchema = {
4
4
  items: {
5
5
  type: 'object',
6
6
  properties: {
7
- targetEvent: {
7
+ targetEventName: {
8
8
  type: 'string'
9
9
  },
10
10
  clientScript: {
11
11
  type: 'string'
12
- },
13
- type: {
14
- type: 'string'
15
12
  }
16
13
  }
17
14
  }
@@ -16,7 +16,6 @@ function View(_ref, ref) {
16
16
  headerRightActions,
17
17
  footerLeftActions,
18
18
  footerRightActions,
19
- context,
20
19
  clientScripts
21
20
  } = state.viewModel;
22
21
  return /*#__PURE__*/React.createElement(Form, {
@@ -29,7 +28,6 @@ function View(_ref, ref) {
29
28
  headerRightActions: headerRightActions,
30
29
  footerLeftActions: footerLeftActions,
31
30
  footerRightActions: footerRightActions,
32
- context: context,
33
31
  rightPanel: rightPanel,
34
32
  clientScripts: clientScripts
35
33
  });
@@ -1,3 +1,4 @@
1
+ import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
1
2
  import DefaultClientActions from "./utils/DefaultClientActions";
2
3
  import { ActionBandLocations } from "../../../../../bc/action-band/Constants";
3
4
  import { i18NProviderUtils } from '@zohodesk/i18n';
@@ -55,11 +56,14 @@ export default class ActionBandTranslator {
55
56
  }
56
57
 
57
58
  const mappedClientActions = mapper(combinedClientActions || []);
58
- const clientActionsContext = { ...context,
59
- defaultSortField: sortConfig.defaultSortField,
60
- instanceName,
61
- moduleName
62
- };
59
+ const transformedClientActions = {};
60
+ Object.entries(mappedClientActions).forEach(_ref => {
61
+ let [key, value] = _ref;
62
+ let bandActions = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
63
+ defaultSortField: sortConfig.defaultSortField
64
+ });
65
+ transformedClientActions[key] = bandActions;
66
+ });
63
67
  const {
64
68
  clientScripts,
65
69
  isFetching: isClientScriptsFetching
@@ -67,10 +71,9 @@ export default class ActionBandTranslator {
67
71
  const {
68
72
  actionBandLeftActions,
69
73
  actionBandRightActions
70
- } = mappedClientActions;
74
+ } = transformedClientActions;
71
75
  return { ...state,
72
76
  ...zclientAction,
73
- context: clientActionsContext,
74
77
  viewModel: {
75
78
  actionBandLeftActions,
76
79
  actionBandRightActions,
@@ -1,9 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import ActionBand from '@zohodesk-private/desk-components/es/ActionBand/ActionBand';
4
- import ClientActionsRenderer from "../../../client-actions/components/client-actions-renderer/frameworks/ui/client-actions-renderer/ClientActionsRenderer";
5
- import { Layout } from "../../../client-actions/components/client-actions-renderer/domain/entities/State";
6
- import { ActionViewGap } from "../../../client-actions/components/interfaces/ActionViewModel";
4
+ import RowActionsRenderer from "../../../client-actions/components/row-actions-renderer/frameworks/ui/RowActions/RowActionsRenderer";
7
5
 
8
6
  function View(_ref, ref) {
9
7
  let {
@@ -14,31 +12,20 @@ function View(_ref, ref) {
14
12
  actionBandRightActions,
15
13
  clientScripts
16
14
  } = state.viewModel;
17
- const {
18
- context
19
- } = state;
20
15
 
21
16
  const renderLeftActions = () => {
22
- return /*#__PURE__*/React.createElement(ClientActionsRenderer, {
17
+ return /*#__PURE__*/React.createElement(RowActionsRenderer, {
23
18
  actions: actionBandLeftActions,
24
19
  clientScripts: clientScripts,
25
- context: context,
26
- viewMeta: {
27
- layout: Layout.HORIZONTAL,
28
- gap: ActionViewGap.XLARGE
29
- }
20
+ gap: "xlarge"
30
21
  });
31
22
  };
32
23
 
33
24
  const renderRightActions = () => {
34
- return /*#__PURE__*/React.createElement(ClientActionsRenderer, {
25
+ return /*#__PURE__*/React.createElement(RowActionsRenderer, {
35
26
  actions: actionBandRightActions,
36
27
  clientScripts: clientScripts,
37
- context: context,
38
- viewMeta: {
39
- layout: Layout.HORIZONTAL,
40
- gap: ActionViewGap.XLARGE
41
- }
28
+ gap: "xlarge"
42
29
  });
43
30
  };
44
31
 
@@ -1,3 +1,4 @@
1
+ import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
1
2
  import SectionTranslator from "./translators/SectionTranslator";
2
3
  import DefaultFormClientActions from "./utils/DefaultClientActions";
3
4
  import { filterClientActionsByLocation } from "../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
@@ -18,7 +19,7 @@ export default class FormTranslator {
18
19
  zclientAction,
19
20
  zclientScriptsEventMapping
20
21
  } = state.behaviours;
21
- let {
22
+ const {
22
23
  context
23
24
  } = state.behaviours.appContext;
24
25
  const {
@@ -45,11 +46,6 @@ export default class FormTranslator {
45
46
  };
46
47
  const initialRecordData = zform.initialRecordData ? zform.initialRecordData : {
47
48
  cf: {}
48
- }; // @ts-ignore
49
-
50
- context = { ...context,
51
- instanceName,
52
- moduleName
53
49
  };
54
50
  const actionContext = { ...context,
55
51
  mode: zform.mode,
@@ -60,7 +56,16 @@ export default class FormTranslator {
60
56
  };
61
57
  Object.entries(mappedClientActions).forEach(_ref => {
62
58
  let [key, value] = _ref;
63
- transformedClientActions[key] = value;
59
+
60
+ if (isFooterEnabled && (key === 'footerLeftActions' || key === 'footerRightActions')) {
61
+ let footerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, actionContext);
62
+ transformedClientActions[key] = footerActions;
63
+ }
64
+
65
+ if (isHeaderEnabled && (key === 'headerLeftActions' || key === 'headerRightActions')) {
66
+ let headerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, actionContext);
67
+ transformedClientActions[key] = headerActions;
68
+ }
64
69
  });
65
70
  const {
66
71
  clientScripts,
@@ -138,7 +143,6 @@ export default class FormTranslator {
138
143
  headerRightActions,
139
144
  footerLeftActions,
140
145
  footerRightActions,
141
- context: actionContext,
142
146
  isLoading: false,
143
147
  rightPanel,
144
148
  clientScripts
@@ -1,5 +1,6 @@
1
1
  import { DefaultFormSectionUIType, fieldTypeToUIType } from "../../../../../cc/fields/field/FormDefaultUIType";
2
2
  import * as FieldTranslators from "./fields";
3
+ import ClientActionsTranslator from "../../../../client-actions/translators/client-actions-translator";
3
4
  import { getDefaultFieldEphiActionTemplate, getDefaultFieldInfoActionTemplate } from "../utils/DefaultClientActions";
4
5
  import sanitizeHtmlString from "../utils/sanitizeHtmlString";
5
6
 
@@ -29,7 +30,10 @@ function SectionTranslator(_ref) {
29
30
  const transformedClientActions = {};
30
31
  Object.entries(sectionFieldOptionActions).forEach(_ref2 => {
31
32
  let [key, value] = _ref2;
32
- transformedClientActions[key] = value;
33
+ let headerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
34
+ ...section
35
+ });
36
+ transformedClientActions[key] = headerActions;
33
37
  });
34
38
  const defaultViewModel = {
35
39
  type: mapping?.UIComponentName ? mapping.UIComponentName : DefaultFormSectionUIType,
@@ -41,9 +45,6 @@ function SectionTranslator(_ref) {
41
45
  }),
42
46
  headerActions: transformedClientActions.sectionHeaderRightActions,
43
47
  titleActions: transformedClientActions.sectionTitleRightActions,
44
- context: { ...context,
45
- ...section
46
- },
47
48
  // headerLeftActions: sectionFieldOptionActions.sectionHeaderLeftActions,
48
49
  // headerRightActions: sectionFieldOptionActions.sectionHeaderRightActions,
49
50
  // titleLeftActions: sectionFieldOptionActions.sectionTitleLeftActions,
@@ -88,14 +89,19 @@ function SectionTranslator(_ref) {
88
89
  const transformedDefaultActions = createEmptyActions();
89
90
  Object.entries(defaultActions).forEach(_ref3 => {
90
91
  let [key, value] = _ref3;
91
- transformedDefaultActions[key] = value;
92
+ let transformedDefaultAction = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
93
+ ...field
94
+ });
95
+ transformedDefaultActions[key] = transformedDefaultAction;
92
96
  }); // Transform client actions
93
97
 
94
98
  const transformedActions = createEmptyActions();
95
99
  Object.entries(fieldLevelActions).forEach(_ref4 => {
96
100
  let [key, value] = _ref4;
97
- // let transformedAction = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context, ...field });
98
- transformedActions[key] = value;
101
+ let transformedAction = ClientActionsTranslator.transform(value, instanceName, moduleName, { ...context,
102
+ ...field
103
+ });
104
+ transformedActions[key] = transformedAction;
99
105
  }); // Initialize fieldPreModified
100
106
 
101
107
  const fieldPreModified = {};
@@ -117,9 +123,7 @@ function SectionTranslator(_ref) {
117
123
  type,
118
124
  fieldPreModified,
119
125
  uiConfig,
120
- context: { ...context,
121
- ...field
122
- },
126
+ context,
123
127
  preferences,
124
128
  fieldOptionActions,
125
129
  instanceName,
@@ -3,8 +3,7 @@ const BooleanFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  uiConfig,
6
- fieldPreModified,
7
- context
6
+ fieldPreModified
8
7
  } = _ref;
9
8
  const fieldModified = { ...fieldPreModified,
10
9
  id: field.id,
@@ -17,8 +16,7 @@ const BooleanFieldTranslator = _ref => {
17
16
  required: field.isMandatory,
18
17
  readonly: field.isReadOnly,
19
18
  // visibility: field.isVisible
20
- isVisible: field.isVisible,
21
- context
19
+ isVisible: field.isVisible
22
20
  };
23
21
  return fieldModified;
24
22
  };
@@ -26,8 +26,7 @@ const CurrencyFieldTranslator = _ref => {
26
26
  isVisible: field.isVisible,
27
27
  currencyLocale: prefCurrencyLocale || contextCurrencyLocale,
28
28
  currencySymbol: prefCurrencySymbol || contextCurrencySymbol,
29
- errorMessage: field.errorMessage || '',
30
- context
29
+ errorMessage: field.errorMessage || ''
31
30
  };
32
31
  return fieldModified;
33
32
  };
@@ -3,8 +3,7 @@ const DateFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  uiConfig,
6
- fieldPreModified,
7
- context
6
+ fieldPreModified
8
7
  } = _ref;
9
8
  const fieldModified = { ...fieldPreModified,
10
9
  id: field.id,
@@ -17,8 +16,7 @@ const DateFieldTranslator = _ref => {
17
16
  errorMessage: field.errorMessage || '',
18
17
  required: field.isMandatory,
19
18
  readonly: field.isReadOnly,
20
- isVisible: field.isVisible,
21
- context
19
+ isVisible: field.isVisible
22
20
  };
23
21
  return fieldModified;
24
22
  };
@@ -3,8 +3,7 @@ const DateTimeFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  uiConfig,
6
- fieldPreModified,
7
- context
6
+ fieldPreModified
8
7
  } = _ref;
9
8
  const fieldModified = { ...fieldPreModified,
10
9
  id: field.id,
@@ -18,8 +17,7 @@ const DateTimeFieldTranslator = _ref => {
18
17
  required: field.isMandatory,
19
18
  readonly: field.isReadOnly,
20
19
  // visibility: field.isVisible
21
- isVisible: field.isVisible,
22
- context
20
+ isVisible: field.isVisible
23
21
  };
24
22
  return fieldModified;
25
23
  };
@@ -3,8 +3,7 @@ const DecimalFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -20,8 +19,7 @@ const DecimalFieldTranslator = _ref => {
20
19
  maxLength: field.maxLength,
21
20
  readonly: field.isReadOnly,
22
21
  isVisible: field.isVisible,
23
- errorMessage: field.errorMessage || '',
24
- context
22
+ errorMessage: field.errorMessage || ''
25
23
  };
26
24
  return fieldModified;
27
25
  };
@@ -3,8 +3,7 @@ const EmailFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  type,
@@ -21,8 +20,7 @@ const EmailFieldTranslator = _ref => {
21
20
  readonly: field.isReadOnly,
22
21
  // visibility: field.isVisible,
23
22
  isVisible: field.isVisible,
24
- errorMessage: field.errorMessage || '',
25
- context
23
+ errorMessage: field.errorMessage || ''
26
24
  };
27
25
  return fieldModified;
28
26
  };
@@ -3,8 +3,7 @@ const LookUpFieldTranslator = _ref => {
3
3
  field,
4
4
  type,
5
5
  fieldPreModified,
6
- uiConfig,
7
- context
6
+ uiConfig
8
7
  } = _ref;
9
8
  const fieldModified = {
10
9
  // Need to check if value is an object or string (ID)
@@ -24,8 +23,7 @@ const LookUpFieldTranslator = _ref => {
24
23
  required: field.isMandatory,
25
24
  isCustomField: field.isCustomField,
26
25
  maxLength: field.maxLength,
27
- lookup: field.lookup,
28
- context
26
+ lookup: field.lookup
29
27
  };
30
28
  return fieldModified;
31
29
  };