Files
nebula.js/commands/serve/web/utils/checkIfConnectionOptionDisabled.js
Ahmad Mirzaei 1c8dd28078 test: nebula web - part 01 (#1004)
* test: base test renderer

* test: `<ConnectionStep />`

* test: `<AppList /> tests`

* test: `<ConnectionGuid />`

* test: `<HubLayout />`

* test: `<ConnectionHistory />`

* test: `<ConnectionOptions />` done

* test: `<Error />` done

* test: `<SelectEngine />` done
2022-11-14 13:55:04 +01:00

21 lines
431 B
JavaScript

export const checkIfConnectionOptionDisabled = ({ label, info }) => {
if (!info) return false;
const labelKey = label
.split(' ')
.map((x) => x.toLowerCase())
.join('-');
if (info.isWebIntegrationIdProvided) {
if (labelKey === 'web-integration-id') return false;
return true;
}
if (info.isClientIdProvided) {
if (labelKey === 'client-id') return false;
return true;
}
return false;
};