Skip to content

Commit aa64c11

Browse files
authored
Merge pull request #187 from it-at-m/MUXDBS-100-feedback
Muxdbs 100 feedback
2 parents 8eb3674 + f0aa9f8 commit aa64c11

File tree

3 files changed

+179
-87
lines changed

3 files changed

+179
-87
lines changed

personalization-webcomponents/src/ChecklistDetail.ce.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
<checklist-list
2525
v-if="openCheckList.length !== 0"
2626
:checklist-items="openCheckList"
27+
:disabled="loadingSort || loadingCheck"
2728
@checked="onCheckedOpen"
2829
@sort="onSortOpen"
2930
></checklist-list>
3031
<muc-banner
3132
v-else
3233
class="banner"
3334
type="success"
34-
>Herzlichen Glückwunsch, Sie haben alle Aufgaben erledigt! Wir
35+
>
36+
Herzlichen Glückwunsch, Sie haben alle Aufgaben erledigt! Wir
3537
bewahren diese Checkliste noch bis zum {{ deletionDate }} für
3638
Sie auf. Danach wird sie automatisch gelöscht.
3739
</muc-banner>
@@ -40,6 +42,7 @@
4042
</h2>
4143
<checklist-list
4244
v-if="closedCheckList.length !== 0"
45+
:disabled="loadingSort || loadingCheck"
4346
:checklist-items="closedCheckList"
4447
@checked="onCheckedClosed"
4548
:is-draggable="false"
@@ -48,7 +51,8 @@
4851
v-else
4952
class="banner"
5053
type="info"
51-
>Sie haben noch keine erledigten Aufgaben. Haken Sie Aufgaben in
54+
>
55+
Sie haben noch keine erledigten Aufgaben. Haken Sie Aufgaben in
5256
der Checkliste ab, um sie als erledigt zu markieren.
5357
</muc-banner>
5458
</div>
@@ -78,6 +82,8 @@ import { QUERY_PARAM_CHECKLIST_ID, setAccessToken } from "@/util/Constants.ts";
7882
7983
const checklist = ref<Checklist | null>(null);
8084
const loading = ref(true);
85+
const loadingSort = ref(false);
86+
const loadingCheck = ref(false);
8187
8288
const { loggedIn } = useDBSLoginWebcomponentPlugin(_authChangedCallback);
8389
@@ -152,7 +158,7 @@ const deletionDate = computed(() => {
152158
153159
function onCheckedOpen(serviceID: string) {
154160
if (checklist.value) {
155-
loading.value = true;
161+
loadingCheck.value = true;
156162
const service = new ChecklistService();
157163
service
158164
.checkChecklistentry(checklist.value.id, serviceID)
@@ -170,13 +176,13 @@ function onCheckedOpen(serviceID: string) {
170176
.catch((err) => {
171177
console.debug(err);
172178
})
173-
.finally(() => (loading.value = false));
179+
.finally(() => (loadingCheck.value = false));
174180
}
175181
}
176182
177183
function onCheckedClosed(serviceID: string) {
178184
if (checklist.value) {
179-
loading.value = true;
185+
loadingCheck.value = true;
180186
const service = new ChecklistService();
181187
service
182188
.uncheckChecklistentry(checklist.value.id, serviceID)
@@ -194,7 +200,7 @@ function onCheckedClosed(serviceID: string) {
194200
.catch((err) => {
195201
console.debug(err);
196202
})
197-
.finally(() => (loading.value = false));
203+
.finally(() => (loadingCheck.value = false));
198204
}
199205
}
200206
@@ -211,7 +217,7 @@ function onSortOpen(evt: { oldIndex: number; newIndex: number }) {
211217
return item.serviceID === elementToSort.serviceID;
212218
}) as number;
213219
if (oldIndex >= 0 && checklist.value) {
214-
loading.value = true;
220+
loadingSort.value = true;
215221
216222
const newIndex = oldIndex + (evt.newIndex - evt.oldIndex);
217223
const element = checklist.value.checklistItems[oldIndex] as ChecklistItem;
@@ -235,7 +241,7 @@ function onSortOpen(evt: { oldIndex: number; newIndex: number }) {
235241
.catch((err) => {
236242
console.debug(err);
237243
})
238-
.finally(() => (loading.value = false));
244+
.finally(() => (loadingSort.value = false));
239245
}
240246
}
241247
</script>

personalization-webcomponents/src/components/ChecklistList.vue

Lines changed: 64 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
role="listitem"
1919
aria-roledescription="sortierbares Listenelement"
2020
:class="{
21-
muted: element.checked !== null,
2221
'keyboard-dragging': draggedIndex === index,
2322
}"
2423
:aria-grabbed="draggedIndex === index ? 'true' : 'false'"
@@ -28,20 +27,36 @@
2827
:key="element.serviceID"
2928
@keydown="handleEnterKeyDown"
3029
>
31-
<input
32-
type="checkbox"
30+
<p13n-checkbox
3331
:id="'cb-' + element.serviceID"
34-
class="radio-look"
35-
:checked="element.checked !== null"
32+
:aria-label="
33+
!!element.checked
34+
? element.title + ' als nicht erledigt markieren.'
35+
: element.title + ' als erledigt markieren.'
36+
"
37+
:checked="!!element.checked"
3638
:disabled="disabled"
37-
@change="() => onSelectChange(element.serviceID)"
39+
style="margin-left: 8px"
40+
@check="() => onSelectChange(element.serviceID)"
3841
/>
3942
<span
43+
tabindex="0"
4044
class="label-text"
41-
@click.prevent="openDialog(element)"
42-
style="cursor: pointer"
45+
:class="{
46+
muted: element.checked !== null,
47+
}"
48+
@click="(evt) => openDialog(element, evt)"
49+
@keydown="
50+
(evt) => (evt.keyCode == 32 ? openDialog(element, evt) : null)
51+
"
4352
>
4453
<b>{{ element.title }}</b>
54+
<span
55+
class="required-label"
56+
v-if="element.required"
57+
>
58+
- verpflichtend
59+
</span>
4560
</span>
4661
<span
4762
v-if="isDraggable"
@@ -82,6 +97,8 @@ import { MucIcon } from "@muenchen/muc-patternlab-vue";
8297
import { Sortable } from "sortablejs-vue3";
8398
import { computed, onBeforeUnmount, onMounted, ref } from "vue";
8499
100+
import P13nCheckbox from "@/components/P13nCheckbox.vue";
101+
85102
const props = withDefaults(
86103
defineProps<{
87104
checklistItems: ChecklistItem[];
@@ -120,7 +137,8 @@ function onSelectChange(serviceID: string) {
120137
emit("checked", serviceID);
121138
}
122139
123-
function openDialog(item: ChecklistItem) {
140+
function openDialog(item: ChecklistItem, evt: Event) {
141+
evt.preventDefault();
124142
dialogItem.value = item;
125143
dialogVisible.value = true;
126144
emit("label-click", item);
@@ -182,24 +200,24 @@ function handleArrowKeyDown(event: KeyboardEvent) {
182200
background-color: #d0e7ff;
183201
}
184202
185-
.container {
186-
max-width: 600px;
187-
margin: 1rem auto;
188-
padding-left: 0;
189-
}
190-
191203
.list {
192204
list-style: none;
193205
padding: 0;
194206
margin: 0;
195-
border-top: 1px solid #ddd;
207+
border-top: 1px solid var(--color-neutrals-beau-blue-light, #e5eef5);
208+
border-bottom: 1px solid var(--color-neutrals-beau-blue-light, #e5eef5);
209+
}
210+
211+
.container {
212+
padding-left: 0;
213+
padding-right: 0;
214+
padding-bottom: 56px;
196215
}
197216
198217
.list-item {
199218
display: flex;
200219
align-items: center;
201-
padding: 0.5rem 1rem;
202-
border-bottom: 1px solid #ddd;
220+
border-bottom: 1px solid var(--color-neutrals-beau-blue-light, #e5eef5);
203221
user-select: none;
204222
cursor: grab;
205223
color: var(--color-brand-main-blue);
@@ -211,75 +229,32 @@ function handleArrowKeyDown(event: KeyboardEvent) {
211229
212230
/* text grayed out when selected */
213231
.muted {
214-
color: #7a8d9f;
232+
color: #7a8d9f !important;
215233
}
216234
217-
.radio-look {
218-
appearance: none;
219-
-webkit-appearance: none;
220-
flex: 0 0 16px;
221-
width: 16px;
222-
height: 16px;
223-
border: 2px solid var(--color-neutrals-grey);
224-
border-radius: 50%;
225-
background: white;
226-
box-sizing: border-box;
227-
margin-right: 0.8rem;
228-
position: relative;
235+
.label-text {
229236
cursor: pointer;
230-
outline-offset: 2px;
231-
transition:
232-
border-color 0.2s ease,
233-
background-color 0.2s ease;
234-
}
235-
236-
.radio-look:hover {
237-
border-color: var(--color-brand-main-blue);
238-
background-color: #cce4ff;
239-
}
240-
241-
.radio-look:hover::before {
242-
content: "";
243-
position: absolute;
244-
top: 50%;
245-
left: 50%;
246-
width: 10px;
247-
height: 10px;
248-
background-color: var(--color-brand-main-blue);
249-
border-radius: 50%;
250-
transform: translate(-50%, -50%);
251-
opacity: 0.3;
252-
pointer-events: none;
253-
transition: opacity 0.2s ease;
254-
}
255-
256-
.radio-look:checked {
257-
border-color: var(--color-brand-main-blue);
258-
background-color: var(--color-brand-main-blue);
259-
}
260-
261-
.radio-look:checked::before {
262-
content: "";
263-
position: absolute;
264-
top: 50%;
265-
left: 50%;
266-
color: white;
267-
font-weight: bold;
268-
font-size: 14px;
269-
line-height: 1;
270-
transform: translate(-50%, -45%);
271-
pointer-events: none;
237+
color: var(--color-brand-main-blue);
238+
/* Body/Body 1 Bold */
239+
font-family: "Open Sans", sans-serif;
240+
font-size: 18px;
241+
font-style: normal;
242+
font-weight: 700;
243+
line-height: 150%; /* 27px */
244+
245+
padding: 16px 8px;
246+
flex-grow: 1;
272247
user-select: none;
273-
transition: color 0.2s ease;
274248
}
275249
276-
.radio-look:checked:hover::before {
277-
opacity: 0.8;
250+
.label-text:hover {
251+
text-decoration: underline;
278252
}
279253
280-
.label-text {
281-
flex-grow: 1;
282-
user-select: none;
254+
@media (max-width: 576px) {
255+
.label-text {
256+
padding: 12px 8px;
257+
}
283258
}
284259
285260
.drag-handle {
@@ -320,4 +295,14 @@ function handleArrowKeyDown(event: KeyboardEvent) {
320295
overflow-y: auto;
321296
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
322297
}
298+
299+
.required-label {
300+
color: var(--neutrals-grey, #3a5368);
301+
/* Body/Body 2 */
302+
font-family: "Open Sans", sans-serif;
303+
font-size: 16px;
304+
font-style: normal;
305+
font-weight: 400;
306+
line-height: 150%;
307+
}
323308
</style>

0 commit comments

Comments
 (0)