feat: update alert rendering for feedback and student status changes based on permissions

This commit is contained in:
Yoga Pangestu 2026-09-01 00:08:45 +07:00
parent 93c5514c22
commit a6c6966cf1
2 changed files with 30 additions and 26 deletions

View File

@ -1,7 +1,3 @@
import { Head, Link, router } from '@inertiajs/react';
import { format } from 'date-fns';
import { Info, Plus } from 'lucide-react';
import { useState } from 'react';
import type { PaginationState } from '@/components/data-table';
import { DataTable } from '@/components/data-table';
import { DeleteConfirmDialog } from '@/components/delete-confirm-dialog';
@ -31,6 +27,10 @@ import {
} from '@/routes/admin/feedback';
import type { Feedback } from '@/types/feedback';
import { FeedbackStatusLabels, FeedbackTypeLabels } from '@/types/feedback';
import { Head, Link, router } from '@inertiajs/react';
import { format } from 'date-fns';
import { Info, Plus } from 'lucide-react';
import { useState } from 'react';
import { createFeedbackColumns, FeedbackStatusVariants } from './columns';
type FeedbackTypeOption = { value: string; label: string };
@ -155,14 +155,16 @@ export default function FeedbackIndex({
feedback={viewing}
/>
<Alert>
<Info />
<AlertTitle>Ubah status Kritik dan Saran</AlertTitle>
<AlertDescription>
Klik badge Status pada tabel untuk mengubah status
Kritik dan Saran secara langsung.
</AlertDescription>
</Alert>
{canUpdateStatus && (
<Alert>
<Info />
<AlertTitle>Ubah status Kritik dan Saran</AlertTitle>
<AlertDescription>
Klik badge Status pada tabel untuk mengubah status
Kritik dan Saran secara langsung.
</AlertDescription>
</Alert>
)}
<DataTable
columns={columns}

View File

@ -1,6 +1,3 @@
import { Head, Link, router } from '@inertiajs/react';
import { FileSpreadsheet, Info, Plus, RotateCcw } from 'lucide-react';
import { useState } from 'react';
import { ConfirmDialog } from '@/components/confirm-dialog';
import type { PaginationState } from '@/components/data-table';
import { DataTable } from '@/components/data-table';
@ -16,15 +13,18 @@ import {
create,
destroy,
edit,
exportMethod as exportStudents,
reset_password,
index as studentsIndex,
update_status,
update_user_status,
exportMethod as exportStudents,
index as studentsIndex,
} from '@/routes/admin/users/students';
import { formatDepartmentLabel } from '@/types/department';
import { createStudentColumns } from './columns';
import { Head, Link, router } from '@inertiajs/react';
import { FileSpreadsheet, Info, Plus, RotateCcw } from 'lucide-react';
import { useState } from 'react';
import type { Student } from './columns';
import { createStudentColumns } from './columns';
type Department = { id: number; name: string; degree_level: string | null };
type StatusOption = { value: string; label: string };
@ -210,14 +210,16 @@ export default function StudentIndex({
}
/>
<Alert>
<Info />
<AlertTitle>Ubah status mahasiswa</AlertTitle>
<AlertDescription>
Klik badge Status pada tabel untuk mengubah status
mahasiswa secara langsung.
</AlertDescription>
</Alert>
{canUpdateAcademicStatus && (
<Alert>
<Info />
<AlertTitle>Ubah status mahasiswa</AlertTitle>
<AlertDescription>
Klik badge Status pada tabel untuk mengubah status
mahasiswa secara langsung.
</AlertDescription>
</Alert>
)}
<DataTable
columns={columns}