Skip to content

Commit

Permalink
remove graphql feature flag
Browse files Browse the repository at this point in the history
closes RECNVS-332

Test plan:
  * context cards should work (they should not use the REST API)
  * graphql should work

Change-Id: I30f273e52a6d5e64dd049c3583211e545605f6e2
Reviewed-on: https://gerrit.instructure.com/141966
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <[email protected]>
QA-Review: Jonathan Featherstone <[email protected]>
Product-Review: Cameron Matheson <[email protected]>
  • Loading branch information
cmatheson committed Mar 5, 2018
1 parent 29e1b69 commit d84d8d0
Show file tree
Hide file tree
Showing 10 changed files with 1 addition and 447 deletions.
1 change: 0 additions & 1 deletion app/controllers/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ def js_env(hash = {}, overwrite = false)
@js_env[:ping_url] = polymorphic_url([:api_v1, @context, :ping]) if @context.is_a?(Course)
@js_env[:TIMEZONE] = Time.zone.tzinfo.identifier if !@js_env[:TIMEZONE]
@js_env[:CONTEXT_TIMEZONE] = @context.time_zone.tzinfo.identifier if !@js_env[:CONTEXT_TIMEZONE] && @context.respond_to?(:time_zone) && @context.time_zone.present?
@js_env[:GRAPHQL_ENABLED] = @domain_root_account.try(:feature_enabled?, :graphql)
unless @js_env[:LOCALE]
@js_env[:LOCALE] = I18n.locale.to_s
@js_env[:BIGEASY_LOCALE] = I18n.bigeasy_locale
Expand Down
9 changes: 0 additions & 9 deletions app/controllers/graphql_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ class GraphQLController < ApplicationController
include Api::V1

before_action :require_user, except: :execute
before_action :require_graphql_feature_flag


def execute
Expand Down Expand Up @@ -40,12 +39,4 @@ def graphiql
render :graphiql, layout: 'bare'
end
end

private

def require_graphql_feature_flag
unless @domain_root_account.feature_enabled?("graphql")
render plain: "not found", status: 404
end
end
end
90 changes: 0 additions & 90 deletions app/jsx/context_cards/RestStudentContextTray.js

This file was deleted.

117 changes: 0 additions & 117 deletions app/jsx/context_cards/StudentCardStore.js

This file was deleted.

7 changes: 1 addition & 6 deletions app/jsx/context_cards/StudentContextCardTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@
import $ from 'jquery'
import React from 'react'
import ReactDOM from 'react-dom'
import GraphQLStudentContextTray from '../context_cards/GraphQLStudentContextTray'
import RestStudentContextTray from '../context_cards/RestStudentContextTray'

const StudentContextTray = ENV.GRAPHQL_ENABLED
? GraphQLStudentContextTray
: RestStudentContextTray;
import StudentContextTray from '../context_cards/GraphQLStudentContextTray'

const handleClickEvent = (event) => {
const studentId = $(event.target).attr('data-student_id');
Expand Down
8 changes: 0 additions & 8 deletions lib/feature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -576,14 +576,6 @@ def self.register(feature_hash)
beta: true,
development: false
},
'graphql' =>
{
display_name: -> { I18n.t("GraphQL API") },
description: -> { I18n.t("EXPERIMENTAL GraphQL API.") },
applies_to: "RootAccount",
state: "on",
beta: true,
},
'rubric_criterion_range' =>
{
display_name: -> { I18n.t('Rubric Criterion Range') },
Expand Down
4 changes: 0 additions & 4 deletions spec/controllers/graphql_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
end

context "graphiql" do
before { Account.default.enable_feature!("graphql") }

it "requires a user" do
get :graphiql
expect(response.location).to match /\/login$/
Expand Down Expand Up @@ -56,8 +54,6 @@
end

context "graphql" do
before { Account.default.enable_feature!("graphql") }

it "works" do
post :execute, params: {query: "{}"}
expect(JSON.parse(response.body)["errors"]).not_to be_blank
Expand Down
43 changes: 0 additions & 43 deletions spec/graphql/selenium/context_card_selenium_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ def grade_assignment(course, student, grader)
@section = @course.default_section
add_enrollment('active', @section)
grade_assignment(@course, @student, @teacher)
Account.default.enable_feature!(:graphql)
Account.default.enable_feature!(:student_context_cards)
end

Expand Down Expand Up @@ -84,7 +83,6 @@ def grade_assignment(course, student, grader)
@section = @course.default_section
add_enrollment('active', @section)
grade_assignment(@course, @student, @admin)
Account.default.enable_feature!(:graphql)
Account.default.enable_feature!(:student_context_cards)
end

Expand Down Expand Up @@ -138,45 +136,4 @@ def grade_assignment(course, student, grader)
expect(cool_link["href"]).to include("/courses/#{@course.id}/grades/#{@student.id}")
end
end

context 'with graphql disabled as an admin' do
before :each do
course_with_admin_logged_in
@section = @course.default_section
add_enrollment('active', @section)
grade_assignment(@course, @student, @admin)
Account.default.disable_feature!(:graphql)
Account.default.enable_feature!(:student_context_cards)
end

it "should should pull student context card data from graphql on people page", priority: "2", test_id: 3308083 do
get "/courses/#{@course.id}/users"
wait_for_ajaximations
f("a[data-student_id='#{@student.id}']").click
wait_for_ajaximations
expect(f(".StudentContextTray-Header__Name h2 a")).to include_text("User")
cool_link = f(".StudentContextTray-Header__Name h2 a")
expect(cool_link["href"]).to include("/courses/#{@course.id}/users/#{@student.id}")
end

it "should link to student submissions page", priority: "2", test_id: 3431682 do
get "/courses/#{@course.id}/users"
wait_for_ajaximations
f("a[data-student_id='#{@student.id}']").click
wait_for_ajaximations
expect(f(".StudentContextTray-Header__Name h2 a")).to include_text("User")
cool_link = f(".StudentContextTray-Progress__Bar a")
expect(cool_link["href"]).to include("/courses/#{@course.id}/assignments/#{@ass.id}/submissions/#{@student.id}")
end

it "should link to grades page", priority: "2", test_id: 3431710 do
get "/courses/#{@course.id}/users"
wait_for_ajaximations
f("a[data-student_id='#{@student.id}']").click
wait_for_ajaximations
expect(f(".StudentContextTray-Header__Name h2 a")).to include_text("User")
cool_link = f(".StudentContextTray-QuickLinks a")
expect(cool_link["href"]).to include("/courses/#{@course.id}/grades/#{@student.id}")
end
end
end
Loading

0 comments on commit d84d8d0

Please sign in to comment.