diff --git a/app/controllers/new_user/dossiers_controller.rb b/app/controllers/new_user/dossiers_controller.rb index 0cdb5a55a..7093665cf 100644 --- a/app/controllers/new_user/dossiers_controller.rb +++ b/app/controllers/new_user/dossiers_controller.rb @@ -28,9 +28,6 @@ module NewUser def show if dossier.brouillon? redirect_to brouillon_dossier_path(dossier) - - elsif !Flipflop.new_dossier_details? - redirect_to users_dossier_recapitulatif_path(dossier) end @dossier = dossier @@ -125,15 +122,7 @@ module NewUser flash.now.alert = errors render :modifier else - if Flipflop.new_dossier_details? - redirect_to demande_dossier_path(@dossier) - else - if current_user.owns?(dossier) - redirect_to users_dossier_recapitulatif_path(@dossier) - else - redirect_to users_dossiers_invite_path(@dossier.invite_for_user(current_user)) - end - end + redirect_to demande_dossier_path(@dossier) end end diff --git a/app/controllers/users/dossiers/invites_controller.rb b/app/controllers/users/dossiers/invites_controller.rb index 880fed4c5..c766a8ce0 100644 --- a/app/controllers/users/dossiers/invites_controller.rb +++ b/app/controllers/users/dossiers/invites_controller.rb @@ -14,10 +14,8 @@ class Users::Dossiers::InvitesController < UsersController if @facade.dossier.brouillon? redirect_to brouillon_dossier_path(@facade.dossier) - elsif Flipflop.new_dossier_details? - return redirect_to dossier_path(@facade.dossier) else - render 'users/recapitulatif/show' + return redirect_to dossier_path(@facade.dossier) end rescue ActiveRecord::RecordNotFound flash.alert = t('errors.messages.dossier_not_found') diff --git a/app/controllers/users/recapitulatif_controller.rb b/app/controllers/users/recapitulatif_controller.rb index 85dea28af..4486e64d4 100644 --- a/app/controllers/users/recapitulatif_controller.rb +++ b/app/controllers/users/recapitulatif_controller.rb @@ -4,11 +4,7 @@ class Users::RecapitulatifController < UsersController end def show - if Flipflop.new_dossier_details? - redirect_to dossier_url(current_user_dossier) - else - create_dossier_facade - end + redirect_to dossier_url(current_user_dossier) end def initiate diff --git a/app/helpers/dossier_helper.rb b/app/helpers/dossier_helper.rb index 4e9367bb4..06a7001c9 100644 --- a/app/helpers/dossier_helper.rb +++ b/app/helpers/dossier_helper.rb @@ -18,10 +18,8 @@ module DossierHelper def url_for_dossier(dossier) if dossier.brouillon? brouillon_dossier_path(dossier) - elsif Flipflop.new_dossier_details? - dossier_path(dossier) else - users_dossier_recapitulatif_path(dossier) + dossier_path(dossier) end end diff --git a/app/views/new_user/dossiers/_dossier_footer.html.haml b/app/views/new_user/dossiers/_dossier_footer.html.haml index e94e44b4a..8c6f2d11f 100644 --- a/app/views/new_user/dossiers/_dossier_footer.html.haml +++ b/app/views/new_user/dossiers/_dossier_footer.html.haml @@ -20,10 +20,7 @@ = link_to service.email, "mailto:#{service.email}" - else Directement - - if Flipflop.new_dossier_details? - = link_to "par la messagerie", messagerie_dossier_path(dossier) - - else - = link_to "par la messagerie", users_dossier_recapitulatif_path(dossier) + = link_to "par la messagerie", messagerie_dossier_path(dossier) %p Par téléphone : diff --git a/app/views/new_user/dossiers/merci.html.haml b/app/views/new_user/dossiers/merci.html.haml index d0fbc9a5a..7b6667e98 100644 --- a/app/views/new_user/dossiers/merci.html.haml +++ b/app/views/new_user/dossiers/merci.html.haml @@ -18,7 +18,4 @@ %b échanger avec un instructeur lors de sa construction et de son instruction - - if Flipflop.new_dossier_details? - = link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary' - - else - = link_to 'Accéder à votre dossier', users_dossier_recapitulatif_path(@dossier), class: 'button large primary' + = link_to 'Accéder à votre dossier', dossier_path(@dossier), class: 'button large primary' diff --git a/config/features.rb b/config/features.rb index e9eb6c48d..fcc8384c7 100644 --- a/config/features.rb +++ b/config/features.rb @@ -19,10 +19,6 @@ Flipflop.configure do feature :publish_draft feature :support_form - feature :new_dossier_details, - title: "Nouvelle page « Dossier »", - default: true - group :production do feature :remote_storage, default: ENV['FOG_ENABLED'] == 'enabled' diff --git a/spec/controllers/new_user/dossiers_controller_spec.rb b/spec/controllers/new_user/dossiers_controller_spec.rb index c7c60bcc6..352d56995 100644 --- a/spec/controllers/new_user/dossiers_controller_spec.rb +++ b/spec/controllers/new_user/dossiers_controller_spec.rb @@ -578,10 +578,7 @@ describe NewUser::DossiersController, type: :controller do end describe '#show' do - let(:new_dossier_details_enabled) { false } - before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, new_dossier_details_enabled) sign_in(user) end @@ -594,17 +591,8 @@ describe NewUser::DossiersController, type: :controller do context 'when the dossier has been submitted' do let(:dossier) { create(:dossier, :en_construction, user: user) } - - context 'and the new dossier details page is disabled' do - let(:new_dossier_details_enabled) { false } - it { is_expected.to redirect_to(users_dossier_recapitulatif_path(dossier)) } - end - - context 'and the new dossier details page is enabled' do - let(:new_dossier_details_enabled) { true } - it { expect(assigns(:dossier)).to eq(dossier) } - it { is_expected.to render_template(:show) } - end + it { expect(assigns(:dossier)).to eq(dossier) } + it { is_expected.to render_template(:show) } end end @@ -612,7 +600,6 @@ describe NewUser::DossiersController, type: :controller do let(:dossier) { create(:dossier, :en_construction, user: user) } before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true) sign_in(user) end diff --git a/spec/features/new_user/dossier_details_spec.rb b/spec/features/new_user/dossier_details_spec.rb index 61218f8be..cf99fed3d 100644 --- a/spec/features/new_user/dossier_details_spec.rb +++ b/spec/features/new_user/dossier_details_spec.rb @@ -6,7 +6,6 @@ describe 'Dossier details:' do let(:dossier) { create(:dossier, :en_construction, :for_individual, :with_commentaires, user: user, procedure: procedure) } before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true) visit_dossier dossier end diff --git a/spec/features/new_user/invite_spec.rb b/spec/features/new_user/invite_spec.rb index 70d3614f3..60b5cc0f7 100644 --- a/spec/features/new_user/invite_spec.rb +++ b/spec/features/new_user/invite_spec.rb @@ -75,10 +75,6 @@ feature 'Invitations' do context 'when the dossier is en_construction' do let!(:dossier) { create(:dossier, :for_individual, :en_construction, user: owner, procedure: procedure) } - before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, true) - end - scenario 'on dossier details, the owner of a dossier can invite another user to collaborate on the dossier', js: true do log_in(owner) navigate_to_dossier(dossier) @@ -101,47 +97,6 @@ feature 'Invitations' do end end - context 'when the dossier is en_construction (legacy UI)' do - let!(:dossier) { create(:dossier, :for_individual, :en_construction, user: owner, procedure: procedure) } - - before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, false) - end - - scenario 'on dossier details, a user can invite another user to collaborate on the dossier', js: true do - log_in(owner) - navigate_to_recapitulatif(dossier) - - legacy_send_invite_to "user_invite@exemple.fr" - - expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier)) - expect(page).to have_text("Une invitation a été envoyée à user_invite@exemple.fr.") - expect(page).to have_text("user_invite@exemple.fr") - end - - scenario 'an invited user can see and edit the dossier', js: true do - visit users_dossiers_invite_path(invite) - expect(page).to have_current_path(new_user_session_path) - - submit_login_form(invited_user.email, invited_user.password) - expect(page).to have_current_path(users_dossiers_invite_path(invite)) - expect(page).to have_no_selector('.button.invite-user-action') - expect(page).to have_text("Dossier nº #{dossier.id}") - - # We should be able to just click() the link, but Capybara detects that the - # enclosing div would be clicked instead. - expect(page).to have_link("MODIFIER", href: brouillon_dossier_path(dossier)) - visit brouillon_dossier_path(dossier) - - expect(page).to have_current_path(brouillon_dossier_path(dossier)) - fill_in "Texte obligatoire", with: "Some edited value" - click_button "Enregistrer les modifications du dossier" - - expect(page).to have_current_path(users_dossiers_invite_path(invite)) - expect(page).to have_text("Some edited value") - end - end - private def log_in(user) @@ -175,12 +130,6 @@ feature 'Invitations' do submit_login_form(invited_user.email, invited_user.password) end - def navigate_to_recapitulatif(dossier) - expect(page).to have_current_path(dossiers_path) - click_on(dossier.id) - expect(page).to have_current_path(users_dossier_recapitulatif_path(dossier)) - end - def send_invite_to(invited_email) click_on "Inviter une personne à modifier ce dossier" expect(page).to have_button("Envoyer une invitation", visible: true) @@ -188,15 +137,4 @@ feature 'Invitations' do fill_in 'invite_email', with: invited_email click_on "Envoyer une invitation" end - - def legacy_send_invite_to(invited_email) - find('.dropdown-toggle', text: "Voir les personnes impliquées").click() - expect(page).to have_button("Ajouter", visible: true) - - fill_in 'invite_email', with: invited_email - - page.accept_alert "Envoyer l'invitation ?" do - click_on "Ajouter" - end - end end diff --git a/spec/features/users/flux_de_commentaires_spec.rb b/spec/features/users/flux_de_commentaires_spec.rb deleted file mode 100644 index 12b7ec552..000000000 --- a/spec/features/users/flux_de_commentaires_spec.rb +++ /dev/null @@ -1,28 +0,0 @@ -require 'spec_helper' - -feature 'users: flux de commentaires' do - let(:user) { create(:user) } - let(:dossier) { create(:dossier, :with_entreprise, user: user, state: Dossier.states.fetch(:en_construction)) } - let(:dossier_id) { dossier.id } - - let(:champ1) { dossier.champs.first } - let(:champ2) { create(:champ, dossier: dossier, type_de_champ: create(:type_de_champ, libelle: "subtitle")) } - - let!(:commentaire1) { create(:commentaire, dossier: dossier, champ: champ1) } - let!(:commentaire2) { create(:commentaire, dossier: dossier, email: 'paul.chavard@beta.gouv.fr') } - let!(:commentaire3) { create(:commentaire, dossier: dossier, champ: champ2) } - let!(:commentaire4) { create(:commentaire, dossier: dossier, champ: champ1) } - - before do - Flipflop::FeatureSet.current.test!.switch!(:new_dossier_details, false) - login_as user, scope: :user - visit users_dossier_recapitulatif_path(dossier) - end - - scenario "seuls les commentaires généraux sont affichés" do - comments = find(".commentaires") - expect(comments).to have_selector(".content", count: 1) - expect(comments).to have_content('paul.chavard') - expect(comments).not_to have_content('paul.chavard@beta.gouv.fr') - end -end