fix (console): update @hasura/dc-agents-types dependency to 0.6.0

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/5978
GitOrigin-RevId: 9fc7bad5c003a733b8d67f0240651ba60585d0b7
This commit is contained in:
Vijay Prasanna 2022-09-22 11:18:40 +05:30 committed by hasura-bot
parent b69bd09ba4
commit 969cb05bdf
7 changed files with 18 additions and 23 deletions

View File

@ -13,7 +13,7 @@
"@babel/plugin-transform-runtime": "^7.14.5",
"@graphql-codegen/core": "^1.17.8",
"@graphql-codegen/typescript": "^1.17.10",
"@hasura/dc-api-types": "^0.4.0",
"@hasura/dc-api-types": "^0.6.0",
"@hookform/resolvers": "2.8.10",
"@radix-ui/react-collapsible": "^1.0.0",
"@radix-ui/react-dialog": "^1.0.0",
@ -3609,9 +3609,9 @@
"integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ=="
},
"node_modules/@hasura/dc-api-types": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@hasura/dc-api-types/-/dc-api-types-0.4.0.tgz",
"integrity": "sha512-Zpjb1RkCW19o/YT4q4z22SzxCGwG59ZI1DCRzo18OlbwC6tjmjrAGSJJCc0MclUKzZoCokFIPISkWxcxgMbBRg=="
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@hasura/dc-api-types/-/dc-api-types-0.6.0.tgz",
"integrity": "sha512-ikK2MYpA5jMq/38MtTv0tkeElGN6+izvQnM02rBjjdMYiSoaQ6VSsDLlbl9ERbMGW0/Hr2Fj0ZNuUsFdM2jamA=="
},
"node_modules/@hookform/devtools": {
"version": "4.0.1",
@ -44401,9 +44401,9 @@
}
},
"@hasura/dc-api-types": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/@hasura/dc-api-types/-/dc-api-types-0.4.0.tgz",
"integrity": "sha512-Zpjb1RkCW19o/YT4q4z22SzxCGwG59ZI1DCRzo18OlbwC6tjmjrAGSJJCc0MclUKzZoCokFIPISkWxcxgMbBRg=="
"version": "0.6.0",
"resolved": "https://registry.npmjs.org/@hasura/dc-api-types/-/dc-api-types-0.6.0.tgz",
"integrity": "sha512-ikK2MYpA5jMq/38MtTv0tkeElGN6+izvQnM02rBjjdMYiSoaQ6VSsDLlbl9ERbMGW0/Hr2Fj0ZNuUsFdM2jamA=="
},
"@hookform/devtools": {
"version": "4.0.1",

View File

@ -81,7 +81,7 @@
"@babel/plugin-transform-runtime": "^7.14.5",
"@graphql-codegen/core": "^1.17.8",
"@graphql-codegen/typescript": "^1.17.10",
"@hasura/dc-api-types": "^0.4.0",
"@hasura/dc-api-types": "^0.6.0",
"@hookform/resolvers": "2.8.10",
"@radix-ui/react-collapsible": "^1.0.0",
"@radix-ui/react-dialog": "^1.0.0",

View File

@ -1,17 +1,15 @@
import React, { FormEvent } from 'react';
import { LabeledInput } from '@/components/Common/LabeledInput';
import { Connect, useAvailableDrivers } from '@/features/ConnectDB';
// import { GDC_DB_CONNECTOR_DEV } from '@/utils/featureFlags';
import {
availableFeatureFlagIds,
useIsFeatureFlagEnabled,
} from '@/features/FeatureFlags';
import { Button } from '@/new-components/Button';
import { NativeDrivers } from '@/features/MetadataAPI';
import ConnectDatabaseForm, { ConnectDatabaseFormProps } from './ConnectDBForm';
import styles from './DataSources.module.scss';
import { SampleDBSection } from './SampleDatabase';
import { Driver, getSupportedDrivers } from '../../../../dataSources';
import { Driver } from '../../../../dataSources';
import { isDBSupported } from './utils';
interface DataSourceFormWrapperProps extends ConnectDatabaseFormProps {
@ -45,8 +43,6 @@ const driverToLabel: Record<
},
};
const supportedDrivers = getSupportedDrivers('connectDbForm.enabled');
const DataSourceFormWrapper: React.FC<DataSourceFormWrapperProps> = props => {
const {
onSubmit,
@ -61,11 +57,7 @@ const DataSourceFormWrapper: React.FC<DataSourceFormWrapperProps> = props => {
connectionTypeState,
} = props;
const { isLoading, data: availableDrivers } = useAvailableDrivers();
const drivers = availableDrivers?.filter(
availableDriver =>
supportedDrivers.includes(availableDriver?.name as NativeDrivers) // NOTE: with GDC this type casting needs to change
);
const { isLoading, data: drivers } = useAvailableDrivers();
const { enabled: isGDCFeatureFlagEnabled } = useIsFeatureFlagEnabled(
availableFeatureFlagIds.gdcId

View File

@ -8,7 +8,7 @@ export const useAvailableDrivers = () => {
queryKey: ['get_available_drivers'],
queryFn: async () => {
const drivers = await DataSource(httpClient).driver.getAllSourceKinds();
return drivers;
return drivers.filter(driver => driver.release !== 'disabled');
},
});
};

View File

@ -15,7 +15,7 @@ export const cockroach: Database = {
getDriverInfo: async () => ({
name: 'cockroach',
displayName: 'CockroachDB',
release: 'Beta',
release: 'disabled',
}),
getDatabaseConfiguration: async () => {
return Feature.NotImplemented;

View File

@ -11,7 +11,7 @@ export const getDatabaseConfiguration = async (
const result = await runMetadataQuery<{
capabilities: CapabilitiesResponse['capabilities'];
config_schema_response: CapabilitiesResponse['configSchemas'];
config_schema_response: CapabilitiesResponse['config_schemas'];
options: {
uri: string;
};
@ -25,7 +25,10 @@ export const getDatabaseConfiguration = async (
},
});
return result.config_schema_response as {
return {
configSchema: result.config_schema_response.config_schema,
otherSchemas: result.config_schema_response.other_schemas,
} as {
configSchema: Property;
otherSchemas: Record<string, Property>;
};

View File

@ -121,7 +121,7 @@ export type GetTablesListAsTreeProps = {
dataSourceName: string;
} & NetworkArgs;
type ReleaseType = 'GA' | 'Beta';
type ReleaseType = 'GA' | 'Beta' | 'disabled';
export type DriverInfoResponse = {
name: SupportedDrivers;