feat: update alert rendering for feedback and student status changes based on permissions
This commit is contained in:
parent
93c5514c22
commit
a6c6966cf1
@ -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,6 +155,7 @@ export default function FeedbackIndex({
|
||||
feedback={viewing}
|
||||
/>
|
||||
|
||||
{canUpdateStatus && (
|
||||
<Alert>
|
||||
<Info />
|
||||
<AlertTitle>Ubah status Kritik dan Saran</AlertTitle>
|
||||
@ -163,6 +164,7 @@ export default function FeedbackIndex({
|
||||
Kritik dan Saran secara langsung.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<DataTable
|
||||
columns={columns}
|
||||
|
||||
@ -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,6 +210,7 @@ export default function StudentIndex({
|
||||
}
|
||||
/>
|
||||
|
||||
{canUpdateAcademicStatus && (
|
||||
<Alert>
|
||||
<Info />
|
||||
<AlertTitle>Ubah status mahasiswa</AlertTitle>
|
||||
@ -218,6 +219,7 @@ export default function StudentIndex({
|
||||
mahasiswa secara langsung.
|
||||
</AlertDescription>
|
||||
</Alert>
|
||||
)}
|
||||
|
||||
<DataTable
|
||||
columns={columns}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user