diff --git a/app/assets/uswds/_uswds-theme.scss b/app/assets/uswds/_uswds-theme.scss
index 8517c523..710282da 100644
--- a/app/assets/uswds/_uswds-theme.scss
+++ b/app/assets/uswds/_uswds-theme.scss
@@ -54,7 +54,7 @@ Add a list of changed settings in the form $setting: value.
}
.icon-white {
- filter: invert(99%) sepia(2%) saturate(3661%) hue-rotate(191deg) brightness(117%) contrast(80%);
+ filter: invert(99%) sepia(2%) saturate(3661%) hue-rotate(191deg) brightness(117%) contrast(80%);
}
.usa-social-link {
diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb
new file mode 100644
index 00000000..e054fb09
--- /dev/null
+++ b/app/helpers/dashboard_helper.rb
@@ -0,0 +1,36 @@
+# frozen_string_literal: true
+
+module DashboardHelper
+ def dashboard_cards_by_role
+ {
+ challenge_manager: [
+ { image_path: 'emoji_events', href: 'http://localhost:4000/', alt: 'challenges', title: 'Challenges',
+ subtitle: 'Create and manage challenges.' },
+ { image_path: 'people', href: 'manage_submissions', alt: 'submissions', title: 'Submissions',
+ subtitle: 'Manage submissions, evaluations, and evaluators.' },
+ { image_path: 'content_copy', href: 'evaluation_forms', alt: 'evaluation forms', title: 'Evaluation Forms',
+ subtitle: 'Create and manage evaluation forms.' },
+ { image_path: 'map', href: 'user_guide', alt: 'resources', title: 'Resources',
+ subtitle: 'Learn how to make the most of the platform.' },
+ { image_path: 'support_agent', href: 'federal-agency-faqs', alt: 'help', title: 'Help',
+ subtitle: 'Get support on the Challenge.Gov platform.' }
+ ],
+ evaluator: [
+ { image_path: 'content_copy', href: 'manage_submissions', alt: 'submissions', title: 'Submissions',
+ subtitle: 'Evaluate my assigned submissions.' },
+ { image_path: 'map', href: 'user_guide', alt: 'user guides', title: 'Resources',
+ subtitle: 'Learn how to make the most of the platform.' },
+ { image_path: 'support_agent', href: 'federal-agency-faqs', alt: 'help', title: 'Help',
+ subtitle: 'Get support on the Challenge.Gov platform.' }
+ ],
+ solver: []
+ }
+ end
+
+ def dashboard_title
+ {
+ challenge_manager: "Challenge Manager Evaluation Dashboard",
+ evaluator: "Evaluator Dashboard"
+ }
+ end
+end
diff --git a/app/views/dashboard/_dashboard.html.erb b/app/views/dashboard/_dashboard.html.erb
new file mode 100644
index 00000000..bd6200f2
--- /dev/null
+++ b/app/views/dashboard/_dashboard.html.erb
@@ -0,0 +1,9 @@
+
+ <%= dashboard_title[role] %>
+ <% dashboard_cards_by_role[role].each_slice(2) do |card1, card2| %>
+
+ <%= render partial: "dashboard_card", locals: { card: card1 } %>
+ <%= render partial: "dashboard_card", locals: { card: card2 } if card2 %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/dashboard/_dashboard_card.html.erb b/app/views/dashboard/_dashboard_card.html.erb
new file mode 100644
index 00000000..8bc4bf15
--- /dev/null
+++ b/app/views/dashboard/_dashboard_card.html.erb
@@ -0,0 +1,15 @@
+
+ <%= link_to(card[:href],
+ class: "display-flex bg-primary-darker text-white flex-align-center height-card text-no-underline"
+ ) do %>
+ <%= image_tag(
+ "images/usa-icons/#{card[:image_path]}.svg",
+ class: "usa-icon--size-7 icon-white margin-x-2",
+ alt: card[:alt]
+ )%>
+
+
<%= card[:title] %>
+
<%= card[:subtitle] %>
+
+ <% end %>
+
\ No newline at end of file
diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb
index 6ad9218c..dbdf1482 100644
--- a/app/views/dashboard/index.html.erb
+++ b/app/views/dashboard/index.html.erb
@@ -1,11 +1,9 @@
-
-
+
<% if logged_in? %>
- Logged In Dashboard Index
+ <%= render partial: "dashboard", locals: { role: current_user.role.to_sym } %>
<% else %>
- Logged Out Dashboard Index
+
Logged Out Dashboard Index
<% end %>
-
\ No newline at end of file
diff --git a/app/views/evaluation_forms/index.html.erb b/app/views/evaluation_forms/index.html.erb
index c93238e6..d3f942ee 100644
--- a/app/views/evaluation_forms/index.html.erb
+++ b/app/views/evaluation_forms/index.html.erb
@@ -1,4 +1,4 @@
-
+
Evaluation Forms
diff --git a/app/views/evaluations/index.html.erb b/app/views/evaluations/index.html.erb
index c4b53c2e..7a7cbbd9 100644
--- a/app/views/evaluations/index.html.erb
+++ b/app/views/evaluations/index.html.erb
@@ -1,4 +1,4 @@
-
+
Evaluations
diff --git a/app/views/manage_submissions/index.html.erb b/app/views/manage_submissions/index.html.erb
index 7eb48703..d3797af9 100644
--- a/app/views/manage_submissions/index.html.erb
+++ b/app/views/manage_submissions/index.html.erb
@@ -1,4 +1,4 @@
-
+
Manage Submissions
diff --git a/app/views/sessions/new.html.erb b/app/views/sessions/new.html.erb
index 90386bdc..30477bfa 100644
--- a/app/views/sessions/new.html.erb
+++ b/app/views/sessions/new.html.erb
@@ -1,4 +1,4 @@
-
+
You must accept the U.S. Government System terms to sign into this website
diff --git a/spec/requests/dashboard_request_spec.rb b/spec/requests/dashboard_request_spec.rb
index 40124571..9d0a063b 100644
--- a/spec/requests/dashboard_request_spec.rb
+++ b/spec/requests/dashboard_request_spec.rb
@@ -27,6 +27,7 @@
it_behaves_like "a page with utility menu links for all users"
it_behaves_like "a page with utility menu links for a challenge manager"
+ it_behaves_like "a page with dashboard content for a challenge manager"
end
context "when logged in as an evaluator on the root url" do
@@ -37,6 +38,7 @@
it_behaves_like "a page with utility menu links for all users"
it_behaves_like "a page with utility menu links for an evaluator"
+ it_behaves_like "a page with dashboard content for an evaluator"
end
end
@@ -64,6 +66,7 @@
it_behaves_like "a page with utility menu links for all users"
it_behaves_like "a page with utility menu links for a challenge manager"
+ it_behaves_like "a page with dashboard content for a challenge manager"
end
context "when logged in as an evaluator on the dashboard" do
@@ -74,6 +77,7 @@
it_behaves_like "a page with utility menu links for all users"
it_behaves_like "a page with utility menu links for an evaluator"
+ it_behaves_like "a page with dashboard content for an evaluator"
end
end
end
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index b0c677be..037abe1f 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -17,8 +17,8 @@
config.shared_context_metadata_behavior = :apply_to_host_groups
end
-def create_and_log_in_user
- user = create_user
+def create_and_log_in_user(user_attrs = {})
+ user = create_user(user_attrs)
code = "ABC123"
login_gov = instance_double(LoginGov)
allow(LoginGov).to receive(:new).and_return(login_gov)
@@ -30,8 +30,9 @@ def create_and_log_in_user
user
end
-def create_user
+def create_user(user_attrs = {})
email = "testsolver@example.gov"
token = SecureRandom.uuid
- User.create!({ email:, token: })
+ user_attrs = { email:, token: }.merge(user_attrs)
+ User.create!(user_attrs)
end
diff --git a/spec/support/shared_examples/dashboard.rb b/spec/support/shared_examples/dashboard.rb
new file mode 100644
index 00000000..7206d449
--- /dev/null
+++ b/spec/support/shared_examples/dashboard.rb
@@ -0,0 +1,16 @@
+RSpec.shared_examples "a page with dashboard content for a challenge manager" do
+ it "has the right subtitles for a challenge manager" do
+ expect(response.body).to include("Create and manage evaluation forms.")
+ expect(response.body).to include("Manage submissions, evaluations, and evaluators")
+ expect(response.body).to include("Learn how to make the most of the platform.")
+ expect(response.body).to include("Get support on the Challenge.Gov platform.")
+ end
+end
+
+RSpec.shared_examples "a page with dashboard content for an evaluator" do
+ it "has the right subtitles for an evaluator" do
+ expect(response.body).to include("Evaluate my assigned submissions.")
+ expect(response.body).to include("Learn how to make the most of the platform.")
+ expect(response.body).to include("Get support on the Challenge.Gov platform.")
+ end
+end
diff --git a/spec/system/logins_spec.rb b/spec/system/logins_spec.rb
index 345cbed5..764c0cc4 100644
--- a/spec/system/logins_spec.rb
+++ b/spec/system/logins_spec.rb
@@ -3,15 +3,35 @@
require 'rails_helper'
describe "A11y", :js do
- it "web root page is accessible" do
- visit "/"
+ describe "Logged-out" do
+ it "web root page is accessible" do
+ visit "/"
+ expect(page).to(be_axe_clean)
+ end
- expect(page).to(be_axe_clean)
+ it "dashboard index page is accessible" do
+ visit dashboard_path
+ expect(page).to(be_axe_clean)
+ end
end
- it "dashboard index page is accessible" do
- visit dashboard_path
+ describe "Logged-in as a Challenge Manager" do
+ let(:user) { create_and_log_in_user(role: "challenge_manager") }
- expect(page).to(be_axe_clean)
+ it "dashboard index page is accessible" do
+ visit dashboard_path
+ expect(user.role).to eq("challenge_manager")
+ expect(page).to(be_axe_clean)
+ end
+ end
+
+ describe "Logged-in as an Evaluator" do
+ let(:user) { create_and_log_in_user(role: "evaluator") }
+
+ it "dashboard index page is accessible" do
+ visit dashboard_path
+ expect(user.role).to eq("evaluator")
+ expect(page).to(be_axe_clean)
+ end
end
end