refactor(app-config): remove canCustomConnect virtual attribute
This commit is contained in:
@@ -93,7 +93,10 @@ function ChooseConnectionSubstep(props) {
|
||||
appWithConnections?.map((connection) => optionGenerator(connection)) ||
|
||||
[];
|
||||
|
||||
if (!appConfig?.data || appConfig?.data?.canCustomConnect) {
|
||||
if (
|
||||
!appConfig?.data ||
|
||||
(!appConfig.data?.disabled && appConfig.data?.allowCustomConnection)
|
||||
) {
|
||||
options.push({
|
||||
label: formatMessage('chooseConnectionSubstep.addNewConnection'),
|
||||
value: ADD_CONNECTION_VALUE,
|
||||
|
@@ -77,7 +77,8 @@ export default function Application() {
|
||||
|
||||
const connectionOptions = React.useMemo(() => {
|
||||
const shouldHaveCustomConnection =
|
||||
appConfig?.data?.connectionAllowed && appConfig?.data?.canCustomConnect;
|
||||
appConfig?.data?.connectionAllowed &&
|
||||
appConfig?.data?.allowCustomConnection;
|
||||
|
||||
const options = [
|
||||
{
|
||||
@@ -155,8 +156,9 @@ export default function Application() {
|
||||
disabled={
|
||||
!allowed ||
|
||||
(appConfig?.data &&
|
||||
!appConfig?.data?.disabled &&
|
||||
!appConfig?.data?.connectionAllowed &&
|
||||
!appConfig?.data?.canCustomConnect) ||
|
||||
!appConfig?.data?.allowCustomConnection) ||
|
||||
connectionOptions.every(({ disabled }) => disabled)
|
||||
}
|
||||
options={connectionOptions}
|
||||
|
@@ -461,7 +461,6 @@ export const AppConfigPropType = PropTypes.shape({
|
||||
key: PropTypes.string,
|
||||
allowCustomConnection: PropTypes.bool,
|
||||
connectionAllowed: PropTypes.bool,
|
||||
canCustomConnect: PropTypes.bool,
|
||||
shared: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
});
|
||||
|
Reference in New Issue
Block a user