From 9bff7afabb36c31a432e30b601599340c46b0ec9 Mon Sep 17 00:00:00 2001 From: gregoirenovel Date: Thu, 22 Nov 2018 00:41:18 +0100 Subject: [PATCH 1/4] [Fix #233] Remove the champ_id column on commentaires --- .../20181121234008_remove_champ_id_from_commentaires.rb | 5 +++++ db/schema.rb | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20181121234008_remove_champ_id_from_commentaires.rb diff --git a/db/migrate/20181121234008_remove_champ_id_from_commentaires.rb b/db/migrate/20181121234008_remove_champ_id_from_commentaires.rb new file mode 100644 index 000000000..e8bb7f80d --- /dev/null +++ b/db/migrate/20181121234008_remove_champ_id_from_commentaires.rb @@ -0,0 +1,5 @@ +class RemoveChampIdFromCommentaires < ActiveRecord::Migration[5.2] + def change + remove_column :commentaires, :champ_id + end +end diff --git a/db/schema.rb b/db/schema.rb index b77ed7444..41ef703c6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2018_11_08_151929) do +ActiveRecord::Schema.define(version: 2018_11_21_234008) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -188,9 +188,7 @@ ActiveRecord::Schema.define(version: 2018_11_08_151929) do t.integer "dossier_id" t.datetime "updated_at", null: false t.integer "piece_justificative_id" - t.integer "champ_id" t.string "file" - t.index ["champ_id"], name: "index_commentaires_on_champ_id" t.index ["dossier_id"], name: "index_commentaires_on_dossier_id" end From ad991a2fe55778d909a2a1a1170a9eea16e597b2 Mon Sep 17 00:00:00 2001 From: Frederic Merizen Date: Thu, 22 Nov 2018 15:26:12 +0100 Subject: [PATCH 2/4] Show user on dossier page in manager --- app/dashboards/dossier_dashboard.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/dashboards/dossier_dashboard.rb b/app/dashboards/dossier_dashboard.rb index b329da0cd..456b3f3a4 100644 --- a/app/dashboards/dossier_dashboard.rb +++ b/app/dashboards/dossier_dashboard.rb @@ -11,6 +11,7 @@ class DossierDashboard < Administrate::BaseDashboard id: Field::Number.with_options(searchable: true), procedure: Field::HasOne, state: Field::String, + user: Field::BelongsTo, text_summary: Field::String.with_options(searchable: false), created_at: Field::DateTime, updated_at: Field::DateTime, @@ -36,6 +37,7 @@ class DossierDashboard < Administrate::BaseDashboard :text_summary, :state, :procedure, + :user, :types_de_champ, :created_at, :updated_at, From 804f0665e397a367a97084ba92d52ad03ba051c2 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Thu, 22 Nov 2018 18:26:18 +0100 Subject: [PATCH 3/4] Re-enable releases cleanup --- config/deploy.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/config/deploy.rb b/config/deploy.rb index 5a36ae2ac..ad139f136 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -110,6 +110,7 @@ task :deploy do invoke :'service:restart_puma' invoke :'service:reload_nginx' invoke :'service:restart_delayed_job' + invoke :'deploy:cleanup' end end end From 0d02f5896ed113b793c0ee56c567b35dfa7c7988 Mon Sep 17 00:00:00 2001 From: pedong Date: Thu, 22 Nov 2018 18:28:08 +0100 Subject: [PATCH 4/4] [Fix #1339] properly display avis confidentiality to experts --- .../avis/instruction.html.haml | 10 ++++++--- .../avis/instruction.html.haml_spec.rb | 21 +++++++++++++++++++ 2 files changed, 28 insertions(+), 3 deletions(-) create mode 100644 spec/views/new_gestionnaire/avis/instruction.html.haml_spec.rb diff --git a/app/views/new_gestionnaire/avis/instruction.html.haml b/app/views/new_gestionnaire/avis/instruction.html.haml index 1cdeba6d6..2b26eb134 100644 --- a/app/views/new_gestionnaire/avis/instruction.html.haml +++ b/app/views/new_gestionnaire/avis/instruction.html.haml @@ -15,9 +15,13 @@ = f.text_area :answer, rows: 3, placeholder: 'Votre avis', required: true .flex.justify-between.align-baseline %p.confidentiel.flex - %span.icon.lock - %span - Cet avis est confidentiel et n'est pas affiché aux autres experts consultés + - if @avis.confidentiel? + %span.icon.lock + %span + Cet avis est confidentiel et n'est pas affiché aux autres experts consultés + - else + %span + Cet avis est partagé avec les autres experts .send-wrapper = f.submit 'Envoyer votre avis', class: 'button send' diff --git a/spec/views/new_gestionnaire/avis/instruction.html.haml_spec.rb b/spec/views/new_gestionnaire/avis/instruction.html.haml_spec.rb new file mode 100644 index 000000000..0d23b7b75 --- /dev/null +++ b/spec/views/new_gestionnaire/avis/instruction.html.haml_spec.rb @@ -0,0 +1,21 @@ +describe 'new_gestionnaire/avis/instruction.html.haml', type: :view do + let(:avis) { create(:avis, confidentiel: confidentiel) } + + before do + assign(:avis, avis) + @dossier = create(:dossier, :accepte) + allow(view).to receive(:current_gestionnaire).and_return(avis.gestionnaire) + end + + subject { render } + + context 'with a confidential avis' do + let(:confidentiel) { true } + it { is_expected.to have_text("Cet avis est confidentiel et n'est pas affiché aux autres experts consultés") } + end + + context 'with a not confidential avis' do + let(:confidentiel) { false } + it { is_expected.to have_text("Cet avis est partagé avec les autres experts") } + end +end