batchCodes.html?showCountriesColumn=yes or batchCodes.html?showCountriesColumn=no
This commit is contained in:
@@ -1,11 +1,11 @@
|
|||||||
class BatchCodeTableInitializer {
|
class BatchCodeTableInitializer {
|
||||||
|
|
||||||
initialize({ batchCodeTableElement, showCountries }) {
|
initialize({ batchCodeTableElement, showCountriesColumn }) {
|
||||||
// FK-TODO: show "Loading.." message or spinning wheel.
|
// FK-TODO: show "Loading.." message or spinning wheel.
|
||||||
this.#loadBarChartDescriptions(showCountries)
|
this.#loadBarChartDescriptions(showCountriesColumn)
|
||||||
.then(barChartDescriptions => {
|
.then(barChartDescriptions => {
|
||||||
const batchCodeTable = this.#createEmptyBatchCodeTable(batchCodeTableElement, showCountries, barChartDescriptions);
|
const batchCodeTable = this.#createEmptyBatchCodeTable(batchCodeTableElement, showCountriesColumn, barChartDescriptions);
|
||||||
this.#setVisibilityOfCountriesColumn(batchCodeTable, showCountries);
|
this.#setVisibilityOfCountriesColumn(batchCodeTable, showCountriesColumn);
|
||||||
fetch('data/batchCodeTables/Global.json')
|
fetch('data/batchCodeTables/Global.json')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(json => {
|
.then(json => {
|
||||||
@@ -25,7 +25,7 @@ class BatchCodeTableInitializer {
|
|||||||
Promise.resolve({});
|
Promise.resolve({});
|
||||||
}
|
}
|
||||||
|
|
||||||
#createEmptyBatchCodeTable(batchCodeTableElement, showCountries, barChartDescriptions) {
|
#createEmptyBatchCodeTable(batchCodeTableElement, showCountriesColumn, barChartDescriptions) {
|
||||||
return batchCodeTableElement.DataTable(
|
return batchCodeTableElement.DataTable(
|
||||||
{
|
{
|
||||||
language:
|
language:
|
||||||
@@ -78,7 +78,7 @@ class BatchCodeTableInitializer {
|
|||||||
return null;
|
return null;
|
||||||
},
|
},
|
||||||
createdCell: (cell, cellData, row, rowIndex, colIndex) => {
|
createdCell: (cell, cellData, row, rowIndex, colIndex) => {
|
||||||
if (showCountries) {
|
if (showCountriesColumn) {
|
||||||
this.#displayBatchcodeByCountryBarChart(
|
this.#displayBatchcodeByCountryBarChart(
|
||||||
row[this.#getColumnIndex('Batch')],
|
row[this.#getColumnIndex('Batch')],
|
||||||
barChartDescriptions,
|
barChartDescriptions,
|
||||||
@@ -124,10 +124,10 @@ class BatchCodeTableInitializer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#setVisibilityOfCountriesColumn(batchCodeTable, showCountries) {
|
#setVisibilityOfCountriesColumn(batchCodeTable, showCountriesColumn) {
|
||||||
batchCodeTable
|
batchCodeTable
|
||||||
.column(this.#getColumnIndex('Countries'))
|
.column(this.#getColumnIndex('Countries'))
|
||||||
.visible(showCountries);
|
.visible(showCountriesColumn);
|
||||||
}
|
}
|
||||||
|
|
||||||
#addCountriesColumn(json) {
|
#addCountriesColumn(json) {
|
||||||
|
|||||||
@@ -58,4 +58,10 @@ class UIUtils {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static getSearchParam(urlParams, searchParam, defaultValue) {
|
||||||
|
return urlParams.has(searchParam) ?
|
||||||
|
urlParams.get(searchParam) :
|
||||||
|
defaultValue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@
|
|||||||
new BatchCodeTableInitializer().initialize(
|
new BatchCodeTableInitializer().initialize(
|
||||||
{
|
{
|
||||||
batchCodeTableElement: $('#batchCodeTable'),
|
batchCodeTableElement: $('#batchCodeTable'),
|
||||||
showCountries: false
|
showCountriesColumn: UIUtils.getSearchParam(new URLSearchParams(window.location.search), 'showCountriesColumn', '').toUpperCase() == 'YES'
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ FK-FIXME:
|
|||||||
FK-TODO:
|
FK-TODO:
|
||||||
- add google captcha to batchCodeTable.html
|
- add google captcha to batchCodeTable.html
|
||||||
- Symptomhistogramm
|
- Symptomhistogramm
|
||||||
- batchCodes.html?showCountries=yes oder batchCodes.html?showCountries=no als Default dazufügen.
|
|
||||||
|
|
||||||
anacron job:
|
anacron job:
|
||||||
sudo cp src/intensivstationen_howbadismybatch.sh /etc/cron.daily/intensivstationen_howbadismybatch
|
sudo cp src/intensivstationen_howbadismybatch.sh /etc/cron.daily/intensivstationen_howbadismybatch
|
||||||
|
|||||||
Reference in New Issue
Block a user