Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Case project #33

Merged
merged 2 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class WorkInventory : BaseEntity<Guid>, IAuditable<Guid>
public Guid? BorrowLendId { get; set; }
public Guid EditionId { get; set; } // Eserin türü
public Guid? ShelfId { get; set; }
public Guid? BookCompartmentId { get; set; }
public Guid? WorkCompartmentId { get; set; }
public string BookNumber { get; set; }
public WorkStatus BookStatus { get; set; }
public bool IsAvailable { get; set; }
Expand All @@ -27,5 +27,5 @@ public class WorkInventory : BaseEntity<Guid>, IAuditable<Guid>

public virtual ICollection<BorrowLend>? BorrowLends { get; set; }

public virtual WorkCompartment BookCompartment { get; set; }
public virtual WorkCompartment WorkCompartment { get; set; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,9 @@ public void Configure(EntityTypeBuilder<WorkInventory> builder)
.HasConversion(new EnumToStringConverter<WorkStatus>());


builder.HasOne(bi => bi.BookCompartment)
builder.HasOne(bi => bi.WorkCompartment)
.WithMany(bc => bc.BookInventoryItems)
.HasForeignKey(bi => bi.BookCompartmentId)
.HasForeignKey(bi => bi.WorkCompartmentId)
.IsRequired(false);


builder.HasOne(bi => bi.BookCompartment)
.WithMany(bc => bc.BookInventoryItems)
.HasForeignKey(bi => bi.BookCompartmentId)
.IsRequired(false);

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public static void Seed(ModelBuilder modelBuilder)


workInventory.ShelfId = shelfId;
workInventory.BookCompartmentId = compartmentId;
workInventory.WorkCompartmentId = compartmentId;
}


Expand Down

This file was deleted.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { BsBook, BsBuilding, BsPeople } from "react-icons/bs";
import { FiHome, FiSettings } from "react-icons/fi";
import { BiSupport } from "react-icons/bi";
import { IoCreateOutline } from "react-icons/io5";
import { CiBoxList } from "react-icons/ci";

export const adminSidebarItems = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ import {
useColorModeValue,
Icon,
Flex,
useColorMode,
} from "@chakra-ui/react";
import Link from "next/link";
import ThemeSwitcher from "../../../../components/ThemeSwitcher";
import LanguageSwitcher from "../../../../components/LanguageSwitcher";
import { FiBell } from "react-icons/fi";



import { FiMinimize, FiMaximize } from "react-icons/fi";
import { HiMenuAlt2 } from "react-icons/hi";
Expand Down Expand Up @@ -85,6 +89,7 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
return (
<>
<HStack spacing={3}>
<NotificationMenu/>
<LanguageSwitcher />
<ThemeSwitcher />

Expand Down Expand Up @@ -125,4 +130,72 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
);
};



const NotificationMenu = () => {
const [isOpen, setIsOpen] = useState(false);
const notifications = [
{
id: 1,
title: "Yeni Mesaj",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
time: "5 dakika önce",
read: false,
},
{
id: 2,
title: "Bildirim",
content: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
time: "1 saat önce",
read: true,
},
{
id: 3,
title: "Bilgilendirme",
content: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
time: "1 gün önce",
read: false,
},
];

const handleToggle = () => {
setIsOpen(!isOpen);
};

const { colorMode } = useColorMode();

// Okunmamış bildirim sayısını hesapla
const unreadNotificationsCount = notifications.filter(notification => !notification.read).length;

return (
<Menu isLazy>
<MenuButton
cursor="pointer"
boxSize={15}
_hover={{ color: colorMode === "light" ? "teal.500" : "teal.300" }}
onClick={handleToggle}
position="relative"
>
<FiBell />
</MenuButton>
<MenuList
zIndex={5}
border="2px solid"
borderColor="gray.200"
boxShadow="4px 4px 0"
minWidth="200px"
display={isOpen ? "block" : "none"}
>
{notifications.map((notification, index) => (
<MenuItem key={index}>
<VStack spacing={2} align="start">
<Text fontWeight="500">{notification.title}</Text>
<Text color="gray.500">{notification.content}</Text>
</VStack>
</MenuItem>
))}
</MenuList>
</Menu>
);
};
export default Navbar;
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import {
useColorModeValue,
Icon,
Flex,
useColorMode,
} from "@chakra-ui/react";
import Link from "next/link";
import ThemeSwitcher from "../../../../components/ThemeSwitcher";
import LanguageSwitcher from "../../../../components/LanguageSwitcher";

import { FiMinimize, FiMaximize } from "react-icons/fi";
import { FiMinimize, FiMaximize, FiBell } from "react-icons/fi";
import { HiMenuAlt2 } from "react-icons/hi";
import { CloseIcon } from "@chakra-ui/icons";

Expand Down Expand Up @@ -97,6 +98,7 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
return (
<>
<HStack spacing={3}>
<NotificationMenu/>
<LanguageSwitcher />
<ThemeSwitcher />

Expand Down Expand Up @@ -136,5 +138,70 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
</>
);
};
const NotificationMenu = () => {
const [isOpen, setIsOpen] = useState(false);
const notifications = [
{
id: 1,
title: "Yeni Mesaj",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
time: "5 dakika önce",
read: false,
},
{
id: 2,
title: "Bildirim",
content: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
time: "1 saat önce",
read: true,
},
{
id: 3,
title: "Bilgilendirme",
content: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
time: "1 gün önce",
read: false,
},
];

const handleToggle = () => {
setIsOpen(!isOpen);
};

const { colorMode } = useColorMode();

// Okunmamış bildirim sayısını hesapla
const unreadNotificationsCount = notifications.filter(notification => !notification.read).length;

return (
<Menu isLazy>
<MenuButton
cursor="pointer"
boxSize={15}
_hover={{ color: colorMode === "light" ? "teal.500" : "teal.300" }}
onClick={handleToggle}
position="relative"
>
<FiBell />
</MenuButton>
<MenuList
zIndex={5}
border="2px solid"
borderColor="gray.200"
boxShadow="4px 4px 0"
minWidth="200px"
display={isOpen ? "block" : "none"}
>
{notifications.map((notification, index) => (
<MenuItem key={index}>
<VStack spacing={2} align="start">
<Text fontWeight="500">{notification.title}</Text>
<Text color="gray.500">{notification.content}</Text>
</VStack>
</MenuItem>
))}
</MenuList>
</Menu>
);
};
export default Navbar;
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import {
useColorModeValue,
Icon,
Flex,
useColorMode,
} from "@chakra-ui/react";
import Link from "next/link";
import ThemeSwitcher from "../../../../components/ThemeSwitcher";
import LanguageSwitcher from "../../../../components/LanguageSwitcher";

import { FiMinimize, FiMaximize } from "react-icons/fi";
import { FiMinimize, FiMaximize, FiBell } from "react-icons/fi";
import { HiMenuAlt2 } from "react-icons/hi";

const Navbar = ({ isOpen, onMenuToggle }) => {
Expand Down Expand Up @@ -85,6 +86,7 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
return (
<>
<HStack spacing={3}>
<NotificationMenu/>
<LanguageSwitcher />
<ThemeSwitcher />

Expand Down Expand Up @@ -125,4 +127,71 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {
);
};

const NotificationMenu = () => {
const [isOpen, setIsOpen] = useState(false);
const notifications = [
{
id: 1,
title: "Yeni Mesaj",
content: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
time: "5 dakika önce",
read: false,
},
{
id: 2,
title: "Bildirim",
content: "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
time: "1 saat önce",
read: true,
},
{
id: 3,
title: "Bilgilendirme",
content: "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
time: "1 gün önce",
read: false,
},
];

const handleToggle = () => {
setIsOpen(!isOpen);
};

const { colorMode } = useColorMode();

// Okunmamış bildirim sayısını hesapla
const unreadNotificationsCount = notifications.filter(notification => !notification.read).length;

return (
<Menu isLazy>
<MenuButton
cursor="pointer"
boxSize={15}
_hover={{ color: colorMode === "light" ? "teal.500" : "teal.300" }}
onClick={handleToggle}
position="relative"
>
<FiBell />
</MenuButton>
<MenuList
zIndex={5}
border="2px solid"
borderColor="gray.200"
boxShadow="4px 4px 0"
minWidth="200px"
display={isOpen ? "block" : "none"}
>
{notifications.map((notification, index) => (
<MenuItem key={index}>
<VStack spacing={2} align="start">
<Text fontWeight="500">{notification.title}</Text>
<Text color="gray.500">{notification.content}</Text>
</VStack>
</MenuItem>
))}
</MenuList>
</Menu>
);
};

export default Navbar;
5 changes: 1 addition & 4 deletions LibraryTrackingApp/src/frontend/pages/admin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,9 @@ import StatData from "@/layouts/Admin/components/Stats";
import { Box } from "@chakra-ui/react";

const AdminIndexPage = () => {



return (
<Box p="6">
<StatData/>
<StatData />
</Box>
);
};
Expand Down
Loading
Loading