Merge pull request #2412 from aignatov-bio/ai-sci-4357-dashboard-general-layout

General dashboard layout [SCI-4357][SCI-4359]
This commit is contained in:
aignatov-bio 2020-02-13 15:10:09 +01:00 committed by GitHub
commit f36e1cb8f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 121 additions and 3 deletions

View file

@ -31,6 +31,7 @@
@import "my_modules/results/*";
@import "my_modules/*";
@import "protocols/*";
@import "dashboard/*";
@import "repository/*";
@import "repository_columns/*";
@import "settings/*";

View file

@ -0,0 +1,11 @@
.dashboard-container .calendar-widget {
grid-column: 10 / span 3;
grid-row: 1 / span 6;
}
@media (max-width: 1000px) {
.dashboard-container .calendar-widget {
grid-column: 1 / span 6;
grid-row: 5 / span 4;
}
}

View file

@ -0,0 +1,11 @@
.dashboard-container .current-tasks-widget {
grid-column: 1 / span 9;
grid-row: 1 / span 6;
}
@media (max-width: 1000px) {
.dashboard-container .current-tasks-widget {
grid-column: 1 / span 12;
grid-row: 1 / span 4;
}
}

View file

@ -0,0 +1,11 @@
.dashboard-container .quick-start-widget {
grid-column: 1 / span 3;
grid-row: 7 / span 6;
}
@media (max-width: 1000px) {
.dashboard-container .quick-start-widget {
grid-column: 7 / span 6;
grid-row: 5 / span 4;
}
}

View file

@ -0,0 +1,17 @@
.dashboard-container .recent-work-widget {
grid-column: 4 / span 6;
grid-row: 7 / span 6;
}
@media (max-width: 1300px) {
.dashboard-container .recent-work-widget {
grid-column: 4 / span 9;
}
}
@media (max-width: 1000px) {
.dashboard-container .recent-work-widget {
grid-column: 1 / span 12;
grid-row: 9 / span 4;
}
}

View file

@ -0,0 +1,24 @@
.dashboard-container {
--dashboard-widgets-gap: 30px;
display: grid;
grid-column-gap: var(--dashboard-widgets-gap);
grid-row-gap: var(--dashboard-widgets-gap);
grid-template-columns: repeat(12, 1fr);
grid-template-rows: repeat(12, 1fr);
min-height: calc(100vh - 51px);
padding: var(--dashboard-widgets-gap) calc(var(--dashboard-widgets-gap) - 15px);
width: 100%;
.basic-widget {
border-radius: $border-radius-modal;
box-shadow: $flyout-shadow;
position: relative;
}
}
@media (max-width: 1300px) {
.dashboard-container {
--dashboard-widgets-gap: 16px;
}
}

View file

@ -0,0 +1,5 @@
# frozen_string_literal: true
class DashboardsController < ApplicationController
def show; end
end

View file

@ -1,4 +1,9 @@
module LeftMenuBarHelper
def dashboard_are_selected?
controller_name == 'dashboards'
end
def projects_are_selected?
controller_name.in? %w(projects experiments my_modules)
end

View file

@ -0,0 +1,2 @@
<div class="calendar-widget basic-widget">
</div>

View file

@ -0,0 +1,2 @@
<div class="current-tasks-widget basic-widget">
</div>

View file

@ -0,0 +1,2 @@
<div class="quick-start-widget basic-widget">
</div>

View file

@ -0,0 +1,2 @@
<div class="recent-work-widget basic-widget">
</div>

View file

@ -0,0 +1,8 @@
<% provide :head_title, t('nav.label.dashboard') %>
<div class="dashboard-container">
<%= render "calendar" %>
<%= render "current_tasks" %>
<%= render "recent_work" %>
<%= render "quick_start" %>
</div>

View file

@ -2,6 +2,12 @@
<div class="scroll-wrapper">
<ul class="nav">
<% if current_user.teams.empty? %>
<li class="disabled">
<span>
<span class="fas fa-thumbtack"></span>
<span><%= t('left_menu_bar.dashboard') %></span>
</span>
</li>
<li class="disabled">
<span>
<span class="fas fa-folder"></span>
@ -27,6 +33,12 @@
</span>
</li>
<% else %>
<li class="<%= "active" if dashboard_are_selected? %>">
<%= link_to dashboard_path, id: "dashboard-link", title: t('left_menu_bar.dashboard') do %>
<span class="fas fa-thumbtack"></span>
<span><%= t('left_menu_bar.dashboard') %></span>
<% end %>
</li>
<li class="<%= "active" if projects_are_selected? %>">
<%= link_to projects_path, id: "projects-link", title: t('left_menu_bar.projects') do %>
<span class="fas fa-folder"></span>

View file

@ -135,7 +135,8 @@ en:
none: "No activities!"
label:
scinote: "SciNote"
projects: "Home"
dashboard: "Overview"
projects: "Projects"
protocols: "Protocols"
calendar: "Calendar"
activities: "Activities"
@ -152,6 +153,7 @@ en:
addon_versions: "Addon versions"
left_menu_bar:
dashboard: "Overview"
projects: "Projects"
repositories: "Inventories"
templates: "Protocols"
@ -257,7 +259,7 @@ en:
projects:
index:
head_title: "Home"
head_title: "Projects"
archive: "Archive"
archived: "Archived"
active: "Active"

View file

@ -16,7 +16,7 @@ Rails.application.routes.draw do
confirmations: 'users/confirmations',
omniauth_callbacks: 'users/omniauth_callbacks' }
root 'projects#index'
root 'dashboards#show'
# # Client APP endpoints
# get '/settings', to: 'client_api/settings#index'
@ -240,6 +240,9 @@ Rails.application.routes.draw do
defaults: { format: 'json' }
post 'reports/destroy', to: 'reports#destroy'
resource :dashboard, only: :show do
end
resources :projects, except: [:new, :destroy] do
resources :user_projects, path: '/users',
only: [:create, :index, :update, :destroy]