From 0cb604f5a8421f5cd4d43bd9a20206a728134dd2 Mon Sep 17 00:00:00 2001 From: fcamblor Date: Fri, 24 Dec 2021 16:06:03 +0100 Subject: [PATCH 1/5] #276 initializing RemoteConfig prior to installing routes as we need RemoteConfig singleton to be initialized (even if not completely filled) prior to calling Router.installRoutes() as, for certain routes (search by departments), title requires some RemoteConfig's promise to be issued --- src/vmd-app.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vmd-app.component.ts b/src/vmd-app.component.ts index b69e873b..ad8848e1 100644 --- a/src/vmd-app.component.ts +++ b/src/vmd-app.component.ts @@ -26,12 +26,12 @@ export class VmdAppComponent extends LitElement { smoothscroll.polyfill(); + RemoteConfig.INSTANCE.sync(); + Router.installRoutes((viewTemplateResult) => { this.viewTemplateResult = viewTemplateResult; }) - RemoteConfig.INSTANCE.sync(); - ServiceWorkers.INSTANCE.startup(); } From 42ae5c7f39a5688767973f93f6530251875e112b Mon Sep 17 00:00:00 2001 From: Nathan Mittelette Date: Thu, 30 Dec 2021 13:32:59 +0100 Subject: [PATCH 2/5] #272 fix ios search bar --- .../vmd-commune-or-departement-selector.component.scss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/vmd-commune-or-departement-selector.component.scss b/src/components/vmd-commune-or-departement-selector.component.scss index 862ea6af..fcdb91ab 100644 --- a/src/components/vmd-commune-or-departement-selector.component.scss +++ b/src/components/vmd-commune-or-departement-selector.component.scss @@ -90,6 +90,7 @@ label, -webkit-appearance: none; appearance: none; outline: none; + background-color: -webkit-control-background; &:focus { box-shadow: 0 0 0 $form-select-focus-width $input-btn-focus-color; @@ -181,4 +182,4 @@ label, .label-for-search { cursor: pointer; -} \ No newline at end of file +} From 76ea3259aec4e97e2f5a2713f0481b60d285da55 Mon Sep 17 00:00:00 2001 From: fcamblor Date: Wed, 29 Jun 2022 15:15:02 +0200 Subject: [PATCH 3/5] introduced spec test to test bijections on adjacent departments --- src/utils/Departements.spec.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/utils/Departements.spec.ts diff --git a/src/utils/Departements.spec.ts b/src/utils/Departements.spec.ts new file mode 100644 index 00000000..87a49051 --- /dev/null +++ b/src/utils/Departements.spec.ts @@ -0,0 +1,20 @@ +import {DEPARTEMENTS_LIMITROPHES} from "./Departements"; + +describe('Departements', () => { + Object.keys(DEPARTEMENTS_LIMITROPHES).forEach(startingDep => { + DEPARTEMENTS_LIMITROPHES[startingDep].forEach(endingDep => { + it(`${startingDep} => ${endingDep} should have bijective adjacent departments`, () => { + // Given + + // When + const endingDepAdjacentDepartments = DEPARTEMENTS_LIMITROPHES[endingDep]; + + // Then + expect(endingDepAdjacentDepartments).toBeDefined() + try { + expect(endingDepAdjacentDepartments.includes(startingDep)).toBeTrue() + }catch(e){ throw new Error(`Missing "${startingDep}" in DEPARTEMENTS_LIMITROPHES["${endingDep}"]`); } + }); + }) + }) +}); From ab6bb3005dae3d2c1cfc4fe4fcc50f0969815ba4 Mon Sep 17 00:00:00 2001 From: fcamblor Date: Wed, 29 Jun 2022 15:15:14 +0200 Subject: [PATCH 4/5] considering that DEPARTEMENTS_LIMITROPHES should be bijective --- src/utils/Departements.ts | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/utils/Departements.ts b/src/utils/Departements.ts index 764b394e..de72d67b 100644 --- a/src/utils/Departements.ts +++ b/src/utils/Departements.ts @@ -3,7 +3,7 @@ import {CodeDepartement} from "../state/State"; export const DEPARTEMENTS_LIMITROPHES: Record = { "01": ["38","73","74","39","71","69",], - "02": ["59","80","60","77","51","08",], + "02": ["59","80","60","77","51","08","62",], "03": ["42","71","58","18","23","63",], "04": ["83","06","05","26","84","13",], "05": ["04","26","38","73",], @@ -12,13 +12,13 @@ export const DEPARTEMENTS_LIMITROPHES: Record Date: Wed, 29 Jun 2022 23:55:10 +0200 Subject: [PATCH 5/5] fixed some additional discrepancies in adjacent departments by cross checking with https://gist.github.com/sunny/13803 and wikipedia --- src/utils/Departements.ts | 50 +++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/utils/Departements.ts b/src/utils/Departements.ts index de72d67b..4be14f20 100644 --- a/src/utils/Departements.ts +++ b/src/utils/Departements.ts @@ -3,36 +3,36 @@ import {CodeDepartement} from "../state/State"; export const DEPARTEMENTS_LIMITROPHES: Record = { "01": ["38","73","74","39","71","69",], - "02": ["59","80","60","77","51","08","62",], + "02": ["59","80","60","77","51","08",], "03": ["42","71","58","18","23","63",], "04": ["83","06","05","26","84","13",], "05": ["04","26","38","73",], "06": ["83","04",], - "07": ["48","30","84","26","38","69","43",], - "08": ["55","51","02","59",], + "07": ["48","30","84","26","38","43","42",], + "08": ["55","51","02",], "09": ["31","11","66",], "10": ["89","21","52","51","77",], "11": ["09","31","81","34","66",], "12": ["34","30","48","15","46","82","81",], - "13": ["30","84","83","24","04",], - "14": ["27","61","50",], + "13": ["30","84","83","04",], + "14": ["27","61","50","76",], "15": ["48","43","63","19","46","12",], "16": ["17","79","86","87","24",], "17": ["85","79","16","33","24",], - "18": ["36","41","45","89","58","03","23",], + "18": ["36","41","45","58","03","23",], "19": ["23","87","24","46","15","63",], "2A": ["2B",], "2B": ["2A",], "21": ["10","89","58","71","39","70","52",], "22": ["29","56","35",], "23": ["87","19","63","03","18","36",], - "24": ["17","16","87","19","46","47","33","13",], + "24": ["17","16","87","19","46","47","33",], "25": ["39","70","90",], - "26": ["84","04","05","38","69","07","30",], + "26": ["84","04","05","38","07",], "27": ["76","60","95","78","28","61","14",], "28": ["27","78","91","45","41","72","61",], "29": ["22","56",], - "30": ["34","12","48","07","26","84","13",], + "30": ["34","12","48","07","84","13",], "31": ["65","32","82","81","11","09",], "32": ["31","65","64","40","47","82",], "33": ["17","24","47","40",], @@ -40,13 +40,13 @@ export const DEPARTEMENTS_LIMITROPHES: Record