mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Add category, subcategory and measure ids to the page. Finishes #179986325
This commit is contained in:
parent
cacc853518
commit
2753888f11
10 changed files with 38 additions and 5 deletions
|
|
@ -23,6 +23,17 @@
|
|||
box-shadow: 0 0 6px rgba($black, 0.25);
|
||||
}
|
||||
|
||||
.construct-id {
|
||||
@extend .font-cabin;
|
||||
@extend .weight-700;
|
||||
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.1em;
|
||||
font-size: 14px;
|
||||
color: $gray-1;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.subcategory-section {
|
||||
@extend .mt-5;
|
||||
@extend .bg-color-white;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,10 @@ class CategoryPresenter
|
|||
@category = category
|
||||
end
|
||||
|
||||
def id
|
||||
@category.category_id
|
||||
end
|
||||
|
||||
def name
|
||||
@category.name
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ class MeasurePresenter
|
|||
@school = school
|
||||
end
|
||||
|
||||
def id
|
||||
@measure.measure_id
|
||||
end
|
||||
|
||||
def name
|
||||
@measure.name
|
||||
end
|
||||
|
|
|
|||
|
|
@ -5,6 +5,10 @@ class SubcategoryPresenter
|
|||
@school = school
|
||||
end
|
||||
|
||||
def id
|
||||
@subcategory.subcategory_id
|
||||
end
|
||||
|
||||
def name
|
||||
@subcategory.name
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
<div class="measure-section mx-4">
|
||||
<p class="construct-id">Measure <%= measure_presenter.id %></p>
|
||||
<h3 class="measure-description sub-header-4 mb-5 "><%= measure_presenter.name %></h3>
|
||||
<div>
|
||||
<%= render partial: "gauge_graph", locals: { gauge: measure_presenter.gauge_presenter, gauge_class: 'gauge-graph-sm', font_class: 'weight-700' } %>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<section class="subcategory-section">
|
||||
<div class="p-7">
|
||||
|
||||
<p class="construct-id">Subcategory <%= subcategory.id %></p>
|
||||
<h2 class="sub-header-2 font-bitter mb-7"><%= subcategory.name %></h2>
|
||||
|
||||
<div class="d-flex justify-content-between align-items-end">
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<% end %>
|
||||
</nav>
|
||||
<% end %>
|
||||
|
||||
<p class="construct-id">Category <%= @category.id %></p>
|
||||
<h1 class="sub-header font-bitter color-red"><%= @category.name %></h1>
|
||||
<p class="col-8 body-large"><%= @category.description %></p>
|
||||
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ describe CategoryPresenter do
|
|||
subcategory1 = Subcategory.new(name: 'A subcategory')
|
||||
subcategory2 = Subcategory.new(name: 'Another subcategory')
|
||||
|
||||
category = Category.new(name: 'Some Category', subcategories: [subcategory1, subcategory2], description: 'A description for some Category', short_description: 'A short description for some Category')
|
||||
category = Category.new(name: 'Some Category', subcategories: [subcategory1, subcategory2], description: 'A description for some Category', short_description: 'A short description for some Category', category_id: '1')
|
||||
return CategoryPresenter.new(category: category)
|
||||
end
|
||||
|
||||
|
|
@ -38,10 +38,11 @@ describe CategoryPresenter do
|
|||
DatabaseCleaner.clean
|
||||
end
|
||||
|
||||
it 'returns the name and description of the category' do
|
||||
it 'returns the name, id and description of the category' do
|
||||
expect(category_presenter.name).to eq 'Some Category'
|
||||
expect(category_presenter.description).to eq 'A description for some Category'
|
||||
expect(category_presenter.short_description).to eq 'A short description for some Category'
|
||||
expect(category_presenter.id).to eq '1'
|
||||
end
|
||||
|
||||
it 'maps subcategories to subcategory presenters' do
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ describe MeasurePresenter do
|
|||
let(:measure) { create(:measure, measure_id: 'measure-id') }
|
||||
let(:measure_presenter) { MeasurePresenter.new(measure: measure, academic_year: academic_year, school: school) }
|
||||
|
||||
it 'returns the id of the measure' do
|
||||
expect(measure_presenter.id).to eq 'measure-id'
|
||||
end
|
||||
|
||||
it 'has an id for use in the data item accordions' do
|
||||
expect(measure_presenter.data_item_accordion_id).to eq 'data-item-accordion-measure-id'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ require 'rails_helper'
|
|||
describe SubcategoryPresenter do
|
||||
let(:academic_year) { create(:academic_year, range: '1989-90') }
|
||||
let(:school) { create(:school, name: 'Best School') }
|
||||
let(:subcategory) { create(:subcategory, name: 'A great subcategory', description: 'A great description') }
|
||||
let(:subcategory) { create(:subcategory, name: 'A great subcategory', subcategory_id: 'A', description: 'A great description') }
|
||||
let(:subcategory_presenter) do
|
||||
measure1 = create(:measure, watch_low_benchmark: 4, growth_low_benchmark: 4.25, approval_low_benchmark: 4.5, ideal_low_benchmark: 4.75, subcategory: subcategory)
|
||||
survey_item1 = create(:teacher_survey_item, measure: measure1)
|
||||
|
|
@ -31,6 +31,10 @@ describe SubcategoryPresenter do
|
|||
expect(subcategory_presenter.description).to eq 'A great description'
|
||||
end
|
||||
|
||||
it 'returns the id of the subcategory' do
|
||||
expect(subcategory_presenter.id).to eq 'A'
|
||||
end
|
||||
|
||||
it 'returns a gauge presenter responsible for the aggregate survey item response likert scores' do
|
||||
expect(subcategory_presenter.gauge_presenter.title).to eq 'Growth'
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue