remove side bar in planner view

fixes FALCOR-266

Test Plan:
- Switch to list view
- notice side bar is gone
- switch back
- notice its back
- go to listview and refresh
- notice its gone
- switch views
- notice its back

Change-Id: I6d9848ba6fcbccefacbf45d4766d6ee228c807cd
Reviewed-on: https://gerrit.instructure.com/112865
Reviewed-by: Clay Diffrient <cdiffrient@instructure.com>
Tested-by: Jenkins
QA-Review: Dan Sasaki <dsasaki@instructure.com>
Product-Review: Mary Jane Anderson <manderson@instructure.com>
This commit is contained in:
Steven Burnett 2017-05-23 15:12:20 -06:00
parent a196ab624f
commit 7059a86cad
3 changed files with 8 additions and 1 deletions

View File

@ -467,6 +467,7 @@ class UsersController < ApplicationController
helper_method :show_planner? helper_method :show_planner?
def show_planner? def show_planner?
return false unless @current_user && @current_user.preferences
if @current_user.preferences[:dashboard_view] if @current_user.preferences[:dashboard_view]
@current_user.preferences[:dashboard_view] == 'planner' @current_user.preferences[:dashboard_view] == 'planner'
else else

View File

@ -86,22 +86,26 @@ export default class DashboardOptionsMenu extends React.Component {
const dashboardPlannerHeader = document.getElementById('dashboard-planner-header') || fakeObj const dashboardPlannerHeader = document.getElementById('dashboard-planner-header') || fakeObj
const dashboardActivity = document.getElementById('dashboard-activity') const dashboardActivity = document.getElementById('dashboard-activity')
const dashboardCards = document.getElementById('DashboardCard_Container') const dashboardCards = document.getElementById('DashboardCard_Container')
const rightSideContent = document.getElementById('right-side-wrapper') || fakeObj
if (newView[0] === 'planner') { if (newView[0] === 'planner') {
dashboardPlanner.style.display = 'block' dashboardPlanner.style.display = 'block'
dashboardPlannerHeader.style.display = 'block' dashboardPlannerHeader.style.display = 'block'
dashboardActivity.style.display = 'none' dashboardActivity.style.display = 'none'
dashboardCards.style.display = 'none' dashboardCards.style.display = 'none'
rightSideContent.style.display = 'none'
} else if (newView[0] === 'activity') { } else if (newView[0] === 'activity') {
dashboardPlanner.style.display = 'none' dashboardPlanner.style.display = 'none'
dashboardPlannerHeader.style.display = 'none' dashboardPlannerHeader.style.display = 'none'
dashboardActivity.style.display = 'block' dashboardActivity.style.display = 'block'
dashboardCards.style.display = 'none' dashboardCards.style.display = 'none'
rightSideContent.style.display = 'block'
} else { } else {
dashboardPlanner.style.display = 'none' dashboardPlanner.style.display = 'none'
dashboardPlannerHeader.style.display = 'none' dashboardPlannerHeader.style.display = 'none'
dashboardActivity.style.display = 'none' dashboardActivity.style.display = 'none'
dashboardCards.style.display = 'block' dashboardCards.style.display = 'block'
rightSideContent.style.display = 'block'
} }
} }

View File

@ -27,7 +27,9 @@
<% end %> <% end %>
<% content_for :right_side do %> <% content_for :right_side do %>
<div class="placeholder"></div> <% if !show_planner? %>
<div class="placeholder"></div>
<% end %>
<% end %> <% end %>
<div id="dashboard"> <div id="dashboard">