diff --git a/app/components/StatusBadge.vue b/app/components/StatusBadge.vue new file mode 100644 index 0000000..3192b23 --- /dev/null +++ b/app/components/StatusBadge.vue @@ -0,0 +1,37 @@ + + + + + diff --git a/app/components/dashboard/CitizenDashboard.vue b/app/components/dashboard/CitizenDashboard.vue index acd7bc4..6069277 100644 --- a/app/components/dashboard/CitizenDashboard.vue +++ b/app/components/dashboard/CitizenDashboard.vue @@ -66,22 +66,6 @@ const handlePageChange = (newPage: number) => { } // Helpers grafici -const getStatusColor = (status: string): string => { - const colors: Record = { - OPEN: 'primary', UNDER_REVIEW: 'info', ASSIGNED: 'warning', - IN_PROGRESS: 'warning', RESOLVED: 'success', REJECTED: 'danger', CLOSED: 'secondary', - } - return colors[status] || 'secondary' -} - -const getStatusLabel = (status: string): string => { - const labels: Record = { - OPEN: 'Aperta', UNDER_REVIEW: 'In revisione', ASSIGNED: 'Assegnata', - IN_PROGRESS: 'In corso', RESOLVED: 'Risolta', REJECTED: 'Rifiutata', CLOSED: 'Chiusa', - } - return labels[status] || status -} - const formatDate = (dateString?: string): string => { if (!dateString) return '' return new Date(dateString).toLocaleDateString('it-IT', { @@ -220,9 +204,7 @@ const formatDate = (dateString?: string): string => { - - {{ getStatusLabel(report.status) }} - + {{ formatDate(report.created_at) }} @@ -235,10 +217,13 @@ const formatDate = (dateString?: string): string => { - -
- -
+ diff --git a/app/components/dashboard/OperatorDashboard.vue b/app/components/dashboard/OperatorDashboard.vue index 507f6ba..1be1adb 100644 --- a/app/components/dashboard/OperatorDashboard.vue +++ b/app/components/dashboard/OperatorDashboard.vue @@ -50,7 +50,7 @@ const handleTakeReport = async (id: number) => { >
{{ report.address }}
- {{ report.status }} +
diff --git a/app/pages/reports/[id].vue b/app/pages/reports/[id].vue index aadf6ce..b5e59a1 100644 --- a/app/pages/reports/[id].vue +++ b/app/pages/reports/[id].vue @@ -41,34 +41,6 @@ const isFlagging = ref(false) const selectedMediaIndex = ref(0) const isGalleryOpen = ref(false) -// Status badge color -const getStatusColor = (status: string): string => { - const colors: Record = { - OPEN: 'primary', - UNDER_REVIEW: 'info', - ASSIGNED: 'warning', - IN_PROGRESS: 'warning', - RESOLVED: 'success', - REJECTED: 'danger', - CLOSED: 'secondary', - } - return colors[status] || 'secondary' -} - -// Status label italiano -const getStatusLabel = (status: string): string => { - const labels: Record = { - OPEN: 'Aperta', - UNDER_REVIEW: 'In revisione', - ASSIGNED: 'Assegnata', - IN_PROGRESS: 'In corso', - RESOLVED: 'Risolta', - REJECTED: 'Rifiutata', - CLOSED: 'Chiusa', - } - return labels[status] || status -} - // Invia messaggio const handleSendMessage = async () => { if (!newMessage.value.trim()) return @@ -145,9 +117,7 @@ const formatDate = (dateString: string): string => {

{{ report.category_name }}

- - {{ getStatusLabel(report.status) }} - + Creata il {{ formatDate(report.created_at) }} @@ -230,8 +200,10 @@ const formatDate = (dateString: string): string => {
{{ formatDate(item.created_at) }} -
- {{ getStatusLabel(item.old_status) }} → {{ getStatusLabel(item.new_status) }} +
+ + +
{{ item.note }}