From 3a07b2b0cfe2030cfcfd70f93dce2fced1832c63 Mon Sep 17 00:00:00 2001 From: Rishichandra Wawhal Date: Thu, 7 Nov 2019 08:27:27 +0530 Subject: [PATCH] handle table configuration defaults in console (fix #3313 #3314 #3316) (#3317) --- console/src/components/Common/utils/pgUtils.js | 4 ++-- .../src/components/Services/Data/TableModify/ColumnEditor.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/console/src/components/Common/utils/pgUtils.js b/console/src/components/Common/utils/pgUtils.js index e4fa0bfed60..e0c1861ee6c 100644 --- a/console/src/components/Common/utils/pgUtils.js +++ b/console/src/components/Common/utils/pgUtils.js @@ -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 {}; }; diff --git a/console/src/components/Services/Data/TableModify/ColumnEditor.js b/console/src/components/Services/Data/TableModify/ColumnEditor.js index f75597ed64c..4bb6d49a136 100644 --- a/console/src/components/Services/Data/TableModify/ColumnEditor.js +++ b/console/src/components/Services/Data/TableModify/ColumnEditor.js @@ -85,7 +85,7 @@ const ColumnEditor = ({ return (