Rename 'Dashboard' to overview in page text and also modify 'dashboard' routes to be 'overview'. Finishes #180076071

pull/1/head
Nelson Jovel 4 years ago
parent 2753888f11
commit f553c3c11c

@ -3,7 +3,7 @@
@import "colors"; @import "colors";
@import "fonts"; @import "fonts";
@import "borders"; @import "borders";
@import "dashboard"; @import "overview";
@import "navigation"; @import "navigation";
@import "buttons"; @import "buttons";
@import "@fortawesome/fontawesome-free/scss/fontawesome"; @import "@fortawesome/fontawesome-free/scss/fontawesome";

@ -1,4 +1,4 @@
class DashboardController < SqmApplicationController class OverviewController < SqmApplicationController
def index def index
@variance_chart_row_presenters = Measure.all.map(&method(:presenter_for_measure)) @variance_chart_row_presenters = Measure.all.map(&method(:presenter_for_measure))

@ -1,7 +1,7 @@
module HeaderHelper module HeaderHelper
def link_to_dashboard(district:, school:, academic_year:) def link_to_overview(district:, school:, academic_year:)
"/districts/#{district.slug}/schools/#{school.slug}/dashboard?year=#{academic_year.range}" "/districts/#{district.slug}/schools/#{school.slug}/overview?year=#{academic_year.range}"
end end
def link_to_browse(district:, school:, academic_year:) def link_to_browse(district:, school:, academic_year:)
@ -9,18 +9,18 @@ module HeaderHelper
end end
def district_url_for(district:, academic_year:) def district_url_for(district:, academic_year:)
dashboard_link(district_slug: district.slug, school_slug: district.schools.alphabetic.first.slug, academic_year_range: academic_year.range, uri_path: request.fullpath) overview_link(district_slug: district.slug, school_slug: district.schools.alphabetic.first.slug, academic_year_range: academic_year.range, uri_path: request.fullpath)
end end
def school_url_for(school:, academic_year:) def school_url_for(school:, academic_year:)
dashboard_link(district_slug: school.district.slug, school_slug: school.slug, academic_year_range: academic_year.range, uri_path: request.fullpath) overview_link(district_slug: school.district.slug, school_slug: school.slug, academic_year_range: academic_year.range, uri_path: request.fullpath)
end end
def school_mapper(school) def school_mapper(school)
{ {
name: school.name, name: school.name,
district_id: school.district_id, district_id: school.district_id,
url: district_school_dashboard_index_path(school.district, school, {year: AcademicYear.first.range}) url: district_school_overview_index_path(school.district, school, {year: AcademicYear.first.range})
} }
end end
@ -30,9 +30,9 @@ module HeaderHelper
private private
def dashboard_link(district_slug:, school_slug:, academic_year_range:, uri_path:) def overview_link(district_slug:, school_slug:, academic_year_range:, uri_path:)
if uri_path.include?("dashboard") if uri_path.include?("overview")
return "/districts/#{district_slug}/schools/#{school_slug}/dashboard?year=#{academic_year_range}" return "/districts/#{district_slug}/schools/#{school_slug}/overview?year=#{academic_year_range}"
end end
"/districts/#{district_slug}/schools/#{school_slug}/browse/teachers-and-leadership?year=#{academic_year_range}" "/districts/#{district_slug}/schools/#{school_slug}/browse/teachers-and-leadership?year=#{academic_year_range}"
end end

@ -1,4 +1,4 @@
module DashboardHelper module OverviewHelper
def format_academic_year(ay) def format_academic_year(ay)
years = ay.range.split('-') years = ay.range.split('-')
"#{years.first} 20#{years.second}" "#{years.first} 20#{years.second}"

@ -7,7 +7,7 @@ import * as ActiveStorage from "@rails/activestorage"
Rails.start() Rails.start()
Turbolinks.start() Turbolinks.start()
ActiveStorage.start() ActiveStorage.start()
import { initializeListenersForNavDropdowns, initializePopovers } from "./dashboard" import { initializeListenersForNavDropdowns, initializePopovers } from "./overview"
import { initializeListenersForHomeDropdowns } from "./home" import { initializeListenersForHomeDropdowns } from "./home"
import { showEmptyDatasetModal } from "./modal" import { showEmptyDatasetModal } from "./modal"

@ -3,7 +3,7 @@
<div class="row py-4 justify-content-between align-items-center"> <div class="row py-4 justify-content-between align-items-center">
<div class="col d-flex justify-content-start align-items-center"> <div class="col d-flex justify-content-start align-items-center">
<%= link_to image_tag('sqm_logo.png', alt: 'MCIEA School Quality Measures Dashboard', class: 'height-56'), welcome_path, class: 'me-7' %> <%= link_to image_tag('sqm_logo.png', alt: 'MCIEA School Quality Measures Dashboard', class: 'height-56'), welcome_path, class: 'me-7' %>
<a class="sub-header-3 link me-4 <%= link_weight(path: 'dashboard') %>" href="<%= link_to_dashboard(district: @district, school: @school, academic_year: @academic_year) %>">Dashboard</a> <a class="sub-header-3 link me-4 <%= link_weight(path: 'overview') %>" href="<%= link_to_overview(district: @district, school: @school, academic_year: @academic_year) %>">Overview</a>
<a class="sub-header-3 link <%= link_weight(path: 'browse') %>" href="<%= link_to_browse(district: @district, school: @school, academic_year: @academic_year) %>">Browse</a> <a class="sub-header-3 link <%= link_weight(path: 'browse') %>" href="<%= link_to_browse(district: @district, school: @school, academic_year: @academic_year) %>">Browse</a>
</div> </div>

@ -24,7 +24,7 @@ Rails.application.routes.draw do
resources :districts do resources :districts do
resources :schools, only: [:index, :show] do resources :schools, only: [:index, :show] do
resources :dashboard, only: [:index] resources :overview, only: [:index]
resources :categories, only: [:show], path: 'browse' resources :categories, only: [:show], path: 'browse'
end end
end end

@ -1,6 +1,6 @@
require 'rails_helper' require 'rails_helper'
describe DashboardController, type: :controller do describe OverviewController, type: :controller do
include BasicAuthHelper include BasicAuthHelper
let(:school) { create(:school) } let(:school) { create(:school) }
let(:district) { create(:district) } let(:district) { create(:district) }

@ -10,7 +10,7 @@ describe 'authentication' do
page.driver.browser.basic_authorize('wrong username', 'wrong password') page.driver.browser.basic_authorize('wrong username', 'wrong password')
end end
it 'does not show any information' do it 'does not show any information' do
visit dashboard_path visit overview_path
expect(page).not_to have_text(school.name) expect(page).not_to have_text(school.name)
end end
@ -21,7 +21,7 @@ describe 'authentication' do
page.driver.browser.basic_authorize(username, password) page.driver.browser.basic_authorize(username, password)
end end
it 'does show information' do it 'does show information' do
visit dashboard_path visit overview_path
expect(page).to have_text(school.name) expect(page).to have_text(school.name)
end end
@ -37,7 +37,7 @@ describe 'authentication' do
"#{username}!" "#{username}!"
end end
def dashboard_path def overview_path
district_school_dashboard_index_path(district, school, year: academic_year.range) district_school_overview_index_path(district, school, year: academic_year.range)
end end
end end

@ -65,15 +65,15 @@ describe 'District Admin', js: true do
visit '/welcome' visit '/welcome'
expect(page).to have_text("Teachers & Leadership") expect(page).to have_text("Teachers & Leadership")
go_to_school_dashboard_from_welcome_page(district, school) go_to_school_overview_from_welcome_page(district, school)
district_admin_sees_dashboard_content district_admin_sees_overview_content
click_on 'Teachers & Leadership' click_on 'Teachers & Leadership'
district_admin_sees_browse_content district_admin_sees_browse_content
click_on 'Dashboard' click_on 'Overview'
district_admin_sees_dashboard_content district_admin_sees_overview_content
click_on 'Browse' click_on 'Browse'
district_admin_sees_browse_content district_admin_sees_browse_content
@ -106,7 +106,7 @@ def district_admin_sees_problem_solving_emphasis
expect(page).to have_css("[data-for-measure-id='4C-i'][width='60.0%'][x='0.0%']") expect(page).to have_css("[data-for-measure-id='4C-i'][width='60.0%'][x='0.0%']")
end end
def go_to_school_dashboard_from_welcome_page(district, school) def go_to_school_overview_from_welcome_page(district, school)
select district.name, from: 'district-dropdown' select district.name, from: 'district-dropdown'
select school.name, from: 'school-dropdown' select school.name, from: 'school-dropdown'
click_on 'Go' click_on 'Go'
@ -125,8 +125,8 @@ def go_to_browse_page_for_school_without_data(school)
select school.name, from: 'select-school' select school.name, from: 'select-school'
end end
def go_to_dashboard_page_for_school_without_data(school) def go_to_overview_page_for_school_without_data(school)
click_on 'Dashboard' click_on 'Overview'
select school.name, from: 'select-school' select school.name, from: 'select-school'
end end
@ -140,7 +140,7 @@ def district_admin_sees_district_change
expect(page).to have_current_path(expected_path) expect(page).to have_current_path(expected_path)
end end
def district_admin_sees_dashboard_content def district_admin_sees_overview_content
expect(page).to have_select('academic-year', selected: '2020 2021') expect(page).to have_select('academic-year', selected: '2020 2021')
expect(page).to have_select('district', selected: 'Winchester') expect(page).to have_select('district', selected: 'Winchester')
expect(page).to have_select('school', selected: 'Winchester High School') expect(page).to have_select('school', selected: 'Winchester High School')

@ -13,8 +13,8 @@ describe 'SQM Application' do
end end
context 'when no measures meet their threshold' do context 'when no measures meet their threshold' do
it 'shows a modal on dashboard page' do it 'shows a modal on overview page' do
visit dashboard_path visit overview_path
expect(page).to have_css '.modal' expect(page).to have_css '.modal'
end end
@ -32,7 +32,7 @@ describe 'SQM Application' do
end end
it 'does not show a modal on any page' do it 'does not show a modal on any page' do
[dashboard_path, browse_path].each do |path| [overview_path, browse_path].each do |path|
visit path visit path
expect(page).not_to have_css '.modal' expect(page).not_to have_css '.modal'
end end
@ -49,8 +49,8 @@ describe 'SQM Application' do
"#{username}!" "#{username}!"
end end
def dashboard_path def overview_path
district_school_dashboard_index_path(district, school, year: academic_year.range) district_school_overview_index_path(district, school, year: academic_year.range)
end end
def browse_path def browse_path

@ -1,6 +1,6 @@
require 'rails_helper' require 'rails_helper'
describe 'dashboard/index.html.erb' do describe 'overview/index.html.erb' do
subject { Nokogiri::HTML(rendered) } subject { Nokogiri::HTML(rendered) }
let(:support_for_teaching) { create(:measure, name: 'Support For Teaching Development & Growth') } let(:support_for_teaching) { create(:measure, name: 'Support For Teaching Development & Growth') }

@ -1,6 +1,6 @@
require 'rails_helper' require 'rails_helper'
describe 'dashboard/_variance_chart.html.erb' do describe 'overview/_variance_chart.html.erb' do
subject { Nokogiri::HTML(rendered) } subject { Nokogiri::HTML(rendered) }
let(:higher_scoring_measure) { create(:measure) } let(:higher_scoring_measure) { create(:measure) }

Loading…
Cancel
Save