Fix MySQL mutations

PR-URL: https://github.com/hasura/graphql-engine-mono/pull/8482
GitOrigin-RevId: 0cdbc081abee6d139c8132a00cae4e268239fd22
This commit is contained in:
Luca Restagno 2023-03-27 11:03:20 +02:00 committed by hasura-bot
parent de128e726a
commit 9143d9443a
7 changed files with 9 additions and 4 deletions

View File

@ -116,6 +116,7 @@ export interface DataSourcesAPI {
NUMERIC?: string;
DATE?: string;
BOOLEAN?: string;
BOOL?: string;
TEXT?: string;
ARRAY?: string;
BIGSERIAL?: string;
@ -445,6 +446,7 @@ export interface DataSourcesAPI {
}
export let currentDriver: Driver = 'postgres';
export let dataSource: DataSourcesAPI = services[currentDriver || 'postgres'];
export const isFeatureSupported = (

View File

@ -384,6 +384,7 @@ const columnDataTypes = {
BIGINT: 'bigint',
BIGSERIAL: 'bigserial',
BOOLEAN: 'boolean',
BOOL: 'bool',
DATE: 'date',
DATETIME: 'datetime',
INTEGER: 'integer',

View File

@ -133,7 +133,7 @@ export const InsertRowForm: React.VFC<InsertRowFormProps> = ({
onChange={onChange}
placeholder={column.placeholder}
isDisabled={!column.insertable}
// disable if the column has no default value
// TODO-NEXT: disable if the column has no default value
isDefaultDisabled={false}
isNullDisabled={!column.nullable}
resetToken={resetToken}

View File

@ -134,7 +134,6 @@ export const ColumnRow = ({
onInput={checkValueRadio}
inputRef={valueInputRef}
disabled={isDisabled}
tabIndex={2}
placeholder={placeholder}
onValueChange={onValueChange}
onCheckValueRadio={onCheckValueRadio}

View File

@ -45,7 +45,10 @@ export const ColumnRowInput: React.VFC<ColumnRowInputProps> = ({
return <JsonInput {...props} />;
}
if (dataType === dataSource.columnDataTypes.BOOLEAN) {
if (
dataType === dataSource.columnDataTypes.BOOLEAN ||
dataType === dataSource.columnDataTypes.BOOL
) {
return (
<BooleanInput
checked={false}

View File

@ -48,7 +48,6 @@ export const TextInput: React.VFC<TextInputProps> = ({
type="text"
className={clsx(inputTw, className || '')}
disabled={disabled}
tabIndex={2}
placeholder={placeholder}
/>
);

View File

@ -12,6 +12,7 @@ export const getPlaceholder = (type: TableColumn['data_type']) => {
case dataSource.columnDataTypes.DATE:
return getISODatePart();
case dataSource.columnDataTypes.TIME:
case 'time':
// eslint-disable-next-line no-case-declarations
const time = getISOTimePart();
return `${time}Z or ${time}+05:30`;