mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-09-11 10:46:25 +03:00
Merge branch 'master' into master
This commit is contained in:
commit
c54096930d
@ -13,8 +13,10 @@ import { hasuraToast } from '../../../../new-components/Toasts';
|
||||
import { useAvailableDrivers } from '../../../ConnectDB/hooks';
|
||||
import { OpenApi3Form } from '../../../OpenApi3Form';
|
||||
import { useMetadata } from '../../../hasura-metadata-api';
|
||||
import { Source } from '../../../hasura-metadata-types';
|
||||
import { useManageDatabaseConnection } from '../../hooks/useManageDatabaseConnection';
|
||||
import { DisplayToastErrorMessage } from '../Common/DisplayToastErrorMessage';
|
||||
import { cleanEmpty } from '../ConnectPostgresWidget/utils/helpers';
|
||||
import { GraphQLCustomization } from '../GraphQLCustomization/GraphQLCustomization';
|
||||
import { adaptGraphQLCustomization } from '../GraphQLCustomization/utils/adaptResponse';
|
||||
import { Template } from './components/Template';
|
||||
@ -25,8 +27,6 @@ import {
|
||||
useFormValidationSchema,
|
||||
} from './useFormValidationSchema';
|
||||
import { generateGDCRequestPayload } from './utils/generateRequest';
|
||||
import { Source } from '../../../hasura-metadata-types';
|
||||
import { cleanEmpty } from '../ConnectPostgresWidget/utils/helpers';
|
||||
|
||||
interface ConnectGDCSourceWidgetProps {
|
||||
driver: string;
|
||||
@ -129,6 +129,11 @@ export const ConnectGDCSourceWidget = (props: ConnectGDCSourceWidgetProps) => {
|
||||
methods: { formState, reset },
|
||||
} = useConsoleForm({
|
||||
schema,
|
||||
options: {
|
||||
defaultValues: {
|
||||
template_variables: [],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -108,7 +108,7 @@ export const TemplateVariables = () => {
|
||||
),
|
||||
}),
|
||||
],
|
||||
[]
|
||||
[remove]
|
||||
);
|
||||
|
||||
const table = useReactTable({
|
||||
|
@ -26,6 +26,10 @@ const createValidationSchema = (configSchemas: GDCConfigSchemas) =>
|
||||
.gte(0, { message: 'Timeout must be a postive number' })
|
||||
.optional(),
|
||||
template: z.string().optional(),
|
||||
|
||||
// template variables is not marked as optional b/c it makes some pretty annoying TS issues with react-hook-form
|
||||
// the field is initialized with a default value of `[]`
|
||||
// with clean up empty fields, including arrays before submission, so it won't be sent to the server if the array is empty
|
||||
template_variables: z
|
||||
.object({
|
||||
name: reqString('variable name'),
|
||||
|
Loading…
Reference in New Issue
Block a user