From c8d2e1868d2d0fb21a4e2c6eec73cd155b42e779 Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Wed, 26 Jan 2022 10:00:01 +0100 Subject: [PATCH 01/21] init front with bootstrap --- run-dev-server | 2 +- static/find_pto.jpg | Bin 0 -> 26359 bytes templates/landing_form.html | 67 ++++++++++++++++++++++++++++++--- templates/style.css | 73 ++++++++++++++++++++++++++++++++++-- 4 files changed, 132 insertions(+), 10 deletions(-) create mode 100644 static/find_pto.jpg diff --git a/run-dev-server b/run-dev-server index 07bf5f5..4827992 100755 --- a/run-dev-server +++ b/run-dev-server @@ -1,3 +1,3 @@ #!/usr/bin/env bash -DEBUG=true CONFIG=./elig-test.ini FLASK_APP=webapp poetry run flask run --reload +DEBUG=true TEMPLATES_AUTO_RELOAD=true FLASK_ENV=development CONFIG=./elig-test.ini FLASK_APP=webapp poetry run flask run --reload diff --git a/static/find_pto.jpg b/static/find_pto.jpg new file mode 100644 index 0000000000000000000000000000000000000000..3f04c18a392e665557f6f330cd37424fc057b630 GIT binary patch literal 26359 zcma&NbyQr>(k?u>6WoKlyAxnwa2?!(4DJp=g1bX-clTfk?ykX;purO~IN$I)=RN2C zao=ye;;OF>3n1^@#C0Kh;$fR`-*5y;!d5&)2wX9gex z{wptAa9q~z?#{v-9FA`6rWQ_S5O#AX2M%vjXAUlQP7Z*mxVN*ZxgErv(hOo{<0wY` zyQ_zq(#ArJT8B@WQ`uPxVr?Vm>k85ERnau}wKEs8pca2eDe5ik?cnSHaW|#(cCdGJ z6ZRIP{s&wbdi{EvgPQW6D(-e-)RM2QQtB$JQA#&kEi8q>(lY;U3;Iip`rn=M^73N$;$e4k zwc_9s5)$Iz2RI_$+cXG3Ka;B7$di9zBC8M&bxsBuNO{Rael$C|$9o^hb z9nB%~(qhz59CjNU3t=EoQb>}Ahabo-$i>A45)kAO;FjhW5agEP=982bko+HAX(w|J z2Z*El|L9u$S6ASF)qN#|gEO>cX^5+hC&WU=)yaYKpNmt@FwH_kQF(U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H6 zzR8${Y&`h-ez2ofo(X+m*z#_EW58dz^y^sZYQ;Cj4uN$!yVF6P%c9e3$>Kdt7kF8Y zGR~=p)k@CA*MDh-A$(G@D09-S*jK4LlAhy3&#G>N+5Q&3{}A*L3M8TL$j1Bzv~8ud z=I-}ipFwlwz;yjBby4d!s%Y?gG!D*MGPergfL|+8iQsXZ3b8T@pVv5YHiTOCB^|cK@>c_g{&PNYN*%!QJOFKEVa=&qBFGE7or06R`Ca zKq^pShz&RB4w4}S;FdOUOG7^+lIfx%_EBwB!z6lxs)nf{_1*o~|0=)(1ysPi-u - + + + + + + Aquilenet: Éligibilité FTTH @@ -24,16 +31,20 @@
-

Test d'éligibilité par PTO

+

Test d'éligibilité par PTO

- + - Où trouver mon numéro de PTO ? + Où trouver mon numéro de PTO ?
- PTO (Point de terminaison optique) est un numéro unique que vous pouvez trouver sur le boîtier de raccordement de la fibre. + PTO (Point de terminaison optique) est un numéro unique que vous pouvez trouver sur le boîtier de + raccordement de la fibre. C'est un petit boîtier blanc installé dans la maison
Responsive image @@ -44,105 +55,150 @@
- +
-

Test d'éligibilité par adresse

-
-
- - - - -
-
-
- - -
-
- - - +

Test d'éligibilité par adresse

+ +
+ + +
-
+
+
+ + +
+
+ + + + +
+
+
+ +
- - -
- +
- + + \ No newline at end of file diff --git a/webapp.py b/webapp.py index 1d1d0fe..040ec9e 100644 --- a/webapp.py +++ b/webapp.py @@ -3,7 +3,7 @@ from flask import Flask, render_template, request, escape import json from config.config import parse_config -from axione_api.api import query_axione_pto, parse_response +from axione_api.api import query_axione_pto, parse_response, query_axione_fantoir from address_finder.api import AddressFinder def load_config(): @@ -54,12 +54,11 @@ def get_fantoir_voies(codeInsee): @app.route("/test/address", methods=['POST']) def test_address(): - commune = escape(request.form['commune']) + codeInsee = escape(request.form['codeInsee']) numeroVoie = escape(request.form['numeroVoie']) # Trimming rivoli's key voie = escape(request.form['voie'])[:-1] - result = query_axione_fantoir(cfg, commune, voie, numeroVoie) - # result = parse_response(query_axione_pto(cfg, pto)) + result = query_axione_fantoir(cfg, codeInsee, voie, numeroVoie) return render_template("result.html", pto="", result=result) -- 2.30.2 From 3fe2a4af9c563626f11f7fbf83ee598d5949308d Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Sat, 12 Feb 2022 21:31:23 +0100 Subject: [PATCH 13/21] fix selection commune/voie --- templates/landing_form.html | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index b93531f..b12da24 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -35,7 +35,7 @@
- @@ -139,15 +139,21 @@ fetch(api, { signalCommunes }) .then(response => response.json()) .then(data => { + valueMatch=false; if (JSON.stringify(data) !== JSON.stringify(communes)) { $("#communes").empty(); communes = data communes.forEach(commune => { + value=commune.codeZip + ' ' + commune.nom $("#communes").append(""); + value + "'>"); + if (value === search) { + valueMatch=true; + } + }); } - if (communes.length == 1) { + if (communes.length == 1 || valueMatch) { codeInsee = communes[0].codeInsee; $('#voieForm').collapse('show'); } else { @@ -156,10 +162,6 @@ } }) .catch(err => { - - if (err.name === "AbortError") { - console.log("DEBUG: updateCommunes aborted !") - } console.error("Error fetching communes:", err) }) } @@ -173,30 +175,29 @@ fetch(api, { signalVoies }) .then(response => response.json()) .then(data => { + valueMatch=false; if (JSON.stringify(data) !== JSON.stringify(voies)) { $("#voies").empty(); voies = Object.entries(data); - console.log(voies) let voie; for (i in voies) { voie = voies[i] $("#voies").append(""); + if (voie[0] === search) { + valueMatch=true; + } } - console.log(voies) - if (voies.length == 1) { + if (voies.length == 1 || valueMatch) { $('#btnTestAdresse').collapse('show'); voie = voies[0] + $('#btnTestAdresse').focus(); } else { $('#btnTestAdresse').collapse('hide'); } } }) .catch(err => { - - if (err.name === "AbortError") { - console.log("DEBUG: updateCommunes aborted !") - } console.error("Error fetching communes:", err) }) } @@ -204,10 +205,16 @@ $('#communeInput').trigger('input') $('#communeInput').trigger('keyup') }); + $('#methodAddress').on('shown.bs.collapse', function () { + $('#communeInput').focus(); + }); $('#voieForm').on('show.bs.collapse', function () { $('#voieInput').trigger('input') $('#voieInput').trigger('keyup') }); + $('#voieForm').on('shown.bs.collapse', function () { + $('#numeroVoieInput').focus(); + }); $('#communeInput').on('keyup', function () { controllerCommunes.abort(); @@ -232,7 +239,6 @@ }); $('#formAddressTest').submit(function(eventObj) { - console.log("SUBMIT",$('#formAddressTest')) $('#formAddressTest').append(``); return true; }); -- 2.30.2 From c9a0a898aaccff3ed1ccb093f6a9ee184cac7212 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Sat, 12 Feb 2022 23:32:32 +0100 Subject: [PATCH 14/21] frontend: implement fetchwithBackoff We're fetching too soon and too often stuff from the backend. Making the search input behaviour a bit flaky. Implementing a backoff fetching strategy. We'll trigger the query only after 500ms of inactivity and will cancel the previous requests before triggering a new one. --- templates/landing_form.html | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index b12da24..49cf39d 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -167,7 +167,7 @@ } // Function to update list of voies (calls backend API) - function updateVoies(codeInsee, search = '') { + function updateVoies(search = '') { var api = "addresses/fantoirvoies/" + codeInsee + '?limit=15'; if (search != '') { api += "&s=" + search; @@ -201,6 +201,21 @@ console.error("Error fetching communes:", err) }) } + + function fetchWithBackoff (fetchFn, timeout, input) { + if(timeout !== null) { + clearTimeout(timeout); + } + if (input.length < 3) { + return null; + } + timeout = setTimeout(() => { + const cleanInput = sanitizeInputStr(input); + fetchFn(cleanInput); + }, 100); + return timeout; + } + $('#methodAddress').on('show.bs.collapse', function () { $('#communeInput').trigger('input') $('#communeInput').trigger('keyup') @@ -216,10 +231,10 @@ $('#numeroVoieInput').focus(); }); - $('#communeInput').on('keyup', function () { + let timeoutCommune = null; + $('#communeInput').on('input', function () { controllerCommunes.abort(); - inputStr = sanitizeInputStr($(this).val()); - updateCommunes(inputStr); + timeoutCommune = fetchWithBackoff(updateCommunes, timeoutCommune, $(this).val()); }); $('#communeInput').on('input', function () { @@ -227,10 +242,11 @@ $('#voieForm').collapse('hide'); } }); - $('#voieInput').on('keyup', function () { + + let timeoutVoie = null; + $('#voieInput').on('input', function () { controllerVoies.abort(); - inputStr = sanitizeInputStr($(this).val()); - updateVoies(codeInsee, inputStr); + timeoutVoie = fetchWithBackoff(updateVoies, timeoutVoie, $(this).val()); }); $('#voieInput').on('input', function () { if ($(this).val() === '') { @@ -246,4 +262,4 @@ - \ No newline at end of file + -- 2.30.2 From fde1a65d6aff10452cf93e67525b2107cd8d6b01 Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Sat, 12 Feb 2022 23:39:40 +0100 Subject: [PATCH 15/21] fix axione api: return result --- axione_api/api.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/axione_api/api.py b/axione_api/api.py index 061b5ac..dfae753 100644 --- a/axione_api/api.py +++ b/axione_api/api.py @@ -43,19 +43,17 @@ def fantoirRequest(insee, rivoli, numVoie): def query_axione_fantoir(cfg, insee, rivoli, numVoie): body = fantoirRequest(insee, rivoli, numVoie) - query_axione(cfg, body) + return query_axione(cfg, body) def query_axione_pto(cfg, ptoRef): body = ptoRequest(ptoRef) - query_axione(cfg, body) + return query_axione(cfg, body) def query_axione(cfg, body): # Note: the password should be the base64 of username:password. # Don't ask why. - passwd = base64.b64encode(f"{cfg.username}:{cfg.password}".encode("utf8")).decode( - "utf8" - ) + passwd = cfg.password headers = { "User-Agent": "aquilenet-elig-test/0.1", "Accept": "*/*", @@ -63,7 +61,7 @@ def query_axione(cfg, body): "Connection": "Keep-Alive", "Authorization": passwd, } - resp = None + respData = None if not cfg.debug: try: conn = http.client.HTTPSConnection( @@ -96,7 +94,7 @@ def query_axione(cfg, body): with open("./fixtures/dummy-data-1.xml", "r") as f: dummyData = f.read() return dummyData - return resp + return respData class LigneResult(TypedDict): -- 2.30.2 From bd24f9044ca0ad9c9cb5371afd4922c1e0585f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Sat, 12 Feb 2022 23:50:33 +0100 Subject: [PATCH 16/21] Autocomplete: set input to selected value when 1 option --- templates/landing_form.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index 49cf39d..3a9ed69 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -182,8 +182,8 @@ let voie; for (i in voies) { voie = voies[i] - $("#voies").append(""); + $("#voies").append(""); if (voie[0] === search) { valueMatch=true; } @@ -191,6 +191,7 @@ if (voies.length == 1 || valueMatch) { $('#btnTestAdresse').collapse('show'); voie = voies[0] + $("#voieInput").val(voie[0]); $('#btnTestAdresse').focus(); } else { $('#btnTestAdresse').collapse('hide'); -- 2.30.2 From 8c7ff6a11b1f91ec1919ab1917ae8205f2c3c8a3 Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Sun, 13 Feb 2022 00:26:31 +0100 Subject: [PATCH 17/21] send codeRivoli to back --- templates/landing_form.html | 5 ++++- webapp.py | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index 3a9ed69..b8df301 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -111,6 +111,7 @@ // Global variables var communes = [] var codeInsee = 0 + var codeRivoli = "" var voies = [] var voie = "" @@ -183,7 +184,7 @@ for (i in voies) { voie = voies[i] $("#voies").append(""); + voie[0] + "'>"); if (voie[0] === search) { valueMatch=true; } @@ -191,6 +192,7 @@ if (voies.length == 1 || valueMatch) { $('#btnTestAdresse').collapse('show'); voie = voies[0] + codeRivoli = voie[1] $("#voieInput").val(voie[0]); $('#btnTestAdresse').focus(); } else { @@ -257,6 +259,7 @@ $('#formAddressTest').submit(function(eventObj) { $('#formAddressTest').append(``); + $('#formAddressTest').append(``); return true; }); }); diff --git a/webapp.py b/webapp.py index 040ec9e..8641b9a 100644 --- a/webapp.py +++ b/webapp.py @@ -57,8 +57,8 @@ def test_address(): codeInsee = escape(request.form['codeInsee']) numeroVoie = escape(request.form['numeroVoie']) # Trimming rivoli's key - voie = escape(request.form['voie'])[:-1] - result = query_axione_fantoir(cfg, codeInsee, voie, numeroVoie) + codeRivoli = escape(request.form['codeRivoli'])[:-1] + result = query_axione_fantoir(cfg, codeInsee, codeRivoli, numeroVoie) return render_template("result.html", pto="", result=result) -- 2.30.2 From 68434bf4464d7ac86da0aac60dc6473a08a96917 Mon Sep 17 00:00:00 2001 From: Johan Le Baut Date: Sun, 13 Feb 2022 12:12:58 +0100 Subject: [PATCH 18/21] handle axione erreur --- .gitignore | 3 ++- axione_api/api.py | 47 +++++++++++++++++++++++++++++-------- fixtures/dummy-data-2.xml | 46 ++++++++++++++++++++++++++++++++++++ fixtures/dummy-data-3.xml | 36 ++++++++++++++++++++++++++++ templates/landing_form.html | 4 ++-- templates/result.html | 14 ++++++++--- templates/style.css | 4 ++-- webapp.py | 7 +++++- 8 files changed, 142 insertions(+), 19 deletions(-) create mode 100644 fixtures/dummy-data-2.xml create mode 100644 fixtures/dummy-data-3.xml diff --git a/.gitignore b/.gitignore index 392f4f6..88d0713 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ __pycache__ -/elig-test.ini \ No newline at end of file +/elig-test.ini +.vscode \ No newline at end of file diff --git a/axione_api/api.py b/axione_api/api.py index dfae753..496a422 100644 --- a/axione_api/api.py +++ b/axione_api/api.py @@ -90,7 +90,6 @@ def query_axione(cfg, body): print(headers) print("BODY: ") print(body) - print("===================") with open("./fixtures/dummy-data-1.xml", "r") as f: dummyData = f.read() return dummyData @@ -121,17 +120,45 @@ class BatimentResult(TypedDict): referenceBatiment: str etages: list[EtageResult] +class AxioneErreur(TypedDict): + codeErreur: str + libelleErreur: str -def parse_response(resp_str) -> list[BatimentResult]: +class AxioneResult(TypedDict): + codeRetour: int + axioneErreur: AxioneErreur + batiments: list[BatimentResult] + + +def parse_response(resp_str) -> AxioneResult: root = ET.fromstring(resp_str) - parsedBatiments = [ - parse_batiment(b) - for b in root.findall( - ".//{http://structureadresseftth.axione.fr/model/commun}batiment" - ) - ] - return parsedBatiments - + codeRetourXml = root.find( + ".//{http://structureadresseftth.axione.fr/model/commun}codeRetour" + ) + codeRetour = int(codeRetourXml.text.strip()) + axioneErreur = None + parsedBatiments = [] + if codeRetour == 0: + parsedBatiments = [ + parse_batiment(b) + for b in root.findall( + ".//{http://structureadresseftth.axione.fr/model/commun}batiment" + ) + ] + else: + axioneErreur = AxioneErreur( + codeErreur = root.find( + ".//{http://structureadresseftth.axione.fr/model/commun}codeErreur" + ).text.strip(), + libelleErreur = root.find( + ".//{http://structureadresseftth.axione.fr/model/commun}libelleErreur" + ).text.strip() + ) + return AxioneResult( + codeRetour=codeRetour, + axioneErreur=axioneErreur, + batiments=parsedBatiments + ) def parse_batiment(batiment) -> BatimentResult: etatBatiment = batiment.get("etatBatiment", None) diff --git a/fixtures/dummy-data-2.xml b/fixtures/dummy-data-2.xml new file mode 100644 index 0000000..a8b8789 --- /dev/null +++ b/fixtures/dummy-data-2.xml @@ -0,0 +1,46 @@ + + + + + + + + + 0 + + BEFO + true + + + + + + + + + + + + + + + BF-ISS1-0110 + + + + + + + + + + PME + OC + + + + + + + + \ No newline at end of file diff --git a/fixtures/dummy-data-3.xml b/fixtures/dummy-data-3.xml new file mode 100644 index 0000000..f83388c --- /dev/null +++ b/fixtures/dummy-data-3.xml @@ -0,0 +1,36 @@ + + + + + + + + + 1 + I01 + Code Rivoli introuvable, manquant ou incomplet + + + + + + + + + + + + + + + + PME + OI + + + + + + + + \ No newline at end of file diff --git a/templates/landing_form.html b/templates/landing_form.html index b8df301..4f6f9cd 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -7,8 +7,8 @@ - + diff --git a/templates/result.html b/templates/result.html index 5db72a8..3d044b9 100644 --- a/templates/result.html +++ b/templates/result.html @@ -11,11 +11,12 @@ -

Aquilenet

-
+

Aquilenet

+ {% if result['codeRetour'] == 0 %} +

Test d'Éligibilité FTTH Aquilenet: Résultats

Résultat pour le PTO: {{ pto }}

- {% for batiment in result %} + {% for batiment in result['batiments'] %} @@ -58,5 +59,12 @@
{% endfor %}
+ {% else %} +
+

Erreur

+

Code d'erreur: {{ result['axioneErreur']['codeErreur'] }}

+

Description de l'erreur: {{ result['axioneErreur']['libelleErreur'] }}

+
+ {% endif %} diff --git a/templates/style.css b/templates/style.css index bcfada8..64e7c6e 100644 --- a/templates/style.css +++ b/templates/style.css @@ -93,7 +93,7 @@ form { align-self: center; margin-bottom: 2em; } - +*/ table,td { border: 2px solid #333; border-collapse: collapse; @@ -107,4 +107,4 @@ thead, tfoot { td { padding-left: 1em; padding-right: 1em; -} */ +} diff --git a/webapp.py b/webapp.py index 8641b9a..6a5be00 100644 --- a/webapp.py +++ b/webapp.py @@ -58,7 +58,12 @@ def test_address(): numeroVoie = escape(request.form['numeroVoie']) # Trimming rivoli's key codeRivoli = escape(request.form['codeRivoli'])[:-1] - result = query_axione_fantoir(cfg, codeInsee, codeRivoli, numeroVoie) + result = parse_response(query_axione_fantoir(cfg, codeInsee, codeRivoli, numeroVoie)) + if cfg.debug: + print("===================") + print("Dummy response: ") + print(result) + print("===================") return render_template("result.html", pto="", result=result) -- 2.30.2 From d0715b0d15094e89bb77e087879049160b1cb7e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Baylac-Jacqu=C3=A9?= Date: Sun, 13 Feb 2022 12:18:24 +0100 Subject: [PATCH 19/21] autocomplete: switch autocomplete.js Turns out implementing a autocomplete widget from scratch is more tricky than expected. It's a shame no such widget has been implemented part of the HTML standart :( --- templates/landing_form.html | 192 +++++++++++++----------------------- templates/style.css | 4 + 2 files changed, 75 insertions(+), 121 deletions(-) diff --git a/templates/landing_form.html b/templates/landing_form.html index 4f6f9cd..13b5438 100644 --- a/templates/landing_form.html +++ b/templates/landing_form.html @@ -15,6 +15,8 @@ + + Aquilenet: Éligibilité FTTH