Skip to content

Commit

Permalink
refactor(ui): display dashboard cards in a grid (#15211)
Browse files Browse the repository at this point in the history
* refactor(ui): display dashboard cards in a grid

* chore(ui): update changelog
  • Loading branch information
alexpaxton authored Sep 19, 2019
1 parent 778db16 commit 2ef1daa
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

### UI Improvements

1. [15211](https://github.com/influxdata/influxdb/pull/15211): Display dashboards index as a grid
1. [15099](https://github.com/influxdata/influxdb/pull/15099): Add viewport scaling to html meta for responsive mobile scaling
1. [15056](https://github.com/influxdata/influxdb/pull/15056): Remove rename and delete functionality from system buckets
1. [15056](https://github.com/influxdata/influxdb/pull/15056): Prevent new buckets from being named with the reserved "\_" prefix
Expand Down
39 changes: 39 additions & 0 deletions ui/src/dashboards/components/DashboardsCardGrid.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/*
Dashboards Card Grid Styles
------------------------------------------------------------------------------
*/

.dashboards-card-grid {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 150px 150px 150px;
grid-column-gap: $ix-marg-a;
grid-row-gap: $ix-marg-a;

.cf-resource-card {
margin-bottom: 0;
}

.resource-description {
height: 60px;
overflow: hidden;
}
}

@media screen and (min-width: $grid--breakpoint-sm) {
.dashboards-card-grid {
grid-template-columns: 1fr 1fr;
}
}

@media screen and (min-width: $grid--breakpoint-md) {
.dashboards-card-grid {
grid-template-columns: 1fr 1fr 1fr;
}
}

@media screen and (min-width: $grid--breakpoint-lg) {
.dashboards-card-grid {
grid-template-columns: 1fr 1fr 1fr 1fr;
}
}
5 changes: 4 additions & 1 deletion ui/src/dashboards/components/dashboard_index/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,10 @@ class DashboardsTable extends PureComponent<Props, State> {
onClick={this.handleClickColumn}
/>
</ResourceList.Header>
<ResourceList.Body emptyState={this.emptyState}>
<ResourceList.Body
emptyState={this.emptyState}
className="dashboards-card-grid"
>
{!!dashboards.length && (
<DashboardCards
dashboards={dashboards}
Expand Down
1 change: 1 addition & 0 deletions ui/src/style/chronograf.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
@import 'src/alerting/components/SentTableField.scss';
@import 'src/alerting/components/notifications/RuleOverlayFooter.scss';
@import 'src/alerting/components/SearchBar.scss';
@import 'src/dashboards/components/DashboardsCardGrid.scss';

// External
@import '../../node_modules/@influxdata/react-custom-scrollbars/dist/styles.css';

0 comments on commit 2ef1daa

Please sign in to comment.