diff --git a/.scss-lint.yml b/.scss-lint.yml index 308771f17..b917c6e0c 100644 --- a/.scss-lint.yml +++ b/.scss-lint.yml @@ -1,7 +1,6 @@ exclude: - - 'app/assets/stylesheets/new_design/reset.scss' + - 'app/assets/stylesheets/reset.scss' - 'app/assets/stylesheets/direct_uploads.scss' - - 'app/assets/stylesheets/new_design/direct_uploads.scss' linters: BangFormat: diff --git a/Gemfile b/Gemfile index dd0a1f48a..265a66efc 100644 --- a/Gemfile +++ b/Gemfile @@ -9,8 +9,6 @@ gem 'administrate' gem 'after_party' gem 'anchored' gem 'bcrypt' -gem 'bootstrap-sass', '>= 3.4.1' -gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8' gem 'browser' gem 'chartkick' gem 'chunky_png' @@ -30,7 +28,6 @@ gem 'ffi-geos', require: false gem 'flipper' gem 'flipper-active_record' gem 'flipper-ui' -gem 'font-awesome-rails' gem 'fugit' gem 'geocoder' gem 'geo_coord', require: "geo/coord" @@ -43,9 +40,9 @@ gem 'groupdate' gem 'haml-rails' gem 'hashie' gem 'http_accept_language' +gem 'i18n-tasks' gem 'iban-tools' gem 'image_processing' -gem 'jquery-rails' # Use jquery as the JavaScript library gem 'json_schemer' gem 'jwt' gem 'kaminari', '1.2.1' # Pagination @@ -70,7 +67,8 @@ gem 'rqrcode' gem 'ruby-saml-idp' gem 'sanitize-url' gem 'sassc-rails' # Use SCSS for stylesheets -gem 'sentry-raven' +gem 'sentry-rails' +gem 'sentry-ruby' gem 'sib-api-v3-sdk' gem 'skylight' gem 'smart_listing' @@ -118,10 +116,9 @@ end group :development, :test do gem 'axe-matchers' # accessibility rspec matchers - gem 'byebug' # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'graphql-schema_comparator' gem 'mina', git: 'https://github.com/mina-deploy/mina.git', require: false # Deploy - gem 'pry-byebug' + gem 'pry-byebug' # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'rspec_junit_formatter', require: false gem 'rspec-rails' gem 'ruby-debug-ide', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9a3451400..3d8d3d540 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -22,38 +22,38 @@ GEM specs: aasm (5.1.1) concurrent-ruby (~> 1.0) - actioncable (6.0.3.3) - actionpack (= 6.0.3.3) + actioncable (6.0.3.4) + actionpack (= 6.0.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailbox (6.0.3.3) - actionpack (= 6.0.3.3) - activejob (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + actionmailbox (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) mail (>= 2.7.1) - actionmailer (6.0.3.3) - actionpack (= 6.0.3.3) - actionview (= 6.0.3.3) - activejob (= 6.0.3.3) + actionmailer (6.0.3.4) + actionpack (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (6.0.3.3) - actionview (= 6.0.3.3) - activesupport (= 6.0.3.3) + actionpack (6.0.3.4) + actionview (= 6.0.3.4) + activesupport (= 6.0.3.4) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.2.0) - actiontext (6.0.3.3) - actionpack (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + actiontext (6.0.3.4) + actionpack (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) nokogiri (>= 1.8.5) - actionview (6.0.3.3) - activesupport (= 6.0.3.3) + actionview (6.0.3.4) + activesupport (= 6.0.3.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -68,25 +68,25 @@ GEM jsonapi-renderer (>= 0.1.1.beta1, < 0.3) active_storage_validations (0.9.0) rails (>= 5.2.0) - activejob (6.0.3.3) - activesupport (= 6.0.3.3) + activejob (6.0.3.4) + activesupport (= 6.0.3.4) globalid (>= 0.3.6) - activemodel (6.0.3.3) - activesupport (= 6.0.3.3) - activerecord (6.0.3.3) - activemodel (= 6.0.3.3) - activesupport (= 6.0.3.3) - activestorage (6.0.3.3) - actionpack (= 6.0.3.3) - activejob (= 6.0.3.3) - activerecord (= 6.0.3.3) + activemodel (6.0.3.4) + activesupport (= 6.0.3.4) + activerecord (6.0.3.4) + activemodel (= 6.0.3.4) + activesupport (= 6.0.3.4) + activestorage (6.0.3.4) + actionpack (= 6.0.3.4) + activejob (= 6.0.3.4) + activerecord (= 6.0.3.4) marcel (~> 0.3.1) activestorage-openstack (1.4.1) fog-openstack (~> 1.0) marcel mime-types rails (>= 5.2.2) - activesupport (6.0.3.3) + activesupport (6.0.3.4) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -134,11 +134,6 @@ GEM bcrypt (3.1.16) bindata (2.4.8) bindex (0.8.1) - bootstrap-sass (3.4.1) - autoprefixer-rails (>= 5.2.1) - sassc (>= 2.0.0) - bootstrap-wysihtml5-rails (0.3.3.8) - railties (>= 3.0) brakeman (4.9.1) browser (5.0.0) builder (3.2.4) @@ -182,7 +177,7 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.1.7) + concurrent-ruby (1.1.8) connection_pool (2.2.3) crack (0.4.4) crass (1.0.6) @@ -237,7 +232,7 @@ GEM http_parser.rb (~> 0.6.0) encryptor (3.0.0) equalizer (0.0.11) - erubi (1.9.0) + erubi (1.10.0) erubis (2.7.0) et-orbi (1.2.4) tzinfo @@ -248,8 +243,11 @@ GEM execjs (2.7.0) factory_bot (5.1.2) activesupport (>= 4.2.0) - faraday (1.0.1) + faraday (1.3.0) + faraday-net_http (~> 1.0) multipart-post (>= 1.2, < 3) + ruby2_keywords + faraday-net_http (1.0.1) ffi (1.13.1) ffi-geos (2.1.0) ffi (>= 1.0.0) @@ -274,8 +272,6 @@ GEM fog-core (~> 2.1) fog-json (>= 1.0) ipaddress (>= 0.8) - font-awesome-rails (4.7.0.5) - railties (>= 3.2, < 6.1) formatador (0.2.5) fugit (1.3.4) et-orbi (~> 1.1, >= 1.1.8) @@ -344,6 +340,7 @@ GEM hana (1.3.7) hashdiff (1.0.1) hashie (4.1.0) + highline (2.0.3) html2haml (2.2.0) erubis (~> 2.7.0) haml (>= 4.0, < 6) @@ -356,8 +353,18 @@ GEM http_accept_language (2.1.1) http_parser.rb (0.6.0) httpclient (2.8.3) - i18n (1.8.5) + i18n (1.8.7) concurrent-ruby (~> 1.0) + i18n-tasks (0.9.33) + activesupport (>= 4.0.2) + ast (>= 2.1.0) + erubi + highline (>= 2.0.0) + i18n + parser (>= 2.2.3.0) + rails-i18n + rainbow (>= 2.2.2, < 4.0) + terminal-table (>= 1.5.1) iban-tools (1.1.0) ice_nine (0.11.2) image_processing (1.12.1) @@ -409,7 +416,7 @@ GEM railties (>= 4) request_store (~> 1.0) logstash-event (1.2.02) - loofah (2.7.0) + loofah (2.9.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.4) @@ -429,7 +436,7 @@ GEM mini_magick (4.11.0) mini_mime (1.0.2) mini_portile2 (2.5.0) - minitest (5.14.2) + minitest (5.14.3) momentjs-rails (2.20.1) railties (>= 3.1) multi_json (1.15.0) @@ -513,20 +520,20 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (6.0.3.3) - actioncable (= 6.0.3.3) - actionmailbox (= 6.0.3.3) - actionmailer (= 6.0.3.3) - actionpack (= 6.0.3.3) - actiontext (= 6.0.3.3) - actionview (= 6.0.3.3) - activejob (= 6.0.3.3) - activemodel (= 6.0.3.3) - activerecord (= 6.0.3.3) - activestorage (= 6.0.3.3) - activesupport (= 6.0.3.3) + rails (6.0.3.4) + actioncable (= 6.0.3.4) + actionmailbox (= 6.0.3.4) + actionmailer (= 6.0.3.4) + actionpack (= 6.0.3.4) + actiontext (= 6.0.3.4) + actionview (= 6.0.3.4) + activejob (= 6.0.3.4) + activemodel (= 6.0.3.4) + activerecord (= 6.0.3.4) + activestorage (= 6.0.3.4) + activesupport (= 6.0.3.4) bundler (>= 1.3.0) - railties (= 6.0.3.3) + railties (= 6.0.3.4) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -545,14 +552,14 @@ GEM rails-i18n (6.0.0) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 7) - railties (6.0.3.3) - actionpack (= 6.0.3.3) - activesupport (= 6.0.3.3) + railties (6.0.3.4) + actionpack (= 6.0.3.4) + activesupport (= 6.0.3.4) method_source rake (>= 0.8.7) thor (>= 0.20.3, < 2.0) rainbow (3.0.0) - rake (13.0.1) + rake (13.0.3) rake-progressbar (0.0.5) rb-fsevent (0.10.4) rb-inotify (0.10.1) @@ -646,7 +653,7 @@ GEM ruby-saml-idp (0.3.5) ruby-vips (2.0.17) ffi (~> 1.9) - ruby2_keywords (0.0.2) + ruby2_keywords (0.0.4) ruby_parser (3.15.0) sexp_processor (~> 4.9) rubyzip (2.3.0) @@ -671,8 +678,16 @@ GEM childprocess (>= 0.5, < 4.0) rubyzip (>= 1.2.2) semantic_range (2.3.0) - sentry-raven (3.1.0) + sentry-rails (4.1.6) + rails (>= 5.0) + sentry-ruby-core (~> 4.1.2) + sentry-ruby (4.1.5) + concurrent-ruby (~> 1.0, >= 1.0.2) faraday (>= 1.0) + sentry-ruby-core (= 4.1.5) + sentry-ruby-core (4.1.5) + concurrent-ruby + faraday sexp_processor (4.15.1) shellany (0.0.1) shoulda-matchers (4.4.1) @@ -718,14 +733,16 @@ GEM httpclient (>= 2.4) sysexits (1.2.0) temple (0.8.2) - thor (1.0.1) + terminal-table (3.0.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thor (1.1.0) thread_safe (0.3.6) tilt (2.0.10) timecop (0.9.1) ttfunk (1.6.2.1) typhoeus (1.4.0) ethon (>= 0.9.0) - tzinfo (1.2.7) + tzinfo (1.2.9) thread_safe (~> 0.1) unf (0.1.4) unf_ext @@ -774,7 +791,7 @@ GEM nokogiri (~> 1.8) xray-rails (0.3.2) rails (>= 3.1.0) - zeitwerk (2.4.0) + zeitwerk (2.4.2) zip_tricks (5.3.1) zipline (1.2.1) rails (>= 3.2.1, < 6.1) @@ -796,11 +813,8 @@ DEPENDENCIES annotate axe-matchers bcrypt - bootstrap-sass (>= 3.4.1) - bootstrap-wysihtml5-rails (~> 0.3.3.8) brakeman browser - byebug capybara capybara-email capybara-screenshot @@ -825,7 +839,6 @@ DEPENDENCIES flipper flipper-active_record flipper-ui - font-awesome-rails fugit geo_coord geocoder @@ -843,9 +856,9 @@ DEPENDENCIES haml-rails hashie http_accept_language + i18n-tasks iban-tools image_processing - jquery-rails json_schemer jwt kaminari (= 1.2.1) @@ -884,7 +897,8 @@ DEPENDENCIES sanitize-url sassc-rails scss_lint - sentry-raven + sentry-rails + sentry-ruby shoulda-matchers sib-api-v3-sdk simple_xlsx_reader diff --git a/README.md b/README.md index 6cb3c6a00..f65a89276 100644 --- a/README.md +++ b/README.md @@ -118,6 +118,7 @@ Pour exécuter les tests de l'application, plusieurs possibilités : Le projet utilise plusieurs linters pour vérifier la lisibilité et la qualité du code. - Faire tourner tous les linters : `bin/rake lint` +- Vérifier l'état des traductions : `bundle exec i18n-tasks health` - [AccessLint](http://accesslint.com/) tourne automatiquement sur les PRs ### Régénérer les binstubs diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js deleted file mode 100644 index 82ee4a0fe..000000000 --- a/app/assets/javascripts/application.js +++ /dev/null @@ -1,18 +0,0 @@ -// This is a manifest file that'll be compiled into application.js, which will include all the files -// listed below. -// -// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path. -// -// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -// compiled file. -// -// Read Sprockets README (https://github.com/sstephenson/sprockets#sprockets-directives) for details -// about supported directives. -// -//= require_tree ./old_design -//= require bootstrap-sprockets - -//= require smart_listing -//= require bootstrap-wysihtml5 -//= require bootstrap-wysihtml5/locales/fr-FR diff --git a/app/assets/javascripts/old_design/admin.js b/app/assets/javascripts/old_design/admin.js deleted file mode 100644 index ef1360d35..000000000 --- a/app/assets/javascripts/old_design/admin.js +++ /dev/null @@ -1,11 +0,0 @@ -/* globals $ */ - -$(document).on('click', '.delete', function () { - $(this).hide(); - $(this).closest('td').find('.confirm').show(); -}); - -$(document).on('click', '.cancel', function () { - $(this).closest('td').find('.delete').show(); - $(this).closest('td').find('.confirm').hide(); -}); diff --git a/app/assets/javascripts/old_design/archive.js b/app/assets/javascripts/old_design/archive.js deleted file mode 100644 index a2e86e87a..000000000 --- a/app/assets/javascripts/old_design/archive.js +++ /dev/null @@ -1,11 +0,0 @@ -/* globals $ */ - -$(document).on('click', 'button#archive-procedure', function () { - $('button#archive-procedure').hide(); - $('#confirm').show(); -}); - -$(document).on('click', '#confirm #cancel', function () { - $('button#archive-procedure').show(); - $('#confirm').hide(); -}); diff --git a/app/assets/javascripts/old_design/bootstrap_wysihtml5.js b/app/assets/javascripts/old_design/bootstrap_wysihtml5.js deleted file mode 100644 index 9d9e0d864..000000000 --- a/app/assets/javascripts/old_design/bootstrap_wysihtml5.js +++ /dev/null @@ -1,39 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', wysihtml5_active); - -function wysihtml5_active() { - $('.wysihtml5').each(function (i, elem) { - $(elem).wysihtml5({ - toolbar: { - fa: true, - link: false, - color: false - }, - parserRules: { - tags: { - p: {}, - h1: {}, - h2: {}, - h3: {}, - h4: {}, - h5: {}, - h6: {}, - b: {}, - i: {}, - u: {}, - small: {}, - blockquote: {}, - ul: {}, - ol: {}, - li: {}, - img: {}, - code: { - unwrap: 1 - } - } - }, - locale: 'fr-FR' - }); - }); -} diff --git a/app/assets/javascripts/old_design/default_data_block.js b/app/assets/javascripts/old_design/default_data_block.js deleted file mode 100644 index 6f682fd91..000000000 --- a/app/assets/javascripts/old_design/default_data_block.js +++ /dev/null @@ -1,38 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', init_default_data_block); - -function init_default_data_block() { - $('.default-data-block #dossier .body').toggle(); - $('.default-data-block #dossier .carret-right').toggle(); - $('.default-data-block #dossier .carret-down').toggle(); - - $('.default-data-block .title').click(function () { - toggle_default_data_bloc(this, 400); - }); - - $('.new-action').click(function () { - var messages_block = $(this) - .parents() - .closest('.default-data-block') - .find('.title'); - toggle_default_data_bloc(messages_block, 400); - }); - - $('.default-data-block.default_visible').each(function () { - toggle_default_data_bloc($(this).find('.title'), 0); - }); - - function toggle_default_data_bloc(element, duration) { - var block = $(element).parents('.show-block'); - if (block.attr('id') == 'messages') { - block.children('.last-commentaire').toggle(); - $('.commentaires').animate({ scrollTop: $(this).height() }, 'slow'); - } - - block.children('.body').slideToggle(duration); - - block.find('.carret-right').toggle(); - block.find('.carret-down').toggle(); - } -} diff --git a/app/assets/javascripts/old_design/dossiers_list_filter.js b/app/assets/javascripts/old_design/dossiers_list_filter.js deleted file mode 100644 index 15e344199..000000000 --- a/app/assets/javascripts/old_design/dossiers_list_filter.js +++ /dev/null @@ -1,46 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', filters_init); - -function filters_init() { - $('html').click(function (event) { - var visible_filter = $('.filter_framed:visible'); - if (visible_filter.length) { - if (!$(event.target).closest('.filter_framed').is(':visible')) { - visible_filter.hide(); - } - } - }); - - $('.filter').on('click', function (event) { - filter_framed_show(event); - filter_framed_close_all_excepted(framed_id(event)); - event.stopPropagation(); - }); - - $('.erase-filter').on('click', function () { - $(this).parent().find('.filter_input').val(''); - }); -} - -function filter_framed_close_all_excepted(id) { - $('.filter_framed:not(' + id + ')').hide(); - - $(id).toggle(); -} - -function framed_id(event) { - return '#framed_' + event.target.id; -} - -function filter_framed_show(event) { - var dom_object = $(framed_id(event)); - - var offset = $('#main-container').offset(); - - var y = event.pageY - offset.top; - var x = event.pageX - offset.left; - - dom_object.css('top', y + 7 + 'px'); - dom_object.css('left', x + 7 + 'px'); -} diff --git a/app/assets/javascripts/old_design/dossiers_list_link.js b/app/assets/javascripts/old_design/dossiers_list_link.js deleted file mode 100644 index 10c2157d1..000000000 --- a/app/assets/javascripts/old_design/dossiers_list_link.js +++ /dev/null @@ -1,8 +0,0 @@ -/* globals $ */ - -$(document).on('click', '#dossiers-list tr', function (event) { - var href = $(this).data('href'); - if (href && event.target.tagName !== 'A') { - location.href = href; - } -}); diff --git a/app/assets/javascripts/old_design/input_helpers.js b/app/assets/javascripts/old_design/input_helpers.js deleted file mode 100644 index 6a8aeb8d6..000000000 --- a/app/assets/javascripts/old_design/input_helpers.js +++ /dev/null @@ -1,44 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', action_type_de_champs); - -function action_type_de_champs() { - $("input[type='email']").on('change', function () { - toggleErrorClass(this, validateEmail($(this).val())); - }); - - $("input[type='number']").on('change', function () { - toggleErrorClass(this, validateNumber($(this).val())); - }); - - $("input[type='phone']").on('change', function () { - var val = $(this).val(); - val = val.replace(/[ ]/g, ''); - - toggleErrorClass(this, validatePhone(val)); - }); -} - -function toggleErrorClass(node, boolean) { - if (boolean) $(node).removeClass('input-error'); - else $(node).addClass('input-error'); -} - -function validatePhone(phone) { - var re = /^(0|(\+[1-9]{2})|(00[1-9]{2}))[1-9][0-9]{8}$/; - return validateInput(phone, re); -} - -function validateEmail(email) { - var re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; - return validateInput(email, re); -} - -function validateNumber(number) { - var re = /^[0-9]+$/; - return validateInput(number, re); -} - -function validateInput(input, regex) { - return regex.test(input); -} diff --git a/app/assets/javascripts/old_design/instructeur_dossier_modal.js b/app/assets/javascripts/old_design/instructeur_dossier_modal.js deleted file mode 100644 index 40ea0b5c9..000000000 --- a/app/assets/javascripts/old_design/instructeur_dossier_modal.js +++ /dev/null @@ -1,17 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', modal_action); - -function modal_action() { - $('#pj-modal').on('show.bs.modal', function (event) { - $('#pj-modal .modal-body .table .tr-content').hide(); - - var button = $(event.relatedTarget); // Button that triggered the modal - var modal_title = button.data('modal_title'); // Extract info from data-* attributes - var modal_index = button.data('modal_index'); // Extract info from data-* attributes - - var modal = $(this); - modal.find('#pj-modal-title').html(modal_title); - $('#pj-modal .modal-body .table #' + modal_index).show(); - }); -} diff --git a/app/assets/javascripts/old_design/procedure.js b/app/assets/javascripts/old_design/procedure.js deleted file mode 100644 index 007b6b40c..000000000 --- a/app/assets/javascripts/old_design/procedure.js +++ /dev/null @@ -1,26 +0,0 @@ -/* globals $ */ - -$(document).on('DOMContentLoaded', button_edit_procedure_init); - -function button_edit_procedure_init() { - buttons_api_carto(); - button_individual(); -} - -function buttons_api_carto() { - $('#procedure-module-api-carto-use-api-carto').on('change', function () { - $('#modules-api-carto').toggle(); - }); - - if ($('#procedure-module-api-carto-use-api-carto').is(':checked')) - $('#modules-api-carto').show(); -} - -function button_individual() { - $('#procedure_for_individual').on('change', function () { - $('#individual-with-siret').toggle(); - }); - - if ($('#procedure_for_individual').is(':checked')) - $('#individual-with-siret').show(); -} diff --git a/app/assets/stylesheets/_card.scss b/app/assets/stylesheets/_card.scss deleted file mode 100644 index 02cd722cc..000000000 --- a/app/assets/stylesheets/_card.scss +++ /dev/null @@ -1,6 +0,0 @@ -.card { - background: #FFFFFF; - padding: 15px; - box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15); - border-radius: 2px; -} diff --git a/app/assets/stylesheets/new_design/_colors.scss b/app/assets/stylesheets/_colors.scss similarity index 100% rename from app/assets/stylesheets/new_design/_colors.scss rename to app/assets/stylesheets/_colors.scss diff --git a/app/assets/stylesheets/_constants.scss b/app/assets/stylesheets/_constants.scss index 119b9eaea..02558f175 100644 --- a/app/assets/stylesheets/_constants.scss +++ b/app/assets/stylesheets/_constants.scss @@ -1,5 +1,14 @@ -// colors -$light-blue: #F2F6FA; +$page-width: 1040px; +$small-page-width: 840px; -// Bootstrap constants -$font-size-base: 16px; +$default-spacer: 8px; +$default-padding: 2 * $default-spacer; +$default-fields-spacer: 5 * $default-spacer; + +// layouts +$two-columns-padding: 60px; +$two-columns-breakpoint: 980px; +$sub-header-bottom-margin: 3 * $default-spacer; + +// z-order +$alert-z-index: 100; diff --git a/app/assets/stylesheets/_helpers.scss b/app/assets/stylesheets/_helpers.scss deleted file mode 100644 index 0e0b3a549..000000000 --- a/app/assets/stylesheets/_helpers.scss +++ /dev/null @@ -1,21 +0,0 @@ -$default-spacer: 15px; - -.m-1 { - margin: $default-spacer; -} - -.mt-1 { - margin-top: $default-spacer; -} - -.mr-1 { - margin-right: $default-spacer; -} - -.mb-1 { - margin-bottom: $default-spacer; -} - -.ml-1 { - margin-left: $default-spacer; -} diff --git a/app/assets/stylesheets/new_design/_mixins.scss b/app/assets/stylesheets/_mixins.scss similarity index 100% rename from app/assets/stylesheets/new_design/_mixins.scss rename to app/assets/stylesheets/_mixins.scss diff --git a/app/assets/stylesheets/new_design/_placeholders.scss b/app/assets/stylesheets/_placeholders.scss similarity index 100% rename from app/assets/stylesheets/new_design/_placeholders.scss rename to app/assets/stylesheets/_placeholders.scss diff --git a/app/assets/stylesheets/new_design/_tabs.scss b/app/assets/stylesheets/_tabs.scss similarity index 100% rename from app/assets/stylesheets/new_design/_tabs.scss rename to app/assets/stylesheets/_tabs.scss diff --git a/app/assets/stylesheets/new_design/_typography.scss b/app/assets/stylesheets/_typography.scss similarity index 100% rename from app/assets/stylesheets/new_design/_typography.scss rename to app/assets/stylesheets/_typography.scss diff --git a/app/assets/stylesheets/new_design/accessibilite.scss b/app/assets/stylesheets/accessibilite.scss similarity index 100% rename from app/assets/stylesheets/new_design/accessibilite.scss rename to app/assets/stylesheets/accessibilite.scss diff --git a/app/assets/stylesheets/new_design/actiontext.scss b/app/assets/stylesheets/actiontext.scss similarity index 100% rename from app/assets/stylesheets/new_design/actiontext.scss rename to app/assets/stylesheets/actiontext.scss diff --git a/app/assets/stylesheets/new_design/add_instructeur.scss b/app/assets/stylesheets/add_instructeur.scss similarity index 100% rename from app/assets/stylesheets/new_design/add_instructeur.scss rename to app/assets/stylesheets/add_instructeur.scss diff --git a/app/assets/stylesheets/new_design/admin-procedures-list.scss b/app/assets/stylesheets/admin-procedures-list.scss similarity index 100% rename from app/assets/stylesheets/new_design/admin-procedures-list.scss rename to app/assets/stylesheets/admin-procedures-list.scss diff --git a/app/assets/stylesheets/admin_type_de_champ.scss b/app/assets/stylesheets/admin_type_de_champ.scss deleted file mode 100644 index b444a553b..000000000 --- a/app/assets/stylesheets/admin_type_de_champ.scss +++ /dev/null @@ -1,52 +0,0 @@ -.header-section { - background-color: rgb(0, 49, 137); - margin-top: 20px; - margin-bottom: 10px; - margin-left: 0; - margin-right: 0; - text-align: center; - padding-bottom: 8px; - - color: #FFFFFF; - - .form-control.libelle { - font-weight: bold; - } - - .form-group.description { - display: none; - } - - .form-group.mandatory { - display: none; - } -} - -#liste-champ { - .form-inline { - margin-bottom: 30px; - } - - .show-inline { - display: inline-block !important; - } - - .form-group.drop-down-list, - .form-group.pj-template, - .form-group.carte-options { - display: none; - } - - .form-group { - vertical-align: top; - margin-right: 15px; - } - - .description { - padding: 0; - - textarea { - padding: 6px 12px; - } - } -} diff --git a/app/assets/stylesheets/new_design/animations.scss b/app/assets/stylesheets/animations.scss similarity index 100% rename from app/assets/stylesheets/new_design/animations.scss rename to app/assets/stylesheets/animations.scss diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index d4990fbba..af88e9f77 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -1,237 +1,9 @@ -// This is a manifest file that'll be compiled into application.css, which will include all the files -// listed below. -// -// Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, -// or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. -// -// You're free to add application-wide styles to this file and they'll appear at the bottom of the -// compiled file so the styles you add here take precedence over styles defined in any styles -// defined in the other CSS/SCSS files in this directory. It is generally better to create a new -// file per style scope. -// -// = require _card -// = require _helpers -// = require admin_type_de_champ -// = require carte -// = require custom_mails -// = require default_data_block -// = require direct_uploads -// = require dossiers -// = require france_connect_particulier -// = require left_panel -// = require login -// = require main_container -// = require navbar -// = require pj_modal -// = require print -// = require procedure -// = require search -// = require site_banner -// = require switch_menu -// = require users -// = require attestation_template_edit - -// = require_self -// = require font-awesome +// = require ./reset +// = require ./custom_reset +// = require ./common +// = require ./utils +// = require ./fonts // = require leaflet -// = require franceconnect -// = require bootstrap-wysihtml5 - -@import "constants"; -@import "bootstrap-sprockets"; -@import "bootstrap"; - -body { - background-color: $light-blue; -} - -html, -body { - height: 100%; -} - -body { - padding-top: 60px; -} - -form { - margin-bottom: 0.3em; -} - -.wysihtml5-sandbox { - resize: vertical; - width: 100% !important; -} - -#wrap { - min-height: 100%; - margin-bottom: -50px; - overflow: hidden; -} - -// Mobile Safari doesn't bubble mouse events by default, unless: -// -// - the target element of the event is a link or a form field. -// - the target element, or any of its ancestors up to but not including the , has an explicit event handler set for any of the mouse events. This event handler may be an empty function. -// - the target element, or any of its ancestors up to and including the document has a cursor: pointer CSS declarations. -// -// (See https://www.quirksmode.org/blog/archives/2014/02/mouse_event_bub.html) -// -// This is a problem for us, because we bind a lot of click events as -// `document.on('click', '.my-element', …)` – which requires proper bubbling. -.ios #wrap { - cursor: pointer; -} - -#wrap::after { - content: ""; - display: block; -} - -#footer, -#wrap::after { - height: 50px; -} - -#footer { - background-color: $light-blue; - text-align: center; - padding: 0; - - a, - p { - color: #000000; - } - - a:hover { - color: #000000; - } - - p { - line-height: 40px; - padding: 0; - } -} - -.text-purple { - color: #8B008B; -} - -.text-default { - color: #808080; -} - -.progress-bar-purple { - background-color: #800080; -} - -.btn { - box-shadow: none !important; -} - -.description { - padding: 10px; -} - -.btn-file { - position: relative; - overflow: hidden; -} - -.btn-file input[type=file] { - position: absolute; - top: 0; - right: 0; - min-width: 100%; - min-height: 100%; - font-size: 100px; - text-align: right; - filter: alpha(opacity = 0); - opacity: 0; - outline: none; - background: #FFFFFF; - cursor: inherit; - display: block; -} - -.vr { - border-left: 1px solid #808080; -} - -.center { - text-align: center; -} - -textarea#description { - width: 100%; -} - -div.pagination { - padding-top: 20px; - display: block; - text-align: center; -} - -.alert { - margin-bottom: 0px; -} - -.alert.alert-success.move-up, -.alert.alert-danger.siret, -.alert.sticky { - position: fixed; - top: 0px; - left: 0; - height: 52px; - width: 100%; - margin-top: 0px; - z-index: 10; - -} - -.archived { - float: right; - margin-top: 10px; - - .confirm { - display: none; - } -} - -#confirm { - display: none; -} - -.confirm { - display: none; -} - -.fa { - width: 15px; - text-align: center; -} - -.off-fc-link { - font-size: 15px !important; - margin-top: -4px; -} - -#fconnect-access { - right: 50px; -} - -#fconnect-access::before { - left: 22.7% !important; -} - -#fconnect-access::after { - left: 23% !important; -} - -.no-padding { - padding: 0; -} - -.no-margin { - margin: 0; -} +// = require select2 +// = require_tree . +// = stub ./print.scss diff --git a/app/assets/stylesheets/new_design/attachment.scss b/app/assets/stylesheets/attachment.scss similarity index 100% rename from app/assets/stylesheets/new_design/attachment.scss rename to app/assets/stylesheets/attachment.scss diff --git a/app/assets/stylesheets/attestation_template_edit.scss b/app/assets/stylesheets/attestation_template_edit.scss index 994cdbfac..4c5069655 100644 --- a/app/assets/stylesheets/attestation_template_edit.scss +++ b/app/assets/stylesheets/attestation_template_edit.scss @@ -1,31 +1,56 @@ +@import "colors"; +@import "constants"; #attestation-template-edit { - .notice { - margin-bottom: 30px; + .text-active { + color: $green; } - .image-upload { - display: flex; - align-items: center; + .text-inactive { + color: $grey; + } +} - input { - margin: 10px 0; +#tags-table { + margin-top: -20px; + margin-bottom: 40px; + + .add-tag-title { + font-size: 18px; + margin-bottom: 16px; + } + + .head { + padding: 10px 0px; + font-weight: bold; + display: flex; + } + + .items { + max-height: 210px; + overflow-y: auto; + border-bottom: 1px solid $border-grey; + } + + .item { + display: flex; + padding: 10px 0; + border-bottom: solid 1px $border-grey; + + .tag { + font-weight: bold; + } + + &:last-child { + border-bottom: none; } } - .thumbnail { - width: 90px; - margin-right: 15px; + .tag { + width: 35%; } - .balises { - max-height: 180px; - overflow-y: scroll; - margin-bottom: 20px; - } - - .table { - border: 1px solid #DDDDDD; - margin-bottom: 0px; + .description { + width: 65%; } } diff --git a/app/assets/stylesheets/new_design/auth.scss b/app/assets/stylesheets/auth.scss similarity index 100% rename from app/assets/stylesheets/new_design/auth.scss rename to app/assets/stylesheets/auth.scss diff --git a/app/assets/stylesheets/new_design/autosave.scss b/app/assets/stylesheets/autosave.scss similarity index 100% rename from app/assets/stylesheets/new_design/autosave.scss rename to app/assets/stylesheets/autosave.scss diff --git a/app/assets/stylesheets/new_design/avis.scss b/app/assets/stylesheets/avis.scss similarity index 100% rename from app/assets/stylesheets/new_design/avis.scss rename to app/assets/stylesheets/avis.scss diff --git a/app/assets/stylesheets/new_design/avis_sign_up.scss b/app/assets/stylesheets/avis_sign_up.scss similarity index 100% rename from app/assets/stylesheets/new_design/avis_sign_up.scss rename to app/assets/stylesheets/avis_sign_up.scss diff --git a/app/assets/stylesheets/new_design/badges.scss b/app/assets/stylesheets/badges.scss similarity index 100% rename from app/assets/stylesheets/new_design/badges.scss rename to app/assets/stylesheets/badges.scss diff --git a/app/assets/stylesheets/new_design/beta.scss b/app/assets/stylesheets/beta.scss similarity index 100% rename from app/assets/stylesheets/new_design/beta.scss rename to app/assets/stylesheets/beta.scss diff --git a/app/assets/stylesheets/new_design/breadcrumb.scss b/app/assets/stylesheets/breadcrumb.scss similarity index 100% rename from app/assets/stylesheets/new_design/breadcrumb.scss rename to app/assets/stylesheets/breadcrumb.scss diff --git a/app/assets/stylesheets/new_design/buttons.scss b/app/assets/stylesheets/buttons.scss similarity index 100% rename from app/assets/stylesheets/new_design/buttons.scss rename to app/assets/stylesheets/buttons.scss diff --git a/app/assets/stylesheets/new_design/card.scss b/app/assets/stylesheets/card.scss similarity index 100% rename from app/assets/stylesheets/new_design/card.scss rename to app/assets/stylesheets/card.scss diff --git a/app/assets/stylesheets/new_design/card_admin.scss b/app/assets/stylesheets/card_admin.scss similarity index 100% rename from app/assets/stylesheets/new_design/card_admin.scss rename to app/assets/stylesheets/card_admin.scss diff --git a/app/assets/stylesheets/carte.scss b/app/assets/stylesheets/carte.scss index eb9f459a8..8728a4915 100644 --- a/app/assets/stylesheets/carte.scss +++ b/app/assets/stylesheets/carte.scss @@ -1,31 +1,17 @@ -// Place all the styles related to the carte controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ -@import "bootstrap"; - -.leaflet-container path { - cursor: url("/assets/edit.png"), default !important; +.areas-title { + font-weight: bold; + margin-top: 5px; + margin-bottom: 5px; } -.info { - padding: 6px 8px; - font: 14px/16px Arial, Helvetica, sans-serif; - background: rgba(255, 255, 255, 0.8); - box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); - border-radius: 5px; -} +.areas { + margin-bottom: 10px; -.info h4 { - margin: 0 0 5px; - color: #777777; -} - -#search-by-address { - .algolia-autocomplete { - width: 555px; - } - - .aa-dropdown-menu { - width: 555px; + input { + margin-top: 5px; } } + +.form [data-react-class='MapEditor'] [data-reach-combobox-input] { + margin-bottom: 0; +} diff --git a/app/assets/stylesheets/new_design/commencer.scss b/app/assets/stylesheets/commencer.scss similarity index 100% rename from app/assets/stylesheets/new_design/commencer.scss rename to app/assets/stylesheets/commencer.scss diff --git a/app/assets/stylesheets/new_design/common.scss b/app/assets/stylesheets/common.scss similarity index 100% rename from app/assets/stylesheets/new_design/common.scss rename to app/assets/stylesheets/common.scss diff --git a/app/assets/stylesheets/new_design/confirmations.scss b/app/assets/stylesheets/confirmations.scss similarity index 100% rename from app/assets/stylesheets/new_design/confirmations.scss rename to app/assets/stylesheets/confirmations.scss diff --git a/app/assets/stylesheets/new_design/contact.scss b/app/assets/stylesheets/contact.scss similarity index 100% rename from app/assets/stylesheets/new_design/contact.scss rename to app/assets/stylesheets/contact.scss diff --git a/app/assets/stylesheets/custom_mails.scss b/app/assets/stylesheets/custom_mails.scss deleted file mode 100644 index c17eaeffa..000000000 --- a/app/assets/stylesheets/custom_mails.scss +++ /dev/null @@ -1,11 +0,0 @@ -#custom-mails { - padding: 20px; - - .wrapper { - background-color: #FFFFFF; - box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); - margin: 15px auto; - max-width: 800px; - padding: 20px; - } -} diff --git a/app/assets/stylesheets/new_design/custom_reset.scss b/app/assets/stylesheets/custom_reset.scss similarity index 100% rename from app/assets/stylesheets/new_design/custom_reset.scss rename to app/assets/stylesheets/custom_reset.scss diff --git a/app/assets/stylesheets/default_data_block.scss b/app/assets/stylesheets/default_data_block.scss deleted file mode 100644 index dbf7c0bd5..000000000 --- a/app/assets/stylesheets/default_data_block.scss +++ /dev/null @@ -1,88 +0,0 @@ -@import "constants"; - -.default-data-block { - font-family: Arial; - - .show-block { - margin-left: auto; - margin-right: auto; - box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); - margin-bottom: 40px; - } - - .carret-right { - float: left; - width: 0; - height: 0; - border-top: 7px solid transparent; - border-bottom: 7px solid transparent; - border-left: 14px solid #FFFFFF; - margin: 12px 12px 0 15px; - } - - .carret-down { - float: left; - width: 0; - height: 0; - display: none; - border-left: 7px solid transparent; - border-right: 7px solid transparent; - border-top: 14px solid #FFFFFF; - margin: 12px 12px 0 15px; - } - - .header { - background-color: #003C92; - min-height: 40px; - color: #FFFFFF; - font-size: 18px; - font-weight: bold; - - .title, - .title-no-expanse, - .action, - .count { - line-height: 40px; - padding: 0px; - text-transform: uppercase; - } - - .title-no-expanse { - cursor: not-allowed; - } - - .title, - .action, - .count { - cursor: pointer; - } - - .title-content { - width: calc(100% - 50px); - float: left; - } - - .action { - background-color: #E45B51; - text-align: center; - line-height: 40px; - font-size: 15px; - text-decoration: none; - color: #FFFFFF; - } - - .action:hover { - color: $light-blue; - } - - .count { - font-size: 16px; - text-align: center; - } - } - - .body { - background-color: #FFFFFF; - display: none; - } -} diff --git a/app/assets/stylesheets/new_design/demande.scss b/app/assets/stylesheets/demande.scss similarity index 100% rename from app/assets/stylesheets/new_design/demande.scss rename to app/assets/stylesheets/demande.scss diff --git a/app/assets/stylesheets/new_design/demarches_index.scss b/app/assets/stylesheets/demarches_index.scss similarity index 100% rename from app/assets/stylesheets/new_design/demarches_index.scss rename to app/assets/stylesheets/demarches_index.scss diff --git a/app/assets/stylesheets/new_design/devise_container.scss b/app/assets/stylesheets/devise_container.scss similarity index 100% rename from app/assets/stylesheets/new_design/devise_container.scss rename to app/assets/stylesheets/devise_container.scss diff --git a/app/assets/stylesheets/direct_uploads.scss b/app/assets/stylesheets/direct_uploads.scss index eda8e75c7..54fa203b1 100644 --- a/app/assets/stylesheets/direct_uploads.scss +++ b/app/assets/stylesheets/direct_uploads.scss @@ -1,12 +1,13 @@ +@import "colors"; + .direct-upload { display: inline-block; position: relative; - padding: 2px 4px; + padding: 4px 15px; margin: 0 3px 3px 0; - border: 1px solid rgba(0, 0, 0, 0.3); + border: 1px solid $border-grey; border-radius: 3px; - font-size: 11px; - line-height: 13px; + font-size: 14px; } .direct-upload--pending { @@ -32,6 +33,7 @@ border-color: red; } -input[type=file][data-direct-upload-url][disabled] { +input[type=file][data-direct-upload-url][disabled], +input[type=file][data-auto-attach-url][disabled] { display: none; } diff --git a/app/assets/stylesheets/new_design/dossier_annotations_privees.scss b/app/assets/stylesheets/dossier_annotations_privees.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_annotations_privees.scss rename to app/assets/stylesheets/dossier_annotations_privees.scss diff --git a/app/assets/stylesheets/new_design/dossier_champs.scss b/app/assets/stylesheets/dossier_champs.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_champs.scss rename to app/assets/stylesheets/dossier_champs.scss diff --git a/app/assets/stylesheets/new_design/dossier_edit.scss b/app/assets/stylesheets/dossier_edit.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_edit.scss rename to app/assets/stylesheets/dossier_edit.scss diff --git a/app/assets/stylesheets/new_design/dossier_index.scss b/app/assets/stylesheets/dossier_index.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_index.scss rename to app/assets/stylesheets/dossier_index.scss diff --git a/app/assets/stylesheets/new_design/dossier_link.scss b/app/assets/stylesheets/dossier_link.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_link.scss rename to app/assets/stylesheets/dossier_link.scss diff --git a/app/assets/stylesheets/new_design/dossier_show.scss b/app/assets/stylesheets/dossier_show.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossier_show.scss rename to app/assets/stylesheets/dossier_show.scss diff --git a/app/assets/stylesheets/dossiers.scss b/app/assets/stylesheets/dossiers.scss deleted file mode 100644 index 04e12f2f2..000000000 --- a/app/assets/stylesheets/dossiers.scss +++ /dev/null @@ -1,76 +0,0 @@ -// Place all the styles related to the dossiers controller here. -// They will automatically be included in application.css. -// You can use Sass (SCSS) here: http://sass-lang.com/ - -h5 span { - font-weight: normal; -} - -#insee-infogreffe { - font-size: 17px; -} - -.flag { - display: inline; - margin-left: auto; - margin-right: auto; - padding-right: 20px; - padding-left: 20px; - - img { - max-width: 150px; - max-height: 60px; - } -} - -#dossiers-list { - .filter { - cursor: pointer; - font-size: 1.1em; - display: inline; - } -} - -#dossiers-list tr:hover { - background-color: #EEEEEE; - cursor: pointer; -} - -#procedure-list { - margin-left: -10px; - margin-top: 20px; - - a, - a:hover { - color: #FFFFFF; - text-decoration: none; - } - - .procedure-list-element.active { - background-color: #668ABD; - } - - .procedure-list-element { - padding: 15px 40px 15px 20px; - cursor: pointer; - line-height: 1.8em; - - .progress-bar-warning { - background-color: #E4594F; - } - - .missing-steps { - color: #FFA500; - } - } - - .procedure-list-element:hover { - background-color: #668ABD; - cursor: pointer; - } -} - -.split-hr-left { - border-bottom: 1px solid #FFFFFF; - margin: 20px 10px 0px 10px; -} diff --git a/app/assets/stylesheets/new_design/dossiers_headers.scss b/app/assets/stylesheets/dossiers_headers.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossiers_headers.scss rename to app/assets/stylesheets/dossiers_headers.scss diff --git a/app/assets/stylesheets/new_design/dossiers_table.scss b/app/assets/stylesheets/dossiers_table.scss similarity index 100% rename from app/assets/stylesheets/new_design/dossiers_table.scss rename to app/assets/stylesheets/dossiers_table.scss diff --git a/app/assets/stylesheets/new_design/etablissement.scss b/app/assets/stylesheets/etablissement.scss similarity index 100% rename from app/assets/stylesheets/new_design/etablissement.scss rename to app/assets/stylesheets/etablissement.scss diff --git a/app/assets/stylesheets/new_design/flex.scss b/app/assets/stylesheets/flex.scss similarity index 100% rename from app/assets/stylesheets/new_design/flex.scss rename to app/assets/stylesheets/flex.scss diff --git a/app/assets/stylesheets/new_design/fonts.scss b/app/assets/stylesheets/fonts.scss similarity index 100% rename from app/assets/stylesheets/new_design/fonts.scss rename to app/assets/stylesheets/fonts.scss diff --git a/app/assets/stylesheets/new_design/forms.scss b/app/assets/stylesheets/forms.scss similarity index 100% rename from app/assets/stylesheets/new_design/forms.scss rename to app/assets/stylesheets/forms.scss diff --git a/app/assets/stylesheets/new_design/france-connect-login.scss b/app/assets/stylesheets/france-connect-login.scss similarity index 100% rename from app/assets/stylesheets/new_design/france-connect-login.scss rename to app/assets/stylesheets/france-connect-login.scss diff --git a/app/assets/stylesheets/france_connect_particulier.scss b/app/assets/stylesheets/france_connect_particulier.scss deleted file mode 100644 index 72025e3a3..000000000 --- a/app/assets/stylesheets/france_connect_particulier.scss +++ /dev/null @@ -1,5 +0,0 @@ -#france-connect-particulier-email { - width: 300px; - margin-left: auto; - margin-right: auto; -} diff --git a/app/assets/stylesheets/new_design/gaps.scss b/app/assets/stylesheets/gaps.scss similarity index 100% rename from app/assets/stylesheets/new_design/gaps.scss rename to app/assets/stylesheets/gaps.scss diff --git a/app/assets/stylesheets/new_design/groupe_instructeur.scss b/app/assets/stylesheets/groupe_instructeur.scss similarity index 100% rename from app/assets/stylesheets/new_design/groupe_instructeur.scss rename to app/assets/stylesheets/groupe_instructeur.scss diff --git a/app/assets/stylesheets/new_design/help_dropdown.scss b/app/assets/stylesheets/help_dropdown.scss similarity index 100% rename from app/assets/stylesheets/new_design/help_dropdown.scss rename to app/assets/stylesheets/help_dropdown.scss diff --git a/app/assets/stylesheets/new_design/helpers.scss b/app/assets/stylesheets/helpers.scss similarity index 100% rename from app/assets/stylesheets/new_design/helpers.scss rename to app/assets/stylesheets/helpers.scss diff --git a/app/assets/stylesheets/new_design/icons.scss b/app/assets/stylesheets/icons.scss similarity index 100% rename from app/assets/stylesheets/new_design/icons.scss rename to app/assets/stylesheets/icons.scss diff --git a/app/assets/stylesheets/new_design/instructeur.scss b/app/assets/stylesheets/instructeur.scss similarity index 100% rename from app/assets/stylesheets/new_design/instructeur.scss rename to app/assets/stylesheets/instructeur.scss diff --git a/app/assets/stylesheets/new_design/invites_form.scss b/app/assets/stylesheets/invites_form.scss similarity index 100% rename from app/assets/stylesheets/new_design/invites_form.scss rename to app/assets/stylesheets/invites_form.scss diff --git a/app/assets/stylesheets/new_design/labels.scss b/app/assets/stylesheets/labels.scss similarity index 100% rename from app/assets/stylesheets/new_design/labels.scss rename to app/assets/stylesheets/labels.scss diff --git a/app/assets/stylesheets/new_design/landing.scss b/app/assets/stylesheets/landing.scss similarity index 100% rename from app/assets/stylesheets/new_design/landing.scss rename to app/assets/stylesheets/landing.scss diff --git a/app/assets/stylesheets/new_design/layouts.scss b/app/assets/stylesheets/layouts.scss similarity index 100% rename from app/assets/stylesheets/new_design/layouts.scss rename to app/assets/stylesheets/layouts.scss diff --git a/app/assets/stylesheets/left_panel.scss b/app/assets/stylesheets/left_panel.scss deleted file mode 100644 index 99898800f..000000000 --- a/app/assets/stylesheets/left_panel.scss +++ /dev/null @@ -1,292 +0,0 @@ -#left-panel { - margin-top: 60px; - padding: 0; - background-color: #003189; - height: calc(100% - 60px); - position: fixed; - top: 0; - left: 0; - bottom: 0; - color: #FFFFFF; - overflow-y: scroll; - - .link-to-dossiers { - padding: 15px 0 0 15px; - - a { - color: #FFFFFF; - } - } - - #first-block { - font-family: Arial; - font-size: 16px; - line-height: 18px; - margin-top: 20px; - - .infos { - font-size: 25px; - text-align: center; - margin: 10px 10px 30px 0; - - .projet-name { - font-size: 25px; - line-height: normal; - padding: 5px; - } - } - - .count { - display: inline-block; - padding: 3px; - border-radius: 25px; - min-width: 40px; - text-align: center; - line-height: 23px; - } - - .text { - display: inline-block; - width: 30px; - margin: 0 0 0 8px; - } - - .dossiers-en-cours, - .en-cours { - margin-top: 20px; - } - - .dossiers-en-cours { - .count { - border: 1px solid #FFFFFF; - } - } - - .nouveaux-dossiers { - .count { - background-color: #5CB85C; - } - } - - .nouvelles-notifications { - .count { - background-color: #E4594F; - } - } - - .dossiers-en-cours, - .nouveaux-dossiers, - .nouvelles-notifications, - .en-cours { - margin: 5px auto 0 20px; - width: 150px; - } - - img { - background-color: #FFFFFF; - } - } - - #action-block { - text-align: center; - margin: 10px; - - .action { - background-color: #E45B51; - text-align: center; - cursor: pointer; - color: #FFFFFF; - margin: 0 10px 0 0; - min-height: 40px; - padding: 5px; - font-family: Arial; - font-size: 16px; - font-weight: bold; - border: none; - width: 100%; - } - - .close-dossier, - .refuse-dossier, - .forget-dossier { - border: 1px solid #FFFFFF; - border-radius: 25px; - margin: 5px; - margin-left: auto; - margin-right: auto; - width: 60px; - } - - .close-dossier:hover, - .refuse-dossier:hover, - .forget-dossier:hover { - color: #000000; - border-color: #000000; - } - - .close-dossier { - background-color: #2A9E2A; - } - - .refuse-dossier { - background-color: #E4594F; - } - - .forget-dossier { - background-color: #FF8300; - } - } - - #menu-block { - #switch-buttons { - height: 30px; - line-height: 30px; - font-size: 16px; - margin-top: 20px; - margin-left: auto; - margin-right: auto; - width: 205px; - border: 1px solid; - padding: 0 0 0 10px; - border-radius: 25px; - cursor: pointer; - - .active { - background-color: #668ABD !important; - cursor: default; - } - - .separator { - height: 26px; - width: 1px; - display: inline-block; - background-color: #FFFFFF; - } - - #switch-procedures:hover, - #switch-notifications:hover { - background-color: #668AEA; - } - - #switch-procedures { - height: 28px; - margin: 0 0 0 -10px; - padding-left: 10px; - width: 100px; - display: inline-block; - border-radius: 25px 0 0 25px; - } - - #switch-notifications { - width: 103px; - display: inline-block; - border-radius: 0 25px 25px 0; - height: 28px; - margin: 0 0 0 -5px; - padding: 0 0 0 5px; - } - } - - .split-hr { - border-bottom: 1px solid #FFFFFF; - width: 200px; - margin: 20px 0 20px 0; - } - } - - #infos-block { - .split-hr { - border-bottom: 1px solid #FFFFFF; - width: 200px; - margin: 20px 0 20px 0; - } - - .dossier-state { - text-align: center; - font-size: 25px; - margin-top: 20px; - width: 200px; - margin-left: auto; - margin-right: auto; - } - - #notifications-list { - .no-notification { - margin: 0 30px 0 30px; - } - - .notification { - padding: 10px 2px 10px 15px; - - .dossier, - .updated-at { - display: inline-block; - color: #CCCCCC; - font-size: 12px; - text-align: left; - } - - .dossier-index, - .updated-at-index, - .count { - display: inline-block; - color: #FFFFFF; - font-size: 14px; - text-align: left; - } - - .count { - background-color: #F0AD4E; - border-radius: 25px; - padding: 0 5px 0 5px; - width: 25px; - text-align: center; - } - - .type-notif { - font-size: 16px; - } - } - } - - .notifications { - margin: 20px 10px 0 5px; - - .fa { - font-size: 25px; - width: 100%; - margin: 0 0 15px 0; - } - - .type-notif { - font-size: 16px; - float: right; - width: 30px; - } - - .notification { - margin: 10px 0 10px 10px; - - .type { - margin-bottom: 20px; - } - - .updated-at { - color: #CCCCCC; - font-size: 12px; - text-align: left; - } - - .split-hr { - width: 40px; - margin: auto; - } - } - } - } -} - -.motivation-text-area { - color: #000000; - margin-bottom: 15px; -} diff --git a/app/assets/stylesheets/new_design/link-sent.scss b/app/assets/stylesheets/link-sent.scss similarity index 100% rename from app/assets/stylesheets/new_design/link-sent.scss rename to app/assets/stylesheets/link-sent.scss diff --git a/app/assets/stylesheets/login.scss b/app/assets/stylesheets/login.scss deleted file mode 100644 index 6be7b6cb3..000000000 --- a/app/assets/stylesheets/login.scss +++ /dev/null @@ -1,33 +0,0 @@ -#form-login { - text-align: center; - max-width: 500px; - - margin-left: auto; - margin-right: auto; - - padding: 20px; - - .btn-fc { - - img { - height: 100px; - } - } - - #new-user { - width: 80%; - margin-left: auto; - margin-right: auto; - } - - hr { - margin-bottom: 40px; - border: none; - height: 1px; - background-image: linear-gradient(to right, rgba(100, 100, 100, 0), rgba(100, 100, 100, 0.75), rgba(100, 100, 100, 0)); - } - - h4 { - text-align: left; - } -} diff --git a/app/assets/stylesheets/main_container.scss b/app/assets/stylesheets/main_container.scss deleted file mode 100644 index fda591698..000000000 --- a/app/assets/stylesheets/main_container.scss +++ /dev/null @@ -1,3 +0,0 @@ -#main-container { - float: right; -} diff --git a/app/assets/stylesheets/new_design/merci.scss b/app/assets/stylesheets/merci.scss similarity index 100% rename from app/assets/stylesheets/new_design/merci.scss rename to app/assets/stylesheets/merci.scss diff --git a/app/assets/stylesheets/new_design/message.scss b/app/assets/stylesheets/message.scss similarity index 100% rename from app/assets/stylesheets/new_design/message.scss rename to app/assets/stylesheets/message.scss diff --git a/app/assets/stylesheets/new_design/messagerie.scss b/app/assets/stylesheets/messagerie.scss similarity index 100% rename from app/assets/stylesheets/new_design/messagerie.scss rename to app/assets/stylesheets/messagerie.scss diff --git a/app/assets/stylesheets/new_design/motivation.scss b/app/assets/stylesheets/motivation.scss similarity index 100% rename from app/assets/stylesheets/new_design/motivation.scss rename to app/assets/stylesheets/motivation.scss diff --git a/app/assets/stylesheets/navbar.scss b/app/assets/stylesheets/navbar.scss deleted file mode 100644 index 6d2813f52..000000000 --- a/app/assets/stylesheets/navbar.scss +++ /dev/null @@ -1,219 +0,0 @@ -@import "constants"; - -#header { - top: 0; - left: 0; - position: fixed; - width: 100%; - z-index: 10; - border-radius: 0; - height: 60px; - - #title-navbar { - color: #FFFFFF; - font-weight: bold; - font-size: 1.8em; - z-index: 10; - overflow: hidden; - } - - #title-navbar:hover { - text-decoration: none; - } - - #home { - text-align: center; - box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.5); - background-color: #003189; - height: 60px; - - .logo { - margin-top: 10px; - height: 40px; - } - - #tps-title { - font-family: Arial; - font-size: 16px; - font-weight: bold; - line-height: 20px; - margin-top: 10px; - } - } - - #navbar-body { - min-height: 60px; - background-color: #FFFFFF; - box-shadow: 0 1px 2px 0 rgba(50, 50, 50, 0.5); - padding-left: 50px; - - .main-info { - font-family: Arial; - font-size: 18px; - font-weight: bold; - line-height: 58px; - min-height: 58px; - color: #000000; - overflow: hidden; - white-space: nowrap; - text-overflow: ellipsis; - } - - .options { - font-family: Arial; - font-size: 14px; - text-align: right; - line-height: 22px; - color: #666666; - padding: 8px; - border-right: 1px solid #C8C6C8; - min-height: 60px; - - .dropdown-toggle { - cursor: pointer; - } - - .dropdown-pannel { - min-height: 100px; - width: 400px; - padding-left: 10px; - } - - .centered-option { - line-height: 40px; - height: 40px; - } - - .caret-right { - border-bottom: 4px solid transparent; - border-top: 4px solid transparent; - border-left: 4px solid; - display: inline-block; - height: 0; - margin: 8px 2px 0 5px; - vertical-align: top; - width: 0; - } - } - - #sign-in { - margin-top: 7px; - - .btn { - float: right; - margin-right: 15px; - } - } - - #sign-out { - text-align: center; - height: 60px; - - a { - line-height: 60px; - } - } - } -} - -#download-menu { - .btn-sm { - color: #000000; - font-size: 14px; - } -} - -.btn-nav { - color: #FFFFFF; - background-color: transparent; - margin-top: 6px; - height: 36px; -} - -.btn-nav:hover { - background-color: #EEEEEE; - border-color: #EEEEEE #EEEEEE #DDDDDD; - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; -} - -.btn-nav.text-info:hover { - color: #23527C; -} - -.btn-nav.text-success:hover { - color: #3C763D; -} - -.btn-nav.text-danger:hover { - color: #A10005; -} - -.navbar { - border: 0 !important; -} - -#beta { - text-align: center; - text-transform: uppercase; - position: fixed; - bottom: 26px; - right: -35px; - transform: rotate(-45deg); - width: 150px; - background-color: #008CBA; - color: #FFFFFF; - padding: 5px; - font-size: 15px; - font-weight: 700; - z-index: 10; -} - -.button-navbar { - color: #666666; - cursor: pointer; -} - -.button-navbar-action { - background-color: #E4594F; - color: #FFFFFF; - cursor: pointer; - display: block; - width: 150px; - text-align: center; - padding: 2px; - float: right; - - .fa { - font-size: 20px; - margin-right: 10px; - } -} - -.lien-demarche { - p.alert { - margin-bottom: 8px; - } -} - -.button-navbar-action:hover { - color: $light-blue; -} - -.button-navbar:hover, -.button-navbar-action:hover { - text-decoration: none; -} - -#credentials { - display: none; - width: initial; - padding: 10px; - left: -130px; - text-align: center; - - .description { - font-weight: bold; - font-size: 20px; - } -} diff --git a/app/assets/stylesheets/new_design/new_alert.scss b/app/assets/stylesheets/new_alert.scss similarity index 100% rename from app/assets/stylesheets/new_design/new_alert.scss rename to app/assets/stylesheets/new_alert.scss diff --git a/app/assets/stylesheets/new_design/_constants.scss b/app/assets/stylesheets/new_design/_constants.scss deleted file mode 100644 index 02558f175..000000000 --- a/app/assets/stylesheets/new_design/_constants.scss +++ /dev/null @@ -1,14 +0,0 @@ -$page-width: 1040px; -$small-page-width: 840px; - -$default-spacer: 8px; -$default-padding: 2 * $default-spacer; -$default-fields-spacer: 5 * $default-spacer; - -// layouts -$two-columns-padding: 60px; -$two-columns-breakpoint: 980px; -$sub-header-bottom-margin: 3 * $default-spacer; - -// z-order -$alert-z-index: 100; diff --git a/app/assets/stylesheets/new_design/attestation_template_edit.scss b/app/assets/stylesheets/new_design/attestation_template_edit.scss deleted file mode 100644 index 4c5069655..000000000 --- a/app/assets/stylesheets/new_design/attestation_template_edit.scss +++ /dev/null @@ -1,56 +0,0 @@ -@import "colors"; -@import "constants"; - -#attestation-template-edit { - .text-active { - color: $green; - } - - .text-inactive { - color: $grey; - } -} - -#tags-table { - margin-top: -20px; - margin-bottom: 40px; - - .add-tag-title { - font-size: 18px; - margin-bottom: 16px; - } - - .head { - padding: 10px 0px; - font-weight: bold; - display: flex; - } - - .items { - max-height: 210px; - overflow-y: auto; - border-bottom: 1px solid $border-grey; - } - - .item { - display: flex; - padding: 10px 0; - border-bottom: solid 1px $border-grey; - - .tag { - font-weight: bold; - } - - &:last-child { - border-bottom: none; - } - } - - .tag { - width: 35%; - } - - .description { - width: 65%; - } -} diff --git a/app/assets/stylesheets/new_design/carte.scss b/app/assets/stylesheets/new_design/carte.scss deleted file mode 100644 index 8728a4915..000000000 --- a/app/assets/stylesheets/new_design/carte.scss +++ /dev/null @@ -1,17 +0,0 @@ -.areas-title { - font-weight: bold; - margin-top: 5px; - margin-bottom: 5px; -} - -.areas { - margin-bottom: 10px; - - input { - margin-top: 5px; - } -} - -.form [data-react-class='MapEditor'] [data-reach-combobox-input] { - margin-bottom: 0; -} diff --git a/app/assets/stylesheets/new_design/direct_uploads.scss b/app/assets/stylesheets/new_design/direct_uploads.scss deleted file mode 100644 index 54fa203b1..000000000 --- a/app/assets/stylesheets/new_design/direct_uploads.scss +++ /dev/null @@ -1,39 +0,0 @@ -@import "colors"; - -.direct-upload { - display: inline-block; - position: relative; - padding: 4px 15px; - margin: 0 3px 3px 0; - border: 1px solid $border-grey; - border-radius: 3px; - font-size: 14px; -} - -.direct-upload--pending { - opacity: 0.6; -} - -.direct-upload__progress { - position: absolute; - top: 0; - left: 0; - bottom: 0; - opacity: 0.2; - background: #0076ff; - transition: width 120ms ease-out, opacity 60ms 60ms ease-in; - transform: translate3d(0, 0, 0); -} - -.direct-upload--complete .direct-upload__progress { - opacity: 0.4; -} - -.direct-upload--error { - border-color: red; -} - -input[type=file][data-direct-upload-url][disabled], -input[type=file][data-auto-attach-url][disabled] { - display: none; -} diff --git a/app/assets/stylesheets/new_design/new_application.scss b/app/assets/stylesheets/new_design/new_application.scss deleted file mode 100644 index af88e9f77..000000000 --- a/app/assets/stylesheets/new_design/new_application.scss +++ /dev/null @@ -1,9 +0,0 @@ -// = require ./reset -// = require ./custom_reset -// = require ./common -// = require ./utils -// = require ./fonts -// = require leaflet -// = require select2 -// = require_tree . -// = stub ./print.scss diff --git a/app/assets/stylesheets/new_design/print.scss b/app/assets/stylesheets/new_design/print.scss deleted file mode 100644 index cbb30fc56..000000000 --- a/app/assets/stylesheets/new_design/print.scss +++ /dev/null @@ -1,63 +0,0 @@ -@import "colors"; -@import "fonts"; - -.new-header, -.sub-header, -footer { - display: none; -} - -.print-header { - display: block; - margin-top: 30px; - font-size: 30px; - line-height: 50px; - font-weight: bold; -} - -body { - font-family: "Muli"; -} - -.subtitle { - margin-top: -20px; - color: $dark-grey; -} - -th, -td { - vertical-align: top; -} - -th { - text-align: left; - - &.header-section { - padding-top: 1.2em; - font-size: 1.2em; - } -} - -.messagerie { - .messages-list { - list-style: none; - padding-left: 0; - max-height: none; - - h2 { - font-size: 110%; - } - - .person-icon { - display: none; - } - } -} - -.message { - margin-bottom: 40px; -} - -.updated-at { - display: none; -} diff --git a/app/assets/stylesheets/new_design/site_banner.scss b/app/assets/stylesheets/new_design/site_banner.scss deleted file mode 100644 index 6b4448781..000000000 --- a/app/assets/stylesheets/new_design/site_banner.scss +++ /dev/null @@ -1,35 +0,0 @@ -@import "colors"; -@import "constants"; - -.site-banner { - width: 100%; - margin: 0; - padding: $default-padding; - color: $black; - background-color: $yellow; - border-bottom: 1px dashed rgba(0, 0, 0, 0.6); - - &.warning { - background-color: $orange-bg; - } - - .container { - display: flex; - align-items: center; - } -} - -.site-banner-icon { - margin-right: $default-padding; - font-size: 30px; - opacity: 0.7; -} - -.site-banner-actions { - display: flex; - margin-left: auto; - - .button { - margin-left: $default-spacer; - } -} diff --git a/app/assets/stylesheets/new_design/new_footer.scss b/app/assets/stylesheets/new_footer.scss similarity index 100% rename from app/assets/stylesheets/new_design/new_footer.scss rename to app/assets/stylesheets/new_footer.scss diff --git a/app/assets/stylesheets/new_design/new_header.scss b/app/assets/stylesheets/new_header.scss similarity index 100% rename from app/assets/stylesheets/new_design/new_header.scss rename to app/assets/stylesheets/new_header.scss diff --git a/app/assets/stylesheets/new_design/new_procedure_from_existing.scss b/app/assets/stylesheets/new_procedure_from_existing.scss similarity index 100% rename from app/assets/stylesheets/new_design/new_procedure_from_existing.scss rename to app/assets/stylesheets/new_procedure_from_existing.scss diff --git a/app/assets/stylesheets/new_design/notifications.scss b/app/assets/stylesheets/notifications.scss similarity index 100% rename from app/assets/stylesheets/new_design/notifications.scss rename to app/assets/stylesheets/notifications.scss diff --git a/app/assets/stylesheets/new_design/pagination.scss b/app/assets/stylesheets/pagination.scss similarity index 100% rename from app/assets/stylesheets/new_design/pagination.scss rename to app/assets/stylesheets/pagination.scss diff --git a/app/assets/stylesheets/new_design/password_strength.scss b/app/assets/stylesheets/password_strength.scss similarity index 100% rename from app/assets/stylesheets/new_design/password_strength.scss rename to app/assets/stylesheets/password_strength.scss diff --git a/app/assets/stylesheets/new_design/patron.scss b/app/assets/stylesheets/patron.scss similarity index 100% rename from app/assets/stylesheets/new_design/patron.scss rename to app/assets/stylesheets/patron.scss diff --git a/app/assets/stylesheets/new_design/personnes_impliquees.scss b/app/assets/stylesheets/personnes_impliquees.scss similarity index 100% rename from app/assets/stylesheets/new_design/personnes_impliquees.scss rename to app/assets/stylesheets/personnes_impliquees.scss diff --git a/app/assets/stylesheets/new_design/pj.scss b/app/assets/stylesheets/pj.scss similarity index 100% rename from app/assets/stylesheets/new_design/pj.scss rename to app/assets/stylesheets/pj.scss diff --git a/app/assets/stylesheets/pj_modal.scss b/app/assets/stylesheets/pj_modal.scss deleted file mode 100644 index deba37dfc..000000000 --- a/app/assets/stylesheets/pj_modal.scss +++ /dev/null @@ -1,9 +0,0 @@ -#pj-modal { - .modal-body { - .table { - .tr-content { - display: none; - } - } - } -} diff --git a/app/assets/stylesheets/print.scss b/app/assets/stylesheets/print.scss index 3376d226f..cbb30fc56 100644 --- a/app/assets/stylesheets/print.scss +++ b/app/assets/stylesheets/print.scss @@ -1,42 +1,63 @@ -@media print { - html, - body { - margin: 0; - } +@import "colors"; +@import "fonts"; - #infos-dossiers .row:last-child { - display: none; - } +.new-header, +.sub-header, +footer { + display: none; +} - #infos-dossiers { - margin-bottom: -70px; - } +.print-header { + display: block; + margin-top: 30px; + font-size: 30px; + line-height: 50px; + font-weight: bold; +} - #left-panel { - margin-top: 0; - height: auto; - position: relative; - width: 100%; - } +body { + font-family: "Muli"; +} - #wrap { - overflow: visible; - } +.subtitle { + margin-top: -20px; + color: $dark-grey; +} - #main-container { - width: 100%; - } +th, +td { + vertical-align: top; +} - .copyright { - width: 100%; - left: 0; - } +th { + text-align: left; - .no-page-break-inside { - page-break-inside: avoid; - } - - .display-block-on-print { - display: block !important; + &.header-section { + padding-top: 1.2em; + font-size: 1.2em; } } + +.messagerie { + .messages-list { + list-style: none; + padding-left: 0; + max-height: none; + + h2 { + font-size: 110%; + } + + .person-icon { + display: none; + } + } +} + +.message { + margin-bottom: 40px; +} + +.updated-at { + display: none; +} diff --git a/app/assets/stylesheets/procedure.scss b/app/assets/stylesheets/procedure.scss deleted file mode 100644 index 591dea9a8..000000000 --- a/app/assets/stylesheets/procedure.scss +++ /dev/null @@ -1,33 +0,0 @@ -#modules-api-carto { - display: none; -} - -#procedure-lien-demarche { - display: none; -} - -#individual-with-siret { - display: none; -} - -.procedure { - &-description { - img { - max-width: 100%; - } - } -} - -.procedure-lien { - align-items: center; - display: flex; - margin-bottom: 8px; - - .prefix { - flex-shrink: 0; - } - - input { - margin-left: 8px; - } -} diff --git a/app/assets/stylesheets/new_design/procedure_admin.scss b/app/assets/stylesheets/procedure_admin.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_admin.scss rename to app/assets/stylesheets/procedure_admin.scss diff --git a/app/assets/stylesheets/new_design/procedure_champs_editor.scss b/app/assets/stylesheets/procedure_champs_editor.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_champs_editor.scss rename to app/assets/stylesheets/procedure_champs_editor.scss diff --git a/app/assets/stylesheets/new_design/procedure_context.scss b/app/assets/stylesheets/procedure_context.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_context.scss rename to app/assets/stylesheets/procedure_context.scss diff --git a/app/assets/stylesheets/new_design/procedure_form.scss b/app/assets/stylesheets/procedure_form.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_form.scss rename to app/assets/stylesheets/procedure_form.scss diff --git a/app/assets/stylesheets/new_design/procedure_list.scss b/app/assets/stylesheets/procedure_list.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_list.scss rename to app/assets/stylesheets/procedure_list.scss diff --git a/app/assets/stylesheets/new_design/procedure_logo.scss b/app/assets/stylesheets/procedure_logo.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_logo.scss rename to app/assets/stylesheets/procedure_logo.scss diff --git a/app/assets/stylesheets/new_design/procedure_show.scss b/app/assets/stylesheets/procedure_show.scss similarity index 100% rename from app/assets/stylesheets/new_design/procedure_show.scss rename to app/assets/stylesheets/procedure_show.scss diff --git a/app/assets/stylesheets/new_design/profil.scss b/app/assets/stylesheets/profil.scss similarity index 100% rename from app/assets/stylesheets/new_design/profil.scss rename to app/assets/stylesheets/profil.scss diff --git a/app/assets/stylesheets/new_design/reset.scss b/app/assets/stylesheets/reset.scss similarity index 100% rename from app/assets/stylesheets/new_design/reset.scss rename to app/assets/stylesheets/reset.scss diff --git a/app/assets/stylesheets/new_design/rich_text.scss b/app/assets/stylesheets/rich_text.scss similarity index 100% rename from app/assets/stylesheets/new_design/rich_text.scss rename to app/assets/stylesheets/rich_text.scss diff --git a/app/assets/stylesheets/search.scss b/app/assets/stylesheets/search.scss deleted file mode 100644 index 17514154a..000000000 --- a/app/assets/stylesheets/search.scss +++ /dev/null @@ -1,34 +0,0 @@ -.new-design-button { - color: #FFFFFF; - display: block; - font-size: 20px; - margin: 16px 0; - padding: 8px; - text-align: center; - border: 1px solid #FFFFFF; - border-radius: 15px; - - &:hover { - background-color: #668ABD; - color: #FFFFFF; - } -} - -#search-block { - margin: 15px 10px 0 10px; -} - -#search-button { - height: 34px; -} - -#mask-search { - display: none; - position: fixed; - background-color: rgba(0, 0, 0, 0.4); - top: 0; - left: 0; - width: 100%; - height: 100%; - z-index: 200; -} diff --git a/app/assets/stylesheets/new_design/services_index.scss b/app/assets/stylesheets/services_index.scss similarity index 100% rename from app/assets/stylesheets/new_design/services_index.scss rename to app/assets/stylesheets/services_index.scss diff --git a/app/assets/stylesheets/site_banner.scss b/app/assets/stylesheets/site_banner.scss index 9db9b754f..6b4448781 100644 --- a/app/assets/stylesheets/site_banner.scss +++ b/app/assets/stylesheets/site_banner.scss @@ -1,25 +1,26 @@ +@import "colors"; +@import "constants"; + .site-banner { width: 100%; margin: 0; - - color: #333333; - background-color: #FEF3B8; + padding: $default-padding; + color: $black; + background-color: $yellow; border-bottom: 1px dashed rgba(0, 0, 0, 0.6); &.warning { - background-color: #FFD8A6; + background-color: $orange-bg; } .container { display: flex; - width: auto; align-items: center; - padding: 8px 16px; } } .site-banner-icon { - margin-right: 16px; + margin-right: $default-padding; font-size: 30px; opacity: 0.7; } @@ -27,4 +28,8 @@ .site-banner-actions { display: flex; margin-left: auto; + + .button { + margin-left: $default-spacer; + } } diff --git a/app/assets/stylesheets/new_design/spinner.scss b/app/assets/stylesheets/spinner.scss similarity index 100% rename from app/assets/stylesheets/new_design/spinner.scss rename to app/assets/stylesheets/spinner.scss diff --git a/app/assets/stylesheets/new_design/stats.scss b/app/assets/stylesheets/stats.scss similarity index 100% rename from app/assets/stylesheets/new_design/stats.scss rename to app/assets/stylesheets/stats.scss diff --git a/app/assets/stylesheets/new_design/status_overview.scss b/app/assets/stylesheets/status_overview.scss similarity index 100% rename from app/assets/stylesheets/new_design/status_overview.scss rename to app/assets/stylesheets/status_overview.scss diff --git a/app/assets/stylesheets/new_design/sub_header.scss b/app/assets/stylesheets/sub_header.scss similarity index 100% rename from app/assets/stylesheets/new_design/sub_header.scss rename to app/assets/stylesheets/sub_header.scss diff --git a/app/assets/stylesheets/new_design/suivi.scss b/app/assets/stylesheets/suivi.scss similarity index 100% rename from app/assets/stylesheets/new_design/suivi.scss rename to app/assets/stylesheets/suivi.scss diff --git a/app/assets/stylesheets/new_design/super_admin.scss b/app/assets/stylesheets/super_admin.scss similarity index 100% rename from app/assets/stylesheets/new_design/super_admin.scss rename to app/assets/stylesheets/super_admin.scss diff --git a/app/assets/stylesheets/switch_menu.scss b/app/assets/stylesheets/switch_menu.scss deleted file mode 100644 index bd8e913ea..000000000 --- a/app/assets/stylesheets/switch_menu.scss +++ /dev/null @@ -1,16 +0,0 @@ -#switch-menu { - position: fixed; - bottom: 10px; - color: #FFFFFF; - list-style: none; - text-decoration: none; - padding-left: 20px; -} - -#switch-menu a, -#switch-menu a:link, -#switch-menu a:visited, -#switch-menu a:hover { - text-decoration: none; - color: #FFFFFF; -} diff --git a/app/assets/stylesheets/new_design/table.scss b/app/assets/stylesheets/table.scss similarity index 100% rename from app/assets/stylesheets/new_design/table.scss rename to app/assets/stylesheets/table.scss diff --git a/app/assets/stylesheets/new_design/table_service.scss b/app/assets/stylesheets/table_service.scss similarity index 100% rename from app/assets/stylesheets/new_design/table_service.scss rename to app/assets/stylesheets/table_service.scss diff --git a/app/assets/stylesheets/new_design/title.scss b/app/assets/stylesheets/title.scss similarity index 100% rename from app/assets/stylesheets/new_design/title.scss rename to app/assets/stylesheets/title.scss diff --git a/app/assets/stylesheets/new_design/toggle-switch.scss b/app/assets/stylesheets/toggle-switch.scss similarity index 100% rename from app/assets/stylesheets/new_design/toggle-switch.scss rename to app/assets/stylesheets/toggle-switch.scss diff --git a/app/assets/stylesheets/new_design/user_dossier_actions.scss b/app/assets/stylesheets/user_dossier_actions.scss similarity index 100% rename from app/assets/stylesheets/new_design/user_dossier_actions.scss rename to app/assets/stylesheets/user_dossier_actions.scss diff --git a/app/assets/stylesheets/new_design/user_signup.scss b/app/assets/stylesheets/user_signup.scss similarity index 100% rename from app/assets/stylesheets/new_design/user_signup.scss rename to app/assets/stylesheets/user_signup.scss diff --git a/app/assets/stylesheets/users.scss b/app/assets/stylesheets/users.scss deleted file mode 100644 index ba38c940b..000000000 --- a/app/assets/stylesheets/users.scss +++ /dev/null @@ -1,63 +0,0 @@ -@import "constants"; - -#admins-index { - margin-left: 2rem; - margin-right: 2rem; - - .default-data-block { - margin-top: 20px; - background-color: #FFFFFF; - - .show-block { - width: 100%; - } - - .body { - height: auto; - } - } -} - -#users-siret-index { - margin: 20px; -} - -#carto-page { - margin: 20px; -} - -.white-back { - margin: 20px !important; -} - -.white-back, -#users-siret-index, -#carto-page { - background-color: #FFFFFF; - box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.5); - padding: 20px; - - .action { - background-color: #E45B51; - text-align: center; - line-height: 40px; - font-size: 15px; - text-decoration: none; - color: #FFFFFF; - text-transform: uppercase; - border: none; - padding: 10px; - } - - .action:hover { - color: $light-blue; - } - - .padding-left-30 { - padding-left: 30px; - } - - h3 { - margin-bottom: 20px; - } -} diff --git a/app/assets/stylesheets/new_design/utils.scss b/app/assets/stylesheets/utils.scss similarity index 100% rename from app/assets/stylesheets/new_design/utils.scss rename to app/assets/stylesheets/utils.scss diff --git a/app/controllers/admin_controller.rb b/app/controllers/admin_controller.rb index 608c1fcef..fa1c4d408 100644 --- a/app/controllers/admin_controller.rb +++ b/app/controllers/admin_controller.rb @@ -1,6 +1,4 @@ class AdminController < ApplicationController - layout 'application_old' - before_action :authenticate_administrateur! def index diff --git a/app/controllers/api/v2/graphql_controller.rb b/app/controllers/api/v2/graphql_controller.rb index 34b564012..dafa1099c 100644 --- a/app/controllers/api/v2/graphql_controller.rb +++ b/app/controllers/api/v2/graphql_controller.rb @@ -61,7 +61,7 @@ class API::V2::GraphqlController < API::V2::BaseController def handle_error_in_production(exception) id = SecureRandom.uuid - Raven.capture_exception(exception, extra: { exception_id: id }) + Sentry.capture_exception(exception, extra: { exception_id: id }) render json: { errors: [ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 7768815e7..ccf75d2b4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -9,8 +9,7 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception, if: -> { !Rails.env.test? } before_action :set_current_roles - before_action :load_navbar_left_pannel_partial_url - before_action :set_raven_context + before_action :set_sentry_user before_action :redirect_if_untrusted before_action :reject, if: -> { feature_enabled?(:maintenance_mode) } before_action :configure_permitted_parameters, if: :devise_controller? @@ -30,14 +29,6 @@ class ApplicationController < ActionController::Base end end - def load_navbar_left_pannel_partial_url - controller = request.controller_class - method = params[:action] - service = RenderPartialService.new(controller, method) - @navbar_url = service.navbar - @left_pannel_url = service.left_panel - end - def multiple_devise_profile_connect? user_signed_in? && instructeur_signed_in? || instructeur_signed_in? && administrateur_signed_in? || @@ -149,8 +140,8 @@ class ApplicationController < ActionController::Base end end - def set_raven_context - Raven.user_context(sentry_user) + def set_sentry_user + Sentry.set_user(sentry_user) end # private method called by rails fwk diff --git a/app/controllers/champs/siret_controller.rb b/app/controllers/champs/siret_controller.rb index 6f1a5a4e4..60f5f1e48 100644 --- a/app/controllers/champs/siret_controller.rb +++ b/app/controllers/champs/siret_controller.rb @@ -11,15 +11,18 @@ class Champs::SiretController < ApplicationController end if !Siret.new(siret: @siret).valid? + # i18n-tasks-use t('errors.messages.invalid_siret') return siret_error(:invalid) end begin etablissement = find_etablissement_with_siret rescue ApiEntreprise::API::Error::RequestFailed, ApiEntreprise::API::Error::ServiceUnavailable + # i18n-tasks-use t('errors.siret_network_error') return siret_error(:network_error) end if etablissement.nil? + # i18n-tasks-use t('errors.messages.siret_not_found') return siret_error(:not_found) end diff --git a/app/graphql/types/dossier_type.rb b/app/graphql/types/dossier_type.rb index 55e8716f4..5f06dce75 100644 --- a/app/graphql/types/dossier_type.rb +++ b/app/graphql/types/dossier_type.rb @@ -82,7 +82,7 @@ module Types end def annotations - Loaders::Association.for(object.class, :champs_private).load(object) + Loaders::Association.for(object.class, champs_private: [:type_de_champ]).load(object) end def pdf diff --git a/app/helpers/procedure_helper.rb b/app/helpers/procedure_helper.rb index 6188838e5..155c28e21 100644 --- a/app/helpers/procedure_helper.rb +++ b/app/helpers/procedure_helper.rb @@ -14,6 +14,12 @@ module ProcedureHelper end def procedure_publish_text(procedure, key) + # i18n-tasks-use t('modal.publish.body.publish') + # i18n-tasks-use t('modal.publish.body.reopen') + # i18n-tasks-use t('modal.publish.submit.publish') + # i18n-tasks-use t('modal.publish.submit.reopen') + # i18n-tasks-use t('modal.publish.title.publish') + # i18n-tasks-use t('modal.publish.title.reopen') action = procedure.close? ? :reopen : :publish t(action, scope: [:modal, :publish, key]) end diff --git a/app/javascript/packs/application-old.js b/app/javascript/packs/application-old.js deleted file mode 100644 index e33dfc996..000000000 --- a/app/javascript/packs/application-old.js +++ /dev/null @@ -1,24 +0,0 @@ -import '../shared/polyfills'; -import Rails from '@rails/ujs'; -import * as ActiveStorage from '@rails/activestorage'; -import jQuery from 'jquery'; - -import '../shared/page-update-event'; -import '../shared/activestorage/ujs'; -import '../shared/safari-11-file-xhr-workaround'; -import '../shared/remote-input'; -import '../shared/franceconnect'; - -// Start Rails helpers -Rails.start(); -ActiveStorage.start(); - -// Disable jQuery-driven animations during tests -if (process.env['RAILS_ENV'] === 'test') { - jQuery.fx.off = true; -} - -// Export jQuery globally for legacy Javascript files used in the old design -jQuery.rails = Rails; -window.$ = jQuery; -window.jQuery = jQuery; diff --git a/app/jobs/api_entreprise/association_job.rb b/app/jobs/api_entreprise/association_job.rb index fe2716c31..26307854c 100644 --- a/app/jobs/api_entreprise/association_job.rb +++ b/app/jobs/api_entreprise/association_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::AssociationJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::RNAAdapter.new(etablissement.siret, procedure_id).to_params etablissement.update!(etablissement_params) end diff --git a/app/jobs/api_entreprise/attestation_fiscale_job.rb b/app/jobs/api_entreprise/attestation_fiscale_job.rb index aaa3c8cd3..ab6168f00 100644 --- a/app/jobs/api_entreprise/attestation_fiscale_job.rb +++ b/app/jobs/api_entreprise/attestation_fiscale_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::AttestationFiscaleJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id, user_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::AttestationFiscaleAdapter.new(etablissement.siret, procedure_id, user_id).to_params attestation_fiscale_url = etablissement_params.delete(:entreprise_attestation_fiscale_url) etablissement.upload_attestation_fiscale(attestation_fiscale_url) if attestation_fiscale_url.present? diff --git a/app/jobs/api_entreprise/attestation_sociale_job.rb b/app/jobs/api_entreprise/attestation_sociale_job.rb index 581ed8037..789afa650 100644 --- a/app/jobs/api_entreprise/attestation_sociale_job.rb +++ b/app/jobs/api_entreprise/attestation_sociale_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::AttestationSocialeJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::AttestationSocialeAdapter.new(etablissement.siret, procedure_id).to_params attestation_sociale_url = etablissement_params.delete(:entreprise_attestation_sociale_url) etablissement.upload_attestation_sociale(attestation_sociale_url) if attestation_sociale_url.present? diff --git a/app/jobs/api_entreprise/bilans_bdf_job.rb b/app/jobs/api_entreprise/bilans_bdf_job.rb index 61c198ab7..7501d3f37 100644 --- a/app/jobs/api_entreprise/bilans_bdf_job.rb +++ b/app/jobs/api_entreprise/bilans_bdf_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::BilansBdfJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::BilansBdfAdapter.new(etablissement.siret, procedure_id).to_params etablissement.update!(etablissement_params) end diff --git a/app/jobs/api_entreprise/effectifs_annuels_job.rb b/app/jobs/api_entreprise/effectifs_annuels_job.rb index d0c1c497e..9bc5e9c62 100644 --- a/app/jobs/api_entreprise/effectifs_annuels_job.rb +++ b/app/jobs/api_entreprise/effectifs_annuels_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::EffectifsAnnuelsJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::EffectifsAnnuelsAdapter.new(etablissement.siret, procedure_id).to_params etablissement.update!(etablissement_params) end diff --git a/app/jobs/api_entreprise/effectifs_job.rb b/app/jobs/api_entreprise/effectifs_job.rb index 321309e0b..5acf8c55f 100644 --- a/app/jobs/api_entreprise/effectifs_job.rb +++ b/app/jobs/api_entreprise/effectifs_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::EffectifsJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) # may 2020 is at the moment the most actual info for effectifs endpoint etablissement_params = ApiEntreprise::EffectifsAdapter.new(etablissement.siret, procedure_id, "2020", "05").to_params etablissement.update!(etablissement_params) diff --git a/app/jobs/api_entreprise/entreprise_job.rb b/app/jobs/api_entreprise/entreprise_job.rb index 02cf5caaf..b6317fd32 100644 --- a/app/jobs/api_entreprise/entreprise_job.rb +++ b/app/jobs/api_entreprise/entreprise_job.rb @@ -1,6 +1,6 @@ class ApiEntreprise::EntrepriseJob < ApiEntreprise::Job def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::EntrepriseAdapter.new(etablissement.siret, procedure_id).to_params etablissement.update!(etablissement_params) end diff --git a/app/jobs/api_entreprise/exercices_job.rb b/app/jobs/api_entreprise/exercices_job.rb index 343dd93da..ba5b27e29 100644 --- a/app/jobs/api_entreprise/exercices_job.rb +++ b/app/jobs/api_entreprise/exercices_job.rb @@ -3,7 +3,7 @@ class ApiEntreprise::ExercicesJob < ApiEntreprise::Job end def perform(etablissement_id, procedure_id) - etablissement = Etablissement.find(etablissement_id) + find_etablissement(etablissement_id) etablissement_params = ApiEntreprise::ExercicesAdapter.new(etablissement.siret, procedure_id).to_params etablissement.update!(etablissement_params) end diff --git a/app/jobs/api_entreprise/job.rb b/app/jobs/api_entreprise/job.rb index c7d749307..e7db45d29 100644 --- a/app/jobs/api_entreprise/job.rb +++ b/app/jobs/api_entreprise/job.rb @@ -8,9 +8,12 @@ class ApiEntreprise::Job < ApplicationJob # - bdf: erreur interne # so we retry every day for 5 days # same logic for ServiceUnavailable - retry_on ApiEntreprise::API::Error::ServiceUnavailable, - ApiEntreprise::API::Error::BadGateway, - wait: 1.day + rescue_from(ApiEntreprise::API::Error::ServiceUnavailable) do |exception| + retry_or_discard(exception) + end + rescue_from(ApiEntreprise::API::Error::BadGateway) do |exception| + retry_or_discard(exception) + end # We guess the backend is slow but not broken # and the information we are looking for is available @@ -33,7 +36,31 @@ class ApiEntreprise::Job < ApplicationJob # override ApplicationJob#error to avoid reporting to sentry end + def log_job_exception(exception) + if etablissement.present? + if etablissement.dossier.present? + etablissement.dossier.log_api_entreprise_job_exception(exception) + elsif etablissement.champ.present? + etablissement.champ.log_fetch_external_data_exception(exception) + end + end + end + + def retry_or_discard(exception) + if executions < max_attempts + retry_job wait: 1.day + else + log_job_exception(exception) + end + end + def max_attempts ENV.fetch("MAX_ATTEMPTS_API_ENTREPRISE_JOBS", DEFAULT_MAX_ATTEMPTS_API_ENTREPRISE_JOBS).to_i end + + attr_reader :etablissement + + def find_etablissement(etablissement_id) + @etablissement = Etablissement.find(etablissement_id) + end end diff --git a/app/jobs/application_job.rb b/app/jobs/application_job.rb index 1caa5b3ac..e858bae90 100644 --- a/app/jobs/application_job.rb +++ b/app/jobs/application_job.rb @@ -12,7 +12,7 @@ class ApplicationJob < ActiveJob::Base end def error(job, exception) - Raven.capture_exception(exception) + Sentry.capture_exception(exception) end def max_attempts diff --git a/app/jobs/cron/auto_archive_procedure_job.rb b/app/jobs/cron/auto_archive_procedure_job.rb index c3a1ceb39..9a998cf43 100644 --- a/app/jobs/cron/auto_archive_procedure_job.rb +++ b/app/jobs/cron/auto_archive_procedure_job.rb @@ -13,7 +13,7 @@ class Cron::AutoArchiveProcedureJob < Cron::CronJob procedure.close! rescue StandardError => e - Raven.capture_exception(e, extra: { procedure_id: procedure.id }) + Sentry.capture_exception(e, extra: { procedure_id: procedure.id }) end end end diff --git a/app/mailers/application_mailer.rb b/app/mailers/application_mailer.rb index 8efa47136..dd5ed4084 100644 --- a/app/mailers/application_mailer.rb +++ b/app/mailers/application_mailer.rb @@ -25,8 +25,7 @@ class ApplicationMailer < ActionMailer::Base rescue StandardError => e # A problem occured when reading logo, maybe the logo is missing and we should clean the procedure to remove logo reference ? - Raven.extra_context(procedure_id: procedure.id) - Raven.capture_exception(e) + Sentry.capture_exception(e, extra: { procedure_id: procedure.id }) nil end end diff --git a/app/models/assign_to.rb b/app/models/assign_to.rb index 07ddde607..82146a7d5 100644 --- a/app/models/assign_to.rb +++ b/app/models/assign_to.rb @@ -35,7 +35,7 @@ class AssignTo < ApplicationRecord # a bug somewhere else that we need to fix. errors = procedure_presentation.errors - Raven.capture_message( + Sentry.capture_message( "Destroying invalid ProcedurePresentation", extra: { procedure_presentation: procedure_presentation.as_json } ) diff --git a/app/models/champ.rb b/app/models/champ.rb index e41120460..fb8dd3221 100644 --- a/app/models/champ.rb +++ b/app/models/champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champ < ApplicationRecord belongs_to :dossier, -> { with_discarded }, inverse_of: :champs, touch: true, optional: false @@ -136,6 +137,12 @@ class Champ < ApplicationRecord type_de_champ.stable_id end + def log_fetch_external_data_exception(exception) + exceptions = self.fetch_external_data_exceptions ||= [] + exceptions << exception.inspect + update_column(:fetch_external_data_exceptions, exceptions) + end + private def needs_dossier_id? diff --git a/app/models/champs/address_champ.rb b/app/models/champs/address_champ.rb index 2bb2c83cc..22bc171e8 100644 --- a/app/models/champs/address_champ.rb +++ b/app/models/champs/address_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::AddressChamp < Champs::TextChamp end diff --git a/app/models/champs/annuaire_education_champ.rb b/app/models/champs/annuaire_education_champ.rb index 4463cc622..79293920a 100644 --- a/app/models/champs/annuaire_education_champ.rb +++ b/app/models/champs/annuaire_education_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::AnnuaireEducationChamp < Champs::TextChamp before_save :cleanup_if_empty diff --git a/app/models/champs/carte_champ.rb b/app/models/champs/carte_champ.rb index 4833ef8f5..0c97eed26 100644 --- a/app/models/champs/carte_champ.rb +++ b/app/models/champs/carte_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::CarteChamp < Champ # Default map location. Center of the World, ahm, France... diff --git a/app/models/champs/checkbox_champ.rb b/app/models/champs/checkbox_champ.rb index 048480a38..40b38af23 100644 --- a/app/models/champs/checkbox_champ.rb +++ b/app/models/champs/checkbox_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::CheckboxChamp < Champs::YesNoChamp def true? diff --git a/app/models/champs/civilite_champ.rb b/app/models/champs/civilite_champ.rb index b971e46c9..8f04758cb 100644 --- a/app/models/champs/civilite_champ.rb +++ b/app/models/champs/civilite_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::CiviliteChamp < Champ def html_label? diff --git a/app/models/champs/commune_champ.rb b/app/models/champs/commune_champ.rb index 02b3595e5..2ebab8e41 100644 --- a/app/models/champs/commune_champ.rb +++ b/app/models/champs/commune_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::CommuneChamp < Champs::TextChamp end diff --git a/app/models/champs/date_champ.rb b/app/models/champs/date_champ.rb index 3eac8eee8..1eca35bf8 100644 --- a/app/models/champs/date_champ.rb +++ b/app/models/champs/date_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DateChamp < Champ before_save :format_before_save diff --git a/app/models/champs/datetime_champ.rb b/app/models/champs/datetime_champ.rb index 21a905f77..cf2d6c7e1 100644 --- a/app/models/champs/datetime_champ.rb +++ b/app/models/champs/datetime_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DatetimeChamp < Champ before_save :format_before_save diff --git a/app/models/champs/decimal_number_champ.rb b/app/models/champs/decimal_number_champ.rb index 3a11cb9ec..b907c1c50 100644 --- a/app/models/champs/decimal_number_champ.rb +++ b/app/models/champs/decimal_number_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DecimalNumberChamp < Champ validates :value, numericality: { diff --git a/app/models/champs/departement_champ.rb b/app/models/champs/departement_champ.rb index ae242484e..d4eaa8501 100644 --- a/app/models/champs/departement_champ.rb +++ b/app/models/champs/departement_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DepartementChamp < Champs::TextChamp end diff --git a/app/models/champs/dossier_link_champ.rb b/app/models/champs/dossier_link_champ.rb index 4812e90cb..39ba322f8 100644 --- a/app/models/champs/dossier_link_champ.rb +++ b/app/models/champs/dossier_link_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DossierLinkChamp < Champ end diff --git a/app/models/champs/drop_down_list_champ.rb b/app/models/champs/drop_down_list_champ.rb index 181696853..29b9be33a 100644 --- a/app/models/champs/drop_down_list_champ.rb +++ b/app/models/champs/drop_down_list_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::DropDownListChamp < Champ THRESHOLD_NB_OPTIONS_AS_RADIO = 5 diff --git a/app/models/champs/email_champ.rb b/app/models/champs/email_champ.rb index 147a1a10c..67bdd1ca4 100644 --- a/app/models/champs/email_champ.rb +++ b/app/models/champs/email_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::EmailChamp < Champs::TextChamp end diff --git a/app/models/champs/engagement_champ.rb b/app/models/champs/engagement_champ.rb index 5dd52d37d..b6992749e 100644 --- a/app/models/champs/engagement_champ.rb +++ b/app/models/champs/engagement_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::EngagementChamp < Champs::CheckboxChamp end diff --git a/app/models/champs/explication_champ.rb b/app/models/champs/explication_champ.rb index 92db6836a..022149978 100644 --- a/app/models/champs/explication_champ.rb +++ b/app/models/champs/explication_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::ExplicationChamp < Champs::TextChamp def search_terms diff --git a/app/models/champs/header_section_champ.rb b/app/models/champs/header_section_champ.rb index 995326224..59fd78da0 100644 --- a/app/models/champs/header_section_champ.rb +++ b/app/models/champs/header_section_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::HeaderSectionChamp < Champ def search_terms diff --git a/app/models/champs/iban_champ.rb b/app/models/champs/iban_champ.rb index 2862642df..feb3429dd 100644 --- a/app/models/champs/iban_champ.rb +++ b/app/models/champs/iban_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::IbanChamp < Champ validates_with IbanValidator diff --git a/app/models/champs/integer_number_champ.rb b/app/models/champs/integer_number_champ.rb index 7d1f6a9e5..68bf2e173 100644 --- a/app/models/champs/integer_number_champ.rb +++ b/app/models/champs/integer_number_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::IntegerNumberChamp < Champ validates :value, numericality: { @@ -22,6 +23,7 @@ class Champs::IntegerNumberChamp < Champ allow_nil: true, allow_blank: true, message: -> (object, _data) { + # i18n-tasks-use t('errors.messages.not_an_integer') "« #{object.libelle} » " + object.errors.generate_message(:value, :not_an_integer) } } diff --git a/app/models/champs/linked_drop_down_list_champ.rb b/app/models/champs/linked_drop_down_list_champ.rb index 4d802bb49..355f44442 100644 --- a/app/models/champs/linked_drop_down_list_champ.rb +++ b/app/models/champs/linked_drop_down_list_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::LinkedDropDownListChamp < Champ delegate :primary_options, :secondary_options, to: 'type_de_champ.dynamic_type' diff --git a/app/models/champs/multiple_drop_down_list_champ.rb b/app/models/champs/multiple_drop_down_list_champ.rb index 2186897bb..c6aa132a7 100644 --- a/app/models/champs/multiple_drop_down_list_champ.rb +++ b/app/models/champs/multiple_drop_down_list_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::MultipleDropDownListChamp < Champ before_save :format_before_save diff --git a/app/models/champs/number_champ.rb b/app/models/champs/number_champ.rb index e08c5f2bf..e0186615c 100644 --- a/app/models/champs/number_champ.rb +++ b/app/models/champs/number_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::NumberChamp < Champ end diff --git a/app/models/champs/pays_champ.rb b/app/models/champs/pays_champ.rb index 42bea3386..ba56eb3ee 100644 --- a/app/models/champs/pays_champ.rb +++ b/app/models/champs/pays_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::PaysChamp < Champs::TextChamp end diff --git a/app/models/champs/phone_champ.rb b/app/models/champs/phone_champ.rb index e395f7a21..74e345f53 100644 --- a/app/models/champs/phone_champ.rb +++ b/app/models/champs/phone_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::PhoneChamp < Champs::TextChamp validates :value, diff --git a/app/models/champs/piece_justificative_champ.rb b/app/models/champs/piece_justificative_champ.rb index 53e97854d..405274d4e 100644 --- a/app/models/champs/piece_justificative_champ.rb +++ b/app/models/champs/piece_justificative_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::PieceJustificativeChamp < Champ MAX_SIZE = 200.megabytes diff --git a/app/models/champs/region_champ.rb b/app/models/champs/region_champ.rb index 3d15aefc4..cf5e89075 100644 --- a/app/models/champs/region_champ.rb +++ b/app/models/champs/region_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::RegionChamp < Champs::TextChamp end diff --git a/app/models/champs/repetition_champ.rb b/app/models/champs/repetition_champ.rb index 8ab6469d9..60064d04c 100644 --- a/app/models/champs/repetition_champ.rb +++ b/app/models/champs/repetition_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::RepetitionChamp < Champ accepts_nested_attributes_for :champs, allow_destroy: true diff --git a/app/models/champs/siret_champ.rb b/app/models/champs/siret_champ.rb index e7dabf5a1..2e21f1ff3 100644 --- a/app/models/champs/siret_champ.rb +++ b/app/models/champs/siret_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::SiretChamp < Champ def search_terms diff --git a/app/models/champs/text_champ.rb b/app/models/champs/text_champ.rb index 4456e4a1d..11fcb3939 100644 --- a/app/models/champs/text_champ.rb +++ b/app/models/champs/text_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::TextChamp < Champ end diff --git a/app/models/champs/textarea_champ.rb b/app/models/champs/textarea_champ.rb index 20d64225d..89177feb2 100644 --- a/app/models/champs/textarea_champ.rb +++ b/app/models/champs/textarea_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::TextareaChamp < Champs::TextChamp def for_export diff --git a/app/models/champs/titre_identite_champ.rb b/app/models/champs/titre_identite_champ.rb index 127711565..b4e32e141 100644 --- a/app/models/champs/titre_identite_champ.rb +++ b/app/models/champs/titre_identite_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::TitreIdentiteChamp < Champ MAX_SIZE = 20.megabytes diff --git a/app/models/champs/yes_no_champ.rb b/app/models/champs/yes_no_champ.rb index 7a1e7bc5f..ccbd46186 100644 --- a/app/models/champs/yes_no_champ.rb +++ b/app/models/champs/yes_no_champ.rb @@ -2,19 +2,20 @@ # # Table name: champs # -# id :integer not null, primary key -# data :jsonb -# private :boolean default(FALSE), not null -# row :integer -# type :string -# value :string -# created_at :datetime -# updated_at :datetime -# dossier_id :integer -# etablissement_id :integer -# external_id :string -# parent_id :bigint -# type_de_champ_id :integer +# id :integer not null, primary key +# data :jsonb +# fetch_external_data_exceptions :string is an Array +# private :boolean default(FALSE), not null +# row :integer +# type :string +# value :string +# created_at :datetime +# updated_at :datetime +# dossier_id :integer +# etablissement_id :integer +# external_id :string +# parent_id :bigint +# type_de_champ_id :integer # class Champs::YesNoChamp < Champ def search_terms diff --git a/app/models/dossier.rb b/app/models/dossier.rb index 165209d1d..a763570c1 100644 --- a/app/models/dossier.rb +++ b/app/models/dossier.rb @@ -3,6 +3,7 @@ # Table name: dossiers # # id :integer not null, primary key +# api_entreprise_job_exceptions :string is an Array # archived :boolean default(FALSE) # autorisation_donnees :boolean # brouillon_close_to_expiration_notice_sent_at :datetime @@ -819,6 +820,12 @@ class Dossier < ApplicationRecord } end + def log_api_entreprise_job_exception(exception) + exceptions = self.api_entreprise_job_exceptions ||= [] + exceptions << exception.inspect + update_column(:api_entreprise_job_exceptions, exceptions) + end + private def geo_areas diff --git a/app/services/procedure_export_service.rb b/app/services/procedure_export_service.rb index 437d4b13d..5e6df9689 100644 --- a/app/services/procedure_export_service.rb +++ b/app/services/procedure_export_service.rb @@ -76,7 +76,7 @@ class ProcedureExportService # transliterate: convert to ASCII characters # to ensure truncate respects 30 bytes # /\*?[] are invalid Excel worksheet characters - options[:sheet_name] = I18n.transliterate(options[:sheet_name], '', locale: :en) + options[:sheet_name] = I18n.transliterate(options[:sheet_name], locale: :en) .delete('/\*?[]') .truncate(30, omission: '') diff --git a/app/services/render_partial_service.rb b/app/services/render_partial_service.rb deleted file mode 100644 index 9bfb61445..000000000 --- a/app/services/render_partial_service.rb +++ /dev/null @@ -1,36 +0,0 @@ -class RenderPartialService - attr_accessor :controller, :method - - def initialize(controller, method) - @controller = controller - @method = method - end - - def navbar - retrieve_navbar - end - - def left_panel - retrieve_left_panel - end - - def self.left_panel_exist?(left_panel_url) - file = left_panel_url.split('/').last - - File.exist?(Rails.root.join('app', 'views', 'layouts', 'left_panels', "_#{file}.html.haml")) - end - - private - - def retrieve_navbar - "layouts/navbars/navbar_#{retrieve_name}" - end - - def retrieve_left_panel - "layouts/left_panels/left_panel_#{retrieve_name}" - end - - def retrieve_name - "#{controller.to_s.parameterize.underscore}_#{method}" - end -end diff --git a/app/views/dossiers/dossier_vide.pdf.prawn b/app/views/dossiers/dossier_vide.pdf.prawn index b33924ae3..5678ee1b0 100644 --- a/app/views/dossiers/dossier_vide.pdf.prawn +++ b/app/views/dossiers/dossier_vide.pdf.prawn @@ -181,7 +181,7 @@ prawn_document(page_size: "A4") do |pdf| italic: Rails.root.join('lib/prawn/fonts/marianne/marianne-thin.ttf' ), }) pdf.font 'marianne' - pdf.svg IO.read("app/assets/images/header/logo-ds-wide.svg"), width: 300, position: :center + pdf.svg IO.read(DOSSIER_PDF_EXPORT_LOGO_SRC), width: 300, position: :center pdf.move_down(40) render_in_2_columns(pdf, 'Démarche', @dossier.procedure.libelle) diff --git a/app/views/dossiers/show.pdf.prawn b/app/views/dossiers/show.pdf.prawn index 5d85579cb..2c7bdf02f 100644 --- a/app/views/dossiers/show.pdf.prawn +++ b/app/views/dossiers/show.pdf.prawn @@ -170,7 +170,7 @@ prawn_document(page_size: "A4") do |pdf| }) pdf.font 'marianne' - pdf.svg IO.read("app/assets/images/header/logo-ds-wide.svg"), width: 300, position: :center + pdf.svg IO.read(DOSSIER_PDF_EXPORT_LOGO_SRC), width: 300, position: :center pdf.move_down(40) format_in_2_columns(pdf, 'Dossier Nº', @dossier.id.to_s) diff --git a/app/views/layouts/_new_header.haml b/app/views/layouts/_header.haml similarity index 100% rename from app/views/layouts/_new_header.haml rename to app/views/layouts/_header.haml diff --git a/app/views/layouts/_navbar.html.haml b/app/views/layouts/_navbar.html.haml deleted file mode 100644 index a712365e4..000000000 --- a/app/views/layouts/_navbar.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -.col-xs-2 - %a#title-navbar{ href: root_path } - .row#home - .col-lg-6.no-padding - = image_tag('marianne.svg', class: 'logo') - .col-lg-6.no-padding#tps-title - = APPLICATION_NAME - -.col-xs-10.no-padding - #navbar-body - .row - %div{ style: "max-width: 50%; position: absolute; display: flex; flex-direction: column; justify-content: center; height: 60px; line-height: 20px; z-index: 2;" } - %span - 👉 Besoin d’aide ? Consultez la documentation et l’aide, contactez-nous par chat ou email, ou prenez RDV. - -# BEST WTF EVER - -# this begin rescue hides potentials bugs by displaying another navbar - - begin - = render partial: @navbar_url - - rescue - = render partial: 'layouts/navbars/navbar_default' - - = render partial: 'layouts/navbars/navbar_log_options' diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 55ba66a6c..d2ed48a5c 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -19,8 +19,8 @@ = preload_link_tag(asset_url("Muli-Regular.woff2")) = preload_link_tag(asset_url("Muli-Bold.woff2")) - = stylesheet_link_tag 'new_design/new_application', media: 'all' - = stylesheet_link_tag 'new_design/print', media: 'print' + = stylesheet_link_tag 'application', media: 'all' + = stylesheet_link_tag 'print', media: 'print' = Gon::Base.render_data(camel_case: true, init: true, nonce: request.content_security_policy_nonce) @@ -36,7 +36,7 @@ #beta Env Test - = render partial: "layouts/new_header" + = render partial: "layouts/header" %main = render partial: "layouts/flash_messages" = content_for?(:content) ? yield(:content) : yield diff --git a/app/views/layouts/application_old.html.haml b/app/views/layouts/application_old.html.haml deleted file mode 100644 index dd6ee1301..000000000 --- a/app/views/layouts/application_old.html.haml +++ /dev/null @@ -1,42 +0,0 @@ -%html - %head - %meta{ :content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type" }/ - %title - = t('dynamics.page_title') - %meta{ 'http-equiv' => "X-UA-Compatible", :content => "IE=edge" } - - = favicon_link_tag(image_url("#{FAVICON_16PX_SRC}"), type: "image/png", sizes: "16x16") - = favicon_link_tag(image_url("#{FAVICON_32PX_SRC}"), type: "image/png", sizes: "32x32") - = favicon_link_tag(image_url("#{FAVICON_96PX_SRC}"), type: "image/png", sizes: "96x96") - - = stylesheet_link_tag 'application', media: 'all' - = stylesheet_link_tag 'print', media: 'print' - - packs = ['application-old', 'track', administrateur_signed_in? ? 'track-admin' : nil].compact - = javascript_packs_with_chunks_tag *packs, defer: true - = javascript_include_tag 'application', defer: true - = csrf_meta_tags - = Gon::Base.render_data(camel_case: true, init: true) - - %body{ class: browser.platform.ios? ? 'ios' : nil } - - if staging? - #beta - Env Test - - #wrap - .row - #header.navbar - = render partial: "layouts/navbar" - .row.no-margin - - if RenderPartialService.left_panel_exist? @left_pannel_url - .col-xs-2#left-panel - = render partial: @left_pannel_url - - main_container_size = 10 - - else - - main_container_size = 12 - - = render partial: 'layouts/main_container', locals: { main_container_size: main_container_size } - #mask-search - %h1 - %i.fa.fa-times{ style: 'position: fixed; top: 10; right: 30; color: white;' } - - = render partial: 'layouts/footer', locals: { main_container_size: main_container_size } diff --git a/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml deleted file mode 100644 index 67d77cdcc..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_assignscontroller_show.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Instructeurs' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml deleted file mode 100644 index 832761229..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_attestationtemplatescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Attestation' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml deleted file mode 100644 index 6d4ad3d89..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'E-mails' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml deleted file mode 100644 index 6d4ad3d89..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_mailtemplatescontroller_index.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'E-mails' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml deleted file mode 100644 index fb215e59f..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_archived.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml deleted file mode 100644 index fb215e59f..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_draft.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_index' diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml deleted file mode 100644 index 43587373d..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_edit.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Description' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml deleted file mode 100644 index e1a5393bd..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_index.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -#first-block - .en-cours - %b - = dossier_count = current_administrateur.procedures.count - = "Démarche".pluralize(dossier_count) - -#action-block - -#menu-block - .split-hr-left - #procedure-list - %a#draft-procedures{ :href => "#{url_for :admin_procedures_draft}" } - .procedure-list-element{ class: @draft_class } - En test - .badge.progress-bar-default - = current_administrateur.procedures.brouillons.count - - %a#active-procedures{ :href => "#{url_for :admin_procedures}" } - .procedure-list-element{ class: @active_class } - Publiées - .badge.progress-bar-success - = current_administrateur.procedures.publiees.count - - %a#archived-procedures{ :href => "#{url_for :admin_procedures_archived}" } - .procedure-list-element{ class: @archived_class } - Closes - .badge.progress-bar-purple - = current_administrateur.procedures.closes.count - - .split-hr-left - = render partial: 'layouts/switch_devise_profile_module' - - -#infos-block diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml deleted file mode 100644 index fad3db3bb..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'MonAvis' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml deleted file mode 100644 index 0d6d0eb8c..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_navbar.html.haml +++ /dev/null @@ -1,82 +0,0 @@ -#first-block - .en-cours - = image_tag @procedure.logo_url, style: 'width: 30px;' - %b - = @procedure.libelle - -#action-block - -#menu-block - .split-hr-left - #procedure-list - %a#onglet-infos{ href: url_for(admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Informations') } - - if @procedure.brouillon? - Test et publication - - else - Publication - - %a#onglet-description{ href: url_for(edit_admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Description') } - Description - - %a#onglet-services{ href: (@procedure.service.present? || current_administrateur.services.present?) ? url_for(admin_services_path(procedure_id: @procedure.id)) : url_for(new_admin_service_path(procedure_id: @procedure.id)) } - .procedure-list-element - Service - - if @procedure.missing_steps.include?(:service) - %p.missing-steps (à compléter) - - %a#onglet-administrateurs{ href: url_for(admin_procedure_administrateurs_path(@procedure)) } - .procedure-list-element - Administrateurs - - - if !feature_enabled?(:administrateur_routage) - %a#onglet-instructeurs{ href: url_for(admin_procedure_groupe_instructeur_path(@procedure, @procedure.defaut_groupe_instructeur)) } - .procedure-list-element{ class: ('active' if active == 'Instructeurs') } - Instructeurs - - if @procedure.missing_steps.include?(:instructeurs) - %p.missing-steps (à compléter) - - - if feature_enabled?(:administrateur_routage) - %a#onglet-instructeurs{ href: url_for(admin_procedure_groupe_instructeurs_path(@procedure)) } - .procedure-list-element - Groupe d'instructeurs - - - if !@procedure.locked? - %a#onglet-champs{ href: champs_admin_procedure_path(@procedure) } - .procedure-list-element{ class: ('active' if active == 'Champs') } - Champs - - - if !@procedure.locked? - %a#onglet-private-champs{ href: annotations_admin_procedure_path(@procedure) } - .procedure-list-element{ class: ('active' if active == 'Annotations privées') } - Annotations privées - - %a#onglet-preview{ href: url_for(apercu_admin_procedure_path(@procedure)), target: "_blank", rel: "noopener" } - .procedure-list-element{ class: ('active' if active == 'Prévisualisation') } - Prévisualisation - - %a#onglet-inemailsfos{ href: url_for(admin_procedure_mail_templates_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'E-mails') } - E-mails - - %a#onglet-attestation{ href: url_for(edit_admin_procedure_attestation_template_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'Attestation') } - Attestation - - %a#onglet-description{ href: url_for(monavis_admin_procedure_path(@procedure)) } - .procedure-list-element{ class: ('active' if active == 'MonAvis') } - MonAvis - - %a#onglet-description{ href: url_for(jeton_admin_procedure_path(@procedure)) } - .procedure-list-element - Jeton - - %a#onglet-description{ href: url_for(admin_procedures_path()) } - .procedure-list-element - Sortir - - .split-hr-left - - -#infos-block diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml deleted file mode 100644 index ffc8baf08..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_show.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Informations' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml deleted file mode 100644 index 43587373d..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'Description' } diff --git a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml b/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml deleted file mode 100644 index fad3db3bb..000000000 --- a/app/views/layouts/left_panels/_left_panel_admin_procedurescontroller_update_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/left_panels/left_panel_admin_procedurescontroller_navbar', locals: { active: 'MonAvis' } diff --git a/app/views/layouts/left_panels/_left_panel_default.html.haml b/app/views/layouts/left_panels/_left_panel_default.html.haml deleted file mode 100644 index d6c626d3a..000000000 --- a/app/views/layouts/left_panels/_left_panel_default.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%div - Default Left Panel diff --git a/app/views/layouts/mailers/_bizdev_signature.html.haml b/app/views/layouts/mailers/_bizdev_signature.html.haml index 2a9c40616..95c6ce6c6 100644 --- a/app/views/layouts/mailers/_bizdev_signature.html.haml +++ b/app/views/layouts/mailers/_bizdev_signature.html.haml @@ -9,6 +9,4 @@ Cordialement, Téléphone (standard) : = CONTACT_PHONE %br -Incubateur de Services Numériques / beta.gouv.fr -%br -Services du Premier Ministre, 20 avenue de Ségur, 75007 Paris += safe_join(CONTACT_ADDRESS.split("\n"), raw('
')) diff --git a/app/views/layouts/navbars/_navbar_admin_instructeurscontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_instructeurscontroller_index.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_instructeurscontroller_index.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_archived.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_draft.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml deleted file mode 100644 index 346c4fb04..000000000 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_index.html.haml +++ /dev/null @@ -1,26 +0,0 @@ -.col-xs-7.main-info - -.col-xs-3.options - %div{ style: "decorate: none; display: flex; box-shadow: none; float: right; display: flex; margin-top: 5px" } - %div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" } - = current_administrateur.email - .dropdown#admin_menu - %button.btn.btn-default.dropdown-toggle#dropdownMenuAdmin{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false } - %i.fa.fa-cog - %span.caret - %ul.dropdown-menu.dropdown-menu-right - %li - = link_to(admin_procedures_path, id: :menu_item_procedure) do - %i.fa.fa-list{ style: "background-size: 10px;" } -   - = t('dynamics.admin.menu.procedures') - %li - = link_to(admin_instructeurs_path) do - %i.fa.fa-user -   - = t('dynamics.admin.menu.instructeurs') - %li.divider{ role: :separator } - %li - = link_to(profil_path, id: :profile) do - %i.fa.fa-user -  Profil diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_monavis.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_monavis.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_update_monavis.html.haml b/app/views/layouts/navbars/_navbar_admin_procedurescontroller_update_monavis.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_procedurescontroller_update_monavis.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml b/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml deleted file mode 100644 index 1ff68e01a..000000000 --- a/app/views/layouts/navbars/_navbar_admin_profilecontroller_show.html.haml +++ /dev/null @@ -1 +0,0 @@ -= render partial: 'layouts/navbars/navbar_admin_procedurescontroller_index' diff --git a/app/views/layouts/navbars/_navbar_default.html.haml b/app/views/layouts/navbars/_navbar_default.html.haml deleted file mode 100644 index 1af336c9d..000000000 --- a/app/views/layouts/navbars/_navbar_default.html.haml +++ /dev/null @@ -1 +0,0 @@ -.col-xs-10 diff --git a/app/views/layouts/navbars/_navbar_log_options.html.haml b/app/views/layouts/navbars/_navbar_log_options.html.haml deleted file mode 100644 index 41793b105..000000000 --- a/app/views/layouts/navbars/_navbar_log_options.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -- if user_signed_in? - #sign-out.col-xs-2.no-padding - = render partial: 'users/login_banner' - = render partial: 'layouts/credentials' -- elsif instructeur_signed_in? - #sign-out.col-xs-2.no-padding - = render partial: 'instructeurs/login_banner' - = render partial: 'layouts/credentials' -- elsif administrateur_signed_in? - #sign-out.col-xs-2.no-padding - = render partial: 'administrateurs/login_banner' - = render partial: 'layouts/credentials' -- else - #sign-in.col-xs-2 - = link_to "Connexion", new_user_session_path, :class => 'btn btn-lg btn-primary' diff --git a/app/views/shared/champs/siret/_etablissement.html.haml b/app/views/shared/champs/siret/_etablissement.html.haml index 90a32e981..ddc069e75 100644 --- a/app/views/shared/champs/siret/_etablissement.html.haml +++ b/app/views/shared/champs/siret/_etablissement.html.haml @@ -8,6 +8,7 @@ - when :network_error = t('errors.messages.siret_network_error') + -# i18n-tasks-use t('errors.messages.siret_network_error') - else - if siret.present? && siret == etablissement&.siret diff --git a/config/env.example.optional b/config/env.example.optional index 7707b8501..e41c6a190 100644 --- a/config/env.example.optional +++ b/config/env.example.optional @@ -21,6 +21,9 @@ APPLICATION_BASE_URL="https://www.demarches-simplifiees.fr" # OLD_CONTACT_EMAIL="" # CONTACT_PHONE="" +# Personnalisation d'instance - Adresses postale de l'opérateur de l'instance +# CONTACT_ADDRESS="Incubateur de Services Numériques / beta.gouv.fr\nServices du Premier Ministre, 20 avenue de Ségur, 75007 Paris" + # Personnalisation d'instance - URL pour la création de compte administrateur sur l'instance # DEMANDE_INSCRIPTION_ADMIN_PAGE_URL="" @@ -50,5 +53,9 @@ APPLICATION_BASE_URL="https://www.demarches-simplifiees.fr" # Personnalisation d'instance - Logo par défaut d'une procédure ---> à placer dans "app/assets/images" # PROCEDURE_DEFAULT_LOGO_SRC="republique-francaise-logo.svg" +# Personnalisation d'instance - Logo dans le PDF d'export d'un dossier ---> à placer dans "app/assets/images" +# DOSSIER_PDF_EXPORT_LOGO_SRC="app/assets/images/header/logo-ds-wide.svg" + # Personnalisation d'instance - fichier utilisé pour poser un filigrane sur les pièces d'identité # WATERMARK_FILE="" + diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml new file mode 100644 index 000000000..28dca98d1 --- /dev/null +++ b/config/i18n-tasks.yml @@ -0,0 +1,136 @@ +# i18n-tasks finds and manages missing and unused translations: https://github.com/glebm/i18n-tasks + +# The "main" locale. +base_locale: fr +## All available locales are inferred from the data by default. Alternatively, specify them explicitly: +# locales: [es, fr] +## Reporting locale, default: en. Available: en, ru. +# internal_locale: en + +# Read and write translations. +data: + ## Translations are read from the file system. Supported format: YAML, JSON. + ## Provide a custom adapter: + # adapter: I18n::Tasks::Data::FileSystem + + # Locale files or `File.find` patterns where translations are read from: + read: + - config/locales/*%{locale}.yml + - config/locales/**/*%{locale}.yml + + # Locale files to write new keys to, based on a list of key pattern => file rules. Matched from top to bottom: + # `i18n-tasks normalize -p` will force move the keys according to these rules + write: + ## For example, write devise and simple form keys to their respective files: + # - ['{devise, simple_form}.*', 'config/locales/\1.%{locale}.yml'] + ## Catch-all default: + # - config/locales/%{locale}.yml + + # External locale data (e.g. gems). + # This data is not considered unused and is never written to. + external: + ## Example (replace %#= with %=): + # - "<%#= %x[bundle show vagrant].chomp %>/templates/locales/%{locale}.yml" + + ## Specify the router (see Readme for details). Valid values: conservative_router, pattern_router, or a custom class. + # router: conservative_router + + yaml: + write: + # do not wrap lines at 80 characters + line_width: -1 + + ## Pretty-print JSON: + # json: + # write: + # indent: ' ' + # space: ' ' + # object_nl: "\n" + # array_nl: "\n" + +# Find translate calls +search: + ## Paths or `File.find` patterns to search in: + # paths: + # - app/ + + ## Root directories for relative keys resolution. + # relative_roots: + # - app/controllers + # - app/helpers + # - app/mailers + # - app/presenters + # - app/views + + ## Files or `File.fnmatch` patterns to exclude from search. Some files are always excluded regardless of this setting: + ## %w(*.jpg *.png *.gif *.svg *.ico *.eot *.otf *.ttf *.woff *.woff2 *.pdf *.css *.sass *.scss *.less *.yml *.json) + exclude: + - app/assets/images + - app/assets/fonts + - app/assets/videos + + ## Alternatively, the only files or `File.fnmatch patterns` to search in `paths`: + ## If specified, this settings takes priority over `exclude`, but `exclude` still applies. + # only: ["*.rb", "*.html.slim"] + + ## If `strict` is `false`, guess usages such as t("categories.#{category}.title"). The default is `true`. + # strict: true + + ## Multiple scanners can be used. Their results are merged. + ## The options specified above are passed down to each scanner. Per-scanner options can be specified as well. + ## See this example of a custom scanner: https://github.com/glebm/i18n-tasks/wiki/A-custom-scanner-example + +## Translation Services +# translation: +# # Google Translate +# # Get an API key and set billing info at https://code.google.com/apis/console to use Google Translate +# google_translate_api_key: "AbC-dEf5" +# # DeepL Pro Translate +# # Get an API key and subscription at https://www.deepl.com/pro to use DeepL Pro +# deepl_api_key: "48E92789-57A3-466A-9959-1A1A1A1A1A1A" + +## Do not consider these keys missing: +# ignore_missing: +# - 'errors.messages.{accepted,blank,invalid,too_short,too_long}' +# - '{devise,simple_form}.*' + +## Consider these keys used: +ignore_unused: +- 'activerecord.attributes.*' +- 'activerecord.errors.*' +- 'errors.messages.blank' +- 'pluralize.*' +- 'views.pagination.*' +- 'time.formats.default' +# - '{devise,kaminari,will_paginate}.*' +# - 'simple_form.{yes,no}' +# - 'simple_form.{placeholders,hints,labels}.*' +# - 'simple_form.{error_notification,required}.:' + +## Exclude these keys from the `i18n-tasks eq-base' report: +# ignore_eq_base: +# all: +# - common.ok +# fr,es: +# - common.brand + +## Exclude these keys from the `i18n-tasks check-consistent-interpolations` report: +# ignore_inconsistent_interpolations: +# - 'activerecord.attributes.*' + +## Ignore these keys completely: +# ignore: +# - kaminari.* + +## Sometimes, it isn't possible for i18n-tasks to match the key correctly, +## e.g. in case of a relative key defined in a helper method. +## In these cases you can use the built-in PatternMapper to map patterns to keys, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# only: %w(*.html.haml *.html.slim), +# patterns: [['= title\b', '.page_title']] %> +# +# The PatternMapper can also match key literals via a special %{key} interpolation, e.g.: +# +# <%# I18n::Tasks.add_scanner 'I18n::Tasks::Scanners::PatternMapper', +# patterns: [['\bSpree\.t[( ]\s*%{key}', 'spree.%{key}']] %> diff --git a/config/initializers/contacts.rb b/config/initializers/contacts.rb index 0c94d76f5..eccde116e 100644 --- a/config/initializers/contacts.rb +++ b/config/initializers/contacts.rb @@ -8,5 +8,6 @@ if !defined?(CONTACT_EMAIL) CONTACT_PHONE = ENV.fetch("CONTACT_PHONE", "01 76 42 02 87") OLD_CONTACT_EMAIL = ENV.fetch("OLD_CONTACT_EMAIL", "contact@tps.apientreprise.fr") + CONTACT_ADDRESS = ENV.fetch("CONTACT_ADDRESS", "Incubateur de Services Numériques / beta.gouv.fr\nServices du Premier Ministre, 20 avenue de Ségur, 75007 Paris") end # rubocop:enable DS/ApplicationName diff --git a/config/initializers/images.rb b/config/initializers/images.rb index 628857d42..462dedd33 100644 --- a/config/initializers/images.rb +++ b/config/initializers/images.rb @@ -14,3 +14,6 @@ MAILER_LOGO_SRC = ENV.fetch("MAILER_LOGO_SRC", "mailer/instructeur_mailer/logo.p # Default logo of a procedure PROCEDURE_DEFAULT_LOGO_SRC = ENV.fetch("PROCEDURE_DEFAULT_LOGO_SRC", "republique-francaise-logo.svg") + +# Logo in PDF export of a "Dossier" +DOSSIER_PDF_EXPORT_LOGO_SRC = ENV.fetch("DOSSIER_PDF_EXPORT_LOGO_SRC", "app/assets/images/header/logo-ds-wide.svg") diff --git a/config/initializers/raven.rb b/config/initializers/raven.rb deleted file mode 100644 index f1c6fab27..000000000 --- a/config/initializers/raven.rb +++ /dev/null @@ -1,8 +0,0 @@ -if ENV['SENTRY_ENABLED'] == 'enabled' - require 'raven' - - Raven.configure do |config| - config.dsn = ENV['SENTRY_DSN_RAILS'] - config.environments = ['production', 'staging'] - end -end diff --git a/config/initializers/sentry.rb b/config/initializers/sentry.rb new file mode 100644 index 000000000..1b1ec6c86 --- /dev/null +++ b/config/initializers/sentry.rb @@ -0,0 +1,6 @@ +Sentry.init do |config| + config.dsn = ENV['SENTRY_ENABLED'] == 'enabled' ? ENV['SENTRY_DSN_RAILS'] : nil + config.send_default_pii = false + config.enabled_environments = ['production'] + config.breadcrumbs_logger = [:active_support_logger] +end diff --git a/config/locales/en.yml b/config/locales/en.yml index ee24bb44a..c1bcac742 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -36,16 +36,6 @@ en: first: First truncate: '…' - # mail: - # administration: - # dossier_expiration_summary: - # expired_dossiers: - # one: "Un dossier a passé sa date limite de conservation" - # other: "%{count} dossiers ont passé leur date limite de conservation" - # expiring_dossiers: - # one: "Un dossier est sur le point de passer sa date limite de conservation" - # other: "%{count} dossiers sont sur le point de passer leur date limite de conservation" - modal: publish: title: @@ -61,7 +51,7 @@ en: activerecord: attributes: user: - siret: 'Numéro SIRET' + siret: 'SIRET number' password: 'password' instructeur: password: 'password' @@ -100,38 +90,25 @@ en: path: taken: is already used for procedure. You cannot use it because it belongs to another administrator. # taken_can_be_claimed: est identique à celui d’une autre de vos procedures publiées. Si vous publiez cette procedure, l’ancienne sera dépubliée et ne sera plus accessible au public. Les utilisateurs qui ont commencé un brouillon vont pouvoir le déposer. - invalid: is not valid. It must countain between 3 and 50 characters among a-z, 0-9, '_' et '-'. + invalid: is not valid. It must countain between 3 and 50 characters among a-z, 0-9, '_' and '-'. errors: messages: - # already_confirmed: "a déjà été validé(e), veuillez essayer de vous connecter" - # confirmation_period_expired: "à confirmer dans les %{period}, merci de faire une nouvelle demande" - # expired: "a expiré, merci d’en faire une nouvelle demande" - not_found: "was not found" - not_locked: "was not locked" - not_saved: - one: "1 error prevented this %{resource} from being saved :" - other: "%{count} errors prevented this %{resource} from being saved :" dossier_not_found: "The file does not exist or you do not have access to it." - dossier_map_not_activated: "The file does not have access to the map." + # # dossier_map_not_activated: "The file does not have access to the map." invalid_siret: "The SIRET is incorrect" procedure_not_found: "The procedure does not exist" siret_unknown: 'Sorry, we did not find any establishment registered under this SIRET number.' - # siret_network_error: 'Désolé, la récupération des informations SIRET est temporairement indisponible. Veuillez réessayer dans quelques instants.' - # etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET' + siret_network_error: 'Désolé, la récupération des informations SIRET est temporairement indisponible. Veuillez réessayer dans quelques instants.' + siret_not_found: 'Nous n’avons pas trouvé d’établissement correspondant à ce numéro de SIRET.' + # # etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET' france_connect: connexion: "Error trying to connect to France Connect." procedure_archived: "This procedure has been closed, it is no longer possible to submit a file." - procedure_not_draft: "THis procedure is not a draft anymore." + # # procedure_not_draft: "This procedure is not a draft anymore." # cadastres_empty: # one: "Aucune parcelle cadastrale sur la zone sélectionnée" # other: "Aucune parcelle cadastrale sur les zones sélectionnées" - # quartiers_prioritaires_empty: - # one: "Aucun quartier prioritaire sur la zone sélectionnée" - # other: "Aucun quartier prioritaire sur les zones sélectionnées" - # parcelles_agricoles_empty: - # one: "Aucune parcelle agricole sur la zone sélectionnée" - # other: "Aucune parcelle agricole sur les zones sélectionnées" not_an_integer: "must be an integer (without decimal)" blank: "can't be blank" diff --git a/config/locales/fr.yml b/config/locales/fr.yml index b3de0f42d..5409206ad 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -36,16 +36,6 @@ fr: first: Premier truncate: '…' - mail: - administration: - dossier_expiration_summary: - expired_dossiers: - one: "Un dossier a passé sa date limite de conservation" - other: "%{count} dossiers ont passé leur date limite de conservation" - expiring_dossiers: - one: "Un dossier est sur le point de passer sa date limite de conservation" - other: "%{count} dossiers sont sur le point de passer leur date limite de conservation" - modal: publish: title: @@ -114,34 +104,21 @@ fr: errors: messages: saml_not_authorized: "Vous n'êtes pas autorisé à accéder à ce service." - already_confirmed: "a déjà été validé(e), veuillez essayer de vous connecter" - confirmation_period_expired: "à confirmer dans les %{period}, merci de faire une nouvelle demande" - expired: "a expiré, merci d’en faire une nouvelle demande" - not_found: "n’a pas été trouvé(e)" - not_locked: "n’était pas verrouillé(e)" - not_saved: - one: "1 erreur a empêché ce(tte) %{resource} d’être sauvegardé(e) :" - other: "%{count} erreurs ont empêché ce(tte) %{resource} d’être sauvegardé(e) :" dossier_not_found: "Le dossier n’existe pas ou vous n’y avez pas accès." - dossier_map_not_activated: "Le dossier n’a pas accès à la cartographie." + # dossier_map_not_activated: "Le dossier n’a pas accès à la cartographie." invalid_siret: "Le siret est incorrect" procedure_not_found: "La démarche n’existe pas" siret_unknown: 'Désolé, nous n’avons pas trouvé d’établissement enregistré correspondant à ce numéro SIRET.' siret_network_error: 'Désolé, la récupération des informations SIRET est temporairement indisponible. Veuillez réessayer dans quelques instants.' - etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET' + siret_not_found: 'Nous n’avons pas trouvé d’établissement correspondant à ce numéro de SIRET.' + # etablissement_fail: 'Désolé, nous n’avons pas réussi à enregistrer l’établissement correspondant à ce numéro SIRET' france_connect: connexion: "Erreur lors de la connexion à France Connect." procedure_archived: "Cette démarche en ligne a été close, il n’est plus possible de déposer de dossier." - procedure_not_draft: "Cette démarche n’est maintenant plus en brouillon." + # procedure_not_draft: "Cette démarche n’est maintenant plus en brouillon." cadastres_empty: one: "Aucune parcelle cadastrale sur la zone sélectionnée" other: "Aucune parcelle cadastrale sur les zones sélectionnées" - quartiers_prioritaires_empty: - one: "Aucun quartier prioritaire sur la zone sélectionnée" - other: "Aucun quartier prioritaire sur les zones sélectionnées" - parcelles_agricoles_empty: - one: "Aucune parcelle agricole sur la zone sélectionnée" - other: "Aucune parcelle agricole sur les zones sélectionnées" not_an_integer: "doit être un nombre entier (sans chiffres après la virgule)" blank: "doit être rempli" diff --git a/db/migrate/20210204180955_add_job_exception_logs.rb b/db/migrate/20210204180955_add_job_exception_logs.rb new file mode 100644 index 000000000..153747111 --- /dev/null +++ b/db/migrate/20210204180955_add_job_exception_logs.rb @@ -0,0 +1,6 @@ +class AddJobExceptionLogs < ActiveRecord::Migration[6.0] + def change + add_column :dossiers, :api_entreprise_job_exceptions, :string, array: true + add_column :champs, :fetch_external_data_exceptions, :string, array: true + end +end diff --git a/db/schema.rb b/db/schema.rb index 46a02c5a3..12e8fcf65 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: 2021_01_21_134435) do +ActiveRecord::Schema.define(version: 2021_02_04_180955) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -147,6 +147,7 @@ ActiveRecord::Schema.define(version: 2021_01_21_134435) do t.integer "row" t.jsonb "data" t.string "external_id" + t.string "fetch_external_data_exceptions", array: true t.index ["dossier_id"], name: "index_champs_on_dossier_id" t.index ["parent_id"], name: "index_champs_on_parent_id" t.index ["private"], name: "index_champs_on_private" @@ -250,6 +251,7 @@ ActiveRecord::Schema.define(version: 2021_01_21_134435) do t.datetime "last_commentaire_updated_at" t.index "to_tsvector('french'::regconfig, (search_terms || private_search_terms))", name: "index_dossiers_on_search_terms_private_search_terms", using: :gin t.index "to_tsvector('french'::regconfig, search_terms)", name: "index_dossiers_on_search_terms", using: :gin + t.string "api_entreprise_job_exceptions", array: true t.index ["archived"], name: "index_dossiers_on_archived" t.index ["groupe_instructeur_id"], name: "index_dossiers_on_groupe_instructeur_id" t.index ["hidden_at"], name: "index_dossiers_on_hidden_at" diff --git a/package.json b/package.json index 8df10ff1d..a6dc72d0d 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "webpack-dev-server": "^3.11.0" }, "scripts": { - "lint:js": "eslint ./app/javascript ./app/assets/javascripts ./config/webpack", + "lint:js": "eslint ./app/javascript ./config/webpack", "webpack:build": "NODE_ENV=production bin/webpack", "graphql:docs:build": "graphdoc --force", "graphql:docs:deploy": "netlify deploy -d ./docs/graphql --prod", diff --git a/spec/controllers/application_controller_spec.rb b/spec/controllers/application_controller_spec.rb index 506cb613f..0c4bfb67e 100644 --- a/spec/controllers/application_controller_spec.rb +++ b/spec/controllers/application_controller_spec.rb @@ -1,17 +1,17 @@ describe ApplicationController, type: :controller do - describe 'before_action: set_raven_context' do + describe 'before_action: set_sentry_user' do it 'is present' do before_actions = ApplicationController ._process_action_callbacks .filter { |process_action_callbacks| process_action_callbacks.kind == :before } .map(&:filter) - expect(before_actions).to include(:set_raven_context) + expect(before_actions).to include(:set_sentry_user) expect(before_actions).to include(:redirect_if_untrusted) end end - describe 'set_raven_context and append_info_to_payload' do + describe 'set_sentry_user and append_info_to_payload' do let(:current_user) { nil } let(:current_instructeur) { nil } let(:current_administrateur) { nil } @@ -24,15 +24,15 @@ describe ApplicationController, type: :controller do expect(@controller).to receive(:current_instructeur).and_return(current_instructeur) expect(@controller).to receive(:current_administrateur).and_return(current_administrateur) expect(@controller).to receive(:current_super_admin).and_return(current_super_admin) - allow(Raven).to receive(:user_context) + allow(Sentry).to receive(:set_user) - @controller.send(:set_raven_context) + @controller.send(:set_sentry_user) @controller.send(:append_info_to_payload, payload) end context 'when no one is logged in' do it do - expect(Raven).to have_received(:user_context) + expect(Sentry).to have_received(:set_user) .with({ id: 'Guest' }) end @@ -53,7 +53,7 @@ describe ApplicationController, type: :controller do let(:current_user) { create(:user) } it do - expect(Raven).to have_received(:user_context) + expect(Sentry).to have_received(:set_user) .with({ id: "User##{current_user.id}" }) end @@ -79,7 +79,7 @@ describe ApplicationController, type: :controller do let(:current_super_admin) { create(:super_admin) } it do - expect(Raven).to have_received(:user_context) + expect(Sentry).to have_received(:set_user) .with({ id: "User##{current_user.id}" }) end diff --git a/spec/controllers/champs/siret_controller_spec.rb b/spec/controllers/champs/siret_controller_spec.rb index f201a761c..4e565dc8b 100644 --- a/spec/controllers/champs/siret_controller_spec.rb +++ b/spec/controllers/champs/siret_controller_spec.rb @@ -81,7 +81,7 @@ describe Champs::SiretController, type: :controller do end it 'displays a “API is unavailable” error message' do - expect(response.body).to include(I18n.t('errors.messages.siret_network_error')) + expect(response.body).to include('Désolé, la récupération des informations SIRET est temporairement indisponible. Veuillez réessayer dans quelques instants.') end end diff --git a/spec/jobs/api_entreprise/job_spec.rb b/spec/jobs/api_entreprise/job_spec.rb index 3b09d3874..d71d7f126 100644 --- a/spec/jobs/api_entreprise/job_spec.rb +++ b/spec/jobs/api_entreprise/job_spec.rb @@ -4,6 +4,8 @@ RSpec.describe ApiEntreprise::Job, type: :job do # https://api.rubyonrails.org/classes/ActiveJob/Exceptions/ClassMethods.html # #method-i-retry_on describe '#perform' do + let(:dossier) { create(:dossier, :with_entreprise) } + context 'when a un retryable error is raised' do let(:errors) { [:standard_error] } @@ -17,20 +19,25 @@ RSpec.describe ApiEntreprise::Job, type: :job do it 'retries 5 times' do ensure_errors_force_n_retry(errors, 5) + expect(dossier.reload.api_entreprise_job_exceptions.first).to match('ApiEntreprise::API::Error::ServiceUnavailable') end end def ensure_errors_force_n_retry(errors, retry_nb) + etablissement = dossier.etablissement + errors.each do |error| assert_performed_jobs(retry_nb) do - ErrorJob.perform_later(error) rescue StandardError + ErrorJob.perform_later(error, etablissement) rescue StandardError end end end end class ErrorJob < ApiEntreprise::Job - def perform(error) + def perform(error, etablissement) + @etablissement = etablissement + response = OpenStruct.new( effective_url: 'http://host.com/path', code: '666', diff --git a/spec/jobs/cron/auto_archive_procedure_job_spec.rb b/spec/jobs/cron/auto_archive_procedure_job_spec.rb index 5d00582f4..3ce167b74 100644 --- a/spec/jobs/cron/auto_archive_procedure_job_spec.rb +++ b/spec/jobs/cron/auto_archive_procedure_job_spec.rb @@ -72,7 +72,7 @@ RSpec.describe Cron::AutoArchiveProcedureJob, type: :job do error = StandardError.new('nop') expect(buggy_procedure).to receive(:close!).and_raise(error) expect(job).to receive(:procedures_to_close).and_return([buggy_procedure, procedure_hier]) - expect(Raven).to receive(:capture_exception).with(error, extra: { procedure_id: buggy_procedure.id }) + expect(Sentry).to receive(:capture_exception).with(error, extra: { procedure_id: buggy_procedure.id }) subject end diff --git a/spec/mailers/previews/administration_mailer_preview.rb b/spec/mailers/previews/administration_mailer_preview.rb index 67f6708da..6523b25f8 100644 --- a/spec/mailers/previews/administration_mailer_preview.rb +++ b/spec/mailers/previews/administration_mailer_preview.rb @@ -19,12 +19,6 @@ class AdministrationMailerPreview < ActionMailer::Preview AdministrationMailer.refuse_admin('bad_admin@pipo.com') end - def dossier_expiration_summary - expiring_dossiers = [Dossier.new(id: 100, procedure: procedure_1)] - expired_dossiers = [Dossier.new(id: 100, procedure: procedure_2)] - AdministrationMailer.dossier_expiration_summary(expiring_dossiers, expired_dossiers) - end - private def procedure_1 diff --git a/spec/models/champ_spec.rb b/spec/models/champ_spec.rb index 6222fc81f..8d5ab3492 100644 --- a/spec/models/champ_spec.rb +++ b/spec/models/champ_spec.rb @@ -510,4 +510,16 @@ describe Champ do end end end + + describe '#log_fetch_external_data_exception' do + let(:champ) { create(:champ_siret) } + + context "add execption to the log" do + before do + champ.log_fetch_external_data_exception(StandardError.new('My special exception!')) + end + + it { expect(champ.fetch_external_data_exceptions).to eq(['#']) } + end + end end diff --git a/spec/models/dossier_spec.rb b/spec/models/dossier_spec.rb index 43d171d5e..6d958587c 100644 --- a/spec/models/dossier_spec.rb +++ b/spec/models/dossier_spec.rb @@ -1424,4 +1424,16 @@ describe Dossier do end end end + + describe '#log_api_entreprise_job_exception' do + let(:dossier) { create(:dossier) } + + context "add execption to the log" do + before do + dossier.log_api_entreprise_job_exception(StandardError.new('My special exception!')) + end + + it { expect(dossier.api_entreprise_job_exceptions).to eq(['#']) } + end + end end diff --git a/spec/services/render_partial_service_spec.rb b/spec/services/render_partial_service_spec.rb deleted file mode 100644 index cc0df90b9..000000000 --- a/spec/services/render_partial_service_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -describe RenderPartialService do - let(:service) { RenderPartialService.new(controller, method) } - let(:controller) { ApplicationController } - let(:method) { :index } - - describe 'navbar' do - subject { service.navbar } - - it { is_expected.to eq "layouts/navbars/navbar_#{controller.to_s.parameterize}_#{method}" } - end - - describe 'left_panel' do - subject { service.left_panel } - - it { is_expected.to eq "layouts/left_panels/left_panel_#{controller.to_s.parameterize}_#{method}" } - end -end diff --git a/spec/views/layouts/_new_header_spec.rb b/spec/views/layouts/_header_spec.rb similarity index 96% rename from spec/views/layouts/_new_header_spec.rb rename to spec/views/layouts/_header_spec.rb index 89d77119e..6cd225c72 100644 --- a/spec/views/layouts/_new_header_spec.rb +++ b/spec/views/layouts/_header_spec.rb @@ -1,4 +1,4 @@ -describe 'layouts/_new_header.html.haml', type: :view do +describe 'layouts/_header.html.haml', type: :view do let(:current_instructeur) { nil } before do diff --git a/spec/views/layouts/_navbar_spec.rb b/spec/views/layouts/_navbar_spec.rb deleted file mode 100644 index d25251c50..000000000 --- a/spec/views/layouts/_navbar_spec.rb +++ /dev/null @@ -1,38 +0,0 @@ -describe 'layouts/_navbar.html.haml', type: :view do - let(:administrateur) { create(:administrateur) } - let(:instructeur) { create(:instructeur, administrateurs: [administrateur]) } - - let!(:procedure) { create(:procedure, administrateur: administrateur) } - - before do - allow(view).to receive(:instructeur_signed_in?).and_return(instructeur_signed_in) - allow(view).to receive(:administrateur_signed_in?).and_return(administrateur_signed_in) - end - - describe 'navbar entries' do - before { render } - - subject { rendered } - - context 'when disconnected' do - let(:instructeur_signed_in) { false } - let(:administrateur_signed_in) { false } - - it { is_expected.to match(/Connexion/) } - end - - context 'when administrateur is connected' do - let(:instructeur_signed_in) { false } - let(:administrateur_signed_in) { true } - - it { is_expected.to match(/Déconnexion/) } - end - - context 'when instructeur is connected' do - let(:instructeur_signed_in) { true } - let(:administrateur_signed_in) { false } - - it { is_expected.to match(/Déconnexion/) } - end - end -end