Skip to content

Commit

Permalink
Merge pull request #23862 from code-dot-org/delete-user-hero
Browse files Browse the repository at this point in the history
Delete unused user-hero
  • Loading branch information
Erin007 committed Jul 23, 2018
2 parents 6f321d7 + 35835f3 commit e4ddcf4
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 221 deletions.
1 change: 0 additions & 1 deletion dashboard/app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
* Shared
*= require user-menu
*= require user-progress
*= require user-hero
*= require teacher-announcement
*= require buttons
*= require course-blocks
Expand Down
4 changes: 0 additions & 4 deletions dashboard/app/controllers/api_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,6 @@ def user_menu
@user_header_options[:loc_prefix] = 'nav.user.'
end

def user_hero
head :not_found unless current_user
end

def update_lockable_state
updates = params.require(:updates)
updates.to_a.each do |item|
Expand Down
84 changes: 0 additions & 84 deletions dashboard/app/views/api/user_hero.html.haml

This file was deleted.

49 changes: 0 additions & 49 deletions dashboard/test/controllers/api_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -975,55 +975,6 @@ class ApiControllerTest < ActionController::TestCase
assert_equal expected_script, response["script"]
end

test "should get user_hero for teacher" do
sign_in @teacher
get :user_hero

assert_select '#welcome.teacher'
assert_select '.teacherdashboard'
end

test "should get user_hero for student with script" do
user_script = create(:user_script, script: Script.get_from_cache(Script::FLAPPY_NAME))
sign_in user_script.user

get :user_hero

assert_select '#welcome.student'
assert_select '#currentprogress', true, "Response was: #{@response.body}"
end

test "should get user_hero for student with no script" do
sign_in @student_1
get :user_hero

assert_select '#welcome.student'
assert_select '#suggestcourse', I18n.t('home.no_primary_course')
end

test "should get user_hero for student who completed all scripts" do
student = create :student
sign_in student
advertised_scripts = [
Script.hoc_2014_script, Script.frozen_script, Script.infinity_script,
Script.flappy_script, Script.playlab_script, Script.artist_script,
Script.course1_script, Script.course2_script, Script.course3_script,
Script.course4_script, Script.twenty_hour_script, Script.starwars_script,
Script.starwars_blocks_script, Script.minecraft_script
]
advertised_scripts.each do |script|
UserScript.create!(user_id: student.id, script_id: script.id, completed_at: Time.now)
end
get :user_hero

assert_select '#welcome.student'
assert_select '#suggestcourse', I18n.t(
'home.student_finished',
online_link: I18n.t('home.online'),
local_school_link: I18n.t('home.local_school')
)
end

test "user menu should open pairing dialog if asked to in the session" do
sign_in create(:student)

Expand Down
5 changes: 0 additions & 5 deletions pegasus/sites.v3/code.org/public/index.haml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ style_min: true
---
%script{src: "https://cdn.optimizely.com/js/400912536.js"}
=inline_css 'homepage.css'
=inline_css 'user-hero.css'

- cookie_key = '_user_type' + (rack_env == :production ? '' : "_#{rack_env.to_s}")
- user_type = request.cookies[cookie_key]
Expand All @@ -32,10 +31,6 @@ style_min: true
#petitionexpand{style: "display: block"}
= view :petition_expand

#user_hero
.container_responsive
#user_hero

= view :homepage_sections
= view :homepage_gallery
= view :donor_slider
Expand Down
78 changes: 0 additions & 78 deletions shared/css/user-hero.scss

This file was deleted.

0 comments on commit e4ddcf4

Please sign in to comment.