{this.props.categoryName}
diff --git a/assets/js/components/style/colors.js b/assets/js/components/style/colors.js
index 348d381..704d431 100644
--- a/assets/js/components/style/colors.js
+++ b/assets/js/components/style/colors.js
@@ -6,5 +6,10 @@ module.exports = {
darkBlue: '#33425B',
black: '#29252C',
white: '#FDFDFD',
- lightGray: '#efefef'
+ lightGray: '#efefef',
+
+ // threshold colours
+ green: '#84ba71',
+ yellow: '#e0cc47',
+ orange: '#e89f31'
}
diff --git a/assets/style/main.css b/assets/style/main.css
index 640b163..1bf83ca 100644
--- a/assets/style/main.css
+++ b/assets/style/main.css
@@ -11,7 +11,7 @@ body, html {
padding: 3px 0;
}
-.candidate-card .collapse > .panel-body {
+/*.candidate-card .collapse > .panel-body {
padding-left: 0px;
padding-right: 0px;
-}
+}*/
diff --git a/database/okcandidate_database_create.sql b/database/okcandidate_database_create.sql
index 7bda4b3..f56aaf2 100644
--- a/database/okcandidate_database_create.sql
+++ b/database/okcandidate_database_create.sql
@@ -41,11 +41,6 @@ CREATE TABLE IF NOT EXISTS category (
category_name varchar(100) NOT NULL
);
-CREATE TABLE IF NOT EXISTS data_type (
- id SERIAL PRIMARY KEY,
- type_name varchar(100) NOT NULL
-);
-
CREATE TABLE IF NOT EXISTS question (
id SERIAL PRIMARY KEY,
survey_id int NOT NULL REFERENCES survey,
@@ -82,8 +77,8 @@ CREATE TABLE IF NOT EXISTS candidate_type (
CREATE TABLE IF NOT EXISTS candidate (
id SERIAL PRIMARY KEY,
candidate_name varchar(100),
- candidate_img varchar(100),
- candidate_website varchar(100),
+ candidate_img varchar(100),
+ candidate_website varchar(100),
candidate_type_id int NOT NULL REFERENCES candidate_type
);
diff --git a/database/okcandidate_database_sampledata.sql b/database/okcandidate_database_sampledata.sql
index 463e3d1..d46e5fb 100644
--- a/database/okcandidate_database_sampledata.sql
+++ b/database/okcandidate_database_sampledata.sql
@@ -298,7 +298,259 @@ INSERT INTO candidate_answer (id, candidate_id, question_id, answer_id, intensit
(105,7,33,89,5),
(106,7,34,90,5),
(107,7,35,93,5),
-(108,7,36,96,5);
+(108,7,36,96,5),
+(109,10,1,1,5),
+(110,10,2,4,5),
+(111,10,3,9,5),
+(112,10,4,11,5),
+(113,10,5,14,5),
+(114,10,6,16,5),
+(115,10,7,19,5),
+(116,10,8,20,5),
+(117,10,9,22,5),
+(118,10,10,26,5),
+(119,10,11,28,5),
+(120,10,12,31,5),
+(121,10,13,33,5),
+(122,10,14,35,5),
+(123,10,15,38,5),
+(124,10,16,41,5),
+(125,10,17,43,5),
+(126,10,18,46,5),
+(127,10,19,49,5),
+(128,10,20,53,5),
+(129,10,21,56,5),
+(130,10,22,58,5),
+(131,10,23,60,5),
+(132,10,24,62,5),
+(133,10,25,66,5),
+(134,10,26,67,5),
+(135,10,27,70,5),
+(136,10,28,73,5),
+(137,10,29,78,5),
+(138,10,30,79,5),
+(139,10,31,82,5),
+(140,10,32,84,5),
+(141,10,33,87,5),
+(142,10,34,90,5),
+(143,10,35,94,5),
+(144,10,36,96,5),
+(145,4,1,1,5),
+(146,4,2,4,5),
+(147,4,3,9,5),
+(148,4,4,12,5),
+(149,4,5,14,5),
+(150,4,6,17,5),
+(151,4,7,19,5),
+(152,4,8,20,5),
+(153,4,9,23,1),
+(154,4,10,24,5),
+(155,4,11,28,5),
+(156,4,12,31,5),
+(157,4,13,34,5),
+(158,4,14,35,5),
+(159,4,15,40,5),
+(160,4,16,41,5),
+(161,4,17,43,5),
+(162,4,18,46,5),
+(163,4,19,50,5),
+(164,4,20,52,5),
+(165,4,21,57,5),
+(166,4,22,58,5),
+(167,4,23,60,5),
+(168,4,24,62,3),
+(169,4,25,66,5),
+(170,4,26,69,2),
+(171,4,27,71,4),
+(172,4,28,73,4),
+(173,4,29,78,5),
+(174,4,30,80,5),
+(175,4,31,83,5),
+(176,4,32,85,5),
+(177,4,33,88,5),
+(178,4,34,92,3),
+(179,4,35,94,4),
+(180,4,36,96,5),
+(181,2,1,1,5),
+(182,2,2,4,5),
+(183,2,3,9,5),
+(184,2,4,12,5),
+(185,2,5,14,5),
+(186,2,6,16,5),
+(187,2,7,19,5),
+(188,2,8,20,5),
+(189,2,9,22,5),
+(190,2,10,26,5),
+(191,2,11,28,5),
+(192,2,12,32,5),
+(193,2,13,34,5),
+(194,2,14,35,5),
+(195,2,15,40,5),
+(196,2,16,41,5),
+(197,2,17,44,3),
+(198,2,18,45,5),
+(199,2,19,50,5),
+(200,2,20,52,5),
+(201,2,21,57,5),
+(202,2,22,58,5),
+(203,2,23,60,5),
+(204,2,24,62,3),
+(205,2,25,66,5),
+(206,2,26,69,5),
+(207,2,27,70,5),
+(208,2,28,73,5),
+(209,2,29,78,5),
+(210,2,30,79,5),
+(211,2,31,83,5),
+(212,2,32,85,5),
+(213,2,33,88,5),
+(214,2,34,91,4),
+(215,2,35,94,5),
+(216,2,36,96,5),
+(217,5,1,2,3),
+(218,5,2,5,3),
+(219,5,3,9,3),
+(220,5,4,13,3),
+(221,5,5,14,4),
+(222,5,6,17,4),
+(223,5,7,18,5),
+(224,5,8,20,2),
+(225,5,9,23,1),
+(226,5,10,27,4),
+(227,5,11,28,3),
+(228,5,12,31,5),
+(229,5,13,34,5),
+(230,5,14,35,5),
+(231,5,15,40,5),
+(232,5,16,42,2),
+(233,5,17,43,5),
+(234,5,18,46,3),
+(235,5,19,50,4),
+(236,5,20,53,3),
+(237,5,21,57,4),
+(238,5,22,58,5),
+(239,5,23,60,4),
+(240,5,24,63,2),
+(241,5,25,64,3),
+(242,5,26,68,3),
+(243,5,27,71,2),
+(244,5,28,73,3),
+(245,5,29,78,4),
+(246,5,30,81,2),
+(247,5,31,83,4),
+(248,5,32,84,5),
+(249,5,33,87,5),
+(250,5,34,92,1),
+(251,5,35,94,3),
+(252,5,36,97,5),
+(253,1,1,1,5),
+(254,1,2,4,5),
+(255,1,3,7,5),
+(256,1,4,12,5),
+(257,1,5,14,4),
+(258,1,6,16,5),
+(259,1,7,19,5),
+(260,1,8,20,5),
+(261,1,9,23,1),
+(262,1,10,26,5),
+(263,1,11,28,5),
+(264,1,12,32,5),
+(265,1,13,34,5),
+(266,1,14,35,5),
+(267,1,15,40,5),
+(268,1,16,42,1),
+(269,1,17,44,5),
+(270,1,18,48,5),
+(271,1,19,50,5),
+(272,1,20,53,5),
+(273,1,21,57,5),
+(274,1,22,59,5),
+(275,1,23,61,5),
+(276,1,24,62,1),
+(277,1,25,65,5),
+(278,1,26,68,3),
+(279,1,27,70,3),
+(280,1,28,74,4),
+(281,1,29,76,5),
+(282,1,30,81,3),
+(283,1,31,83,5),
+(284,1,32,85,5),
+(285,1,33,89,5),
+(286,1,34,92,1),
+(287,1,35,94,5),
+(288,1,36,97,5),
+(289,3,1,1,5),
+(290,3,2,4,5),
+(291,3,3,9,5),
+(292,3,4,12,5),
+(293,3,5,14,5),
+(294,3,6,16,5),
+(295,3,7,18,5),
+(296,3,8,20,5),
+(297,3,9,22,4),
+(298,3,10,24,5),
+(299,3,11,28,4),
+(300,3,12,31,5),
+(301,3,13,33,5),
+(302,3,14,35,5),
+(303,3,15,39,5),
+(304,3,16,41,5),
+(305,3,17,44,5),
+(306,3,18,46,5),
+(307,3,19,49,5),
+(308,3,20,53,5),
+(309,3,21,55,5),
+(310,3,22,58,5),
+(311,3,23,60,5),
+(312,3,24,62,4),
+(313,3,25,66,5),
+(314,3,26,68,5),
+(315,3,27,70,5),
+(316,3,28,74,5),
+(317,3,29,78,5),
+(318,3,30,80,4),
+(319,3,31,82,5),
+(320,3,32,84,5),
+(321,3,33,89,5),
+(322,3,34,91,5),
+(323,3,35,94,5),
+(324,3,36,96,5),
+(325,9,1,1,4),
+(326,9,2,5,4),
+(327,9,3,9,3),
+(328,9,4,11,3),
+(329,9,5,15,1),
+(330,9,6,17,1),
+(331,9,7,19,5),
+(332,9,8,20,3),
+(333,9,9,23,1),
+(334,9,10,25,4),
+(335,9,11,29,2),
+(336,9,12,30,4),
+(337,9,13,33,5),
+(338,9,14,35,4),
+(339,9,15,38,5),
+(340,9,16,42,3),
+(341,9,17,44,5),
+(342,9,18,47,3),
+(343,9,19,51,4),
+(344,9,20,53,4),
+(345,9,21,57,3),
+(346,9,22,58,5),
+(347,9,23,60,5),
+(348,9,24,62,1),
+(349,9,25,64,4),
+(350,9,26,68,3),
+(351,9,27,70,4),
+(352,9,28,74,3),
+(353,9,29,78,4),
+(354,9,30,79,4),
+(355,9,31,82,5),
+(356,9,32,85,5),
+(357,9,33,89,5),
+(358,9,34,91,1),
+(359,9,35,95,5),
+(360,9,36,97,5);
-------------------------
-- Candidate Geography --
diff --git a/design/loading survey.png b/design/loading survey.png
new file mode 100644
index 0000000..2f3fe82
Binary files /dev/null and b/design/loading survey.png differ
diff --git a/design/okcandidate-wireframes.bmpr b/design/okcandidate-wireframes.bmpr
index d81e9d5..e8a09a0 100644
Binary files a/design/okcandidate-wireframes.bmpr and b/design/okcandidate-wireframes.bmpr differ
diff --git a/test/frontend/components/atoms/CandidateMatchRatingSpec.js b/test/frontend/components/atoms/CandidateMatchRatingSpec.js
new file mode 100644
index 0000000..d8c500c
--- /dev/null
+++ b/test/frontend/components/atoms/CandidateMatchRatingSpec.js
@@ -0,0 +1,111 @@
+import React from 'react'
+import TestUtils from 'react-addons-test-utils'
+import { expect } from 'chai'
+
+import CandidateMatchRating
+ from '../../../../assets/js/components/atoms/CandidateMatchRating'
+import colours
+ from '../../../../assets/js/components/style/colors'
+
+describe('The candidate match rating component', () => {
+ let rating
+
+ beforeEach(() => {
+ rating = TestUtils.renderIntoDocument(
+
+ )
+ })
+
+ it('will exist', () => {
+ expect(rating).to.be.ok
+ })
+
+ context('colour', () => {
+ let colour
+
+ beforeEach(() => {
+ colour = rating.colour
+ })
+
+ it('will exist', () => {
+ expect(colour).to.be.ok
+ })
+
+ it('will start with the red colour in the common style colours', () => {
+ expect(colour).to.equal(colours.red)
+ })
+ })
+
+ context('container style', () => {
+ let style
+
+ beforeEach(() => {
+ style = rating.getContainerStyle()
+ })
+
+ it('will exist', () => {
+ expect(style).to.be.ok
+ })
+
+ it('will have the common red style colour in its background', () => {
+ expect(style).to.have.property('background')
+ .that.equal(colours.red)
+ })
+
+ context('with a less than 50% match', () => {
+ beforeEach(() => {
+ rating = TestUtils.renderIntoDocument(
+
+ )
+ style = rating.getContainerStyle()
+ })
+
+ it('will have a red background', () => {
+ expect(style).to.have.property('background')
+ .that.equal(colours.red)
+ })
+ })
+
+ context('with a match between 50% and 60%', () => {
+ beforeEach(() => {
+ rating = TestUtils.renderIntoDocument(
+
+ )
+ style = rating.getContainerStyle()
+ })
+
+ it('will have an orange background', () => {
+ expect(style).to.have.property('background')
+ .that.equal(colours.orange)
+ })
+ })
+
+ context('with a match between 60% and 80%', () => {
+ beforeEach(() => {
+ rating = TestUtils.renderIntoDocument(
+
+ )
+ style = rating.getContainerStyle()
+ })
+
+ it('will have a yellow background', () => {
+ expect(style).to.have.property('background')
+ .that.equal(colours.yellow)
+ })
+ })
+
+ context('with a match above 80%', () => {
+ beforeEach(() => {
+ rating = TestUtils.renderIntoDocument(
+
+ )
+ style = rating.getContainerStyle()
+ })
+
+ it('will have a green background', () => {
+ expect(style).to.have.property('background')
+ .that.equal(colours.green)
+ })
+ })
+ })
+})
diff --git a/views/Default.jsx b/views/Default.jsx
index 27efe23..6c8d8bd 100644
--- a/views/Default.jsx
+++ b/views/Default.jsx
@@ -4,6 +4,16 @@ const React = require('react');
const Default = React.createClass({
+ componentDidMount() {
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga')
+
+ ga('create', 'UA-39303796-10', 'auto');
+ ga('send', 'pageview');
+ },
+
render: function() {
return(