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:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user