mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-14 08:02:15 +03:00
console: fix issue with column data type being reported as "STRING" for gdc tables
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/10204 GitOrigin-RevId: 0b997aafe55ed13b0963b1cb7b84764dfdddb13c
This commit is contained in:
parent
0e55ea931f
commit
014d362d7c
@ -1,4 +1,3 @@
|
||||
import { getEntries } from '../../../../components/Services/Data/Common/tsUtils';
|
||||
import { DataNode } from 'antd/lib/tree';
|
||||
import React from 'react';
|
||||
import { FaTable, FaFolder } from 'react-icons/fa';
|
||||
@ -71,26 +70,7 @@ export function convertToTreeData(
|
||||
export function adaptAgentDataType(
|
||||
sqlDataType: TableColumn['dataType']
|
||||
): TableColumn['dataType'] {
|
||||
const DataTypeToSQLTypeMap: Record<string, string[]> = {
|
||||
bool: ['bool'],
|
||||
string: ['string'],
|
||||
number: ['number', 'integer', 'float'],
|
||||
datetime: ['datetime'],
|
||||
timestamp: ['timestamp'],
|
||||
xml: ['xml'],
|
||||
json: ['json', 'jsonb'],
|
||||
};
|
||||
|
||||
const [dataType] = getEntries(DataTypeToSQLTypeMap).find(([, value]) =>
|
||||
value.includes(
|
||||
typeof sqlDataType === 'string'
|
||||
? sqlDataType.toLowerCase()
|
||||
: sqlDataType.type.toLowerCase()
|
||||
)
|
||||
) ?? [
|
||||
typeof sqlDataType === 'string' ? 'string' : sqlDataType.type.toLowerCase(),
|
||||
[],
|
||||
];
|
||||
|
||||
return dataType;
|
||||
return typeof sqlDataType === 'string'
|
||||
? sqlDataType.toLowerCase()
|
||||
: sqlDataType.type.toLowerCase();
|
||||
}
|
||||
|
@ -1157,6 +1157,13 @@ export const NestedObjectsInitiallyEmpty: StoryObj<typeof RowPermissionsInput> =
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
await waitFor(
|
||||
async () => {
|
||||
await canvas.findByTestId('RootInputReady');
|
||||
},
|
||||
{ timeout: 1000 }
|
||||
);
|
||||
|
||||
await canvas.findAllByRole('option', {
|
||||
name: 'address',
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user