refactoring

This commit is contained in:
Frank Knoll
2024-07-14 02:11:41 +02:00
parent b143949798
commit a8ec099c00
8 changed files with 54 additions and 45 deletions

View File

@@ -5,29 +5,29 @@ class PageInitializer {
PageInitializer.#configureVaccine(vaccine);
}
static #configureSymptom({ symptomSelectElement, selectSymptom, onSymptomSelected, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
static #configureSymptom({ symptomSelectElement, searchParam, prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName }) {
const prrByVaccineTableView = new PrrByVaccineTableView(prrByVaccineTableElement, downloadPrrByVaccineTableButton, keyColumnName);
Select2.initializeSelectElement(
{
selectElement: symptomSelectElement,
textOfOption2Select: selectSymptom,
textOfOption2Select: searchParam.get(),
onValueSelected: (id, text) => {
prrByVaccineTableView.displayPrrByVaccineTable4Symptom(id, text);
onSymptomSelected(text);
searchParam.set(text);
},
minimumInputLength: 0
});
}
static #configureVaccine({ vaccineSelectElement, selectVaccine, onVaccineSelected, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
static #configureVaccine({ vaccineSelectElement, searchParam, prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName }) {
const prrBySymptomTableView = new PrrBySymptomTableView(prrBySymptomTableElement, downloadPrrBySymptomTableButton, valueName);
Select2.initializeSelectElement(
{
selectElement: vaccineSelectElement,
textOfOption2Select: selectVaccine,
textOfOption2Select: searchParam.get(),
onValueSelected: (id, text) => {
prrBySymptomTableView.displayPrrBySymptomTable4Vaccine(id, text);
onVaccineSelected(text);
searchParam.set(text);
},
minimumInputLength: 0
});

View File

@@ -33,7 +33,7 @@ class PrrByKeyTableView {
}
#downloadPrrByKey() {
UIUtils.downloadUrlAsFilename(
UrlUtils.downloadUrlAsFilename(
window.URL.createObjectURL(
new Blob(
[this.#prrByKeyTable.getDisplayedTableAsCsv(`# ${this.#valueName}: ${this.#text}`)],

View File

@@ -7,10 +7,10 @@ class SearchParam {
}
get() {
return UIUtils.getSearchParamOfCurrentUrl(this.#name);
return UrlUtils.getSearchParamOfCurrentUrl(this.#name);
}
set(value) {
UIUtils.setSearchParamOfCurrentUrl(this.#name, value);
UrlUtils.setSearchParamOfCurrentUrl(this.#name, value);
}
}