Add debug UI for task visibility and improve lane filtering logic

- Added a debug section in `MyWashStart.vue` and `SelfServeTryModal.vue` to display task visibility, conditions, and rule evaluations for enhanced testing and visibility.
- Updated lane filtering logic in `useSelfServeLogic` to handle `null` and missing lane values more consistently.
This commit is contained in:
Jeppe Bundgaard
2026-01-19 12:41:25 +01:00
parent 479962e755
commit d770da869f
3 changed files with 73 additions and 3 deletions
@@ -238,6 +238,41 @@ const getConditionById = (id) => {
</b-tooltip>
</li>
</ul>
<hr>
<h5 class="subtitle is-5">Alle mulige opgaver (synlighed)</h5>
<ul>
<li v-for="t in tasks" :key="t.id" class="is-size-7">
<span class="icon is-small">
<i :class="isTaskActive(t.id) ? 'fas fa-eye has-text-success' : 'fas fa-eye-slash has-text-grey-light'"></i>
</span>
{{ t.task }}
<b-tooltip v-if="t.condition_id"
position="is-top"
multilined
type="is-dark"
>
<template v-slot:content>
<div v-if="getConditionById(t.condition_id)" class="has-text-left">
<p v-if="getConditionById(t.condition_id).description" class="mb-2"><i>{{ getConditionById(t.condition_id).description }}</i></p>
<p class="is-size-7 has-text-weight-bold mb-1">Regler:</p>
<div v-for="r in rules.filter(rule => parseInt(rule.condition_id) === parseInt(t.condition_id))" :key="r.id" class="is-size-7">
<span class="icon is-small">
<i :class="evaluateRule(r, new Set([parseInt(t.condition_id)])) ? 'fas fa-check has-text-success' : 'fas fa-times has-text-danger'"></i>
</span>
<span class="ml-1">[{{ getRuleTypeLabel(r.type) }}] {{ r.name }}</span>
</div>
<div v-if="rules.filter(rule => parseInt(rule.condition_id) === parseInt(t.condition_id)).length === 0" class="is-size-7 is-italic">
Ingen regler
</div>
</div>
</template>
<span class="has-text-grey is-clickable">(Hvis: {{ getConditionById(t.condition_id)?.name || t.condition_id }})</span>
</b-tooltip>
</li>
</ul>
<p v-if="tasks.length === 0" class="is-italic">Ingen opgaver fundet</p>
</div>
</div>
</div>
+3 -3
View File
@@ -141,7 +141,7 @@ export function useSelfServeLogic() {
(item) =>
parseInt(item.department) === deptId &&
parseInt(item.product) === vTypeId &&
(lId === null || parseInt(item.lane) === lId)
(lId === null || !item.lane || parseInt(item.lane) === 0 || parseInt(item.lane) === lId)
)
.sort((a, b) => (a.order_priority || 0) - (b.order_priority || 0));
@@ -149,7 +149,7 @@ export function useSelfServeLogic() {
(item) =>
parseInt(item.department) === deptId &&
parseInt(item.product) === vTypeId &&
(lId === null || parseInt(item.lane) === lId)
(lId === null || !item.lane || parseInt(item.lane) === 0 || parseInt(item.lane) === lId)
);
const conditionIds = conditions.value.map((item) => item.id);
@@ -167,7 +167,7 @@ export function useSelfServeLogic() {
(item) =>
parseInt(item.department) === deptId &&
parseInt(item.product) === vTypeId &&
(lId === null || parseInt(item.lane) === lId)
(lId === null || !item.lane || parseInt(item.lane) === 0 || parseInt(item.lane) === lId)
);
tasks.value = await Promise.all(
@@ -1108,6 +1108,41 @@ watch(() => currentStep.value, () => {
</b-tooltip>
</li>
</ul>
<hr>
<h5 class="subtitle is-5">Debug: Alle mulige opgaver (synlighed)</h5>
<ul>
<li v-for="t in tasks" :key="t.id" class="is-size-7">
<span class="icon is-small">
<i :class="isTaskActive(t.id) ? 'fas fa-eye has-text-success' : 'fas fa-eye-slash has-text-grey-light'"></i>
</span>
{{ t.task }}
<b-tooltip v-if="t.condition_id"
position="is-top"
multilined
type="is-dark"
>
<template v-slot:content>
<div v-if="getConditionById(t.condition_id)" class="has-text-left">
<p v-if="getConditionById(t.condition_id).description" class="mb-2"><i>{{ getConditionById(t.condition_id).description }}</i></p>
<p class="is-size-7 has-text-weight-bold mb-1">Regler:</p>
<div v-for="r in rules.filter(rule => parseInt(rule.condition_id as any) === parseInt(t.condition_id))" :key="r.id" class="is-size-7">
<span class="icon is-small">
<i :class="evaluateRule(r, new Set([parseInt(t.condition_id)])) ? 'fas fa-check has-text-success' : 'fas fa-times has-text-danger'"></i>
</span>
<span class="ml-1">[{{ getRuleTypeLabel(r.type) }}] {{ r.name }}</span>
</div>
<div v-if="rules.filter(rule => parseInt(rule.condition_id as any) === parseInt(t.condition_id)).length === 0" class="is-size-7 is-italic">
Ingen regler
</div>
</div>
</template>
<span class="has-text-grey is-clickable">(Hvis: {{ getConditionById(t.condition_id)?.name || t.condition_id }})</span>
</b-tooltip>
</li>
</ul>
<p v-if="tasks.length === 0" class="is-italic">Ingen opgaver fundet</p>
</div>
<div v-for="question in visibleQuestions" :key="question.id" class="box mb-4">