UNPKG

@openshift-assisted/ui-lib

Version:

React component library for the Assisted Installer UI

45 lines 1.82 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isFeatureSupported = exports.getFeatureDisabledReason = void 0; const getClusterExistsReason = (t) => t('ai:This option is not editable after the draft cluster is created'); const getSNODisabledReason = (clusterExists, isSupported, t) => { if (clusterExists) { return getClusterExistsReason(t); } if (!isSupported) { return t('ai:Single-Node OpenShift is not supported in this OpenShift version'); } return undefined; }; const getArmDisabledReason = (clusterExists, versionName, versionOptions, isSupported, t) => { if (clusterExists) { return getClusterExistsReason(t); } if (!isSupported) { return t('ai:arm64 is not supported in this OpenShift version'); } // TODO(jtomasek): versionOptions derived from clusterimagesets need to include cpuArchitectures array to correctly determine this // if (!isArmSupportedByTheImage(versionName, versionOptions)) { // return t('ai:Selected image does not support arm64'); // } return undefined; }; const getFeatureDisabledReason = (featureId, clusterExists, versionName, versionOptions, isSupported, t) => { switch (featureId) { case 'SNO': { return getSNODisabledReason(clusterExists, isSupported, t); } case 'ARM64_ARCHITECTURE': { return getArmDisabledReason(clusterExists, versionName, versionOptions, isSupported, t); } default: { return undefined; } } }; exports.getFeatureDisabledReason = getFeatureDisabledReason; const isFeatureSupported = (supportLevel) => { return supportLevel !== 'unsupported'; }; exports.isFeatureSupported = isFeatureSupported; //# sourceMappingURL=featureStateUtils.js.map