From 959ff6be2cd7c52179fd55447de100e54020ce63 Mon Sep 17 00:00:00 2001 From: simon lehericey Date: Wed, 2 May 2018 11:28:18 +0200 Subject: [PATCH 1/3] [fix #1902] decrease session timeout to 1 hour --- config/initializers/devise.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 68eebcf50..e45172e74 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -150,7 +150,7 @@ Devise.setup do |config| # ==> Configuration for :timeoutable # The time you want to timeout the user session without activity. After this # time the user will be asked for credentials again. Default is 30 minutes. - config.timeout_in = 24.hours + config.timeout_in = 1.hour # If true, expires auth token on session timeout. # config.expire_auth_token_on_timeout = false From 7130eb6f418534f32b277bd46240bef0259c36df Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 2 May 2018 15:25:39 +0200 Subject: [PATCH 2/3] Fix Sentry #2565 --- .../20180502092852_remove_parent_procedure_foreign_key.rb | 5 +++++ db/schema.rb | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb diff --git a/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb b/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb new file mode 100644 index 000000000..5b466f851 --- /dev/null +++ b/db/migrate/20180502092852_remove_parent_procedure_foreign_key.rb @@ -0,0 +1,5 @@ +class RemoveParentProcedureForeignKey < ActiveRecord::Migration[5.2] + def change + remove_foreign_key :procedures, column: "parent_procedure_id" + end +end diff --git a/db/schema.rb b/db/schema.rb index eec9b4f96..c1b888d2c 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_04_24_130548) do +ActiveRecord::Schema.define(version: 2018_05_02_092852) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -574,7 +574,6 @@ ActiveRecord::Schema.define(version: 2018_04_24_130548) do add_foreign_key "procedure_paths", "administrateurs" add_foreign_key "procedure_paths", "procedures" add_foreign_key "procedure_presentations", "assign_tos" - add_foreign_key "procedures", "procedures", column: "parent_procedure_id" add_foreign_key "received_mails", "procedures" add_foreign_key "refused_mails", "procedures" add_foreign_key "without_continuation_mails", "procedures" From 3e50903b66b149735161457bbed4af8713b7e946 Mon Sep 17 00:00:00 2001 From: Mathieu Magnin Date: Wed, 25 Apr 2018 15:37:11 +0200 Subject: [PATCH 3/3] [Fix #1873] Add pre maintenance warning --- app/assets/stylesheets/_maintenance.scss | 15 +++++++++++++++ app/assets/stylesheets/application.scss | 1 + .../stylesheets/new_design/_maintenance.scss | 8 ++++++++ app/views/layouts/_pre_maintenance.html.haml | 4 ++++ app/views/layouts/application.html.haml | 1 + app/views/layouts/new_application.html.haml | 1 + config/features.rb | 1 + 7 files changed, 31 insertions(+) create mode 100644 app/assets/stylesheets/_maintenance.scss create mode 100644 app/assets/stylesheets/new_design/_maintenance.scss create mode 100644 app/views/layouts/_pre_maintenance.html.haml diff --git a/app/assets/stylesheets/_maintenance.scss b/app/assets/stylesheets/_maintenance.scss new file mode 100644 index 000000000..dd59c31d6 --- /dev/null +++ b/app/assets/stylesheets/_maintenance.scss @@ -0,0 +1,15 @@ +.maintenance { + width: 100%; + position: fixed; + top: 0; + z-index: 100; + display: flex; + flex-direction: column; + justify-content: center; + + span { + margin: auto; + background: #FFD8A6; + padding: 0 4px; + } +} diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index f2c861d76..e163c9274 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -12,6 +12,7 @@ // defined in the other CSS/SCSS files in this directory. It is generally better to create a new // file per style scope. // +// = require _maintenance // = require _card // = require _helpers // = require _turbolinks diff --git a/app/assets/stylesheets/new_design/_maintenance.scss b/app/assets/stylesheets/new_design/_maintenance.scss new file mode 100644 index 000000000..153a5f685 --- /dev/null +++ b/app/assets/stylesheets/new_design/_maintenance.scss @@ -0,0 +1,8 @@ +@import "colors"; + +.maintenance { + padding: 20px; + text-align: center; + width: 100%; + background: $orange-bg; +} diff --git a/app/views/layouts/_pre_maintenance.html.haml b/app/views/layouts/_pre_maintenance.html.haml new file mode 100644 index 000000000..636556d16 --- /dev/null +++ b/app/views/layouts/_pre_maintenance.html.haml @@ -0,0 +1,4 @@ +- if Flipflop.pre_maintenance_mode? + .maintenance + %span + Une opération de maintenance est prévue sur demarches-simplifiees.fr à 23 h 00. La plateforme sera inaccessible pendant une vingtaine de minutes. diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 9c6640ace..79878e57e 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -17,6 +17,7 @@ = csrf_meta_tags %body = render partial: 'layouts/support_navigator_banner' + = render partial: 'layouts/pre_maintenance' - if Rails.env == 'staging' #beta Env Test diff --git a/app/views/layouts/new_application.html.haml b/app/views/layouts/new_application.html.haml index c214f26a0..daa786536 100644 --- a/app/views/layouts/new_application.html.haml +++ b/app/views/layouts/new_application.html.haml @@ -21,6 +21,7 @@ .page-wrapper = render partial: "layouts/support_navigator_banner" = render partial: "layouts/ie_lt_10" + = render partial: 'layouts/pre_maintenance' - if Rails.env == "staging" #beta Env Test diff --git a/config/features.rb b/config/features.rb index 14e779b0c..2ef08cc14 100644 --- a/config/features.rb +++ b/config/features.rb @@ -22,5 +22,6 @@ Flipflop.configure do default: Rails.env.production? end + feature :pre_maintenance_mode feature :maintenance_mode end