Skip to content

Commit

Permalink
Remove unused imports and variables and parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Floby committed May 8, 2021
1 parent b2fa588 commit eb8a7ed
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import '@testing-library/jest-dom'
import { html } from 'lit-html'
import { waitFor, screen, fireEvent } from "testing-library__dom";
import { screen } from "testing-library__dom";
import userEvent from "@testing-library/user-event"
import { fixture } from "@open-wc/testing-helpers";
import './vmd-commune-or-departement-selector.component'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,13 @@ import {classMap} from "lit-html/directives/class-map";
import {Commune, Departement} from "../state/State";
import {repeat} from "lit-html/directives/repeat";
import communeSelectorCss from "./vmd-commune-or-departement-selector.component.scss";
import {Strings} from "../utils/Strings";
import {TemplateResult} from "lit-html";
import {CSS_Global} from "../styles/ConstructibleStyleSheets";

export type AutocompleteTriggered = { value: string };
export type CommuneSelected = { commune: Commune };
export type DepartementSelected = { departement: Departement };
export type ValueStrCustomEvent<T extends string> = CustomEvent<{value: T}>;

type DepartementRecherchable = Departement & {
fullTextSearchableNom: string;
fullTextSearchableCodeDepartement: string;
};

const SVG_CLOSE_ICON = html`<svg width="25" height="25" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" fill="black"><path d="M12 0c6.623 0 12 5.377 12 12s-5.377 12-12 12-12-5.377-12-12 5.377-12 12-12zm0 1c6.071 0 11 4.929 11 11s-4.929 11-11 11-11-4.929-11-11 4.929-11 11-11zm0 10.293l5.293-5.293.707.707-5.293 5.293 5.293 5.293-.707.707-5.293-5.293-5.293 5.293-.707-.707 5.293-5.293-5.293-5.293.707-.707 5.293 5.293z"/></svg>`

@customElement('vmd-commune-or-departement-selector')
Expand Down Expand Up @@ -86,7 +79,7 @@ export class VmdCommuneOrDepartmentSelectorComponent extends LitElement {
`;
}

renderListItems(): TemplateResult|DirectiveFn {
renderListItems() {
return repeat(this.suggestions, this.keyForSuggestion.bind(this), (suggestion, index) => {
if (this.suggestionIsDepartement(suggestion)) {
return this.renderDepartementItem(suggestion, index)
Expand Down
8 changes: 1 addition & 7 deletions src/components/vmd-search.component.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import {css, customElement, html, LitElement, internalProperty, property, unsafeCSS} from 'lit-element';
import {Router} from "../routing/Router";
import {css, customElement, html, LitElement, internalProperty, property } from 'lit-element';
import { SearchRequest } from '../state/State'
import {
Commune,
Departement,
libelleUrlPathDeCommune,
libelleUrlPathDuDepartement,
PLATEFORMES,
State,
StatsLieu,
} from "../state/State";
import {
AutocompleteTriggered,
CommuneSelected,
DepartementSelected
} from "../components/vmd-commune-or-departement-selector.component";
Expand Down
2 changes: 1 addition & 1 deletion src/routing/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class Routing {
</vmd-rdv-par-commune>`
},
pageTitleProvider: (params) =>
State.current.chercheCommuneParCode(Router.basePath, params['codePostal'], params['codeCommune'])
State.current.chercheCommuneParCode(params['codePostal'], params['codeCommune'])
.then(commune => `Vaccination COVID-19 à ${commune.nom} ${commune.codePostal}`)
});
this.declareRoutes({
Expand Down
2 changes: 0 additions & 2 deletions src/state/Autocomplete.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,8 @@ const communeDeaumont: Commune = {
}

describe("State.Autocomplete", () => {
const apiBaseUrl = "https://VMD.API/"
const webBaseUrl = "https://MY.WEB.PATH/"


const FILES = {
[`${webBaseUrl}autocompletes.json`]: ['1','14', 'd', 'de', 'dea'],
[`${webBaseUrl}autocomplete-cache/14.json`]: {
Expand Down
1 change: 0 additions & 1 deletion src/state/Autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ export class Autocomplete {

private async getLongestPrefixMatch(term: NormalizedSearch): Promise<NormalizedSearch | undefined> {
const prefixes = await this.getAutocompletePrefixes()
let longestMatch = term
for (let size = term.length; size > 0; --size) {
const subPrefix = term.substring(0, size)
if (prefixes.has(subPrefix)) {
Expand Down
2 changes: 1 addition & 1 deletion src/state/State.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ export class State {
}
}

async chercheCommuneParCode(basePath: string, codePostal: string, codeCommune: string): Promise<Commune> {
async chercheCommuneParCode(codePostal: string, codeCommune: string): Promise<Commune> {
const commune = await this.autocomplete.findCommune(codePostal, codeCommune)
return commune || State.COMMUNE_VIDE
}
Expand Down
6 changes: 0 additions & 6 deletions src/views/vmd-home.view.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
import {css, customElement, html, LitElement, property } from 'lit-element';
import {Router} from "../routing/Router";
import {
Commune,
Departement,
libelleUrlPathDeCommune,
libelleUrlPathDuDepartement,
PLATEFORMES,
SearchRequest,
State,
StatsLieu,
} from "../state/State";
import {
CommuneSelected,
DepartementSelected
} from "../components/vmd-commune-or-departement-selector.component";
import {CSS_Global, CSS_Home} from "../styles/ConstructibleStyleSheets";

@customElement('vmd-home')
Expand Down
10 changes: 5 additions & 5 deletions src/views/vmd-rdv.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import {
SearchRequest,
CodeDepartement,
CodeTriCentre,
Commune,
Departement,
libelleUrlPathDeCommune,
libelleUrlPathDuDepartement,
Lieu, LieuAffichableAvecDistance, LieuxAvecDistanceParDepartement,
Expand All @@ -21,8 +19,6 @@ import {Dates} from "../utils/Dates";
import {Strings} from "../utils/Strings";
import {
ValueStrCustomEvent,
AutocompleteTriggered,
CommuneSelected, DepartementSelected, VmdCommuneOrDepartmentSelectorComponent
} from "../components/vmd-commune-or-departement-selector.component";
import {DEPARTEMENTS_LIMITROPHES} from "../utils/Departements";
import {TemplateResult} from "lit-html";
Expand Down Expand Up @@ -328,7 +324,7 @@ export class VmdRdvParCommuneView extends AbstractVmdRdvView {
}
}

protected codeDepartementAdditionnels(codeDepartementSelectionne: CodeDepartement) {
codeDepartementAdditionnels(codeDepartementSelectionne: CodeDepartement) {
return DEPARTEMENTS_LIMITROPHES[codeDepartementSelectionne];
}

Expand Down Expand Up @@ -424,6 +420,10 @@ export class VmdRdvParDepartementView extends AbstractVmdRdvView {
}
}

codeDepartementAdditionnels () {
return []
}


libelleLieuSelectionne(): TemplateResult {
let nom = '???'
Expand Down

0 comments on commit eb8a7ed

Please sign in to comment.