console: hide bigquery from connect db form dropdown in cloud console

GitOrigin-RevId: e71b33ce2154e0584a773de49fa41c4e0c153d13
This commit is contained in:
Abhijeet Singh Khangarot 2021-05-11 04:48:47 +05:30 committed by hasura-bot
parent 1e45580e7c
commit ad461d9285
5 changed files with 20 additions and 10 deletions

View File

@ -3,7 +3,7 @@ import React, { ChangeEvent, Dispatch, useState } from 'react';
import { ConnectDBActions, ConnectDBState, connectionTypes } from './state';
import { LabeledInput } from '../../../Common/LabeledInput';
import Tooltip from '../../../Common/Tooltip/Tooltip';
import { Driver } from '../../../../dataSources';
import { Driver, getSupportedDrivers } from '../../../../dataSources';
import { readFile } from './utils';
import styles from './DataSources.scss';
@ -48,6 +48,15 @@ const dbTypePlaceholders: Record<Driver, string> = {
const defaultTitle = 'Connect Database Via';
const driverToLabel: Record<Driver, string> = {
mysql: 'MySQL',
postgres: 'PostgreSQL',
mssql: 'MS Server',
bigquery: 'BigQuery',
};
const supportedDrivers = getSupportedDrivers('connectDbForm.enabled');
const ConnectDatabaseForm: React.FC<ConnectDatabaseFormProps> = ({
connectionDBState,
connectionDBStateDispatch,
@ -146,15 +155,11 @@ const ConnectDatabaseForm: React.FC<ConnectDatabaseFormProps> = ({
className={`form-control ${styles.connect_db_input_pad}`}
data-test="database-type"
>
<option key="postgres" value="postgres">
Postgres
</option>
<option key="mssql" value="mssql">
MS Server
</option>
<option key="bigquery" value="bigquery">
BigQuery
</option>
{supportedDrivers.map(driver => (
<option key={driver} value={driver}>
{driverToLabel[driver]}
</option>
))}
</select>
</>
)}

View File

@ -7,6 +7,7 @@ import {
BaseTableColumn,
SupportedFeaturesType,
} from '../../types';
import globals from '../../../Globals';
import { generateTableRowRequest } from './utils';
const permissionColumnDataTypes = {
@ -151,6 +152,7 @@ export const supportedFeatures: SupportedFeaturesType = {
tracking: false,
},
connectDbForm: {
enabled: globals.consoleType !== 'cloud',
connectionParameters: false,
databaseURL: true,
environmentVariable: true,

View File

@ -158,6 +158,7 @@ export const supportedFeatures: SupportedFeaturesType = {
tracking: true,
},
connectDbForm: {
enabled: true,
connectionParameters: false,
databaseURL: true,
environmentVariable: true,

View File

@ -581,6 +581,7 @@ export const supportedFeatures: SupportedFeaturesType = {
tracking: true,
},
connectDbForm: {
enabled: true,
connectionParameters: true,
databaseURL: true,
environmentVariable: true,

View File

@ -289,6 +289,7 @@ export type SupportedFeaturesType = {
tracking: boolean;
};
connectDbForm: {
enabled: boolean;
connectionParameters: boolean;
databaseURL: boolean;
environmentVariable: boolean;