diff --git a/app/javascript/components/ComboRegionsSearch.js b/app/javascript/components/ComboRegionsSearch.js new file mode 100644 index 000000000..630ed5742 --- /dev/null +++ b/app/javascript/components/ComboRegionsSearch.js @@ -0,0 +1,21 @@ +import React from 'react'; +import { ReactQueryCacheProvider } from 'react-query'; + +import ComboSearch from './ComboSearch'; +import { queryCache } from './shared/queryCache'; + +function ComboRegionsSearch(params) { + return ( + + [code, nom]} + /> + + ); +} + +export default ComboRegionsSearch; diff --git a/app/javascript/loaders/ComboRegionsSearch.js b/app/javascript/loaders/ComboRegionsSearch.js new file mode 100644 index 000000000..4b281012d --- /dev/null +++ b/app/javascript/loaders/ComboRegionsSearch.js @@ -0,0 +1,3 @@ +import Loadable from '../components/Loadable'; + +export default Loadable(() => import('../components/ComboRegionsSearch')); diff --git a/app/views/shared/dossiers/editable_champs/_regions.html.haml b/app/views/shared/dossiers/editable_champs/_regions.html.haml index 4b16bea2d..6119f7a4e 100644 --- a/app/views/shared/dossiers/editable_champs/_regions.html.haml +++ b/app/views/shared/dossiers/editable_champs/_regions.html.haml @@ -1,4 +1,3 @@ -= form.select :value, [champ.value].compact, - { include_blank: true }, - required: champ.mandatory?, - class: 'select2 regions' +- hidden_field_id = SecureRandom.uuid += form.hidden_field :value, { data: { uuid: hidden_field_id } } += react_component("ComboRegionsSearch", mandatory: champ.mandatory?, hiddenFieldId: hidden_field_id)