remove feature flag zonage
This commit is contained in:
parent
1e200262dc
commit
11a18516b2
9 changed files with 14 additions and 6 deletions
|
@ -653,7 +653,7 @@ class Procedure < ApplicationRecord
|
|||
end
|
||||
|
||||
def missing_zones?
|
||||
if feature_enabled?(:zonage)
|
||||
if Rails.application.config.ds_zonage_enabled
|
||||
zones.empty?
|
||||
else
|
||||
false
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
%h2.fr-mt-5w.fr-mb-3w.fr-h1 Indispensable avant publication
|
||||
.fr-grid-row.fr-grid-row--gutters
|
||||
= render Procedure::Card::PresentationComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ZonesComponent.new(procedure: @procedure) if @procedure.feature_enabled?(:zonage)
|
||||
= render Procedure::Card::ZonesComponent.new(procedure: @procedure) if Rails.application.config.ds_zonage_enabled
|
||||
= render Procedure::Card::ChampsComponent.new(procedure: @procedure)
|
||||
= render Procedure::Card::ServiceComponent.new(procedure: @procedure, administrateur: current_administrateur)
|
||||
= render Procedure::Card::AdministrateursComponent.new(procedure: @procedure)
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
= f.label :zone do
|
||||
= t('zone', scope: 'activerecord.attributes.procedure')
|
||||
- if @procedure.feature_enabled?(:zonage)
|
||||
- if Rails.application.config.ds_zonage_enabled
|
||||
= f.collection_check_boxes :zone_ids, Zone.available_at(@procedure.published_or_created_at), :id, :label do |b|
|
||||
.editable-champ.editable-champ-checkbox
|
||||
= b.check_box
|
||||
|
|
|
@ -77,6 +77,8 @@ module TPS
|
|||
|
||||
config.ds_opendata_enabled = ENV.fetch('OPENDATA_ENABLED', nil) == 'enabled'
|
||||
|
||||
config.ds_zonage_enabled = ENV.fetch("ZONAGE_ENABLED", nil) == "enabled"
|
||||
|
||||
config.skylight.probes += [:graphql]
|
||||
|
||||
# Custom Configuration
|
||||
|
|
|
@ -149,6 +149,10 @@ DATAGOUV_API_URL="https://www.data.gouv.fr/api/1"
|
|||
DATAGOUV_DESCRIPTIF_DEMARCHES_DATASET="datasetid"
|
||||
DATAGOUV_DESCRIPTIF_DEMARCHES_RESOURCE="resourceid"
|
||||
|
||||
# Zonage
|
||||
ZONAGE_ENABLED='enabled' # zonage disabled by default if `ZONAGE_ENABLED` not set
|
||||
|
||||
|
||||
# SAML
|
||||
SAML_IDP_CERTIFICATE="idpcertificate"
|
||||
SAML_IDP_SECRET_KEY="-----BEGIN RSA PRIVATE KEY-----\nblabla+blabla\n-----END RSA PRIVATE KEY-----\n"
|
||||
|
|
|
@ -80,6 +80,8 @@ Rails.application.configure do
|
|||
status_visible_duration: 500
|
||||
}
|
||||
|
||||
config.ds_zonage_enabled = true
|
||||
|
||||
# BCrypt is slow by design - but during tests we want to make it faster
|
||||
# to compute hashes of passwords.
|
||||
silence_warnings do
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
namespace :after_party do
|
||||
desc 'Deployment task: populate_zones'
|
||||
task populate_zones: :environment do
|
||||
if Flipper.enabled? :zonage
|
||||
if Rails.application.config.ds_zonage_enabled
|
||||
puts "Running deploy task 'populate_zones'"
|
||||
collectivite = Zone.find_or_create_by!(acronym: 'COLLECTIVITE')
|
||||
coll_label = collectivite.labels.find_or_initialize_by(designated_on: Date.parse('1977-07-30'))
|
||||
|
|
|
@ -1243,7 +1243,7 @@ describe Procedure do
|
|||
|
||||
describe '.missing_zones?' do
|
||||
before do
|
||||
Flipper.enable :zonage
|
||||
Rails.application.config.ds_zonage_enabled = true
|
||||
end
|
||||
|
||||
let(:procedure) { create(:procedure, zones: []) }
|
||||
|
|
|
@ -3,7 +3,7 @@ describe 'administrateurs/procedures/zones.html.haml' do
|
|||
let(:populate_zones_task) { Rake::Task['after_party:populate_zones'] }
|
||||
|
||||
before do
|
||||
Flipper.enable(:zonage)
|
||||
Rails.application.config.ds_zonage_enabled = true
|
||||
populate_zones_task.invoke
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue