Unverified Commit b0ff41df authored by Tamika Tannis's avatar Tamika Tannis Committed by GitHub

Add db to tablelistitem + re-add database to syntax help text (#241)

parent c37972d0
...@@ -125,6 +125,12 @@ body { ...@@ -125,6 +125,12 @@ body {
font-family: $font-family-monospace; font-family: $font-family-monospace;
} }
.resource-type {
color: $gray;
font-size: 13px;
font-family: $font-family-monospace;
}
.helper-text { .helper-text {
color: $text-medium; color: $text-medium;
font-size: 12px; font-size: 12px;
......
...@@ -4,7 +4,7 @@ export const ERROR_CLASSNAME = 'error'; ...@@ -4,7 +4,7 @@ export const ERROR_CLASSNAME = 'error';
export const PLACEHOLDER_DEFAULT = 'search for data resources...'; export const PLACEHOLDER_DEFAULT = 'search for data resources...';
export const SUBTEXT_DEFAULT = `Search within a category using the pattern with wildcard support 'category:*searchTerm*', e.g. 'schema:*core*'. export const SUBTEXT_DEFAULT = `Search within a category using the pattern with wildcard support 'category:*searchTerm*', e.g. 'schema:*core*'.
Current categories are 'column', 'schema', 'table', and 'tag'.`; Current categories are 'column', 'database', 'schema', 'table', and 'tag'.`;
export const SYNTAX_ERROR_CATEGORY = `Advanced search syntax only supports searching one category. Please remove all extra ':'`; export const SYNTAX_ERROR_CATEGORY = `Advanced search syntax only supports searching one category. Please remove all extra ':'`;
export const SYNTAX_ERROR_PREFIX = 'Did you mean '; export const SYNTAX_ERROR_PREFIX = 'Did you mean ';
export const SYNTAX_ERROR_SPACING_SUFFIX = ` ? Please remove the space around the ':'.`; export const SYNTAX_ERROR_SPACING_SUFFIX = ` ? Please remove the space around the ':'.`;
...@@ -38,7 +38,7 @@ class TableListItem extends React.Component<TableListItemProps, {}> { ...@@ -38,7 +38,7 @@ class TableListItem extends React.Component<TableListItemProps, {}> {
<Link className="resource-list-item table-list-item" to={ this.getLink() }> <Link className="resource-list-item table-list-item" to={ this.getLink() }>
<img className="icon icon-database icon-color" /> <img className="icon icon-database icon-color" />
<div className="content"> <div className="content">
<div className={ hasLastUpdated? "col-sm-9 col-md-10" : "col-sm-12"}> <div className="col-sm-6 col-md-8">
<div className="resource-name title-2"> <div className="resource-name title-2">
<div className="truncated"> <div className="truncated">
{ `${table.schema_name}.${table.name}`} { `${table.schema_name}.${table.name}`}
...@@ -47,6 +47,9 @@ class TableListItem extends React.Component<TableListItemProps, {}> { ...@@ -47,6 +47,9 @@ class TableListItem extends React.Component<TableListItemProps, {}> {
</div> </div>
<div className="body-secondary-3 truncated">{ table.description }</div> <div className="body-secondary-3 truncated">{ table.description }</div>
</div> </div>
<div className="resource-type hidden-xs col-sm-3 col-md-2 text-center">
{ table.database }
</div>
{ {
hasLastUpdated && hasLastUpdated &&
<div className="hidden-xs col-sm-3 col-md-2"> <div className="hidden-xs col-sm-3 col-md-2">
......
...@@ -14,7 +14,7 @@ describe('TableListItem', () => { ...@@ -14,7 +14,7 @@ describe('TableListItem', () => {
table: { table: {
type: ResourceType.table, type: ResourceType.table,
cluster: '', cluster: '',
database: '', database: 'testdb',
description: 'I am the description', description: 'I am the description',
key: '', key: '',
last_updated_epoch: 1553829681, last_updated_epoch: 1553829681,
...@@ -52,13 +52,17 @@ describe('TableListItem', () => { ...@@ -52,13 +52,17 @@ describe('TableListItem', () => {
expect(wrapper.find('.content').children().at(0).children().at(1).text()).toEqual('I am the description'); expect(wrapper.find('.content').children().at(0).children().at(1).text()).toEqual('I am the description');
}); });
it('renders resource type', () => {
expect(wrapper.find('.content').children().at(1).text()).toEqual(props.table.database);
});
describe('if props.table has last_updated_epoch', () => { describe('if props.table has last_updated_epoch', () => {
it('renders Last Update title', () => { it('renders Last Update title', () => {
expect(wrapper.find('.content').children().at(1).children().at(0).text()).toEqual('Last Updated'); expect(wrapper.find('.content').children().at(2).children().at(0).text()).toEqual('Last Updated');
}); });
it('renders getDateLabel value', () => { it('renders getDateLabel value', () => {
expect(wrapper.find('.content').children().at(1).children().at(1).text()).toEqual(wrapper.instance().getDateLabel()); expect(wrapper.find('.content').children().at(2).children().at(1).text()).toEqual(wrapper.instance().getDateLabel());
}); });
}); });
...@@ -74,7 +78,7 @@ describe('TableListItem', () => { ...@@ -74,7 +78,7 @@ describe('TableListItem', () => {
name: 'tableName', name: 'tableName',
schema_name: 'tableSchema', schema_name: 'tableSchema',
}}); }});
expect(wrapper.find('.content').children().at(1).exists()).toBeFalsy(); expect(wrapper.find('.content').children().at(2).exists()).toBeFalsy();
}); });
}); });
}); });
......
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