From 9fb564ea5a373e53690f8bf81521878c1f7dac3d Mon Sep 17 00:00:00 2001 From: Bilou Date: Fri, 31 Mar 2023 18:45:37 +0200 Subject: [PATCH] $ --- src/app.riot | 14 ++++---------- src/components/global/api/Model.js | 12 +++--------- src/components/global/api/View.js | 4 +--- src/components/global/map/map.riot | 2 +- 4 files changed, 9 insertions(+), 23 deletions(-) diff --git a/src/app.riot b/src/app.riot index 35650ec..aab8457 100644 --- a/src/app.riot +++ b/src/app.riot @@ -1,16 +1,8 @@
-
-
- -
-
- -
- -
- +
+
@@ -31,11 +23,13 @@ './pages/home.riot' )), }, + state: { pages, showNotFound: false, activePage: null }, + onBeforeMount({ isServer }) { this.anyRouteStream = route('(.*)') this.anyRouteStream.on.value(this.onAnyRoute) diff --git a/src/components/global/api/Model.js b/src/components/global/api/Model.js index 4c7f9f8..1825dec 100644 --- a/src/components/global/api/Model.js +++ b/src/components/global/api/Model.js @@ -2,8 +2,6 @@ import log from "./log" export default class Model { constructor() { - localStorage.clear() - this.state = { api: { link: "https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri", @@ -123,8 +121,6 @@ export default class Model { `&facet=${encodeURIComponent(this.state.api.facet.filiaire)}` + `&apikey=${this.state.api.apikey}` - console.log(this.state.api.apikey) - return fetch(link) .then((res) => res.json()) .then((data) => { @@ -250,7 +246,7 @@ export default class Model { * (Bilal prends la responsabilite de ce massacre) * */ if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") { - link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=fili&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205` + + link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205` + `&apikey=${this.state.api.apikey}` } else if(this.state.page.tcat === "Formation Bac + 3") { link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203` + @@ -301,16 +297,14 @@ export default class Model { `&location=6,48.04137,1.74683&basemap=e69ab1` + `&apikey=${this.state.api.apikey}` - console.log(link) - /** * (Bilal prends la responsabilite de ce massacre) * */ if(this.state.page.tcat === "Formation d'ingénieur Bac + 5") { - link = `https://data.enseignementsup-recherche.gouv.fr/api/records/1.0/search/?dataset=fr-esr-parcoursup&q=&lang=fr&sort=tri&rows=10000&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205&location=6,48.04137,1.74683&basemap=e69ab1` + + link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20d%27ing%C3%A9nieur%20Bac%20%2B%205&location=6,48.04137,1.74683&basemap=e69ab1` + `&apikey=${this.state.api.apikey}` } else if(this.state.page.tcat === "Formation Bac + 3") { - link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&facet=fili&facet=form_lib_voe_acc&facet=fil_lib_voe_acc&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203&location=6,47.0088,2.09656&basemap=e69ab1&location=6,48.04137,1.74683&basemap=e69ab1` + + link = `https://data.enseignementsup-recherche.gouv.fr/explore/embed/dataset/fr-esr-parcoursup/map/?timezone=Europe%2FBerlin&sort=tri&refine.fili=Ecole%20d%27Ing%C3%A9nieur&refine.form_lib_voe_acc=Formations%20%20des%20%C3%A9coles%20d%27ing%C3%A9nieurs&refine.fil_lib_voe_acc=Formation%20Bac%20%2B%203&location=6,48.04137,1.74683&basemap=e69ab1` + `&apikey=${this.state.api.apikey}` } diff --git a/src/components/global/api/View.js b/src/components/global/api/View.js index 5789ebe..1e82c13 100644 --- a/src/components/global/api/View.js +++ b/src/components/global/api/View.js @@ -306,9 +306,7 @@ export default class View { this.map.innerHTML = "" const nmap = document.createElement("map") - - console.log(link) - + riot.mount(nmap, { link: link }, "map") diff --git a/src/components/global/map/map.riot b/src/components/global/map/map.riot index 3d1b76f..be013f2 100644 --- a/src/components/global/map/map.riot +++ b/src/components/global/map/map.riot @@ -9,7 +9,7 @@ #map-container #map-map { width: 100%; - height: 25vw; + height: 45vw; }