refined class usage for usage and coverage tests
Sonarqube Scanner / Build and analyze (push) Failing after 17s
Sonarqube Scanner / Build and analyze (push) Failing after 17s
This commit is contained in:
@@ -8,6 +8,7 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
|
||||
button: 'editor-button',
|
||||
close: 'editor-close',
|
||||
dialog: 'editor-dialog',
|
||||
dialogTitle: 'editor-dialog-title',
|
||||
newRoute: 'editor-new-route',
|
||||
poiAudio: 'editor-poi-audio',
|
||||
poiCancel: 'editor-poi-cancel',
|
||||
@@ -124,19 +125,34 @@ globalThis.Wegwichtel = globalThis.Wegwichtel || {};
|
||||
status.dataset.kind = isError ? 'error' : 'notice';
|
||||
}
|
||||
|
||||
function setDialogTitle(value) {
|
||||
const title = byId(ids.dialogTitle);
|
||||
if (title) title.textContent = value;
|
||||
}
|
||||
|
||||
function routeDialogTitle() {
|
||||
if (state.currentSource === 'local') {
|
||||
return routeId(state.currentRoute) ? 'Lokale Strecke bearbeiten' : 'Neue lokale Strecke';
|
||||
}
|
||||
return 'Veröffentlichte Strecke bearbeiten';
|
||||
}
|
||||
|
||||
function showListView() {
|
||||
setDialogTitle('Streckenverwaltung');
|
||||
setHidden(byId(ids.routeListView), false);
|
||||
setHidden(byId(ids.routeDetailView), true);
|
||||
setHidden(byId(ids.poiFormView), true);
|
||||
}
|
||||
|
||||
function showRouteView() {
|
||||
setDialogTitle(routeDialogTitle());
|
||||
setHidden(byId(ids.routeListView), true);
|
||||
setHidden(byId(ids.routeDetailView), false);
|
||||
setHidden(byId(ids.poiFormView), true);
|
||||
}
|
||||
|
||||
function showPoiView() {
|
||||
setDialogTitle(state.currentPoi ? 'POI bearbeiten' : 'POI hinzufügen');
|
||||
setHidden(byId(ids.routeListView), true);
|
||||
setHidden(byId(ids.routeDetailView), true);
|
||||
setHidden(byId(ids.poiFormView), false);
|
||||
|
||||
Reference in New Issue
Block a user