Merge pull request #5569 from betagouv/cleanup-flipper-gates

#5571 - Cleanup flipper gates
This commit is contained in:
Keirua 2020-09-17 10:07:54 +02:00 committed by GitHub
commit 503527459e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 5 additions and 25 deletions

View file

@ -16,7 +16,7 @@ module Types
end end
end end
if administrateur && Flipper.enabled?(:administrateur_graphql, administrateur.user) if administrateur
context[:authorized][demarche.id] = true context[:authorized][demarche.id] = true
true true
end end

View file

@ -85,8 +85,6 @@ class DossierOperationLog < ApplicationRecord
def self.serialize_subject(subject) def self.serialize_subject(subject)
if subject.nil? if subject.nil?
nil nil
elsif !Flipper.enabled?(:operation_log_serialize_subject)
{ id: subject.id }
else else
case subject case subject
when Dossier when Dossier

View file

@ -1,7 +1,5 @@
#main-container{ class: "col-xs-#{main_container_size}" } #main-container{ class: "col-xs-#{main_container_size}" }
.row .row
- if feature_enabled?(:team_on_strike)
= render partial: 'layouts/strike_banner'
= render partial: 'layouts/outdated_browser_banner' = render partial: 'layouts/outdated_browser_banner'
= render partial: 'layouts/pre_maintenance' = render partial: 'layouts/pre_maintenance'
.row .row

View file

@ -1,8 +0,0 @@
#strike-banner.site-banner
.container
.site-banner-icon ⚠️
.site-banner-text
%strong
En raison dune grève nationale interprofessionnelle, une partie du personnel de #{APPLICATION_NAME} ne travaille pas.
%br
Les délais de réponse aux questions techniques pourront être perturbés pendant les prochains jours.

View file

@ -20,13 +20,11 @@
= Gon::Base.render_data(camel_case: true, init: true, nonce: request.content_security_policy_nonce) = Gon::Base.render_data(camel_case: true, init: true, nonce: request.content_security_policy_nonce)
- if feature_enabled?(:xray) - if Rails.env.development? && feature_enabled?(:xray)
= stylesheet_link_tag :xray = stylesheet_link_tag :xray
%body{ id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil } %body{ id: content_for(:page_id), class: browser.platform.ios? ? 'ios' : nil }
.page-wrapper .page-wrapper
- if feature_enabled?(:team_on_strike)
= render partial: 'layouts/strike_banner'
= render partial: "layouts/outdated_browser_banner" = render partial: "layouts/outdated_browser_banner"
= render partial: 'layouts/pre_maintenance' = render partial: 'layouts/pre_maintenance'
@ -42,7 +40,7 @@
- if content_for?(:footer) - if content_for?(:footer)
= content_for(:footer) = content_for(:footer)
- if feature_enabled?(:xray) - if Rails.env.development? && feature_enabled?(:xray)
= javascript_include_tag :xray = javascript_include_tag :xray
= yield :charts_js = yield :charts_js

View file

@ -25,15 +25,12 @@ end
# A list of features to be deployed on first push # A list of features to be deployed on first push
features = [ features = [
:administrateur_champ_integer_number,
:administrateur_graphql,
:administrateur_web_hook, :administrateur_web_hook,
:insee_api_v3, :insee_api_v3,
:instructeur_bypass_email_login_token, :instructeur_bypass_email_login_token,
:autosave_dossier_draft, :autosave_dossier_draft,
:maintenance_mode, :maintenance_mode,
:mini_profiler, :mini_profiler,
:operation_log_serialize_subject,
:xray, :xray,
:carte_ign, :carte_ign,
:localization :localization

View file

@ -210,7 +210,7 @@ Rails.application.routes.draw do
# API # API
# #
authenticated :user, lambda { |user| user.administrateur_id && Flipper.enabled?(:administrateur_graphql, user) } do authenticated :user, lambda { |user| user.administrateur_id } do
mount GraphqlPlayground::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql" mount GraphqlPlayground::Rails::Engine, at: "/graphql", graphql_path: "/api/v2/graphql"
end end

View file

@ -106,10 +106,6 @@ describe API::V2::GraphqlController do
subject { post :execute, params: { query: query } } subject { post :execute, params: { query: query } }
before do
Flipper.enable(:administrateur_graphql, admin.user)
end
context "when authenticated" do context "when authenticated" do
let(:authorization_header) { ActionController::HttpAuthentication::Token.encode_credentials(token) } let(:authorization_header) { ActionController::HttpAuthentication::Token.encode_credentials(token) }

View file

@ -307,6 +307,7 @@ describe Instructeurs::DossiersController, type: :controller do
before do before do
attestation = Attestation.new attestation = Attestation.new
allow(attestation).to receive(:pdf).and_return(double(read: 'pdf', size: 2.megabytes)) allow(attestation).to receive(:pdf).and_return(double(read: 'pdf', size: 2.megabytes))
allow(attestation).to receive(:pdf_url).and_return('http://some_document_url')
allow_any_instance_of(Dossier).to receive(:build_attestation).and_return(attestation) allow_any_instance_of(Dossier).to receive(:build_attestation).and_return(attestation)
end end