Merge branch 'dev'

This commit is contained in:
gregoirenovel 2018-09-07 10:11:04 +02:00
commit d9feae4df0
9 changed files with 59 additions and 19 deletions

View file

@ -88,7 +88,8 @@ gem 'groupdate'
gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8' gem 'bootstrap-wysihtml5-rails', '~> 0.3.3.8'
gem 'spreadsheet_architect', '~> 1.4.8' # https://github.com/westonganger/spreadsheet_architect/issues/14 gem 'spreadsheet_architect'
gem 'axlsx', '~> 3.0.0.pre' # https://github.com/randym/axlsx/issues/501#issuecomment-373640365
gem 'apipie-rails' gem 'apipie-rails'
# For Markdown support in apipie # For Markdown support in apipie

View file

@ -96,10 +96,14 @@ GEM
attr_required (1.0.1) attr_required (1.0.1)
autoprefixer-rails (8.3.0) autoprefixer-rails (8.3.0)
execjs execjs
axlsx (2.0.1) axlsx (3.0.0.pre)
htmlentities (~> 4.3.1) htmlentities (~> 4.3, >= 4.3.4)
nokogiri (>= 1.4.1) mimemagic (~> 0.3)
rubyzip (~> 1.0.0) nokogiri (~> 1.8, >= 1.8.2)
rubyzip (~> 1.2, >= 1.2.1)
axlsx_styler (0.2.0)
activesupport (>= 3.1)
axlsx (>= 2.0, < 4)
bcrypt (3.1.12) bcrypt (3.1.12)
bindata (2.4.3) bindata (2.4.3)
bindex (0.5.0) bindex (0.5.0)
@ -632,10 +636,10 @@ GEM
rgeo (1.0.0) rgeo (1.0.0)
rgeo-geojson (2.0.0) rgeo-geojson (2.0.0)
rgeo (~> 1.0) rgeo (~> 1.0)
rodf (0.3.7) rodf (1.0.0)
activesupport (>= 3.0, < 6.0) activesupport (>= 3.0)
builder (~> 3.0) builder (>= 3.0)
rubyzip (~> 1.0) rubyzip (>= 1.0)
rspec (3.7.0) rspec (3.7.0)
rspec-core (~> 3.7.0) rspec-core (~> 3.7.0)
rspec-expectations (~> 3.7.0) rspec-expectations (~> 3.7.0)
@ -673,7 +677,7 @@ GEM
ruby_dep (1.5.0) ruby_dep (1.5.0)
ruby_parser (3.11.0) ruby_parser (3.11.0)
sexp_processor (~> 4.9) sexp_processor (~> 4.9)
rubyzip (1.0.0) rubyzip (1.2.2)
safe_yaml (1.0.4) safe_yaml (1.0.4)
sanitize-url (0.1.4) sanitize-url (0.1.4)
sass (3.5.6) sass (3.5.6)
@ -722,9 +726,10 @@ GEM
jquery-rails jquery-rails
kaminari (>= 0.17) kaminari (>= 0.17)
rails (>= 3.2) rails (>= 3.2)
spreadsheet_architect (1.4.8) spreadsheet_architect (3.1.0)
axlsx (>= 2.0) axlsx (>= 2, < 4)
rodf (= 0.3.7) axlsx_styler (>= 0.1.7, < 2)
rodf (>= 1.0.0, < 2)
spring (2.0.2) spring (2.0.2)
activesupport (>= 4.2) activesupport (>= 4.2)
spring-commands-rspec (1.0.4) spring-commands-rspec (1.0.4)
@ -809,6 +814,7 @@ DEPENDENCIES
administrate administrate
after_party after_party
apipie-rails apipie-rails
axlsx (~> 3.0.0.pre)
bootstrap-sass (~> 3.3.5) bootstrap-sass (~> 3.3.5)
bootstrap-wysihtml5-rails (~> 0.3.3.8) bootstrap-wysihtml5-rails (~> 0.3.3.8)
brakeman brakeman
@ -885,7 +891,7 @@ DEPENDENCIES
simple_form simple_form
skylight skylight
smart_listing smart_listing
spreadsheet_architect (~> 1.4.8) spreadsheet_architect
spring spring
spring-commands-rspec spring-commands-rspec
therubyracer therubyracer
@ -902,4 +908,4 @@ DEPENDENCIES
xray-rails xray-rails
BUNDLED WITH BUNDLED WITH
1.16.2 1.16.3

View file

@ -1,10 +1,12 @@
$(document).on('turbolinks:load', init_path_modal); $(document).on('turbolinks:load', init_path_modal);
var PROCEDURE_PATH_SELECTOR = 'input[data-autocomplete=path]';
function init_path_modal() { function init_path_modal() {
path_modal_action(); path_modal_action();
path_validation_action(); path_validation_action();
path_type_init(); path_type_init();
path_validation($("input[id='procedure_path']")); path_validation($(PROCEDURE_PATH_SELECTOR));
} }
function path_modal_action() { function path_modal_action() {
@ -22,7 +24,7 @@ function path_modal_action() {
} }
function path_validation_action() { function path_validation_action() {
$("input[id='procedure_path']").keyup(function (key) { $(PROCEDURE_PATH_SELECTOR).keyup(function (key) {
if (key.keyCode != 13) if (key.keyCode != 13)
path_validation(this); path_validation(this);
}); });
@ -57,7 +59,7 @@ function validatePath(path) {
} }
function path_type_init() { function path_type_init() {
$('#procedure_path').bind('autocomplete:select', function(ev, suggestion) { $(PROCEDURE_PATH_SELECTOR).bind('autocomplete:select', function(ev, suggestion) {
togglePathMessage(true, suggestion['mine']); togglePathMessage(true, suggestion['mine']);
}); });
} }

View file

@ -12,6 +12,7 @@ import '../shared/sentry';
import '../shared/rails-ujs-fix'; import '../shared/rails-ujs-fix';
import '../shared/safari-11-file-xhr-workaround'; import '../shared/safari-11-file-xhr-workaround';
import '../shared/autocomplete'; import '../shared/autocomplete';
import '../shared/remote-input';
// Start Rails helpers // Start Rails helpers
Rails.start(); Rails.start();

View file

@ -14,6 +14,7 @@ import '../shared/sentry';
import '../shared/rails-ujs-fix'; import '../shared/rails-ujs-fix';
import '../shared/safari-11-file-xhr-workaround'; import '../shared/safari-11-file-xhr-workaround';
import '../shared/autocomplete'; import '../shared/autocomplete';
import '../shared/remote-input';
import '../new_design/buttons'; import '../new_design/buttons';
import '../new_design/form-validation'; import '../new_design/form-validation';

View file

@ -0,0 +1,24 @@
import Rails from 'rails-ujs';
import debounce from 'debounce';
const { delegate, fire } = Rails;
const remote = 'data-remote';
const inputChangeSelector = `input[${remote}], textarea[${remote}]`;
// This is a patch for ujs remote handler. Its purpose is to add
// a debounced input listener.
function handleRemote(event) {
const element = this;
if (isRemote(element)) {
fire(element, 'change', event);
}
}
function isRemote(element) {
const value = element.getAttribute(remote);
return value && value !== 'false';
}
delegate(document, inputChangeSelector, 'input', debounce(handleRemote, 200));

View file

@ -9,7 +9,7 @@
%h2.new-h2 Signaler un dysfonctionnement %h2.new-h2 Signaler un dysfonctionnement
%p.new-p %p.new-p
= "Si, malgré notre vigilance, vous rencontriez le moindre problème daccessibilité sur notre site, nhésitez pas à #{contact_link('nous écrire', tags: 'a11y')}." Si, malgré notre vigilance, vous rencontriez le moindre problème daccessibilité sur notre site, nhésitez pas à #{contact_link('nous écrire', tags: 'a11y')}.
%h2.new-h2 Défenseur des droits %h2.new-h2 Défenseur des droits
%p.new-p %p.new-p

View file

@ -5,6 +5,7 @@
"activestorage": "^5.2.0", "activestorage": "^5.2.0",
"autocomplete.js": "^0.31.0", "autocomplete.js": "^0.31.0",
"chartkick": "^2.3.6", "chartkick": "^2.3.6",
"debounce": "^1.2.0",
"highcharts": "^6.1.1", "highcharts": "^6.1.1",
"jquery": "^3.3.1", "jquery": "^3.3.1",
"leaflet": "^1.3.1", "leaflet": "^1.3.1",

View file

@ -2137,6 +2137,10 @@ dateformat@^3.0.3:
version "3.0.3" version "3.0.3"
resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae"
debounce@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/debounce/-/debounce-1.2.0.tgz#44a540abc0ea9943018dc0eaa95cce87f65cd131"
debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9: debug@2.6.9, debug@^2.1.2, debug@^2.2.0, debug@^2.3.3, debug@^2.6.6, debug@^2.6.8, debug@^2.6.9:
version "2.6.9" version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"