Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete unused user-hero #23862

Merged
merged 2 commits into from
Jul 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.