Unverified Commit 9752b675 authored by Daniel's avatar Daniel Committed by GitHub

Change stat collection info from tooltip to label (#42)

parent 89df42c8
...@@ -26,6 +26,16 @@ img.icon { ...@@ -26,6 +26,16 @@ img.icon {
mask-image: url('/static/images/icons/Database.svg'); mask-image: url('/static/images/icons/Database.svg');
} }
&.icon-down {
-webkit-mask-image: url('/static/images/icons/Down.svg');
mask-image: url('/static/images/icons/Down.svg');
}
&.icon-left {
-webkit-mask-image: url('/static/images/icons/Left.svg');
mask-image: url('/static/images/icons/Left.svg');
}
&.icon-loading { &.icon-loading {
-webkit-mask-image: url('/static/images/icons/Loader.svg'); -webkit-mask-image: url('/static/images/icons/Loader.svg');
mask-image: url('/static/images/icons/Loader.svg'); mask-image: url('/static/images/icons/Loader.svg');
...@@ -45,6 +55,11 @@ img.icon { ...@@ -45,6 +55,11 @@ img.icon {
-webkit-mask-image: url('/static/images/icons/Right.svg'); -webkit-mask-image: url('/static/images/icons/Right.svg');
mask-image: url('/static/images/icons/Right.svg'); mask-image: url('/static/images/icons/Right.svg');
} }
&.icon-up {
-webkit-mask-image: url('/static/images/icons/Up.svg');
mask-image: url('/static/images/icons/Up.svg');
}
} }
.btn img.icon { .btn img.icon {
......
...@@ -34,7 +34,7 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -34,7 +34,7 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
this.setState(prevState => ({ this.setState(prevState => ({
isExpanded: !prevState.isExpanded isExpanded: !prevState.isExpanded
})); }));
} };
formatDate = (unixEpochTimeValue) => { formatDate = (unixEpochTimeValue) => {
const date = new Date(0); const date = new Date(0);
...@@ -42,7 +42,7 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -42,7 +42,7 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
/* TODO: Internationalization */ /* TODO: Internationalization */
return date.toLocaleDateString(); return date.toLocaleDateString();
} };
render() { render() {
const metadata = this.props.data; const metadata = this.props.data;
...@@ -53,10 +53,10 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -53,10 +53,10 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
const startDate = isExpandable ? this.formatDate(startEpoch) : null; const startDate = isExpandable ? this.formatDate(startEpoch) : null;
const endDate = isExpandable ? this.formatDate(endEpoch) : null; const endDate = isExpandable ? this.formatDate(endEpoch) : null;
let infoText = 'These stats are based on data collected for this column'; let infoText = 'Stats collected';
if (startDate && endDate) { if (startDate && endDate) {
if (startDate === endDate) { if (startDate === endDate) {
infoText = `${infoText} on ${startDate}`; infoText = `${infoText} on ${startDate} partition`;
} }
else { else {
infoText = `${infoText} between ${startDate} and ${endDate}`; infoText = `${infoText} between ${startDate} and ${endDate}`;
...@@ -75,16 +75,9 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -75,16 +75,9 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
<div className='type'>{metadata.type || 'null'}</div> <div className='type'>{metadata.type || 'null'}</div>
</div> </div>
</div> </div>
{
this.state.isExpanded &&
<InfoButton title='How is this data generated?'
infoText={infoText}
placement='top'
/>
}
{ {
isExpandable && isExpandable &&
<img className={'expand-icon ' + (this.state.isExpanded ? 'icon-up' : 'icon-down')}/> <img className={'icon ' + (this.state.isExpanded ? 'icon-up' : 'icon-down')}/>
} }
</div> </div>
<div className={'description ' + (this.state.isExpanded ? '' : (isExpandable ? 'truncated' : ''))}> <div className={'description ' + (this.state.isExpanded ? '' : (isExpandable ? 'truncated' : ''))}>
...@@ -109,11 +102,17 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem ...@@ -109,11 +102,17 @@ class DetailListItem extends React.Component<DetailListItemProps, DetailListItem
</div> </div>
) )
} }
{
metadata.stats.length > 0 &&
<div className="stat-collection-info">
{ infoText }
</div>
}
</div> </div>
} }
</li> </li>
); );
} }
}; }
export default DetailListItem; export default DetailListItem;
...@@ -10,25 +10,6 @@ ...@@ -10,25 +10,6 @@
border-bottom-color: $gray-lighter !important; border-bottom-color: $gray-lighter !important;
background-color: transparent !important; background-color: transparent !important;
img {
height: 24px;
min-width: 24px;
border: none;
background-color: $gray-lighter;
}
img.icon-down {
-webkit-mask-image: url('/static/images/icons/Down.svg');
mask-image: url('/static/images/icons/Down.svg');
}
img.icon-up {
-webkit-mask-image: url('/static/images/icons/Up.svg');
mask-image: url('/static/images/icons/Up.svg');
}
.expand-icon {
width: 24px;
margin: 0 4px;
}
.description { .description {
color: $gray-light; color: $gray-light;
max-width: 100%; max-width: 100%;
...@@ -37,6 +18,7 @@ ...@@ -37,6 +18,7 @@
padding-right: 32px; padding-right: 32px;
} }
// TODO - move to common styles
.truncated, .truncated,
.truncated .editable-text { .truncated .editable-text {
white-space: nowrap; white-space: nowrap;
...@@ -50,6 +32,24 @@ ...@@ -50,6 +32,24 @@
margin: -10px -4px 0; margin: -10px -4px 0;
padding: 10px 4px 0; padding: 10px 4px 0;
.title {
display: flex;
flex-direction: row;
}
.name {
font-size: 16px;
font-family: $font-family-sans-serif-bold;
font-weight: $font-weight-sans-serif-bold;
margin-right: 8px;
}
.type {
color: $brand-color-3;
font-size: 13px;
margin-top: 4px;
font-family: 'Menlo-Bold', Helvetica, Arial, sans-serif;
}
&.expandable { &.expandable {
cursor: pointer; cursor: pointer;
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
color: $brand-color-4; color: $brand-color-4;
} }
.expand-icon { .icon {
background-color: $brand-color-4; background-color: $brand-color-4;
} }
} }
...@@ -68,44 +68,32 @@ ...@@ -68,44 +68,32 @@
} }
.column-stats { .column-stats {
display: flex; display: block;
flex-direction: row; margin-top: 8px;
flex-wrap: wrap;
margin-top: 10px;
width: 100%; width: 100%;
}
.title {
display: flex;
flex-direction: row;
}
.name {
font-size: 16px;
font-family: $font-family-sans-serif-bold;
font-weight: $font-weight-sans-serif-bold;
margin-right: 8px;
}
.type {
color: $brand-color-3;
font-size: 13px;
margin-top: 4px;
font-family: 'Menlo-Bold', Helvetica, Arial, sans-serif;
}
.column-stat { .column-stat {
flex: 1; display: inline-block;
min-width: 120px; margin-top: 8px;
margin-top: 8px; max-width: 150px;
max-width: 20%; min-width: 120px;
width: 20%;
.title { .title {
color: $gray-light; color: $gray-light;
font-size: 12px; font-size: $font-size-small;
font-family: $font-family-sans-serif-bold; font-family: $font-family-sans-serif-bold;
font-weight: $font-weight-sans-serif-bold; font-weight: $font-weight-sans-serif-bold;
}
.content {
color: $brand-color-4;
}
} }
.content {
color: $brand-color-4; .stat-collection-info {
font-size: 14px; color: $gray-light;
font-style: italic;
margin-top: 4px;
} }
} }
} }
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