Unverified Commit 052dec38 authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Update TableDetail Page (#210)

* Some fixes

* Remove a unecessary workaround

* Css cleanup
parent 719f9fcf
...@@ -72,10 +72,10 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -72,10 +72,10 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
return ( return (
<li className='list-group-item detail-list-item'> <li className='list-group-item detail-list-item'>
<div className={'column-info ' + (isExpandable ? 'expandable' : '')} onClick={ isExpandable? this.onClick : null }> <div className={'column-info ' + (isExpandable ? 'expandable' : '')} onClick={ isExpandable? this.onClick : null }>
<div style={{ width: '100%', display: 'inline-grid' }}> <div className='title-section'>
<div className='title-row'> <div className='title-row'>
<div className='name title-2'>{metadata.name}</div> <div className='name title-2'>{metadata.name}</div>
<div className='column-type'>{metadata.type || 'null'}</div> <div className='column-type'>{metadata.type ? metadata.type.toLowerCase() : 'null'}</div>
</div> </div>
</div> </div>
{ {
......
...@@ -31,15 +31,22 @@ ...@@ -31,15 +31,22 @@
margin: -10px -4px 0; margin: -10px -4px 0;
padding: 10px 4px 0; padding: 10px 4px 0;
.title-row { .title-section {
display: flex; width: 100%;
flex-direction: row; overflow-wrap: break-word;
.name { .title-row {
margin-right: 8px; display: flex;
} flex-direction: row;
.column-type {
margin-top: 4px; .name {
margin-right: 8px;
max-width: 85%;
}
.column-type {
margin-top: 4px;
max-width: 15%;
}
} }
} }
......
...@@ -195,8 +195,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone ...@@ -195,8 +195,7 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
} }
}; };
getAvatarForLineage = () => { renderAvatarForLineage = (href: string) => {
const href = AppConfig.tableLineage.urlGenerator(this.database, this.cluster, this.schema, this.tableName);
return ( return (
<a href={ href } target='_blank' id="explore-lineage" onClick={logClick}> <a href={ href } target='_blank' id="explore-lineage" onClick={logClick}>
<AvatarLabel label={ this.displayName } src={ AppConfig.tableLineage.iconPath }/> <AvatarLabel label={ this.displayName } src={ AppConfig.tableLineage.iconPath }/>
...@@ -217,6 +216,14 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone ...@@ -217,6 +216,14 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
const entityCardSections = []; const entityCardSections = [];
// "Data Store" section
const dataStoreRenderer = () => {
return (
<label className="m-auto">{ data.database.toUpperCase() }</label>
);
};
entityCardSections.push({'title': 'Data Store', 'contentRenderer': dataStoreRenderer, 'isEditable': false});
// "Owned By" section // "Owned By" section
const ownerSectionRenderer = () => { const ownerSectionRenderer = () => {
return ( return (
...@@ -271,23 +278,27 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone ...@@ -271,23 +278,27 @@ export class TableDetail extends React.Component<TableDetailProps & RouteCompone
// "Lineage" Section // "Lineage" Section
if (AppConfig.tableLineage.isEnabled) { if (AppConfig.tableLineage.isEnabled) {
entityCardSections.push({ const href = AppConfig.tableLineage.urlGenerator(this.database, this.cluster, this.schema, this.tableName);
'title': 'Table Lineage' + (AppConfig.tableLineage.isBeta ? ' (beta)' : ''), if (!!href) {
'contentRenderer': this.getAvatarForLineage, entityCardSections.push({
'isEditable': false 'title': 'Table Lineage' + (AppConfig.tableLineage.isBeta ? ' (beta)' : ''),
}); 'contentRenderer': () => { return this.renderAvatarForLineage(href) },
'isEditable': false
});
};
} }
// "Preview" Section // "Preview" Section
const previewSectionRenderer = () => { const previewSectionRenderer = () => {
const exploreSqlHref = AppConfig.tableProfile.isExploreEnabled ? this.getExploreSqlUrl() : '';
return ( return (
<div> <div>
<DataPreviewButton modalTitle={ this.displayName } /> <DataPreviewButton modalTitle={ this.displayName } />
{ {
AppConfig.tableProfile.isExploreEnabled && exploreSqlHref &&
<a <a
className="btn btn-default btn-block" className="btn btn-default btn-block"
href={this.getExploreSqlUrl()} href={exploreSqlHref}
role="button" role="button"
target="_blank" target="_blank"
id="explore-sql" id="explore-sql"
......
...@@ -161,7 +161,6 @@ export default function reducer(state: TableMetadataReducerState = initialState, ...@@ -161,7 +161,6 @@ export default function reducer(state: TableMetadataReducerState = initialState,
case GetLastIndexed.SUCCESS: case GetLastIndexed.SUCCESS:
return { ...state, lastIndexed: (<GetLastIndexedResponse>action).payload.lastIndexedEpoch }; return { ...state, lastIndexed: (<GetLastIndexedResponse>action).payload.lastIndexedEpoch };
case GetPreviewData.FAILURE: case GetPreviewData.FAILURE:
return { ...state, preview: initialPreviewState };
case GetPreviewData.SUCCESS: case GetPreviewData.SUCCESS:
return { ...state, preview: (<GetPreviewDataResponse>action).payload }; return { ...state, preview: (<GetPreviewDataResponse>action).payload };
case UpdateTableOwner.REQUEST: case UpdateTableOwner.REQUEST:
......
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