Commit 69ffbe7c authored by Alexandre Lanceart's avatar Alexandre Lanceart

Filtre map ok combinaison en cours

parent e7f9e8cd
Pipeline #37981 failed with stages
in 6 minutes and 35 seconds
......@@ -2,7 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="74fa4bd5-f917-4bc8-a84b-dd3b53780f18" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/src/components/map/UnivMakers.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/map/UnivMakers.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/filter/Filter.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/filter/Filter.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/components/search/Search.js" beforeDir="false" afterPath="$PROJECT_DIR$/src/components/search/Search.js" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/dist/" />
......@@ -20,17 +21,20 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/components/filter/Filter.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-600">
<caret line="35" column="54" lean-forward="true" selection-start-line="35" selection-start-column="54" selection-end-line="35" selection-end-column="54" />
<state relative-caret-position="1414">
<caret line="196" column="62" lean-forward="true" selection-start-line="196" selection-start-column="62" selection-end-line="196" selection-end-column="62" />
<folding>
<element signature="e#157#183#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/components/map/UnivMakers.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="319">
<caret line="49" column="4" selection-start-line="49" selection-start-column="4" selection-end-line="49" selection-end-column="4" />
<state relative-caret-position="514">
<caret line="119" column="10" lean-forward="true" selection-start-line="119" selection-start-column="10" selection-end-line="119" selection-end-column="10" />
<folding>
<element signature="e#0#26#0" expanded="true" />
</folding>
......@@ -73,11 +77,11 @@
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/components/search/Search.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
<caret line="71" column="40" selection-start-line="71" selection-start-column="40" selection-end-line="71" selection-end-column="40" />
<state relative-caret-position="139">
<caret line="43" column="5" lean-forward="true" selection-start-line="43" selection-start-column="5" selection-end-line="43" selection-end-column="5" />
<folding>
<element signature="e#0#26#0" expanded="true" />
</folding>
......@@ -135,9 +139,9 @@
<option value="$PROJECT_DIR$/src/components/map/UnivMap.js" />
<option value="$PROJECT_DIR$/src/components/filter/DownshiftMultiple.js" />
<option value="$PROJECT_DIR$/src/components/common/CustomComponentForAPI.js" />
<option value="$PROJECT_DIR$/src/components/map/UnivMakers.js" />
<option value="$PROJECT_DIR$/src/components/filter/Filter.js" />
<option value="$PROJECT_DIR$/src/components/search/Search.js" />
<option value="$PROJECT_DIR$/src/components/map/UnivMakers.js" />
</list>
</option>
</component>
......@@ -244,12 +248,12 @@
<workItem from="1552898039270" duration="329000" />
<workItem from="1552898445653" duration="2158000" />
<workItem from="1552903453991" duration="8635000" />
<workItem from="1553500611345" duration="8637000" />
<workItem from="1553500611345" duration="13100000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="41754000" />
<option name="totallyTimeSpent" value="46217000" />
</component>
<component name="ToolWindowManager">
<frame x="64" y="-11" width="1857" height="971" extended-state="6" />
......@@ -436,56 +440,59 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/pages/PageMap.js">
<entry file="file://$PROJECT_DIR$/src/components/map/UnivMap.js">
<provider selected="true" editor-type-id="text-editor">
<state>
<state relative-caret-position="675">
<caret line="93" column="8" lean-forward="true" selection-start-line="93" selection-start-column="8" selection-end-line="93" selection-end-column="8" />
<folding>
<element signature="e#0#26#0" expanded="true" />
<element signature="e#0#41#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/filter/Filter.js">
<entry file="file://$PROJECT_DIR$/src/components/pages/PageSearch.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-600">
<caret line="35" column="54" lean-forward="true" selection-start-line="35" selection-start-column="54" selection-end-line="35" selection-end-column="54" />
<state relative-caret-position="-116">
<caret line="7" selection-start-line="7" selection-end-line="7" />
<folding>
<element signature="e#0#26#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/map/UnivMap.js">
<entry file="file://$PROJECT_DIR$/src/components/pages/PageMap.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="675">
<caret line="93" column="8" lean-forward="true" selection-start-line="93" selection-start-column="8" selection-end-line="93" selection-end-column="8" />
<state>
<folding>
<element signature="e#0#41#0" expanded="true" />
<element signature="e#0#26#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/pages/PageSearch.js">
<entry file="file://$PROJECT_DIR$/src/components/map/UnivMakers.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-116">
<caret line="7" selection-start-line="7" selection-end-line="7" />
<state relative-caret-position="514">
<caret line="119" column="10" lean-forward="true" selection-start-line="119" selection-start-column="10" selection-end-line="119" selection-end-column="10" />
<folding>
<element signature="e#0#26#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/search/Search.js">
<entry file="file://$PROJECT_DIR$/src/components/filter/Filter.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="570">
<caret line="71" column="40" selection-start-line="71" selection-start-column="40" selection-end-line="71" selection-end-column="40" />
<state relative-caret-position="1414">
<caret line="196" column="62" lean-forward="true" selection-start-line="196" selection-start-column="62" selection-end-line="196" selection-end-column="62" />
<folding>
<element signature="e#0#26#0" expanded="true" />
<element signature="e#157#183#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/components/map/UnivMakers.js">
<entry file="file://$PROJECT_DIR$/src/components/search/Search.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="319">
<caret line="49" column="4" selection-start-line="49" selection-start-column="4" selection-end-line="49" selection-end-column="4" />
<state relative-caret-position="139">
<caret line="43" column="5" lean-forward="true" selection-start-line="43" selection-start-column="5" selection-end-line="43" selection-end-column="5" />
<folding>
<element signature="e#0#26#0" expanded="true" />
</folding>
......
......@@ -126,7 +126,6 @@ class Filter extends CustomComponentForAPI {
res.set(countryId, country);
});
return [...res.values()];
}
......@@ -143,6 +142,7 @@ class Filter extends CustomComponentForAPI {
selectedUniversities.push(campusFull.university.id);
}
});
console.log(selectedUniversities);
this.props.saveSelection(selectedUniversities);
}
......
......@@ -34,6 +34,8 @@ class Search extends CustomComponentForAPI {
}
/**
* Get the university suggestions for the `input` string.
*
......@@ -41,16 +43,39 @@ class Search extends CustomComponentForAPI {
* @memberof Search
*/
getSuggestions(input) {
var list_univsel_temp;
if(this.props.selected_universities.length === 0){
list_univsel_temp = this.props.selected_universities;
console.log("vide");
}
else{
list_univsel_temp = this.props.selected_universities.selection;
}
const list_univsel = list_univsel_temp.map(p => p);
const universities = this.getLatestReadData("universities"),
filter = fuzzysort.go(input, universities, { keys: ["name", "acronym"] });
let suggestions = filter.map(item => item.obj);
console.log(suggestions);
console.log("sugg");
if (suggestions.length == 0) {
suggestions = universities;
}
this.setState({ suggestions });
var suggestions_def = [];
suggestions.forEach(suggestions => {
if( (list_univsel.length > 0 && list_univsel.indexOf(suggestions.id) > -1) || list_univsel.length === 0 ) {
suggestions_def.push(suggestions);
}
});
console.log(suggestions_def);
this.setState({ suggestions_def });
}
......@@ -60,6 +85,7 @@ class Search extends CustomComponentForAPI {
customRender() {
const { classes } = this.props;
return (
<>
......@@ -96,6 +122,7 @@ class Search extends CustomComponentForAPI {
Search.propTypes = {
classes: PropTypes.object.isRequired,
selected_universities: PropTypes.array
};
......@@ -106,6 +133,7 @@ const mapStateToProps = (state) => {
mainCampuses: state.api.mainCampusesAll,
cities: state.api.citiesAll,
countries: state.api.countriesAll,
selected_universities : state.app.selectedUniversities
};
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment