Skip to content

Commit

Permalink
feat: fix location enum
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrastopoulos committed May 27, 2024
1 parent a7a9c5a commit bc8c8ae
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 95 deletions.
51 changes: 0 additions & 51 deletions src/components/Dialogs/ConfirmUserDeletionDIalog.tsx

This file was deleted.

2 changes: 1 addition & 1 deletion src/components/ItemHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export function ItemHistory({ item }: ItemHistoryProps) {
</div>
<div className="collapse-content whitespace-normal text-xs">
<p>
{auditLogQuery.data.map((audit) => audit.actor.name).join('\n')}
{auditLogQuery.data.map((audit) => audit.actor.clerkId).join('\n')}
</p>
</div>
</button>
Expand Down
2 changes: 0 additions & 2 deletions src/components/Layouts/ManageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import ConfirmItemDeletionDialog from 'components/Dialogs/ConfirmItemDeletionDialog';
import ConfirmUserDeletionDialog from 'components/Dialogs/ConfirmUserDeletionDIalog';
import MassArchiveDialog from 'components/Dialogs/MassArchiveDialog';
import EditUserDialog from 'components/Dialogs/UserEditDialog';
import Link from 'next/link';
Expand All @@ -12,7 +11,6 @@ export default function ManageLayout({ children }: PropsWithChildren) {
<>
<ConfirmItemDeletionDialog />
<MassArchiveDialog />
<ConfirmUserDeletionDialog />
<EditUserDialog />

<div>
Expand Down
26 changes: 2 additions & 24 deletions src/components/UserRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,9 @@
/* eslint-disable jsx-a11y/no-noninteractive-tabindex */

import { Menu, Transition } from '@headlessui/react';
import clsx from 'clsx';
import Image from 'next/image';
import { Fragment } from 'react';
import {
FaBell,
FaBellSlash,
FaEllipsisV,
FaTrash,
FaUserLock
} from 'react-icons/fa';
import { FaBell, FaBellSlash, FaEllipsisV, FaUserLock } from 'react-icons/fa';
import { RouterOutputs } from 'server/trpc/router/_app';
import useDialogStore from 'stores/DialogStore';
import useSelectedUserStore from 'stores/SelectedUserStore';
Expand All @@ -23,7 +16,7 @@ export default function UserRow({
}: {
data: RouterOutputs['user']['search'][number];
}) {
const { confirmUserDeletionDialog, editUserDialog } = useDialogStore();
const { editUserDialog } = useDialogStore();
const { setSelectedUser } = useSelectedUserStore();

return (
Expand Down Expand Up @@ -107,21 +100,6 @@ export default function UserRow({
</button>
</Menu.Item>
<div className="divider my-1" />
<Menu.Item>
<button
className="flex w-full items-center rounded-md px-2 py-2 text-sm ui-active:bg-error ui-active:text-accent-content"
onClick={() => {
setSelectedUser(data);
confirmUserDeletionDialog();
}}
>
<FaTrash
className={clsx('mr-2 h-4 w-4')}
aria-hidden="true"
/>
<span>Delete User</span>
</button>
</Menu.Item>
</Menu.Items>
</Transition>
</Menu>
Expand Down
15 changes: 2 additions & 13 deletions src/components/ValueIcons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,8 @@ import { Value } from '@prisma/client';
import { ReactNode } from 'react';

export const ValueIcons: Record<Value, ReactNode> = {
LOW: (
<div className="rating tooltip rating-sm gap-1" data-tip="Low Value">
<input
disabled
checked
type="radio"
name="rating-3"
className="mask mask-star bg-red-400"
/>
</div>
),
MEDIUM: (
<div className="rating tooltip rating-sm gap-1" data-tip="Medium Value">
GENERAL: (
<div className="rating tooltip rating-sm gap-1" data-tip="General Value">
<input
disabled
checked
Expand Down
3 changes: 2 additions & 1 deletion src/lib/schemas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
ItemInteraction,
Location,
Permission,
RetrieveLocation,
Status,
Value
} from '@prisma/client';
Expand All @@ -23,7 +24,7 @@ export const ItemSchema = z.object({
}),
identifiable: z.boolean(),
itemLocation: z.string().min(3),
retrieveLocation: z.nativeEnum(Location),
retrieveLocation: z.nativeEnum(RetrieveLocation),
longDescription: z.string().nullish(),
status: z.nativeEnum(Status).default(Status.PENDING)
});
Expand Down
3 changes: 0 additions & 3 deletions src/stores/DialogStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ type DialogStore = {
manageSubscriptionsDialog: () => void;
confirmItemDeletionDialog: () => void;
massArchiveDialog: () => void;
confirmUserDeletionDialog: () => void;
editUserDialog: () => void;
clearDialog: () => void;
};
Expand All @@ -26,8 +25,6 @@ export default create<DialogStore>((set) => ({
confirmItemDeletionDialog: () =>
set(() => ({ dialog: 'confirmItemDeletion' })),
massArchiveDialog: () => set(() => ({ dialog: 'massArchive' })),
confirmUserDeletionDialog: () =>
set(() => ({ dialog: 'confirmUserDeletion' })),
editUserDialog: () => set(() => ({ dialog: 'editUser' })),
clearDialog: () => set(() => ({ dialog: null }))
}));

0 comments on commit bc8c8ae

Please sign in to comment.