Skip to content

Commit d85d998

Browse files
committed
✨ use situationId in webcomponents
1 parent 81c2309 commit d85d998

File tree

5 files changed

+12
-26
lines changed

5 files changed

+12
-26
lines changed

personalization-webcomponents/src/ChecklistPreview.ce.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,12 @@ function _saveChecklistAcceptedDSE() {
296296
});
297297
const body = JSON.stringify({
298298
title: lebenslageTitle.value,
299-
lebenslageId: lebenslageId.value,
299+
situationId: lebenslageId.value,
300300
checklistItems: checklistItemsDtos,
301301
});
302302
303+
console.log(body);
304+
303305
fetch(url, {
304306
method: "POST",
305307
headers: {

personalization-webcomponents/src/api/persservice/Checklist.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export default interface Checklist {
44
id: string;
55
title: string;
66
lhmExtId: string;
7+
situationId: string;
78
checklistItems: ChecklistItem[];
89
lastUpdate: Date;
910
}

personalization-webcomponents/src/components/ChecklistCard.vue

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<img
1010
width="56px"
1111
height="56px"
12-
:src="getChecklistIconByTitle(checklist.title)"
12+
:src="getChecklistIconBySituationId(checklist.situationId)"
1313
alt="checklist-icon"
1414
/>
1515
</div>
@@ -69,15 +69,12 @@
6969
<script setup lang="ts">
7070
import type Checklist from "@/api/persservice/Checklist.ts";
7171
72-
import { MucCard } from "@muenchen/muc-patternlab-vue";
73-
import { computed } from "vue";
72+
import {MucCard} from "@muenchen/muc-patternlab-vue";
73+
import {computed} from "vue";
7474
7575
import ChecklistitemListitem from "@/components/ChecklistitemListitem.vue";
7676
import MucChip from "@/components/common/MucChip.vue";
77-
import {
78-
getChecklistIconByTitle,
79-
QUERY_PARAM_CHECKLIST_ID,
80-
} from "@/util/Constants.ts";
77+
import {getChecklistIconBySituationId, QUERY_PARAM_CHECKLIST_ID,} from "@/util/Constants.ts";
8178
8279
const props = defineProps<{
8380
checklist: Checklist;

personalization-webcomponents/src/components/ChecklistHeader.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<muc-intro
33
tagline="Checkliste"
44
:title="checklist.title"
5-
:img="getChecklistIconByTitle(checklist.title)"
5+
:img="getChecklistIconBySituationId(checklist.situationId)"
66
imgAlt=""
77
>
88
<div
@@ -57,7 +57,7 @@ import { MucIntro } from "@muenchen/muc-patternlab-vue";
5757
import { computed, onMounted } from "vue";
5858
5959
import MucChip from "@/components/common/MucChip.vue";
60-
import { getChecklistIconByTitle } from "@/util/Constants.ts";
60+
import {getChecklistIconBySituationId} from "@/util/Constants.ts";
6161
6262
const props = defineProps<{
6363
checklist: Checklist;

personalization-webcomponents/src/util/Constants.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,8 @@ export const QUERY_PARAM_CHECKLIST_ID = "cl-id";
1010

1111
let ACCESS_TOKEN: string | undefined = undefined;
1212

13-
export function getChecklistIconByTitle(checklistTitle: string) {
14-
return {
15-
"Ich habe wenig Geld.":
16-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10482730.svg",
17-
"Ich will umziehen.":
18-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10482700.svg",
19-
"Ich manage eine Familie.":
20-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10483310.svg",
21-
Einwanderung:
22-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10483311.svg",
23-
Umzug:
24-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10482700.svg",
25-
Test: "https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10483310.svg",
26-
title3:
27-
"https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/10483310.svg",
28-
}[checklistTitle];
13+
export function getChecklistIconBySituationId(situationId: string) {
14+
return `https://stadt.muenchen.de/dam/Home/lhm_common/service-navigator/${situationId}.svg`;
2915
}
3016

3117
export function getAPIBaseURL(): string {

0 commit comments

Comments
 (0)