Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
fc983f1
add fahrzewugklassen
boal Jan 15, 2025
98ef9aa
add optionsmenusettings
boal Jan 15, 2025
edbf6a1
change spring boot version
boal Jan 15, 2025
df290fd
reformat code
boal Jan 15, 2025
ce05296
fetch all optionsmenue entries
boal Jan 15, 2025
a16f4d5
resolve merge conflict
boal Jan 27, 2025
5e91ea6
resolve merge commit
boal Jan 27, 2025
1a9e399
Merge branch 'main-ls2' into refactor/optionsmenu-information
boal Jan 28, 2025
f7c8c45
resolve merge conflicts
boal Feb 4, 2025
3d87ffa
chage spring boot version
boal Feb 4, 2025
9dcabaa
reformat code
boal Feb 4, 2025
a15219e
Merge branch 'sprint' into refactor/optionsmenu-information
boal Feb 4, 2025
3f758c9
change key generatio method for optionsmenue settings
boal Feb 4, 2025
be23515
change key generatio method for optionsmenue settings
boal Feb 4, 2025
7c23e9d
refactor icons
boal Feb 5, 2025
c6ebcba
refactor icons
boal Feb 5, 2025
7fbc9ea
first part of implementation
boal Feb 6, 2025
e7ebee2
additional implementation
boal Feb 6, 2025
4cfb1a0
fix some error
boal Feb 6, 2025
a5498c8
refactor code
boal Feb 7, 2025
62aa033
add exclusion
boal Feb 7, 2025
14f8b2f
remove unused method and stores
boal Feb 7, 2025
f2641af
remove unused method and stores
boal Feb 7, 2025
3ab6b98
remove unused method and stores
boal Feb 7, 2025
7a2213f
add reset fahrzeugkategorien und arten at change of intervall
boal Feb 7, 2025
d5f6fe6
add reset fahrzeugkategorien und arten at change of intervall
boal Feb 7, 2025
7873ab3
move reset fahrzeugkategorien and arten to main componente for option…
boal Feb 7, 2025
d567290
move reset fahrzeugkategorien and arten to main componente for option…
boal Feb 7, 2025
95139f6
Merge branch 'sprint' into refactor/optionsmenu-information
boal Feb 10, 2025
592750c
remove message to reset fahrzeuge
boal Feb 10, 2025
b821421
remove message to reset fahrzeuge
boal Feb 10, 2025
fde2135
resolve merge conflict
boal Feb 10, 2025
05210d5
refactor code
boal Feb 10, 2025
233b31d
add unit test
boal Feb 10, 2025
9820e74
add unit test
boal Feb 10, 2025
129cdbe
add unit test
boal Feb 10, 2025
0f7e427
add unit test
boal Feb 10, 2025
7c9672d
add unit test
boal Feb 10, 2025
986966f
add not running unit test git add .git add .!
boal Feb 11, 2025
2a16c7f
fix unit tests
boal Feb 11, 2025
a7438a6
fix unit tests
boal Feb 11, 2025
c440ca0
resolve merge conflicts
boal Feb 12, 2025
c67edb5
resolve merge conflicts
boal Feb 12, 2025
c8f8ea1
resolve review remarks
boal Feb 27, 2025
6ace0e3
Merge branch 'sprint' into refactor/optionsmenu-information
boal Feb 28, 2025
83c06de
Merge branch 'sprint' into refactor/optionsmenu-information
boal Mar 10, 2025
88e817b
Merge branch 'sprint' into refactor/optionsmenu-information
boal Mar 25, 2025
01caced
resolve merge conflicts
boal May 2, 2025
273eca8
resolve merge conflicts
boal May 7, 2025
9fcc49c
Merge branch 'sprint' into refactor/optionsmenu-information
boal May 7, 2025
5c68e96
resolve merge conflicts
boal May 8, 2025
207338d
fix url
boal May 8, 2025
4d0deee
enternen des setzen der Standardeinstellung
boal May 9, 2025
b3bf56a
add method to find smallest common denominator
boal May 12, 2025
e3eb9e5
adapt menu for zeitintervall to chow the correct intervalls
boal May 12, 2025
ec1749e
change reset to fahrzeugoptions
boal May 12, 2025
3507322
refactor to method
boal May 12, 2025
bdfd36d
add logic to computed method for intervall change detection
boal May 12, 2025
2b1c35b
adapt check for disability of fahrzeugkategorien und klassen
boal May 12, 2025
b980cfa
adapt selectable interval determination
boal May 13, 2025
d0f590b
remove unused import
boal May 13, 2025
895191c
remove reset of fahrzeugklassen und kategorien in intervall
boal May 13, 2025
c7894de
Merge branch 'sprint' into refactor/optionsmenu-information
boal May 13, 2025
9b65c95
Merge branch 'sprint' into refactor/optionsmenu-information
boal May 13, 2025
86021fe
Merge branch 'sprint' into refactor/optionsmenu-information
boal May 14, 2025
fdcd683
fix bug by adding a clone deep to map data extraction
boal May 14, 2025
d98fc93
fix unit test
boal May 15, 2025
f0feb79
rename meth9od
boal May 19, 2025
d6eadaa
set kfz or rad as default after change of date range
boal May 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
</template>

<script setup lang="ts">
import type OptionsmenueSettingsDTO from "@/types/common/OptionsmenueSettingsDTO";
import type MapConfigDTO from "@/types/karte/MapConfigDTO";
import type MessstelleAuswertungDTO from "@/types/messstelle/auswertung/MessstelleAuswertungDTO";

Expand All @@ -83,6 +84,7 @@ import goldTrophy from "@/../public/easteregg/trophy-outline-gold.svg";
import silverTrophy from "@/../public/easteregg/trophy-outline-silver.svg";
import MapConfigService from "@/api/service/MapConfigService";
import MessstelleAuswertungService from "@/api/service/MessstelleAuswertungService";
import OptionsmenueSettingsService from "@/api/service/OptionsmenueSettingsService";
import SsoUserInfoService from "@/api/service/SsoUserInfoService";
import VersionInfoService from "@/api/service/VersionInfoService";
import InfoMessage from "@/components/app/InfoMessage.vue";
Expand All @@ -91,6 +93,7 @@ import TheSnackbar from "@/components/common/TheSnackbar.vue";
import SearchInputField from "@/components/search/SearchInputField.vue";
import { useMapConfigStore } from "@/store/MapConfigStore";
import { useMapOptionsStore } from "@/store/MapOptionsStore";
import { useOptionsmenueSettingsStore } from "@/store/OptionsmenueSettingsStore";
import { useSearchStore } from "@/store/SearchStore";
import { useSnackbarStore } from "@/store/SnackbarStore";
import { useUserStore } from "@/store/UserStore";
Expand All @@ -108,6 +111,7 @@ const showGesamtauswertung = ref(false);
const snackbarStore = useSnackbarStore();
const userStore = useUserStore();
const searchStore = useSearchStore();
const optionsmenueSettingsStore = useOptionsmenueSettingsStore();
const mapOptionsStore = useMapOptionsStore();
const mapConfigStore = useMapConfigStore();
const route = useRoute();
Expand Down Expand Up @@ -138,6 +142,13 @@ function created() {
.catch(() => {
backendVersion.value = "error";
});
OptionsmenueSettingsService.getAllOptionsmenueSettingsForMessstellen().then(
(optionsmenueSettings: Array<OptionsmenueSettingsDTO>) => {
optionsmenueSettingsStore.setOptionsmenueSettingsByIntervallAndFahrzeugklasse(
optionsmenueSettings
);
}
);
MapConfigService.getMapConfig().then((res: MapConfigDTO) => {
mapConfigStore.setMapConfig(res);
});
Expand Down
17 changes: 17 additions & 0 deletions frontend/src/api/service/OptionsmenueSettingsService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import type OptionsmenueSettingsDTO from "@/types/common/OptionsmenueSettingsDTO";

import FetchService from "@/api/service/FetchService";

export default class OptionsmenueSettingsService {
private static readonly ENDPOINT: string =
"api/dave-backend-service/settings-optionsmenue/messstelle/all";

static getAllOptionsmenueSettingsForMessstellen(): Promise<
Array<OptionsmenueSettingsDTO>
> {
return FetchService.getData(
this.ENDPOINT,
"Beim Holen der Einstellungen des Optionsmenüs ist ein Fehler aufgetreten."
);
}
}
6 changes: 3 additions & 3 deletions frontend/src/components/messstelle/MessstelleInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<div class="d-flex flex-row-reverse">
<messstelle-kommentar :kommentar="messstelle.kommentar" />
<fahrzeugklassen-icon
:fahrzeugklasse="fahrzeugKlasse"
:fahrzeugklasse="fahrzeugklasse"
color="primary"
size="small"
/>
Expand Down Expand Up @@ -130,9 +130,9 @@ const datumLetztePlausibleMessung = computed(() => {
return dateUtils.formatDate(props.messstelle.datumLetztePlausibleMessung);
});

const fahrzeugKlasse = computed(() => {
const fahrzeugklasse = computed(() => {
if (props.messstelle.messquerschnitte.length > 0) {
return props.messstelle.fahrzeugKlassen;
return props.messstelle.fahrzeugklasse;
} else {
return "k.A.";
}
Expand Down
30 changes: 22 additions & 8 deletions frontend/src/components/messstelle/icons/FahrzeugklassenIcon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@
</template>

<script setup lang="ts">
import { isNil } from "lodash";
import { computed } from "vue";

import TooltipWithIcon from "@/components/zaehlstelle/icons/TooltipWithIcon.vue";
import Fahrzeugklasse from "@/types/enum/Fahrzeugklasse";
import IconTooltip from "@/types/util/IconTooltip";

interface Props {
size?: string;
color?: string;
fahrzeugklasse: string;
fahrzeugklasse: Fahrzeugklasse | string | undefined;
}

const props = withDefaults(defineProps<Props>(), {
Expand All @@ -28,11 +30,13 @@ const props = withDefaults(defineProps<Props>(), {
* Lädt das richtige SVG Icon aus der Liste.
*/
const icon = computed<IconTooltip>(() => {
let result = fahrzeugklassenIcons().get(props.fahrzeugklasse);
if (result === undefined) {
let result = isNil(props.fahrzeugklasse)
? undefined
: fahrzeugklassenIcons().get(props.fahrzeugklasse);
if (isNil(result)) {
result = new IconTooltip(
"mdi-help",
"Keine Information zu den Fahrzeugklassen"
"Keine Information zu Fahrzeugklassen vorhanden"
);
}
return result;
Expand All @@ -41,11 +45,21 @@ const icon = computed<IconTooltip>(() => {
/**
* Alle Fahrzeugklasse Icons zu den Schlüsseln.
*/
function fahrzeugklassenIcons(): Map<string, IconTooltip> {
function fahrzeugklassenIcons(): Map<Fahrzeugklasse | string, IconTooltip> {
return new Map([
["8+1", new IconTooltip("$achtUndEins", "Fahrzeugklasse: 8+1")],
["QKFZ", new IconTooltip("$qkfz", "Fahrzeugklasse: QKFZ")],
["QPKW + QLKW", new IconTooltip("$qpkwLkw", "Fahrzeugklasse: QPKW + QLKW")],
[
Fahrzeugklasse.ACHT_PLUS_EINS,
new IconTooltip("$achtPlusEins", "Fahrzeugklasse: 8+1"),
],
[
Fahrzeugklasse.SUMME_KFZ,
new IconTooltip("$summeKfz", "Fahrzeugklasse: Summe KFZ"),
],
[
Fahrzeugklasse.ZWEI_PLUS_EINS,
new IconTooltip("$zweiPlusEins", "Fahrzeugklasse: 2+1"),
],
[Fahrzeugklasse.RAD, new IconTooltip("mdi-bicycle", "Fahrzeugklasse: Rad")],
]);
}
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
color="tertiary"
text="Zurücksetzen"
variant="elevated"
@click="resetOptions"
@click="resetOptionsForMessstelle"
/>
<v-spacer />
</v-card-actions>
Expand All @@ -83,6 +83,7 @@ import FahrzeugPanel from "@/components/messstelle/optionsmenue/panels/FahrzeugP
import MessquerschnittPanel from "@/components/messstelle/optionsmenue/panels/MessquerschnittPanel.vue";
import ZeitPanel from "@/components/messstelle/optionsmenue/panels/ZeitPanel.vue";
import { useMessstelleStore } from "@/store/MessstelleStore";
import { useOptionsmenueSettingsStore } from "@/store/OptionsmenueSettingsStore";
import { useSnackbarStore } from "@/store/SnackbarStore";
import { useUserStore } from "@/store/UserStore";
import StartAndEndDate from "@/types/common/StartAndEndDate";
Expand All @@ -103,6 +104,7 @@ defineProps<Props>();

const display = useDisplay();
const messstelleStore = useMessstelleStore();
const optionsmenueSettingsStore = useOptionsmenueSettingsStore();
const snackbarStore = useSnackbarStore();
const messstelleUtils = useMessstelleUtils();
const dialog = ref(false);
Expand Down Expand Up @@ -135,7 +137,7 @@ watch(messstelle, () => {
chosenOptions.value = messstelleStore.getFilteroptions;
messstelleStore.reloadFilteroptions();
} else {
resetOptions();
resetOptionsForMessstelle();
}
});

Expand Down Expand Up @@ -227,13 +229,7 @@ function saveChosenOptions(): void {
}

function setDefaultOptionsForMessstelle(): void {
chosenOptions.value.fahrzeuge =
DefaultObjectCreator.createDefaultFahrzeugOptions();

chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr =
messstelle.value.detektierteVerkehrsarten === DetektierteFahrzeugart.KFZ;
chosenOptions.value.fahrzeuge.radverkehr =
!chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr;
resetFahrzeugOptions();

const defaultDate = messstelleStore.getMaxPossibleDateForMessstelle;
chosenOptions.value.zeitraumStartAndEndDate = new StartAndEndDate(
Expand Down Expand Up @@ -270,31 +266,52 @@ function setDefaultOptionsForMessstelle(): void {
chosenOptions.value.stundensumme = true;
chosenOptions.value.tagessumme = true;
chosenOptions.value.spitzenstunde = true;
messstelleStore.calculateActiveMessfaehigkeit(
messstelle.value.datumLetztePlausibleMessung.toString()
);
messstelleStore.setBelastungsplanChosenSize(1);
saveChosenOptions();
}

function resetOptions(): void {
function resetOptionsForMessstelle(): void {
setDefaultOptionsForMessstelle();
}

function resetFahrzeugOptions(): void {
chosenOptions.value.fahrzeuge =
DefaultObjectCreator.createDefaultFahrzeugOptions();

chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr =
messstelle.value.detektierteVerkehrsarten === DetektierteFahrzeugart.KFZ;
chosenOptions.value.fahrzeuge.radverkehr =
!chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr;
}

/**
* Ermittlung der möglichen Einstellungen im Optionsmenü auf Basis der Messfähigkeiten
*/
function setOptionsmenueSettingsByMessfaehigkeitenForGivenZeitraum(): void {
const messfaehigkeiten = messstelleStore.getMessfaehigkeitenForGivenZeitraum(
chosenOptions.value.zeitraumStartAndEndDate.startDate,
chosenOptions.value.zeitraumStartAndEndDate.endDate
);
optionsmenueSettingsStore.setOptionsmenueSettingsByMessfaehigkeiten(
messfaehigkeiten
);
}

watch(
() => messstelleStore.getActiveMessfaehigkeit.fahrzeugklassen,
() => chosenOptions.value.intervall,
() => {
chosenOptions.value.fahrzeuge =
DefaultObjectCreator.createDefaultFahrzeugOptions();
chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr =
messstelle.value.detektierteVerkehrsarten === DetektierteFahrzeugart.KFZ;
chosenOptions.value.fahrzeuge.radverkehr =
!chosenOptions.value.fahrzeuge.kraftfahrzeugverkehr;
setOptionsmenueSettingsByMessfaehigkeitenForGivenZeitraum();
},
{ deep: true, immediate: true }
);

snackbarStore.showWarning(
'Durch die Änderung des Zeitraums wurden die Kategorie "Fahrzeuge" zurückgesetzt.'
);
}
watch(
() => chosenOptions.value.zeitraumStartAndEndDate,
() => {
resetFahrzeugOptions();
setOptionsmenueSettingsByMessfaehigkeitenForGivenZeitraum();
},
{ deep: true, immediate: true }
);

watch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,38 +13,15 @@
v-model="chosenOptionsCopy"
class="mt-1"
/>
<fahrzeug-panel-fahrzeugkategorien-content
v-if="showFahrzeugkategorien"
v-model="chosenOptionsCopy"
/>
<fahrzeug-panel-fahrzeugkategorien-content v-model="chosenOptionsCopy" />
</v-expansion-panel>
</template>

<script setup lang="ts">
import type MessstelleOptionsDTO from "@/types/messstelle/MessstelleOptionsDTO";

import { computed } from "vue";

import FahrzeugPanelFahrzeugkategorienContent from "@/components/messstelle/optionsmenue/panels/content/FahrzeugPanelFahrzeugkategorienContent.vue";
import FahrzeugPanelVerkehrsartenContent from "@/components/messstelle/optionsmenue/panels/content/FahrzeugPanelVerkehrsartenContent.vue";
import { useMessstelleStore } from "@/store/MessstelleStore";
import Fahrzeugklasse from "@/types/enum/Fahrzeugklasse";
import ZaehldatenIntervall from "@/types/enum/ZaehldatenIntervall";

const chosenOptionsCopy = defineModel<MessstelleOptionsDTO>({ required: true });

const messstelleStore = useMessstelleStore();

const showFahrzeugkategorien = computed(() => {
return (
messstelleStore.isKfzMessstelle &&
messstelleStore.getActiveMessfaehigkeit.fahrzeugklassen ===
Fahrzeugklasse.ACHT_PLUS_EINS &&
!(
chosenOptionsCopy.value.intervall ===
ZaehldatenIntervall.STUNDE_VIERTEL ||
chosenOptionsCopy.value.intervall === ZaehldatenIntervall.STUNDE_HALB
)
);
});
</script>
Loading
Loading