handle table configuration defaults in console (fix #3313 #3314 #3316) (#3317)

This commit is contained in:
Rishichandra Wawhal 2019-11-07 08:27:27 +05:30 committed by Rikin Kachhia
parent a1a851b3d1
commit 3a07b2b0cf
2 changed files with 4 additions and 3 deletions

View File

@ -243,14 +243,14 @@ export const getSchemaTableNames = (allTables, tableSchema) => {
export const getTableCustomRootFields = table => {
if (table.configuration) {
return table.configuration.custom_root_fields;
return table.configuration.custom_root_fields || {};
}
return {};
};
export const getTableCustomColumnNames = table => {
if (table.configuration) {
return table.configuration.custom_column_names;
return table.configuration.custom_column_names || {};
}
return {};
};

View File

@ -85,7 +85,7 @@ const ColumnEditor = ({
return (
<div className={`${styles.display_flex} form-group`}>
<label className={'col-xs-4'}>
Custom GraphQL field
GraphQL field name
<Tooltip
message={
'Expose the column with a different name in the GraphQL API'
@ -97,6 +97,7 @@ const ColumnEditor = ({
className="input-sm form-control"
value={selectedProperties[colName].customFieldName}
onChange={updateColumnCustomField}
placeholder={`${colName} (default)`}
type="text"
data-test="edit-col-custom-field"
/>