diff --git a/app/package.json b/app/package.json index 0f5661644..f648adc06 100755 --- a/app/package.json +++ b/app/package.json @@ -1,6 +1,6 @@ { "name": "Bauhaus", - "version": "3.0.15", + "version": "3.0.16", "description": "Web application for the management of concepts, classifications and other statistical objects", "repository": { "type": "git", diff --git a/packages/operations/src/sims/sims-geography-picker.js b/packages/operations/src/sims/sims-geography-picker.js index ecc6004f3..d80729fe9 100644 --- a/packages/operations/src/sims/sims-geography-picker.js +++ b/packages/operations/src/sims/sims-geography-picker.js @@ -9,7 +9,6 @@ import SimsGeographyField from './sims-geography-field'; import './sims-geography-picker.scss'; import { SimsGeographyI18NLabel } from 'bauhaus-operations'; - const SimsGeographyPicker = ({ onChange, value, loadGeographies }) => { const [territory, setTerritory] = useState(); const geographiesOptions = useSelector(Stores.Geographies.getAllOptions); @@ -19,15 +18,20 @@ const SimsGeographyPicker = ({ onChange, value, loadGeographies }) => { }, []); const openViewPanel = useCallback(() => { - setTerritory(geographiesOptions?.find(({ value: v }) => v === value)?.geography); + setTerritory( + geographiesOptions?.find(({ value: v }) => v === value)?.geography + ); setSlidingModal(true); }, [geographiesOptions, value]); - const onSave = useCallback((territoryUri) => { - setSlidingModal(false); - loadGeographies(); - onChange(territoryUri) - }, [loadGeographies, onChange]); + const onSave = useCallback( + (territoryUri) => { + setSlidingModal(false); + loadGeographies(); + onChange(territoryUri); + }, + [loadGeographies, onChange] + ); const onCancel = useCallback(() => { setTerritory(undefined); @@ -37,7 +41,9 @@ const SimsGeographyPicker = ({ onChange, value, loadGeographies }) => { return ; }; - const shouldSeeViewButton = geographiesOptions?.find(({ value: v }) => v === value)?.typeTerritory === "Territoire Statistique"; + const shouldSeeViewButton = + geographiesOptions?.find(({ value: v }) => v === value)?.typeTerritory === + 'Territoire Statistique'; return ( <>
@@ -48,11 +54,13 @@ const SimsGeographyPicker = ({ onChange, value, loadGeographies }) => { )} filterOption={(option, searchValue) => { const search = searchValue.toLowerCase(); - const label = option.data.label.toLowerCase(); - const typeTerritory = option.data.typeTerritory.toLowerCase(); - return !searchValue - || label.indexOf(search) >= 0 - || typeTerritory.indexOf(search) >= 0 + const label = option.label.toLowerCase(); + const typeTerritory = option.typeTerritory.toLowerCase(); + return ( + !searchValue || + label.indexOf(search) >= 0 || + typeTerritory.indexOf(search) >= 0 + ); }} options={geographiesOptions} onChange={(e) => onChange(e ? e.value : '')} @@ -65,16 +73,34 @@ const SimsGeographyPicker = ({ onChange, value, loadGeographies }) => {
- - - setSlidingModal(false)}> - + setSlidingModal(false)} + > + ); @@ -83,5 +109,4 @@ const mapDispatchToProps = { loadGeographies: Stores.Geographies.loadGeographies, }; -export default connect(undefined, mapDispatchToProps)(SimsGeographyPicker) - +export default connect(undefined, mapDispatchToProps)(SimsGeographyPicker); diff --git a/sonar-project.properties b/sonar-project.properties index c622434b4..a9f54eab4 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -4,7 +4,7 @@ sonar.host.url=https://sonarcloud.io # Project name & version sonar.projectName=Bauhaus -sonar.projectVersion=3.0.15 +sonar.projectVersion=3.0.16 # Path to sources sonar.sources=app/src,packages/operations/src,packages/structures/src,packages/utilities/src