@openshift-assisted/ui-lib 2.9.6-cim → 2.9.7-cim
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/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts +1 -0
- package/build/@types/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts +1 -0
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts +2 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentHostsSelection.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.d.ts +1 -0
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDeploymentWizard.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts +1 -0
- package/build/@types/cim/components/ClusterDeployment/ClusterDetailsFormFields.d.ts.map +1 -1
- package/build/@types/cim/components/ClusterDeployment/types.d.ts +4 -0
- package/build/@types/cim/components/ClusterDeployment/types.d.ts.map +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts +1 -1
- package/build/@types/cim/components/helpers/versions.d.ts.map +1 -1
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts +1 -3
- package/build/@types/common/api/assisted-service/ClustersAPI.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts +0 -1
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/constants.d.ts +0 -3
- package/build/@types/ocm/components/clusterConfiguration/platformIntegration/constants.d.ts.map +1 -1
- package/build/@types/ocm/components/clusterWizard/ClusterDetails.d.ts.map +1 -1
- package/build/@types/ocm/hooks/index.d.ts +0 -1
- package/build/@types/ocm/hooks/index.d.ts.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js +3 -2
- package/build/cjs/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js +3 -3
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js +5 -4
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsSelection.js +14 -9
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentHostsSelection.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js +2 -2
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js +4 -4
- package/build/cjs/cim/components/ClusterDeployment/ClusterDeploymentWizard.js.map +1 -1
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js +4 -3
- package/build/cjs/cim/components/ClusterDeployment/ClusterDetailsFormFields.js.map +1 -1
- package/build/cjs/cim/components/Hypershift/hooks/useSupportedOCPVersions.js +1 -1
- package/build/cjs/cim/components/Hypershift/hooks/useSupportedOCPVersions.js.map +1 -1
- package/build/cjs/cim/components/helpers/versions.js +9 -2
- package/build/cjs/cim/components/helpers/versions.js.map +1 -1
- package/build/cjs/common/api/assisted-service/ClustersAPI.js +0 -6
- package/build/cjs/common/api/assisted-service/ClustersAPI.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js +7 -11
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js +1 -2
- package/build/cjs/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js +2 -3
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.js.map +1 -1
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/constants.js +2 -5
- package/build/cjs/ocm/components/clusterConfiguration/platformIntegration/constants.js.map +1 -1
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js +6 -5
- package/build/cjs/ocm/components/clusterWizard/ClusterDetails.js.map +1 -1
- package/build/cjs/ocm/hooks/index.js +1 -3
- package/build/cjs/ocm/hooks/index.js.map +1 -1
- package/lib/cim/components/ClusterDeployment/ACMClusterDeploymentDetailsStep.tsx +8 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsForm.tsx +7 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentDetailsStep.tsx +6 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostSelectionStep.tsx +2 -0
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentHostsSelection.tsx +14 -12
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentNetworkingForm.tsx +3 -1
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentNetworkingStep.tsx +3 -0
- package/lib/cim/components/ClusterDeployment/ClusterDeploymentWizard.tsx +4 -0
- package/lib/cim/components/ClusterDeployment/ClusterDetailsFormFields.tsx +8 -2
- package/lib/cim/components/ClusterDeployment/types.ts +4 -0
- package/lib/cim/components/Hypershift/hooks/useSupportedOCPVersions.ts +1 -1
- package/lib/cim/components/helpers/versions.ts +8 -1
- package/lib/common/api/assisted-service/ClustersAPI.ts +0 -9
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfiguration.tsx +5 -18
- package/lib/ocm/components/clusterConfiguration/networkConfiguration/NetworkConfigurationForm.tsx +3 -4
- package/lib/ocm/components/clusterConfiguration/platformIntegration/ExternalPlatformDropdown.tsx +3 -15
- package/lib/ocm/components/clusterConfiguration/platformIntegration/constants.tsx +1 -5
- package/lib/ocm/components/clusterWizard/ClusterDetails.tsx +11 -6
- package/lib/ocm/hooks/index.ts +0 -1
- package/package.json +3 -4
- package/build/@types/ocm/hooks/useClusterSupportedPlatforms.d.ts +0 -11
- package/build/@types/ocm/hooks/useClusterSupportedPlatforms.d.ts.map +0 -1
- package/build/cjs/ocm/hooks/useClusterSupportedPlatforms.js +0 -53
- package/build/cjs/ocm/hooks/useClusterSupportedPlatforms.js.map +0 -1
- package/lib/ocm/hooks/useClusterSupportedPlatforms.ts +0 -70
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
-
const swr_1 = tslib_1.__importDefault(require("swr"));
|
|
6
|
-
const api_1 = require("../api");
|
|
7
|
-
const apis_1 = require("../services/apis");
|
|
8
|
-
const common_1 = require("../../common");
|
|
9
|
-
function getIntegrablePlatformIntegration(allClusterPlatforms) {
|
|
10
|
-
const integrationPlatforms = allClusterPlatforms.filter((platform) => !common_1.NonPlatformIntegrations.includes(platform));
|
|
11
|
-
const uniqueIntegrationPlatforms = Array.from(new Set(integrationPlatforms));
|
|
12
|
-
if (integrationPlatforms.length === 1) {
|
|
13
|
-
const [exclusivelyAvailablePlatform] = uniqueIntegrationPlatforms;
|
|
14
|
-
return (0, common_1.isClusterPlatformTypeVM)({ platform: { type: exclusivelyAvailablePlatform } })
|
|
15
|
-
? exclusivelyAvailablePlatform
|
|
16
|
-
: undefined;
|
|
17
|
-
}
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
function useClusterSupportedPlatforms(clusterId) {
|
|
21
|
-
const { addAlert, alerts } = (0, common_1.useAlerts)();
|
|
22
|
-
const url = apis_1.ClustersAPI.makeSupportedPlatformsBaseURI(clusterId);
|
|
23
|
-
const fetcher = () => apis_1.ClustersAPI.getSupportedPlatforms(clusterId).then((res) => res.data);
|
|
24
|
-
const { data, error } = (0, swr_1.default)(url, fetcher, {
|
|
25
|
-
refreshInterval: common_1.POLLING_INTERVAL,
|
|
26
|
-
errorRetryCount: 0,
|
|
27
|
-
revalidateOnFocus: false,
|
|
28
|
-
});
|
|
29
|
-
const isLoading = !error && !data;
|
|
30
|
-
const supportedPlatformIntegration = isLoading || !data ? undefined : getIntegrablePlatformIntegration(data);
|
|
31
|
-
react_1.default.useEffect(() => {
|
|
32
|
-
if (error) {
|
|
33
|
-
const title = `Failed to retrieve supported platforms (clusterId: ${clusterId})`;
|
|
34
|
-
//TODO(brotman) add handling of existing errors to alerts context
|
|
35
|
-
if (alerts.find((alert) => alert.title === title)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
(0, api_1.handleApiError)(error, () => addAlert({
|
|
39
|
-
title,
|
|
40
|
-
message: (0, api_1.getApiErrorMessage)(error),
|
|
41
|
-
}));
|
|
42
|
-
}
|
|
43
|
-
}, [error, addAlert, clusterId, alerts]);
|
|
44
|
-
return {
|
|
45
|
-
isPlatformIntegrationSupported: supportedPlatformIntegration !== undefined,
|
|
46
|
-
supportedPlatformIntegration: (supportedPlatformIntegration ||
|
|
47
|
-
'no-active-integrations'),
|
|
48
|
-
isLoading,
|
|
49
|
-
error,
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
exports.default = useClusterSupportedPlatforms;
|
|
53
|
-
//# sourceMappingURL=useClusterSupportedPlatforms.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useClusterSupportedPlatforms.js","sourceRoot":"","sources":["../../../../lib/ocm/hooks/useClusterSupportedPlatforms.ts"],"names":[],"mappings":";;;AAAA,0DAA0B;AAE1B,sDAAyB;AACzB,gCAA4D;AAC5D,2CAA+C;AAC/C,yCAMsB;AAMtB,SAAS,gCAAgC,CAAC,mBAAmC;IAC3E,MAAM,oBAAoB,GAAG,mBAAmB,CAAC,MAAM,CACrD,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,gCAAuB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAC1D,CAAC;IACF,MAAM,0BAA0B,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAC7E,IAAI,oBAAoB,CAAC,MAAM,KAAK,CAAC,EAAE;QACrC,MAAM,CAAC,4BAA4B,CAAC,GAAG,0BAA0B,CAAC;QAClE,OAAO,IAAA,gCAAuB,EAAC,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,4BAA4B,EAAE,EAAE,CAAC;YAClF,CAAC,CAAC,4BAA4B;YAC9B,CAAC,CAAC,SAAS,CAAC;KACf;IACD,OAAO,SAAS,CAAC;AACnB,CA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8BAA8B,EAAE,4BAA4B,KAAK,SAAS;QAC1E,4BAA4B,EAAE,CAAC,4BAA4B;YACzD,wBAAwB,CAAqC;QAC/D,SAAS;QACT,KAAK;KACN,CAAC;AACJ,CAAC;AAtCD,+CAsCC"}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { AxiosError } from 'axios';
|
|
3
|
-
import useSWR from 'swr';
|
|
4
|
-
import { getApiErrorMessage, handleApiError } from '../api';
|
|
5
|
-
import { ClustersAPI } from '../services/apis';
|
|
6
|
-
import {
|
|
7
|
-
POLLING_INTERVAL,
|
|
8
|
-
NonPlatformIntegrations,
|
|
9
|
-
isClusterPlatformTypeVM,
|
|
10
|
-
useAlerts,
|
|
11
|
-
SupportedPlatformType,
|
|
12
|
-
} from '../../common';
|
|
13
|
-
import { APIErrorMixin } from '../../common/api/utils';
|
|
14
|
-
import { PlatformType } from '@openshift-assisted/types/assisted-installer-service';
|
|
15
|
-
|
|
16
|
-
export type SupportedPlatformIntegrationType = 'no-active-integrations' | SupportedPlatformType;
|
|
17
|
-
|
|
18
|
-
function getIntegrablePlatformIntegration(allClusterPlatforms: PlatformType[]) {
|
|
19
|
-
const integrationPlatforms = allClusterPlatforms.filter(
|
|
20
|
-
(platform) => !NonPlatformIntegrations.includes(platform),
|
|
21
|
-
);
|
|
22
|
-
const uniqueIntegrationPlatforms = Array.from(new Set(integrationPlatforms));
|
|
23
|
-
if (integrationPlatforms.length === 1) {
|
|
24
|
-
const [exclusivelyAvailablePlatform] = uniqueIntegrationPlatforms;
|
|
25
|
-
return isClusterPlatformTypeVM({ platform: { type: exclusivelyAvailablePlatform } })
|
|
26
|
-
? exclusivelyAvailablePlatform
|
|
27
|
-
: undefined;
|
|
28
|
-
}
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export default function useClusterSupportedPlatforms(clusterId: string) {
|
|
33
|
-
const { addAlert, alerts } = useAlerts();
|
|
34
|
-
const url = ClustersAPI.makeSupportedPlatformsBaseURI(clusterId);
|
|
35
|
-
const fetcher = () => ClustersAPI.getSupportedPlatforms(clusterId).then((res) => res.data);
|
|
36
|
-
const { data, error } = useSWR<PlatformType[], AxiosError<APIErrorMixin>>(url, fetcher, {
|
|
37
|
-
refreshInterval: POLLING_INTERVAL,
|
|
38
|
-
errorRetryCount: 0,
|
|
39
|
-
revalidateOnFocus: false,
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const isLoading = !error && !data;
|
|
43
|
-
|
|
44
|
-
const supportedPlatformIntegration =
|
|
45
|
-
isLoading || !data ? undefined : getIntegrablePlatformIntegration(data);
|
|
46
|
-
|
|
47
|
-
React.useEffect(() => {
|
|
48
|
-
if (error) {
|
|
49
|
-
const title = `Failed to retrieve supported platforms (clusterId: ${clusterId})`;
|
|
50
|
-
//TODO(brotman) add handling of existing errors to alerts context
|
|
51
|
-
if (alerts.find((alert) => alert.title === title)) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
handleApiError(error, () =>
|
|
55
|
-
addAlert({
|
|
56
|
-
title,
|
|
57
|
-
message: getApiErrorMessage(error),
|
|
58
|
-
}),
|
|
59
|
-
);
|
|
60
|
-
}
|
|
61
|
-
}, [error, addAlert, clusterId, alerts]);
|
|
62
|
-
|
|
63
|
-
return {
|
|
64
|
-
isPlatformIntegrationSupported: supportedPlatformIntegration !== undefined,
|
|
65
|
-
supportedPlatformIntegration: (supportedPlatformIntegration ||
|
|
66
|
-
'no-active-integrations') as SupportedPlatformIntegrationType,
|
|
67
|
-
isLoading,
|
|
68
|
-
error,
|
|
69
|
-
};
|
|
70
|
-
}
|