BatchCodeTableInitializer.#trackSearchWithGoogleAnalytics()
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -18,6 +18,7 @@ class BatchCodeTableInitializer {
|
|||||||
this.#countrySelect.addEventListener('change', event => this.#displayCountry());
|
this.#countrySelect.addEventListener('change', event => this.#displayCountry());
|
||||||
this.#displayCountry();
|
this.#displayCountry();
|
||||||
this.#initializeHistogramView();
|
this.#initializeHistogramView();
|
||||||
|
this.#trackSearchWithGoogleAnalytics();
|
||||||
}
|
}
|
||||||
|
|
||||||
#getCountry() {
|
#getCountry() {
|
||||||
@@ -135,22 +136,38 @@ class BatchCodeTableInitializer {
|
|||||||
|
|
||||||
#initializeHistogramView() {
|
#initializeHistogramView() {
|
||||||
const thisClassInstance = this;
|
const thisClassInstance = this;
|
||||||
$(`#${this.#batchCodeTableElement[0].id} tbody`).on(
|
$(`#${this.#batchCodeTableElement[0].id} tbody`)
|
||||||
'click',
|
.on(
|
||||||
'td.dt-control',
|
'click',
|
||||||
function () {
|
'td.dt-control',
|
||||||
const tr = $(this).closest('tr');
|
function () {
|
||||||
const row = thisClassInstance.#batchCodeTable.row(tr);
|
const tr = $(this).closest('tr');
|
||||||
if (row.child.isShown()) {
|
const row = thisClassInstance.#batchCodeTable.row(tr);
|
||||||
row.child.hide();
|
if (row.child.isShown()) {
|
||||||
tr.removeClass('shown');
|
row.child.hide();
|
||||||
} else {
|
tr.removeClass('shown');
|
||||||
const uiContainer = document.createElement("div");
|
} else {
|
||||||
row.child(uiContainer).show();
|
const uiContainer = document.createElement("div");
|
||||||
tr.addClass('shown');
|
row.child(uiContainer).show();
|
||||||
const batchcode = row.data()[thisClassInstance.#getColumnIndex('Batch')];
|
tr.addClass('shown');
|
||||||
new HistogramView(uiContainer).displayHistogramView(thisClassInstance.#getCountry(), batchcode);
|
const batchcode = row.data()[thisClassInstance.#getColumnIndex('Batch')];
|
||||||
}
|
new HistogramView(uiContainer).displayHistogramView(thisClassInstance.#getCountry(), batchcode);
|
||||||
});
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
#trackSearchWithGoogleAnalytics() {
|
||||||
|
const thisClassInstance = this;
|
||||||
|
$(`#${this.#batchCodeTableElement[0].id}`)
|
||||||
|
.on(
|
||||||
|
'search.dt',
|
||||||
|
function () {
|
||||||
|
gtag(
|
||||||
|
'event',
|
||||||
|
'view_search_results',
|
||||||
|
{
|
||||||
|
'search_term': thisClassInstance.#batchCodeTable.search()
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ jupyter notebook
|
|||||||
FK-FIXME:
|
FK-FIXME:
|
||||||
|
|
||||||
FK-TODO:
|
FK-TODO:
|
||||||
|
- add google captcha to batchCodeTable.html
|
||||||
|
|
||||||
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