@amp-labs/react 1.4.1 → 1.4.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.
- package/build/src/components/Configure/nav/ObjectManagementNav/index.js +1 -1
- package/build/src/components/Configure/state/utils.js +2 -1
- package/build/src/components/Configure/utils.d.ts +8 -1
- package/build/src/components/Configure/utils.js +11 -4
- package/build/src/services/version.d.ts +1 -1
- package/build/src/services/version.js +1 -1
- package/package.json +1 -1
|
@@ -43,7 +43,7 @@ function ObjectManagementNav({ children, }) {
|
|
|
43
43
|
const [tabIndex, setTabIndex] = (0, react_1.useState)(0);
|
|
44
44
|
const appName = (project === null || project === void 0 ? void 0 : project.appName) || '';
|
|
45
45
|
const config = installation === null || installation === void 0 ? void 0 : installation.config;
|
|
46
|
-
const readNavObjects = hydratedRevision && (0, utils_2.
|
|
46
|
+
const readNavObjects = hydratedRevision && (0, utils_2.generateReadNavObjects)(config, hydratedRevision);
|
|
47
47
|
const isNavObjectsReady = readNavObjects !== null; // null = hydratedRevision/config is not ready
|
|
48
48
|
const isWriteSupported = !!((_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.write);
|
|
49
49
|
const otherNavObject = isWriteSupported ? (0, utils_2.generateOtherNavObject)(config) : undefined;
|
|
@@ -83,7 +83,8 @@ exports.setHydrateConfigState = setHydrateConfigState;
|
|
|
83
83
|
* resets configure state for all objects in hydrated revision to hydrated revision values
|
|
84
84
|
*/
|
|
85
85
|
const resetAllObjectsConfigurationState = (hydratedRevision, config, setObjectConfiguresState) => {
|
|
86
|
-
|
|
86
|
+
// read nav objects from hydrated revision
|
|
87
|
+
const navObjects = (0, utils_1.generateAllNavObjects)(config, hydratedRevision);
|
|
87
88
|
const objectConfigurationsState = {};
|
|
88
89
|
navObjects.forEach(({ name, completed }) => {
|
|
89
90
|
if (completed) {
|
|
@@ -20,8 +20,15 @@ export declare function getRequiredMapFieldsFromObject(object: HydratedIntegrati
|
|
|
20
20
|
export declare function getOptionalFieldsFromObject(object: HydratedIntegrationObject): HydratedIntegrationField[] | null;
|
|
21
21
|
export declare const getReadObject: (config: Config, objectName: string) => any;
|
|
22
22
|
export declare function getFieldKeyValue(field: HydratedIntegrationField): string;
|
|
23
|
+
/**
|
|
24
|
+
* generates Nav Objects for read action
|
|
25
|
+
* @param config
|
|
26
|
+
* @param hydratedRevision
|
|
27
|
+
* @returns NavObject[]
|
|
28
|
+
*/
|
|
29
|
+
export declare const generateReadNavObjects: (config: Config | undefined, hydratedRevision: HydratedRevision) => NavObject[];
|
|
23
30
|
export declare const generateOtherNavObject: (config: Config | undefined) => NavObject;
|
|
24
|
-
export declare function
|
|
31
|
+
export declare function generateAllNavObjects(config: Config | undefined, hydratedRevision: HydratedRevision): NavObject[];
|
|
25
32
|
export declare function validateFieldMappings(requiredMapFields: IntegrationFieldMapping[] | null | undefined, selectedRequiredMapFields: SelectMappingFields | null | undefined, setErrors: (boundary: ErrorBoundary, errors: string[]) => void): {
|
|
26
33
|
errorList: string[];
|
|
27
34
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.validateFieldMappings = exports.
|
|
3
|
+
exports.validateFieldMappings = exports.generateAllNavObjects = exports.generateOtherNavObject = exports.generateReadNavObjects = exports.getFieldKeyValue = exports.getReadObject = exports.getOptionalFieldsFromObject = exports.getRequiredMapFieldsFromObject = exports.getRequiredFieldsFromObject = exports.getStandardObjectFromAction = exports.isIntegrationFieldMapping = void 0;
|
|
4
4
|
const ErrorContextProvider_1 = require("../../context/ErrorContextProvider");
|
|
5
5
|
const constant_1 = require("./nav/ObjectManagementNav/constant");
|
|
6
6
|
/**
|
|
@@ -73,6 +73,7 @@ const generateReadNavObjects = (config, hydratedRevision) => {
|
|
|
73
73
|
});
|
|
74
74
|
return navObjects;
|
|
75
75
|
};
|
|
76
|
+
exports.generateReadNavObjects = generateReadNavObjects;
|
|
76
77
|
const generateOtherNavObject = (config) => {
|
|
77
78
|
var _a;
|
|
78
79
|
const navObject = {
|
|
@@ -83,11 +84,17 @@ const generateOtherNavObject = (config) => {
|
|
|
83
84
|
};
|
|
84
85
|
exports.generateOtherNavObject = generateOtherNavObject;
|
|
85
86
|
// generates standard objects and whether they are complete based on config and hydrated revision
|
|
86
|
-
function
|
|
87
|
-
|
|
87
|
+
function generateAllNavObjects(config, hydratedRevision) {
|
|
88
|
+
var _a;
|
|
89
|
+
const navObjects = (0, exports.generateReadNavObjects)(config, hydratedRevision);
|
|
90
|
+
const isWriteSupported = !!((_a = hydratedRevision === null || hydratedRevision === void 0 ? void 0 : hydratedRevision.content) === null || _a === void 0 ? void 0 : _a.write);
|
|
91
|
+
const otherNavObject = isWriteSupported ? (0, exports.generateOtherNavObject)(config) : undefined;
|
|
92
|
+
if (otherNavObject) {
|
|
93
|
+
navObjects.push(otherNavObject);
|
|
94
|
+
}
|
|
88
95
|
return navObjects;
|
|
89
96
|
}
|
|
90
|
-
exports.
|
|
97
|
+
exports.generateAllNavObjects = generateAllNavObjects;
|
|
91
98
|
// validates whether required fields are filled out or throws error
|
|
92
99
|
function validateFieldMappings(requiredMapFields, selectedRequiredMapFields, setErrors) {
|
|
93
100
|
// check if fields with requirements are met
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "1.4.
|
|
1
|
+
export declare const LIB_VERSION = "1.4.2";
|