Skip to content

Commit a9bb857

Browse files
committed
💚 apply linter
1 parent 8aa0edf commit a9bb857

File tree

7 files changed

+75
-63
lines changed

7 files changed

+75
-63
lines changed

personalization-service/src/main/java/de/muenchen/dbs/personalization/serviceNavigator/PublicServiceNavigatorController.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class PublicServiceNavigatorController {
3636
public PublicServiceNavigatorController(P13nConfiguration p13nConfiguration) {
3737
this.p13nConfiguration = p13nConfiguration;
3838

39-
if(StringUtils.isBlank(p13nConfiguration.getProxyHost())) {
39+
if (StringUtils.isBlank(p13nConfiguration.getProxyHost())) {
4040
this.restTemplate = new RestTemplate();
4141
} else {
4242
Proxy proxy = new Proxy(Proxy.Type.HTTP, new InetSocketAddress(p13nConfiguration.getProxyHost(), p13nConfiguration.getProxyPort()));
@@ -49,7 +49,7 @@ public PublicServiceNavigatorController(P13nConfiguration p13nConfiguration) {
4949
@GetMapping
5050
@Operation(summary = "Lookup ServiceNavigator Services by ServiceID. Returns a list of services for the given service IDs.")
5151
@ResponseStatus(HttpStatus.OK)
52-
public List<Object> getServicesByIds(@RequestParam("ids")String serviceIds) {
52+
public List<Object> getServicesByIds(@RequestParam("ids") String serviceIds) {
5353
final String url = p13nConfiguration.getServiceNavigatorUrl() + SERVICENAVIGATOR_QUERY_PARAMETER_ID + serviceIds;
5454
ResponseEntity<List> forEntity = restTemplate.getForEntity(url, List.class);
5555
return forEntity.getBody();

personalization-webcomponents/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ <h1>The following webcomponents are available:</h1>
4949
<li>
5050
<a href="index-checklist-detail.html">checklist-detail webcomp</a>
5151
</li>
52-
<li>
53-
<a href="index-checklist-preview.html">checklist-preview webcomp</a>
54-
</li>
52+
<li>
53+
<a href="index-checklist-preview.html">checklist-preview webcomp</a>
54+
</li>
5555
<li>
5656
<a href="index-checklist-overview.html">checklist-overview webcomp</a>
5757
</li>
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
export interface SNService {
2-
serviceName: string
3-
publicUrl: string
4-
summary: string
5-
onlineServices?: OnlineService[]
6-
id: string
7-
hasResponsibilities?: boolean
8-
isExternal: boolean
9-
appointmentServiceUrl?: string
10-
appointmentService?: boolean
2+
serviceName: string;
3+
publicUrl: string;
4+
summary: string;
5+
onlineServices?: OnlineService[];
6+
id: string;
7+
hasResponsibilities?: boolean;
8+
isExternal: boolean;
9+
appointmentServiceUrl?: string;
10+
appointmentService?: boolean;
1111
}
1212

1313
export interface OnlineService {
14-
uri: string
15-
label: string
14+
uri: string;
15+
label: string;
1616
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export interface ServiceNavigatorResult {
2-
id: string
3-
name: string
4-
services: number[]
2+
id: string;
3+
name: string;
4+
services: number[];
55
}

personalization-webcomponents/src/checklist-preview-webcomponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import ChecklistPreviewVueComponent from "@/checklist-preview.ce.vue";
44

55
// convert into custom element constructor
66
const ChecklistPreviewWebcomponent = defineCustomElement(
7-
ChecklistPreviewVueComponent
7+
ChecklistPreviewVueComponent
88
);
99

1010
// register
Lines changed: 53 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,97 @@
11
<template>
22
<div>
33
<!-- eslint-disable-next-line vue/no-v-html -->
4-
<div v-html="mucIconsSprite"/>
4+
<div v-html="mucIconsSprite" />
55
<!-- eslint-disable-next-line vue/no-v-html -->
6-
<div v-html="customIconsSprite"/>
6+
<div v-html="customIconsSprite" />
77

88
<div v-if="loading">
9-
<skeleton-loader/>
9+
<skeleton-loader />
1010
</div>
1111
<div v-else-if="snServices">
1212
<h1>Abfrageergebnis</h1>
1313
<div>
1414
<div
15-
class="snServiceElement"
16-
v-for="service in snServices"
17-
:key="service.id"
15+
class="snServiceElement"
16+
v-for="service in snServices"
17+
:key="service.id"
1818
>
19-
<p>
20-
<b>{{ service.serviceName }} (ID: {{ service.id }})</b><br>
21-
<span>{{ service.summary }}</span><br><br>
19+
<div>
20+
<b>{{ service.serviceName }} (ID: {{ service.id }})</b><br />
21+
<span>{{ service.summary }}</span
22+
><br /><br />
2223
<div v-if="service.onlineServices">
2324
<b>Online-Services:</b>
2425
<ul>
2526
<li
26-
v-for="onlineService in service.onlineServices"
27-
:key="onlineService.uri"
27+
v-for="onlineService in service.onlineServices"
28+
:key="onlineService.uri"
2829
>
2930
<a :href="onlineService.uri">{{ onlineService.label }}</a>
3031
</li>
3132
</ul>
3233
</div>
33-
</p>
34+
</div>
3435
</div>
3536
</div>
3637
</div>
37-
<div v-else>
38-
oops something went wrong
39-
</div>
38+
<div v-else>oops something went wrong</div>
4039
</div>
4140
</template>
4241

4342
<script setup lang="ts">
43+
import type { SNService } from "@/api/servicenavigator/ServiceNavigatorLookup.ts";
44+
import type { ServiceNavigatorResult } from "@/api/servicenavigator/ServiceNavigatorResult.ts";
45+
4446
import customIconsSprite from "@muenchen/muc-patternlab-vue/assets/icons/custom-icons.svg?raw";
4547
import mucIconsSprite from "@muenchen/muc-patternlab-vue/assets/icons/muc-icons.svg?raw";
48+
import { onMounted, ref } from "vue";
49+
4650
import SkeletonLoader from "@/components/common/skeleton-loader.vue";
47-
import {onMounted, ref} from "vue";
48-
import {getAPIBaseURL, LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT} from "@/util/constants.ts";
49-
import type {ServiceNavigatorResult} from "@/api/servicenavigator/ServiceNavigatorResult.ts";
50-
import type {SNService} from "@/api/servicenavigator/ServiceNavigatorLookup.ts";
51+
import {
52+
getAPIBaseURL,
53+
LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT,
54+
} from "@/util/constants.ts";
5155
5256
const loading = ref(true);
5357
const snServices = ref<SNService[] | null>(null);
5458
5559
onMounted(() => {
5660
loading.value = true;
5761
58-
let serviceNavigatorResultString = localStorage.getItem(LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT);
62+
const serviceNavigatorResultString = localStorage.getItem(
63+
LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT
64+
);
5965
if (!serviceNavigatorResultString) {
60-
console.error("No Data found in LocalStorage with key ", LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT);
66+
console.debug(
67+
"No Data found in LocalStorage with key ",
68+
LOCALSTORAGE_KEY_SERVICENAVIGATOR_RESULT
69+
);
6170
loading.value = false;
6271
} else {
63-
const snResult = JSON.parse(serviceNavigatorResultString) as ServiceNavigatorResult;
64-
const url = getAPIBaseURL() + "/public/api/backend-service/servicenavigator?ids=" + snResult.services.join(",");
72+
const snResult = JSON.parse(
73+
serviceNavigatorResultString
74+
) as ServiceNavigatorResult;
75+
const url =
76+
getAPIBaseURL() +
77+
"/public/api/backend-service/servicenavigator?ids=" +
78+
snResult.services.join(",");
6579
fetch(url)
66-
.then(resp => {
67-
if (resp.ok) {
68-
resp.json()
69-
.then((snServicesBody: SNService[]) => {
70-
console.log(snServicesBody);
71-
snServices.value = snServicesBody;
72-
})
73-
} else {
74-
resp.text().then(errBody => {
75-
throw Error(errBody)
76-
})
77-
}
78-
})
79-
.catch(error => {
80-
console.log(error);
81-
})
82-
.finally(() => loading.value = false);
80+
.then((resp) => {
81+
if (resp.ok) {
82+
resp.json().then((snServicesBody: SNService[]) => {
83+
snServices.value = snServicesBody;
84+
});
85+
} else {
86+
resp.text().then((errBody) => {
87+
throw Error(errBody);
88+
});
89+
}
90+
})
91+
.catch((error) => {
92+
console.debug(error);
93+
})
94+
.finally(() => (loading.value = false));
8395
}
8496
});
8597
</script>
@@ -97,4 +109,4 @@ onMounted(() => {
97109
border: 1px solid lightgray;
98110
border-radius: 16px;
99111
}
100-
</style>
112+
</style>

personalization-webcomponents/src/util/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ export function getChecklistIconByTitle(checklistTitle: string) {
1717
}[checklistTitle];
1818
}
1919

20-
export function getAPIBaseURL(): String {
20+
export function getAPIBaseURL(): string {
2121
if (import.meta.env.VITE_VUE_APP_API_URL) {
2222
return import.meta.env.VITE_VUE_APP_API_URL;
2323
} else {
2424
return new URL(import.meta.url).origin;
2525
}
26-
}
26+
}

0 commit comments

Comments
 (0)