feat: update authentication flow and user navigation
This commit is contained in:
@@ -14,47 +14,45 @@ const handleTakeReport = async (id: number) => {
|
||||
|
||||
<template>
|
||||
<div class="row">
|
||||
<!-- Colonna Sinistra: Segnalazioni da prendere in carico -->
|
||||
<div class="col-12 col-lg-6 mb-4">
|
||||
<h3 class="mb-3 border-bottom pb-2">Da prendere in carico (OPEN)</h3>
|
||||
<div class="list-group">
|
||||
<div v-if="openReportsRes?.ok && openReportsRes.reports.length === 0" class="text-muted">
|
||||
Nessuna nuova segnalazione in ingresso.
|
||||
</div>
|
||||
<div
|
||||
v-for="report in openReportsRes?.reports" :key="report.id"
|
||||
class="list-group-item d-flex justify-content-between align-items-center"
|
||||
>
|
||||
<div>
|
||||
<h6 class="mb-1">{{ report.address }}</h6>
|
||||
<small class="text-muted">{{ report.created_at }}</small>
|
||||
<div class="card card-bg h-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h3 class="h5 mb-0">Da prendere in carico</h3>
|
||||
<NuxtLink to="/operator" class="btn btn-link btn-sm pe-0">Apri coda</NuxtLink>
|
||||
</div>
|
||||
<button @click="handleTakeReport(report.id)" class="btn btn-outline-primary btn-sm">
|
||||
Prendi in carico
|
||||
</button>
|
||||
<div v-if="openReportsRes?.ok && openReportsRes.reports.length === 0" class="alert alert-info mb-0">
|
||||
Nessuna nuova segnalazione in ingresso.
|
||||
</div>
|
||||
<ReportTable
|
||||
v-else
|
||||
:reports="openReportsRes?.reports || []"
|
||||
action-variant="manage"
|
||||
detail-base-path="/operator/reports"
|
||||
@take="handleTakeReport"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Colonna Destra: Segnalazioni in gestione dell'operatore -->
|
||||
<div class="col-12 col-lg-6 mb-4">
|
||||
<h3 class="mb-3 border-bottom pb-2">Le mie assegnazioni</h3>
|
||||
<div class="list-group">
|
||||
<div v-if="assignedReportsRes?.ok && assignedReportsRes.reports.length === 0" class="text-muted">
|
||||
Non hai segnalazioni in carico.
|
||||
</div>
|
||||
<NuxtLink
|
||||
v-for="report in assignedReportsRes?.reports" :key="report.id"
|
||||
:to="`/operator/reports/${report.id}`"
|
||||
class="list-group-item list-group-item-action d-flex justify-content-between align-items-center"
|
||||
>
|
||||
<div>
|
||||
<h6 class="mb-1">{{ report.address }}</h6>
|
||||
<StatusBadge :status="report.status" />
|
||||
<div class="card card-bg h-100">
|
||||
<div class="card-body">
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h3 class="h5 mb-0">Le mie assegnazioni</h3>
|
||||
<NuxtLink to="/operator/assigned" class="btn btn-link btn-sm pe-0">Vedi tutte</NuxtLink>
|
||||
</div>
|
||||
<BIIcon name="it-chevron-right" size="sm" color="primary" />
|
||||
</NuxtLink>
|
||||
<div v-if="assignedReportsRes?.ok && assignedReportsRes.reports.length === 0" class="alert alert-info mb-0">
|
||||
Non hai segnalazioni in carico.
|
||||
</div>
|
||||
<ReportTable
|
||||
v-else
|
||||
:reports="assignedReportsRes?.reports || []"
|
||||
detail-base-path="/operator/reports"
|
||||
action-label="Apri segnalazione"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user