Unverified Commit 9b8b0a93 authored by Daniel's avatar Daniel Committed by GitHub

Added a 'is_view' and 'Table View' indicator on the table details page (#106)

parent f2641319
...@@ -180,6 +180,7 @@ def _get_table_metadata(*, table_key: str, index: int, source: str) -> Dict[str, ...@@ -180,6 +180,7 @@ def _get_table_metadata(*, table_key: str, index: int, source: str) -> Dict[str,
'cluster', 'cluster',
'database', 'database',
'owners', 'owners',
'is_view',
'schema', 'schema',
'table_description', 'table_description',
'table_name', 'table_name',
......
...@@ -13,6 +13,7 @@ import AppConfig from 'config/config'; ...@@ -13,6 +13,7 @@ import AppConfig from 'config/config';
import AvatarLabel from 'components/common/AvatarLabel'; import AvatarLabel from 'components/common/AvatarLabel';
import Breadcrumb from 'components/common/Breadcrumb'; import Breadcrumb from 'components/common/Breadcrumb';
import EntityCard from 'components/common/EntityCard'; import EntityCard from 'components/common/EntityCard';
import Flag from "components/common/Flag";
import LoadingSpinner from 'components/common/LoadingSpinner'; import LoadingSpinner from 'components/common/LoadingSpinner';
import ScrollTracker from "components/common/ScrollTracker"; import ScrollTracker from "components/common/ScrollTracker";
import TagInput from 'components/Tags/TagInput'; import TagInput from 'components/Tags/TagInput';
...@@ -68,6 +69,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone ...@@ -68,6 +69,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
columns: [], columns: [],
database: '', database: '',
is_editable: false, is_editable: false,
is_view: false,
schema: '', schema: '',
table_name: '', table_name: '',
table_description: '', table_description: '',
...@@ -330,8 +332,15 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone ...@@ -330,8 +332,15 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
<Breadcrumb path='/' text='Search Results'/> <Breadcrumb path='/' text='Search Results'/>
<div className="row"> <div className="row">
<div className="detail-header col-xs-12 col-md-7 col-lg-8"> <div className="detail-header col-xs-12 col-md-7 col-lg-8">
<div className="title">{ `${data.schema}.${data.table_name}` }</div> <div className="title">
<WatermarkLabel watermarks={ data.watermarks }/> { `${data.schema}.${data.table_name}` }
</div>
{
data.is_view && <Flag text="Table View" labelStyle="primary" />
}
{
!data.is_view && <WatermarkLabel watermarks={ data.watermarks }/>
}
<TableDescEditableText <TableDescEditableText
maxLength={ 750 } maxLength={ 750 }
value={ data.table_description } value={ data.table_description }
......
...@@ -75,6 +75,7 @@ export interface TableMetadata { ...@@ -75,6 +75,7 @@ export interface TableMetadata {
columns: TableColumn[]; columns: TableColumn[];
database: string; database: string;
is_editable: boolean; is_editable: boolean;
is_view: boolean;
schema: string; schema: string;
table_name: string; table_name: string;
table_description: string; table_description: string;
......
@import 'variables'; @import 'variables';
.flag { .flag {
margin-right: 4px; display: inline-block;
margin-left: 4px; margin: 4px 4px 4px 0;
font-size: 14px;
} }
...@@ -103,6 +103,7 @@ const initialTableDataState: TableMetadata = { ...@@ -103,6 +103,7 @@ const initialTableDataState: TableMetadata = {
columns: [], columns: [],
database: '', database: '',
is_editable: false, is_editable: false,
is_view: false,
schema: '', schema: '',
table_name: '', table_name: '',
table_description: '', table_description: '',
......
...@@ -49,6 +49,7 @@ const globalState: GlobalState = { ...@@ -49,6 +49,7 @@ const globalState: GlobalState = {
columns: [], columns: [],
database: '', database: '',
is_editable: false, is_editable: false,
is_view: false,
schema: '', schema: '',
table_name: '', table_name: '',
table_description: '', table_description: '',
......
...@@ -46,6 +46,7 @@ class MetadataTest(unittest.TestCase): ...@@ -46,6 +46,7 @@ class MetadataTest(unittest.TestCase):
{'reader': {'email': 'test@test.com', 'first_name': None, 'last_name': None}, 'read_count': 100} {'reader': {'email': 'test@test.com', 'first_name': None, 'last_name': None}, 'read_count': 100}
], ],
'owners': [], 'owners': [],
'is_view': False,
'columns': [ 'columns': [
{ {
'name': 'column_1', 'name': 'column_1',
...@@ -94,6 +95,7 @@ class MetadataTest(unittest.TestCase): ...@@ -94,6 +95,7 @@ class MetadataTest(unittest.TestCase):
'value': '01-30-2019' 'value': '01-30-2019'
}, },
'owners': [], 'owners': [],
'is_view': False,
'columns': [ 'columns': [
{ {
'name': 'column_1', 'name': 'column_1',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment