@zohodesk/library-platform 1.2.0 → 1.2.2-exp.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/cc/table-connected/SdkContract.js +28 -3
- package/es/cc/table-list/Properties.js +9 -8
- package/es/cc/table-list/row/Properties.js +19 -6
- package/es/index.js +6 -2
- package/es/library/custom-component/frameworks/json-schema-validator/Validator.js +57 -44
- package/es/library/custom-component/frameworks/json-schema-validator/__generated__/registry.d.js +1 -0
- package/es/library/custom-component/frameworks/json-schema-validator/__generated__/registry.js +92 -0
- package/es/library/custom-component/frameworks/json-schema-validator/__generated__/validators.js +1 -0
- package/es/library/custom-component/frameworks/json-schema-validator/__tests__/Validator.test.js +478 -0
- package/es/library/custom-component/frameworks/ui/DependencyFactory.js +16 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils.js +11 -0
- package/es/platform/client-actions/behaviour/zclient-actions/adapters/resources/ClientActionsFetchSDK.js +76 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsAPIGatewayParams.js +1 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/ClientActionsFetchSDKParams.js +10 -0
- package/es/platform/client-actions/behaviour/zclient-actions/applications/interfaces/IClientActionsFetchSDK.js +0 -0
- package/es/platform/client-actions/cc/action-event-mediator/Properties.js +18 -4
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/adapters/resources/ClientScriptsFetchSDK.js +43 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsAPIGatewayParams.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/ClientScriptsSDKFetchParams.js +1 -0
- package/es/platform/client-scripts/behaviour/zclient-scripts-fetch/applications/interfaces/IClientScriptsFetchSDK.js +0 -0
- package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js +7 -4
- package/es/platform/data-source/http-template/getPageClientActions.js +23 -0
- package/es/platform/zform/adapters/presenter/FormTranslator.js +18 -15
- package/es/platform/zform/adapters/presenter/translators/SectionTranslator.js +1 -1
- package/es/platform/zlist/adapters/presenters/TableTranslator.js +5 -4
- package/package.json +6 -4
|
File without changes
|
package/es/platform/components/smart-action-band/adapters/presenters/ActionBandTranslator.js
CHANGED
|
@@ -2,6 +2,7 @@ import ClientActionsTranslator from "../../../../client-actions/translators/clie
|
|
|
2
2
|
import DefaultClientActions from "./utils/DefaultClientActions";
|
|
3
3
|
import { ActionBandLocations } from "../../../../../bc/action-band/Constants";
|
|
4
4
|
import { i18NProviderUtils } from '@zohodesk/i18n';
|
|
5
|
+
import { filterClientActionsByLocation } from "../../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
|
|
5
6
|
export default class ActionBandTranslator {
|
|
6
7
|
static transformState(state) {
|
|
7
8
|
const {
|
|
@@ -83,10 +84,12 @@ export default class ActionBandTranslator {
|
|
|
83
84
|
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
function mapper(clientActions) {
|
|
88
|
+
return {
|
|
89
|
+
actionBandLeftActions: filterClientActionsByLocation(clientActions, ActionBandLocations.LEFT_ACTIONS),
|
|
90
|
+
actionBandRightActions: filterClientActionsByLocation(clientActions, ActionBandLocations.RIGHT_ACTIONS)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
90
93
|
|
|
91
94
|
function getColumnChooserProps(columnChooser) {
|
|
92
95
|
let availableFields = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
let getClientActions = {
|
|
2
|
+
name: 'uiActions',
|
|
3
|
+
api: '/{{servicePrefix}}/{{orgName}}/api/v1/clientActions',
|
|
4
|
+
parameters: `{
|
|
5
|
+
"from":{{from}},
|
|
6
|
+
"limit":{{limit}},
|
|
7
|
+
"modules": "{{modules}}",
|
|
8
|
+
"page": "{{page}}"
|
|
9
|
+
}`,
|
|
10
|
+
type: 'GET',
|
|
11
|
+
transformer: data => data,
|
|
12
|
+
properties: {
|
|
13
|
+
modelName: {
|
|
14
|
+
required: true,
|
|
15
|
+
typeMetadata: {
|
|
16
|
+
schema: {
|
|
17
|
+
type: 'string'
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
export default getClientActions;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import ClientActionsTranslator from "../../../client-actions/translators/client-actions-translator";
|
|
2
2
|
import SectionTranslator from "./translators/SectionTranslator";
|
|
3
3
|
import DefaultFormClientActions from "./utils/DefaultClientActions";
|
|
4
|
+
import { filterClientActionsByLocation } from "../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
|
|
4
5
|
export default class FormTranslator {
|
|
5
6
|
static transformState(state) {
|
|
6
7
|
const {
|
|
@@ -56,7 +57,7 @@ export default class FormTranslator {
|
|
|
56
57
|
Object.entries(mappedClientActions).forEach(_ref => {
|
|
57
58
|
let [key, value] = _ref;
|
|
58
59
|
|
|
59
|
-
if (isFooterEnabled && (key === '
|
|
60
|
+
if (isFooterEnabled && (key === 'footerLeftActions' || key === 'footerRightActions')) {
|
|
60
61
|
let footerActions = ClientActionsTranslator.transform(value, instanceName, moduleName, actionContext);
|
|
61
62
|
transformedClientActions[key] = footerActions;
|
|
62
63
|
}
|
|
@@ -152,17 +153,19 @@ export default class FormTranslator {
|
|
|
152
153
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
|
-
const mapper =
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
156
|
+
const mapper = clientActions => {
|
|
157
|
+
return {
|
|
158
|
+
headerLeftActions: filterClientActionsByLocation(clientActions, 'header_left_actions'),
|
|
159
|
+
headerRightActions: filterClientActionsByLocation(clientActions, 'header_right_actions'),
|
|
160
|
+
footerLeftActions: filterClientActionsByLocation(clientActions, 'footer_left_actions'),
|
|
161
|
+
footerRightActions: filterClientActionsByLocation(clientActions, 'footer_right_actions'),
|
|
162
|
+
fieldLabelActions: filterClientActionsByLocation(clientActions, 'field_label_actions'),
|
|
163
|
+
fieldActions: filterClientActionsByLocation(clientActions, 'field_actions'),
|
|
164
|
+
sectionHeaderLeftActions: filterClientActionsByLocation(clientActions, 'section_header_left_actions'),
|
|
165
|
+
sectionHeaderRightActions: filterClientActionsByLocation(clientActions, 'section_header_right_actions'),
|
|
166
|
+
sectionTitleLeftActions: filterClientActionsByLocation(clientActions, 'section_title_left_actions'),
|
|
167
|
+
sectionTitleRightActions: filterClientActionsByLocation(clientActions, 'section_title_right_actions'),
|
|
168
|
+
fieldOptionLeftActions: filterClientActionsByLocation(clientActions, 'field_options_left_actions'),
|
|
169
|
+
fieldOptionRightActions: filterClientActionsByLocation(clientActions, 'field_options_right_actions')
|
|
170
|
+
};
|
|
171
|
+
};
|
|
@@ -109,7 +109,7 @@ function SectionTranslator(_ref) {
|
|
|
109
109
|
fieldPreModified['actions'] = transformedDefaultActions.fieldActions.concat(transformedActions.fieldActions);
|
|
110
110
|
const noPlaceHolderSupport = ['Boolean', 'Date', 'DateTime']; // Placeholder check
|
|
111
111
|
|
|
112
|
-
if (field.toolTip && field.toolTipType === "
|
|
112
|
+
if (field.toolTip && field.toolTipType === "placeHolder" && !noPlaceHolderSupport.includes(field.type)) {
|
|
113
113
|
fieldPreModified["placeholder"] = field.toolTip;
|
|
114
114
|
} // const optionActionAvailArray = ['Picklist', 'Multiselect'];
|
|
115
115
|
// // Option Actions check
|
|
@@ -13,6 +13,7 @@ import DefaultClientActions from "./utils/DefaultClientActions";
|
|
|
13
13
|
import SelectionTranslator from "./SelectionTranslator";
|
|
14
14
|
import { SortModelOrder } from "../../domain/entities/interfaces/Properties";
|
|
15
15
|
import { SortOrder } from "../../../../bc/zlist/Types";
|
|
16
|
+
import { filterClientActionsByLocation } from "../../../client-actions/behaviour/zclient-actions/adapters/presenters/FilterUtils";
|
|
16
17
|
const EMPTY_OBJECT = {};
|
|
17
18
|
const EMPTY_ARRAY = [];
|
|
18
19
|
|
|
@@ -220,9 +221,9 @@ function mapClientActions(clientActions) {
|
|
|
220
221
|
}
|
|
221
222
|
});
|
|
222
223
|
return {
|
|
223
|
-
headerActions: clientActions
|
|
224
|
-
fieldActions: clientActions
|
|
225
|
-
rowActions: clientActions
|
|
226
|
-
noLocation: clientActions
|
|
224
|
+
headerActions: filterClientActionsByLocation(clientActions, 'header_actions'),
|
|
225
|
+
fieldActions: filterClientActionsByLocation(clientActions, 'field_actions'),
|
|
226
|
+
rowActions: filterClientActionsByLocation(clientActions, 'row_actions'),
|
|
227
|
+
noLocation: filterClientActionsByLocation(clientActions, null)
|
|
227
228
|
};
|
|
228
229
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zohodesk/library-platform",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.2-exp.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "es/index.js",
|
|
6
6
|
"files": [
|
|
@@ -13,7 +13,9 @@
|
|
|
13
13
|
"form:test": "npm test -- --silent --testPathIgnorePatterns=\"table\"",
|
|
14
14
|
"test:form": "react-cli test -- --silent --testPathIgnorePatterns=\"(table|mock)\"",
|
|
15
15
|
"clean": "cdt clean ./es",
|
|
16
|
+
"precompile-schemas": "node scripts/precompile-schemas.js",
|
|
16
17
|
"build": "npm run clean && cbt build:es",
|
|
18
|
+
"build:precompile": "npm run build && npm run precompile-schemas",
|
|
17
19
|
"build:watch": "npm run build -- -w",
|
|
18
20
|
"test": "jest",
|
|
19
21
|
"prepare": "npm run build",
|
|
@@ -46,7 +48,7 @@
|
|
|
46
48
|
"@zohodesk-private/dot-registry": "0.0.2",
|
|
47
49
|
"@zohodesk-private/node-plugins": "1.1.9",
|
|
48
50
|
"@zohodesk/a11y": "2.3.8",
|
|
49
|
-
"@zohodesk/codestandard-validator": "1.1
|
|
51
|
+
"@zohodesk/codestandard-validator": "1.3.1",
|
|
50
52
|
"@zohodesk/components": "1.5.8",
|
|
51
53
|
"@zohodesk/dot": "1.8.6",
|
|
52
54
|
"@zohodesk/dotkit": "1.0.7",
|
|
@@ -88,10 +90,10 @@
|
|
|
88
90
|
"@zohodesk/svg": "1.2.6",
|
|
89
91
|
"@zohodesk/utils": "1.3.15",
|
|
90
92
|
"color": "4.2.3",
|
|
91
|
-
"react-sortable-hoc": "1.11.0"
|
|
93
|
+
"react-sortable-hoc": "1.11.0",
|
|
94
|
+
"ajv": "8.18.0"
|
|
92
95
|
},
|
|
93
96
|
"dependencies": {
|
|
94
|
-
"ajv": "6.12.6",
|
|
95
97
|
"jsep": "0.3.5",
|
|
96
98
|
"object-path-immutable": "4.1.2"
|
|
97
99
|
}
|