From 14380dde699058289d025760cb67bbc7207bea59 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Thu, 23 Apr 2020 15:20:29 +0300 Subject: [PATCH] feat(Dashboards): Switches to grid view (LLC-15) (#1522) --- lib/constants/dashboard.js | 4 + lib/models/dashboard.js | 1 + ui/src/components/DropDownMenu/index.js | 6 +- .../components/IconButton/CopyIconButton.js | 40 +-- ui/src/containers/Dashboard/index.js | 202 +++++++-------- ui/src/containers/Dashboard/styled/index.js | 12 + .../DashboardCard/assets/blank-dashboard.png | Bin 0 -> 2748 bytes .../DashboardCard/assets/getting-started.png | Bin 0 -> 4215 bytes .../DashboardCard/assets/private.png | Bin 0 -> 360 bytes .../DashboardCard/assets/stream-starter.png | Bin 0 -> 4288 bytes ui/src/containers/DashboardCard/index.js | 244 ++++++++++++++++++ ui/src/containers/DashboardCard/styles.css | 64 +++++ ui/src/containers/DashboardList/index.js | 142 ++++++++++ ui/src/containers/DashboardList/styles.css | 6 + ui/src/containers/DashboardTemplates/index.js | 21 +- .../DashboardTemplates/styled/index.js | 9 + ui/src/containers/Dashboards/index.js | 128 ++++----- ui/src/containers/EditConfirm/index.js | 103 ++++++++ ui/src/containers/OrganisationHome/index.js | 6 + ui/src/containers/PrivacyToggleModal/index.js | 71 +++++ ui/src/containers/Widget/index.js | 2 +- .../redux/modules/dashboard/blankDashboard.js | 1 + .../redux/modules/dashboard/gettingStarted.js | 1 + .../redux/modules/dashboard/streamStarter.js | 1 + ui/src/static/core.css | 2 +- 25 files changed, 854 insertions(+), 212 deletions(-) create mode 100644 ui/src/containers/DashboardCard/assets/blank-dashboard.png create mode 100644 ui/src/containers/DashboardCard/assets/getting-started.png create mode 100644 ui/src/containers/DashboardCard/assets/private.png create mode 100644 ui/src/containers/DashboardCard/assets/stream-starter.png create mode 100644 ui/src/containers/DashboardCard/index.js create mode 100644 ui/src/containers/DashboardCard/styles.css create mode 100644 ui/src/containers/DashboardList/index.js create mode 100644 ui/src/containers/DashboardList/styles.css create mode 100644 ui/src/containers/EditConfirm/index.js create mode 100644 ui/src/containers/PrivacyToggleModal/index.js diff --git a/lib/constants/dashboard.js b/lib/constants/dashboard.js index 17a99d86ef..13a8b7eb73 100644 --- a/lib/constants/dashboard.js +++ b/lib/constants/dashboard.js @@ -1,3 +1,7 @@ export const JWT_SECURED = 'JWT_SECURED'; export const ANY = 'ANY'; export const OFF = 'OFF'; + +export const BLANK_DASHBOARD = 'blankDashboard'; +export const STREAM_STARTER = 'streamStarter'; +export const GETTING_STARTED = 'gettingStarted'; diff --git a/lib/models/dashboard.js b/lib/models/dashboard.js index 140df0edcd..3e18e6218d 100644 --- a/lib/models/dashboard.js +++ b/lib/models/dashboard.js @@ -71,6 +71,7 @@ export const schema = new mongoose.Schema({ owner: { type: mongoose.Schema.Types.ObjectId, ref: 'User', index: true }, isPublic: { type: Boolean, default: false }, hasBeenMigrated: { type: Boolean, default: false }, + type: { type: String }, }); schema.readScopes = keys(scopes.USER_SCOPES); diff --git a/ui/src/components/DropDownMenu/index.js b/ui/src/components/DropDownMenu/index.js index c75e6f64b1..f07c9b1d18 100644 --- a/ui/src/components/DropDownMenu/index.js +++ b/ui/src/components/DropDownMenu/index.js @@ -53,9 +53,9 @@ class DropDownMenu extends Component { {this.props.button} {this.state.isOpen && -