Skip to content

Commit

Permalink
Sprint 4 (#34)
Browse files Browse the repository at this point in the history
* Feat/dave 118 anpassungen tooltip und marker (#28)

* demodaten angepasst

* tooltip messstelle angepasst

* Testdatenangepasst

* messstelle tooltip angepasst

* name entfernt und durch id ersetzt, (#30)

* testdaten angepasst (#31)

* Feature/dave 150 zurueckspringen karte (#29)

* 🚧 koordinaten werden als query string in url gespeichert und ausgelesen

* 🚧 aktuelle position wird auch für messstellen gespeichert

* center wert wird an map übergeben

* 🎨

* Feat/dave 128 suche detektordaten adminportal (#33)

* 🐛 no-console rule wieder aktiviert (#23)

---------

Co-authored-by: DanielOber <145556033+DanielOber@users.noreply.github.com>
Co-authored-by: VJ <145964798+vjohnslhm@users.noreply.github.com>
Co-authored-by: martind260 <99957516+martind260@users.noreply.github.com>
Co-authored-by: alexander.kerscher <alexander.kerscher@muenchen.de>
  • Loading branch information
5 people committed Jan 11, 2024
1 parent b3c43f5 commit cc548b1
Show file tree
Hide file tree
Showing 12 changed files with 119 additions and 119 deletions.
51 changes: 46 additions & 5 deletions frontend/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,13 @@
<v-icon small>mdi-counter</v-icon>
{{ item.text }}
</v-list-item-title>
<v-list-item-title
v-if="item.type === suggestionTypeMessstelle"
@click="showMessstelle(item)"
>
<v-icon small>mdi-cards-diamond</v-icon>
{{ item.text }}
</v-list-item-title>
</v-list-item-content>
</template>
</v-autocomplete>
Expand Down Expand Up @@ -94,6 +101,7 @@
...)<br />
* Straßen- / Platzname (Rosenheimerplatz, Dachauer Straße,
...)<br />
* Messstellennummer / -name (4203,...)<br />
<!-- Es fehlt noch: Wetter, Schulzeit, (erweiterte) Zählsituation-->
</span>
</v-tooltip>
Expand Down Expand Up @@ -194,6 +202,7 @@ import SucheWordSuggestDTO from "@/domain/dto/suche/SucheWordSuggestDTO";
import SucheComplexSuggestsDTO from "@/domain/dto/suche/SucheComplexSuggestsDTO";
import SucheZaehlungSuggestDTO from "@/domain/dto/suche/SucheZaehlungSuggestDTO";
import SucheZaehlstelleSuggestDTO from "@/domain/dto/suche/SucheZaehlstelleSuggestDTO";
import SucheMessstelleSuggestDTO from "@/domain/dto/suche/SucheMessstelleSuggestDTO";
import DefaultObjectCreator from "@/util/DefaultObjectCreator";
import BaseUrlProvider from "@/api/util/BaseUrlProvider";
/* eslint-enable no-unused-vars */
Expand All @@ -207,6 +216,9 @@ export default class App extends Vue {
private static readonly SUGGESTION_TYPE_ZAEHLSTELLE: string = "zaehlstelle";
private static readonly SUGGESTION_TYPE_ZAEHLUNG: string = "zaehlung";
private static readonly SUGGESTION_TYPE_MESSSTELLE: string = "messstelle";
private static readonly URL_HANDBUCH_LINK: string =
"https://wilma.muenchen.de/web/senders/af10dc2a-8da5-4d24-815a-b6a9df4c686b/documents/54ddf065-d01f-4965-9bdf-c66ea47927c8";
Expand Down Expand Up @@ -256,6 +268,10 @@ export default class App extends Vue {
return App.SUGGESTION_TYPE_ZAEHLUNG;
}
get suggestionTypeMessstelle(): string {
return App.SUGGESTION_TYPE_MESSSTELLE;
}
// Lifecycle hook
created() {
SsoUserInfoService.getUserInfo()
Expand All @@ -270,12 +286,10 @@ export default class App extends Vue {
return false;
});
this.getFrontendVersion().then((version: string) => {
console.info("Frontend Version: ", version);
this.frontendVersion = version;
});
this.getBackendVersion().then((version: string) => {
console.info("Backend Version: ", version);
this.backendVersion = version;
});
}
Expand Down Expand Up @@ -313,6 +327,7 @@ export default class App extends Vue {
word.text,
this.suggestionTypeVorschlag,
"",
"",
""
)
);
Expand All @@ -326,7 +341,8 @@ export default class App extends Vue {
zaehlung.text,
this.suggestionTypeZaehlung,
zaehlung.zaehlstelleId,
zaehlung.id
zaehlung.id,
""
)
);
}
Expand All @@ -339,11 +355,26 @@ export default class App extends Vue {
zaehlstelle.text,
this.suggestionTypeZaehlstelle,
zaehlstelle.id,
"",
""
)
);
}
);
suggestions.messstellenSuggests.forEach(
(messstelle: SucheMessstelleSuggestDTO) => {
this.suggestions.push(
new Suggest(
messstelle.text,
this.suggestionTypeMessstelle,
"",
"",
messstelle.id
)
);
}
);
})
.catch((error) =>
this.$store.dispatch("snackbar/showError", error)
Expand Down Expand Up @@ -390,11 +421,15 @@ export default class App extends Vue {
}
this.$store.commit("search/lastSearchQuery", this.searchQuery);
if (this.$route.name === "zaehlstelle" && this.searchQuery !== "") {
if (
(this.$route.name === "zaehlstelle" ||
this.$route.name === "messstelle") &&
this.searchQuery !== ""
) {
this.$router.push(`/`);
}
SucheService.searchZaehlstelle(this.searchQuery)
SucheService.searchErhebungsstelle(this.searchQuery)
.then((result) => {
this.$store.commit("search/result", result);
})
Expand Down Expand Up @@ -422,6 +457,12 @@ export default class App extends Vue {
);
}
showMessstelle(item: Suggest) {
this.selectedSuggestion =
DefaultObjectCreator.createDefaultSuggestion();
this.$router.push(`/messstelle/${item.mstId}`);
}
updateSearchQuery(itemIndex: number) {
if (itemIndex > -1) {
this.searchQuery = this.getSuggestions[itemIndex].text;
Expand Down
59 changes: 4 additions & 55 deletions frontend/src/api/service/SucheService.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import FetchService from "@/api/service/FetchService";
import SucheComplexSuggestsDTO from "@/domain/dto/suche/SucheComplexSuggestsDTO";
import ZaehlstelleKarteDTO from "@/domain/dto/ZaehlstelleKarteDTO";
import MessstelleKarteDTO from "@/domain/dto/MessstelleKarteDTO";
import AnzeigeKarteDTO from "@/domain/dto/AnzeigeKarteDTO";

export default class SucheService {
Expand All @@ -16,61 +14,12 @@ export default class SucheService {
);
}

static searchZaehlstelle(query: string): Promise<Array<AnzeigeKarteDTO>> {
static searchErhebungsstelle(
query: string
): Promise<Array<AnzeigeKarteDTO>> {
return FetchService.getData(
`${this.ENDPOINT}/search?nofilter=true&query=${query}`,
"Beim Suchen von Zählstellen ist ein Fehler aufgetreten."
"Beim Suchen von Zähl-/Messstellen ist ein Fehler aufgetreten."
);
}
static getMockMessstelleKarte(): AnzeigeKarteDTO[] {
const mstOne: MessstelleKarteDTO = {
type: "messstelle",
id: "randomID",
latitude: 48.1887227,
longitude: 11.4290655,
tooltip: {
mstId: "MSTID1",
standortDatenportal: "StandortDatenportal1",
stadtbezirk: 13,
realisierungsdatum: "01.01.2023",
abbaudatum: "01.02.2023",
datumLetzteMessung: "15.01.2023",
kfz: true,
},
};

const msttwo: MessstelleKarteDTO = {
type: "messstelle",
id: "randomID2",
latitude: 48.1316995,
longitude: 11.6227731,
tooltip: {
mstId: "MSTID2",
standortDatenportal: "StandortDatenportal2",
stadtbezirk: 13,
realisierungsdatum: "02.01.2020",
abbaudatum: "04.04.2020",
datumLetzteMessung: "31.03.2020",
kfz: true,
},
};

const mstthree: MessstelleKarteDTO = {
type: "messstelle",
id: "randomID3",
latitude: 48.1315995,
longitude: 11.6217731,
tooltip: {
mstId: "MSTID3",
standortDatenportal: "StandortDatenportal3",
stadtbezirk: 13,
realisierungsdatum: "01.01.2023",
abbaudatum: "01.01.2023",
datumLetzteMessung: "01.03.2023",
kfz: true,
},
};

return [mstOne, msttwo, mstthree];
}
}
Loading

0 comments on commit cc548b1

Please sign in to comment.