- <%= studio_assessment.participant.id %> |
- <%= studio_assessment.staff.id %> |
+ <%= studio_assessment.participant%> |
+ <%= studio_assessment.staff%> |
<%= studio_assessment.bigpicture_score %> |
<%= studio_assessment.bigpicture_comment %> |
<%= studio_assessment.progfundamentals_score %> |
@@ -53,8 +54,8 @@
<%= studio_assessment.problemsolvingalt_comment %> |
<%= studio_assessment.passed_capstone %> |
<%= studio_assessment.capstone_comment %> |
-
<%= studio_assessment.assessment_type %> |
+ <%= studio_assessment.created_at%> |
<%= link_to 'Show', studio_assessment %> |
<%= link_to 'Edit', edit_studio_assessment_path(studio_assessment) %> |
<%= link_to 'Destroy', studio_assessment, method: :delete, data: { confirm: 'Are you sure?' } %> |
@@ -66,3 +67,6 @@
<%= link_to 'New Studio Assessment', new_studio_assessment_path %>
+<% end %>
+
+<%= react_component("StudioAssessmentDashboard", {assessments: @studio_assessments, is_admin: @user.admin? }) %>
diff --git "a/config/database.yml\342\200\251" "b/config/database.yml\342\200\251"
new file mode 100644
index 00000000..81980273
--- /dev/null
+++ "b/config/database.yml\342\200\251"
@@ -0,0 +1,85 @@
+# PostgreSQL. Versions 9.3 and up are supported.
+#
+# Install the pg driver:
+# gem install pg
+# On macOS with Homebrew:
+# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
+# On macOS with MacPorts:
+# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
+# On Windows:
+# gem install pg
+# Choose the win32 build.
+# Install PostgreSQL and put its /bin directory on your path.
+#
+# Configure Using Gemfile
+# gem 'pg'
+#
+default: &default
+ adapter: postgresql
+ encoding: unicode
+ # For details on connection pooling, see Rails configuration guide
+ # https://guides.rubyonrails.org/configuring.html#database-pooling
+ pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
+
+development:
+ <<: *default
+ database: unloop_development
+
+ # The specified database role being used to connect to postgres.
+ # To create additional roles in postgres see `$ createuser --help`.
+ # When left blank, postgres will use the default role. This is
+ # the same name as the operating system user that initialized the database.
+ #username: unloop
+
+ # The password associated with the postgres role (username).
+ #password:
+
+ # Connect on a TCP socket. Omitted by default since the client uses a
+ # domain socket that doesn't need configuration. Windows does not have
+ # domain sockets, so uncomment these lines.
+ #host: localhost
+
+ # The TCP port the server listens on. Defaults to 5432.
+ # If your server runs on a different port number, change accordingly.
+ #port: 5432
+
+ # Schema search path. The server defaults to $user,public
+ #schema_search_path: myapp,sharedapp,public
+
+ # Minimum log levels, in increasing order:
+ # debug5, debug4, debug3, debug2, debug1,
+ # log, notice, warning, error, fatal, and panic
+ # Defaults to warning.
+ #min_messages: notice
+
+# Warning: The database defined as "test" will be erased and
+# re-generated from your development database when you run "rake".
+# Do not set this db to the same as development or production.
+test:
+ <<: *default
+ database: unloop_test
+
+# As with config/credentials.yml, you never want to store sensitive information,
+# like your database password, in your source code. If your source code is
+# ever seen by anyone, they now have access to your database.
+#
+# Instead, provide the password as a unix environment variable when you boot
+# the app. Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
+# for a full rundown on how to provide these environment variables in a
+# production deployment.
+#
+# On Heroku and other platform providers, you may have a full connection URL
+# available as an environment variable. For example:
+#
+# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
+#
+# You can use this database configuration with:
+#
+# production:
+# url: <%= ENV['DATABASE_URL'] %>
+#
+production:
+ <<: *default
+ database: unloop_production
+ username: unloop
+ password: <%= ENV['UNLOOP_DATABASE_PASSWORD'] %>
diff --git a/config/routes.rb b/config/routes.rb
index cf7fe829..9800f21a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -14,6 +14,10 @@
resources :assignments, :paperworks, :case_notes, :professional_questionnaires, :personal_questionnaires, only: [:index, :show, :new, :edit]
+ get '/assignments', to: 'assignments#index'
+
+ get '/studio_assessments', to: 'studio_assessments#index'
+
resources :staffs, only: [] do
collection do
get 'dashboard', to: 'staffs#dashboard'
diff --git a/db/seeds.rb b/db/seeds.rb
index 17e022ba..730dc203 100644
--- a/db/seeds.rb
+++ b/db/seeds.rb
@@ -7,7 +7,7 @@
NUM_PROF_QUESTIONNAIRE = 25
NUM_TEMPLATE_ACTION_ITEMS = 10
NUM_ACTION_ITEMS = 25
-
+NUM_STUDIO_ASSESSMENTS = 25
STAFF_START_ID = Staff.count + 1
STAFF_END_ID = STAFF_START_ID + NUM_STAFF - 1
PARTICIPANT_START_ID = Participant.count + 1
@@ -144,6 +144,34 @@ def create_google_accounts
end
end
+def create_studio_assesments
+ 1.upto(NUM_STUDIO_ASSESSMENTS) do |i|
+ StudioAssessment.create!(
+ bigpicture_score: Faker::Number.between(from: 0, to: 3),
+ bigpicture_comment: Faker::Cannabis.buzzword,
+ progfundamentals_score: Faker::Number.between(from: 0, to: 3),
+ progfundamentals_comment: Faker::Cannabis.buzzword,
+ versioncontrol_score: Faker::Number.between(from: 0, to: 3),
+ versioncontrol_comment: Faker::Cannabis.buzzword,
+ react_score: Faker::Number.between(from: 0, to: 3),
+ react_comment: Faker::Cannabis.buzzword,
+ node_score: Faker::Number.between(from: 0, to: 3),
+ node_comment: Faker::Cannabis.buzzword,
+ db_score: Faker::Number.between(from: 0, to: 3),
+ db_comment: Faker::Cannabis.buzzword,
+ problemsolving_score: Faker::Number.between(from: 0, to: 3),
+ problemsolving_comment:Faker::Cannabis.buzzword,
+ problemsolvingalt_score: Faker::Number.between(from: 0, to: 3),
+ problemsolvingalt_comment:Faker::Cannabis.buzzword,
+ passed_capstone: Faker::Boolean.boolean,
+ capstone_comment:Faker::Cannabis.buzzword,
+ assessment_type: Faker::Hacker.say_something_smart,
+ staff_id: Faker::Number.between(from: STAFF_START_ID, to: STAFF_END_ID),
+ participant_id: Faker::Number.between(from: PARTICIPANT_START_ID, to: PARTICIPANT_END_ID)
+ )
+ end
+ puts "Created #{NUM_STUDIO_ASSESSMENTS} Studio Assessments"
+end
create_staff
create_participants
@@ -154,3 +182,4 @@ def create_google_accounts
create_questionnaires
create_template_action_items
create_assignments
+create_studio_assesments
diff --git a/spec/controllers/assignments_controller_spec.rb b/spec/controllers/assignments_controller_spec.rb
new file mode 100644
index 00000000..3652be7b
--- /dev/null
+++ b/spec/controllers/assignments_controller_spec.rb
@@ -0,0 +1,12 @@
+require 'rails_helper'
+
+RSpec.describe AssignmentsController, type: :controller do
+
+ describe "GET #index" do
+ it "returns http success" do
+ get :index
+ expect(response).to have_http_status(:success)
+ end
+ end
+
+end
diff --git a/spec/helpers/assignments_helper_spec.rb b/spec/helpers/assignments_helper_spec.rb
new file mode 100644
index 00000000..2bb91536
--- /dev/null
+++ b/spec/helpers/assignments_helper_spec.rb
@@ -0,0 +1,15 @@
+require 'rails_helper'
+
+# Specs in this file have access to a helper object that includes
+# the AssignmentsHelper. For example:
+#
+# describe AssignmentsHelper do
+# describe "string concat" do
+# it "concats two strings with spaces" do
+# expect(helper.concat_strings("this","that")).to eq("this that")
+# end
+# end
+# end
+RSpec.describe AssignmentsHelper, type: :helper do
+ pending "add some examples to (or delete) #{__FILE__}"
+end
diff --git a/spec/policies/assignment_policy_spec.rb b/spec/policies/assignment_policy_spec.rb
new file mode 100644
index 00000000..f87ead4a
--- /dev/null
+++ b/spec/policies/assignment_policy_spec.rb
@@ -0,0 +1,27 @@
+require 'rails_helper'
+
+RSpec.describe AssignmentPolicy, type: :policy do
+ let(:user) { User.new }
+
+ subject { described_class }
+
+ permissions ".scope" do
+ pending "add some examples to (or delete) #{__FILE__}"
+ end
+
+ permissions :show? do
+ pending "add some examples to (or delete) #{__FILE__}"
+ end
+
+ permissions :create? do
+ pending "add some examples to (or delete) #{__FILE__}"
+ end
+
+ permissions :update? do
+ pending "add some examples to (or delete) #{__FILE__}"
+ end
+
+ permissions :destroy? do
+ pending "add some examples to (or delete) #{__FILE__}"
+ end
+end
diff --git a/spec/views/assignments/index.html.erb_spec.rb b/spec/views/assignments/index.html.erb_spec.rb
new file mode 100644
index 00000000..1d9f1c6a
--- /dev/null
+++ b/spec/views/assignments/index.html.erb_spec.rb
@@ -0,0 +1,5 @@
+require 'rails_helper'
+
+RSpec.describe "assignments/index.html.erb", type: :view do
+ pending "add some examples to (or delete) #{__FILE__}"
+end