Harden workstation UX and seed placeholder scans after Playwright QA.
Fix mobile queue navigation, draft/loading states, and Intake overflow; seed MinIO demo PDFs so document viewing does not 500; add e2e smoke coverage.
This commit is contained in:
@@ -138,7 +138,10 @@
|
||||
</button>
|
||||
|
||||
<div class="flex items-center justify-end gap-3 sm:gap-4 min-w-0 ml-auto">
|
||||
<span class="text-sm text-ink-secondary truncate max-w-[9rem] sm:max-w-none">
|
||||
<span
|
||||
class="text-sm text-ink-secondary truncate max-w-[9rem] sm:max-w-none"
|
||||
:title="auth.userFullName"
|
||||
>
|
||||
{{ auth.userFullName }}
|
||||
</span>
|
||||
<button
|
||||
|
||||
@@ -1,45 +1,65 @@
|
||||
<template>
|
||||
<div
|
||||
v-if="show"
|
||||
class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 px-4"
|
||||
>
|
||||
<div class="bg-white rounded-lg p-6 max-w-md w-full">
|
||||
<h3 class="text-lg font-semibold mb-4">Assign Entry Clerk</h3>
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="show"
|
||||
class="fixed inset-0 z-[70] flex items-center justify-center bg-black/50 p-4"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
aria-labelledby="assign-clerk-title"
|
||||
data-testid="assign-clerk-dialog"
|
||||
@keydown.esc.prevent="emit('close')"
|
||||
@click.self="emit('close')"
|
||||
>
|
||||
<div
|
||||
class="w-full max-w-md rounded-card border border-line bg-surface p-6 shadow-dialog"
|
||||
@click.stop
|
||||
>
|
||||
<h3 id="assign-clerk-title" class="text-lg font-semibold text-ink-strong">
|
||||
Assign Entry Clerk
|
||||
</h3>
|
||||
|
||||
<p v-if="loading" class="text-sm text-gray-500 mb-4">Loading clerks...</p>
|
||||
<div v-else class="mb-4">
|
||||
<label class="block text-sm font-medium text-gray-700 mb-2">Entry Clerk</label>
|
||||
<select v-model="selectedClerkId" class="form-input">
|
||||
<option value="">Select entry clerk...</option>
|
||||
<option v-for="clerk in clerks" :key="clerk.id" :value="clerk.id">
|
||||
{{ clerk.fullName }} ({{ clerk.username }})
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p v-if="loading" class="mt-4 text-sm text-ink-secondary">Loading clerks...</p>
|
||||
<div v-else class="mt-4">
|
||||
<label for="assign-clerk-select" class="block text-sm font-semibold text-ink mb-2">
|
||||
Entry Clerk
|
||||
</label>
|
||||
<select id="assign-clerk-select" v-model="selectedClerkId" class="form-input">
|
||||
<option value="">Select entry clerk...</option>
|
||||
<option v-for="clerk in clerks" :key="clerk.id" :value="clerk.id">
|
||||
{{ clerk.fullName }} ({{ clerk.username }})
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div v-if="errorMessage" class="text-clinical-danger text-sm mb-4">
|
||||
{{ errorMessage }}
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col-reverse sm:flex-row sm:justify-end gap-4">
|
||||
<button
|
||||
type="button"
|
||||
@click="emit('close')"
|
||||
class="px-4 py-2 text-gray-600 hover:text-gray-800"
|
||||
<div
|
||||
v-if="errorMessage"
|
||||
class="mt-4 rounded-input bg-clinical-danger-bg border border-clinical-danger/20 px-3 py-2 text-sm text-clinical-danger"
|
||||
role="alert"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
@click="confirm"
|
||||
class="btn-primary"
|
||||
:disabled="!selectedClerkId || loading"
|
||||
>
|
||||
Assign Batch
|
||||
</button>
|
||||
{{ errorMessage }}
|
||||
</div>
|
||||
|
||||
<div class="mt-6 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="px-4 py-2 text-sm text-ink-secondary hover:text-ink-strong"
|
||||
:disabled="assigning"
|
||||
@click="emit('close')"
|
||||
>
|
||||
Cancel
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="btn-primary"
|
||||
:disabled="!selectedClerkId || loading || assigning"
|
||||
@click="confirm"
|
||||
>
|
||||
{{ assigning ? 'Assigning…' : 'Assign Batch' }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Teleport>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -50,6 +70,7 @@ import type { UserSummary } from '../types'
|
||||
const props = defineProps<{
|
||||
show: boolean
|
||||
batchId: string | null
|
||||
assigning?: boolean
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -89,7 +110,7 @@ watch(
|
||||
)
|
||||
|
||||
function confirm(): void {
|
||||
if (!props.batchId || !selectedClerkId.value) return
|
||||
if (!props.batchId || !selectedClerkId.value || props.assigning) return
|
||||
emit('assigned', props.batchId, selectedClerkId.value)
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="overflow-x-auto">
|
||||
<div :class="compact ? 'min-w-0' : 'overflow-x-auto'">
|
||||
<InlineError
|
||||
v-if="error"
|
||||
title="Could not load batches"
|
||||
@@ -8,7 +8,7 @@
|
||||
retry-label="Retry"
|
||||
@retry="$emit('retry')"
|
||||
/>
|
||||
<SkeletonBlock v-else-if="loading" variant="table" :rows="5" />
|
||||
<SkeletonBlock v-else-if="loading" variant="table" :rows="compact ? 3 : 5" />
|
||||
<EmptyState
|
||||
v-else-if="batches.length === 0"
|
||||
:title="emptyTitle"
|
||||
@@ -18,12 +18,59 @@
|
||||
<slot name="emptyAction" />
|
||||
</template>
|
||||
</EmptyState>
|
||||
|
||||
<!-- Compact stacked list for narrow side panels -->
|
||||
<ul v-else-if="compact" class="divide-y divide-line min-w-0" data-testid="batch-list-compact">
|
||||
<li
|
||||
v-for="batch in batches"
|
||||
:key="batch.id"
|
||||
class="py-3 first:pt-0 last:pb-0"
|
||||
>
|
||||
<button
|
||||
type="button"
|
||||
class="w-full min-w-0 text-left rounded-input hover:bg-primary-50 -mx-1 px-1 py-1 transition-colors"
|
||||
@click="$emit('select', batch.id)"
|
||||
>
|
||||
<div class="flex items-start justify-between gap-2 min-w-0">
|
||||
<div class="min-w-0">
|
||||
<p class="text-sm font-semibold text-ink-strong truncate">
|
||||
{{ formatBatchType(batch.batchType) }}
|
||||
</p>
|
||||
<p class="mt-0.5 font-mono text-[11px] text-ink-secondary truncate">
|
||||
{{ batch.id.substring(0, 8) }}…
|
||||
</p>
|
||||
</div>
|
||||
<StatusBadge :status="batch.status" class="shrink-0" />
|
||||
</div>
|
||||
<div class="mt-1.5 flex flex-wrap items-center gap-2 text-xs text-ink-secondary">
|
||||
<span
|
||||
:class="batch.track === 'BACKFILL'
|
||||
? 'bg-primary-50 text-primary-800 border border-primary-100'
|
||||
: 'bg-clinical-safe-bg text-clinical-safe border border-[#ABEFC6]'"
|
||||
class="status-badge"
|
||||
>
|
||||
{{ batch.track === 'BACKFILL' ? 'Backfill' : 'Live' }}
|
||||
</span>
|
||||
<span class="tabular-nums">{{ formatCompactDate(batch.createdAt) }}</span>
|
||||
</div>
|
||||
</button>
|
||||
<button
|
||||
v-if="showAssign && batch.status === 'UPLOADED'"
|
||||
type="button"
|
||||
class="mt-2 text-primary-600 hover:text-primary-800 text-xs font-medium"
|
||||
@click="$emit('assign', batch.id)"
|
||||
>
|
||||
Assign clerk
|
||||
</button>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<table v-else class="w-full min-w-[36rem] text-sm">
|
||||
<thead>
|
||||
<tr class="border-b text-left text-ink-secondary">
|
||||
<th class="py-2 px-4">ID</th>
|
||||
<th class="py-2 px-4">Type</th>
|
||||
<th class="py-2 px-4">Track</th>
|
||||
<th class="py-2 px-4 hidden sm:table-cell">Track</th>
|
||||
<th class="py-2 px-4">Status</th>
|
||||
<th class="py-2 px-4">Created</th>
|
||||
<th v-if="showAssign" class="py-2 px-4">Actions</th>
|
||||
@@ -38,7 +85,7 @@
|
||||
>
|
||||
<td class="py-2 px-4 font-mono text-xs">{{ batch.id.substring(0, 8) }}...</td>
|
||||
<td class="py-2 px-4">{{ formatBatchType(batch.batchType) }}</td>
|
||||
<td class="py-2 px-4">
|
||||
<td class="py-2 px-4 hidden sm:table-cell">
|
||||
<span
|
||||
:class="batch.track === 'BACKFILL'
|
||||
? 'bg-primary-50 text-primary-800 border border-primary-100'
|
||||
@@ -51,8 +98,9 @@
|
||||
<td class="py-2 px-4">
|
||||
<StatusBadge :status="batch.status" />
|
||||
</td>
|
||||
<td class="py-2 px-4 text-ink-secondary">
|
||||
{{ new Date(batch.createdAt).toLocaleString() }}
|
||||
<td class="py-2 px-4 text-ink-secondary whitespace-nowrap">
|
||||
<span class="sm:hidden">{{ formatCompactDate(batch.createdAt) }}</span>
|
||||
<span class="hidden sm:inline">{{ new Date(batch.createdAt).toLocaleString() }}</span>
|
||||
</td>
|
||||
<td v-if="showAssign" class="py-2 px-4">
|
||||
<button
|
||||
@@ -82,6 +130,8 @@ withDefaults(
|
||||
batches: BatchDetailResponse[]
|
||||
loading: boolean
|
||||
showAssign?: boolean
|
||||
/** Stacked list for narrow panels (e.g. Intake sidebar) */
|
||||
compact?: boolean
|
||||
error?: string | null
|
||||
emptyTitle?: string
|
||||
emptyDescription?: string
|
||||
@@ -89,6 +139,7 @@ withDefaults(
|
||||
{
|
||||
emptyTitle: 'No batches found.',
|
||||
emptyDescription: undefined,
|
||||
compact: false,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -101,4 +152,12 @@ defineEmits<{
|
||||
function formatBatchType(type: string): string {
|
||||
return type.replace(/_/g, ' ').replace(/\b\w/g, (c) => c.toUpperCase())
|
||||
}
|
||||
|
||||
function formatCompactDate(value: string): string {
|
||||
return new Date(value).toLocaleDateString(undefined, {
|
||||
month: 'short',
|
||||
day: 'numeric',
|
||||
year: 'numeric',
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="open"
|
||||
class="fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4"
|
||||
class="fixed inset-0 z-[70] flex items-center justify-center bg-black/50 p-4"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
:aria-labelledby="titleId"
|
||||
data-testid="confirm-dialog"
|
||||
@keydown.esc.prevent="$emit('cancel')"
|
||||
@click.self="$emit('cancel')"
|
||||
>
|
||||
<div
|
||||
class="w-full max-w-md rounded-card border border-line bg-surface p-6 shadow-dialog"
|
||||
@@ -23,7 +24,8 @@
|
||||
<div class="mt-6 flex flex-col-reverse gap-3 sm:flex-row sm:justify-end">
|
||||
<button
|
||||
type="button"
|
||||
class="px-4 py-2 text-sm text-ink-secondary hover:text-ink-strong"
|
||||
class="px-4 py-2 text-sm text-ink-secondary hover:text-ink-strong disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
:disabled="confirmLoading"
|
||||
@click="$emit('cancel')"
|
||||
>
|
||||
{{ cancelLabel }}
|
||||
@@ -31,10 +33,10 @@
|
||||
<button
|
||||
type="button"
|
||||
:class="variant === 'danger' ? 'btn-danger' : 'btn-primary'"
|
||||
:disabled="confirmDisabled"
|
||||
:disabled="confirmDisabled || confirmLoading"
|
||||
@click="$emit('confirm')"
|
||||
>
|
||||
{{ confirmLabel }}
|
||||
{{ confirmLoading ? confirmLoadingLabel : confirmLabel }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -54,12 +56,16 @@ withDefaults(
|
||||
cancelLabel?: string
|
||||
variant?: 'primary' | 'danger'
|
||||
confirmDisabled?: boolean
|
||||
confirmLoading?: boolean
|
||||
confirmLoadingLabel?: string
|
||||
}>(),
|
||||
{
|
||||
confirmLabel: 'Confirm',
|
||||
cancelLabel: 'Cancel',
|
||||
variant: 'primary',
|
||||
confirmDisabled: false,
|
||||
confirmLoading: false,
|
||||
confirmLoadingLabel: 'Working…',
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<Teleport to="body">
|
||||
<div
|
||||
v-if="open"
|
||||
class="fixed inset-0 z-50 flex justify-end"
|
||||
class="fixed inset-0 z-40 flex justify-end"
|
||||
data-testid="help-panel"
|
||||
>
|
||||
<div
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
<iframe
|
||||
v-if="isPdf"
|
||||
:src="url"
|
||||
class="scan-page w-[800px] h-[1100px] bg-white"
|
||||
class="scan-page w-full max-w-[800px] aspect-[8/11] h-auto sm:w-[800px] sm:h-[1100px] sm:aspect-auto bg-white"
|
||||
frameborder="0"
|
||||
title="Scanned document"
|
||||
/>
|
||||
@@ -132,6 +132,7 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed, watch, nextTick } from 'vue'
|
||||
import { useResizeObserver } from '@vueuse/core'
|
||||
import SkeletonBlock from './SkeletonBlock.vue'
|
||||
import InlineError from './InlineError.vue'
|
||||
import EmptyState from './EmptyState.vue'
|
||||
@@ -242,6 +243,12 @@ watch(
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
useResizeObserver(viewerContainer, () => {
|
||||
if (props.url && !props.loading && !props.error) {
|
||||
fitWidth()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="fixed top-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none">
|
||||
<div class="fixed top-16 right-4 z-[60] sm:top-4 flex flex-col gap-2 max-w-sm w-full pointer-events-none px-2 sm:px-0">
|
||||
<transition-group name="toast">
|
||||
<div
|
||||
v-for="toast in toasts"
|
||||
|
||||
@@ -4,27 +4,68 @@
|
||||
data-testid="workstation-action-bar"
|
||||
data-tour="workstation-action-bar"
|
||||
>
|
||||
<div
|
||||
class="flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between"
|
||||
>
|
||||
<div class="flex flex-wrap items-center gap-2 min-w-0">
|
||||
<div class="flex flex-wrap items-center gap-2 sm:justify-between">
|
||||
<details
|
||||
v-if="hasSecondaryActions"
|
||||
class="relative sm:hidden"
|
||||
data-testid="workstation-action-bar-menu"
|
||||
>
|
||||
<summary
|
||||
class="btn-secondary list-none cursor-pointer text-sm [&::-webkit-details-marker]:hidden"
|
||||
>
|
||||
More actions
|
||||
</summary>
|
||||
<div
|
||||
class="absolute bottom-full left-0 z-20 mb-2 flex min-w-[11rem] flex-col gap-2 rounded-input border border-line bg-surface p-2 shadow-dialog"
|
||||
>
|
||||
<slot name="left" />
|
||||
<slot name="center" />
|
||||
<slot name="right" />
|
||||
</div>
|
||||
</details>
|
||||
<div v-else class="flex flex-wrap items-center gap-2 min-w-0 sm:hidden">
|
||||
<slot name="left" />
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2 min-w-0 sm:justify-center">
|
||||
<slot name="center" />
|
||||
</div>
|
||||
<div class="flex flex-wrap items-center gap-2 sm:justify-end">
|
||||
|
||||
<div class="hidden sm:flex flex-wrap items-center gap-2 min-w-0">
|
||||
<slot name="left" />
|
||||
<slot name="center" />
|
||||
</div>
|
||||
|
||||
<div class="ml-auto flex flex-wrap items-center gap-2 sm:justify-end">
|
||||
<slot name="primary" />
|
||||
<slot name="right" />
|
||||
<div class="hidden sm:contents">
|
||||
<slot name="right" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { Comment, computed, useSlots } from 'vue'
|
||||
|
||||
/**
|
||||
* Sticky bottom action bar for Entry / Verification / Approval workstations.
|
||||
* Wire into forms in Phase 16. Slots: left (Reject), center (Save Draft),
|
||||
* primary (Submit…), right (Next). Prefer btn-primary / btn-danger / btn-secondary.
|
||||
* On narrow viewports, secondary actions (left/center/right) collapse into a menu;
|
||||
* primary submit stays visible.
|
||||
*/
|
||||
const slots = useSlots()
|
||||
|
||||
function slotHasContent(name: 'left' | 'center' | 'right'): boolean {
|
||||
const nodes = slots[name]?.() ?? []
|
||||
return nodes.some(
|
||||
(node) =>
|
||||
node.type !== Comment &&
|
||||
!(typeof node.type === 'symbol' && String(node.type).includes('v-cmt')),
|
||||
)
|
||||
}
|
||||
|
||||
const hasSecondaryActions = computed(
|
||||
() =>
|
||||
slotHasContent('left') ||
|
||||
slotHasContent('center') ||
|
||||
slotHasContent('right'),
|
||||
)
|
||||
</script>
|
||||
|
||||
@@ -23,6 +23,38 @@
|
||||
>
|
||||
<slot name="rail" />
|
||||
</aside>
|
||||
|
||||
<!-- Below xl the rail is hidden; keep an explicit path back to the queue -->
|
||||
<div
|
||||
v-if="queuePath"
|
||||
class="xl:hidden col-span-full flex flex-wrap items-center gap-3 border-b border-line bg-surface px-3 py-2 sm:px-4"
|
||||
data-testid="workstation-mobile-nav"
|
||||
>
|
||||
<RouterLink
|
||||
:to="queuePath"
|
||||
class="inline-flex items-center gap-1.5 text-sm font-medium text-primary-700 hover:text-primary-800 shrink-0"
|
||||
>
|
||||
<span aria-hidden="true">←</span>
|
||||
{{ queueLabel }}
|
||||
</RouterLink>
|
||||
<label
|
||||
v-if="showMobileBatchSwitcher"
|
||||
class="flex min-w-0 flex-1 items-center gap-2 sm:max-w-xs"
|
||||
>
|
||||
<span class="sr-only">Switch batch in queue</span>
|
||||
<select
|
||||
class="form-input min-w-0 flex-1 py-1.5 text-sm"
|
||||
data-testid="workstation-mobile-batch-select"
|
||||
:value="selectedBatchId"
|
||||
@change="onMobileBatchChange"
|
||||
>
|
||||
<option v-for="item in queueBatches" :key="item.id" :value="item.id">
|
||||
{{ item.label }}
|
||||
</option>
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<section
|
||||
class="workstation-scan min-h-0 min-w-0"
|
||||
data-testid="workstation-scan"
|
||||
@@ -44,12 +76,50 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, useSlots } from 'vue'
|
||||
import { RouterLink } from 'vue-router'
|
||||
|
||||
const props = defineProps<{
|
||||
/** When false, render full-width queue slot only */
|
||||
hasBatch: boolean
|
||||
export type WorkstationQueueBatchOption = {
|
||||
id: string
|
||||
label: string
|
||||
}
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
/** When false, render full-width queue slot only */
|
||||
hasBatch: boolean
|
||||
/** Queue list route shown on viewports where the rail is hidden */
|
||||
queuePath?: string
|
||||
queueLabel?: string
|
||||
/** Compact batch switcher below xl when rail is hidden */
|
||||
queueBatches?: WorkstationQueueBatchOption[]
|
||||
selectedBatchId?: string
|
||||
}>(),
|
||||
{
|
||||
queuePath: undefined,
|
||||
queueLabel: 'Back to queue',
|
||||
queueBatches: () => [],
|
||||
selectedBatchId: undefined,
|
||||
},
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
(e: 'select-batch', batchId: string): void
|
||||
}>()
|
||||
|
||||
const slots = useSlots()
|
||||
const showRail = computed(() => props.hasBatch && !!slots.rail)
|
||||
|
||||
const showMobileBatchSwitcher = computed(
|
||||
() =>
|
||||
props.hasBatch &&
|
||||
!!props.selectedBatchId &&
|
||||
(props.queueBatches?.length ?? 0) > 0,
|
||||
)
|
||||
|
||||
function onMobileBatchChange(event: Event) {
|
||||
const id = (event.target as HTMLSelectElement).value
|
||||
if (id && id !== props.selectedBatchId) {
|
||||
emit('select-batch', id)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user