Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
1f594f5
user side navbar implementation
KushPatel-18 Jan 6, 2026
0071f80
User dashboard implemented with imported friends inventory and groups…
KushPatel-18 Jan 6, 2026
4b32a61
User Friends page implementation selecting and managing individual fr…
KushPatel-18 Jan 6, 2026
36245b0
Popup implementation on user friends page for quick user search
KushPatel-18 Jan 6, 2026
507673b
User groups page implementation with imported user groups table
KushPatel-18 Jan 6, 2026
a029d7c
User inventory page implementation with imported user inventory table
KushPatel-18 Jan 6, 2026
fe701dc
Popup implementation for selected user group selected on user group/d…
KushPatel-18 Jan 6, 2026
63f9f2c
Popup implementation for selected user inventory item selected on use…
KushPatel-18 Jan 6, 2026
0649942
Backend Friends implementation
KushPatel-18 Jan 6, 2026
7fd1ff5
Installation of friend app
KushPatel-18 Jan 6, 2026
c7d34f8
friend update and relationship implementation; friend management - ad…
KushPatel-18 Jan 6, 2026
f0725fa
migrations
KushPatel-18 Jan 6, 2026
0303b09
Popup implementation for editing user inventory item (base framework)
KushPatel-18 Jan 7, 2026
0ff8810
Updated logic for user inventory to close selection modal and open it…
KushPatel-18 Jan 7, 2026
8558556
Restructured user inventory edit modal layout and cleaned up code
KushPatel-18 Jan 7, 2026
ec2d179
Inventory item edit included description, and overall form/layout cle…
KushPatel-18 Jan 7, 2026
4c99f52
temporary field of date type in InventoryItem
KushPatel-18 Jan 7, 2026
8dfd6d1
Reworked for InventoryItem logic for mock data temporary date type fi…
KushPatel-18 Jan 7, 2026
945d180
Restructured user inventory select modal layout and cleaned up code/s…
KushPatel-18 Jan 7, 2026
5c27024
Restructured user groups select modal layout and cleaned up code/layout
KushPatel-18 Jan 7, 2026
c343e89
Restructured user friends select modal layout and cleaned up code
KushPatel-18 Jan 7, 2026
921b479
Layout tweaks and code clean up for popups
KushPatel-18 Jan 7, 2026
3c316de
User friends add popup modal cleaned up, and functionality to close m…
KushPatel-18 Jan 7, 2026
0244647
User friends select popup modal added functionality to close modal by…
KushPatel-18 Jan 7, 2026
fba4787
User inventory select/edit + user groups select popup modal added fun…
KushPatel-18 Jan 7, 2026
a5b0784
minor cleanup user group selection modal
KushPatel-18 Jan 7, 2026
4c3dea3
Resolved 'BasePermissionMetaclass' error - inserted trailing comma in…
KushPatel-18 Jan 7, 2026
c7aaca1
Login and Logout redirect urls set in settings.py
KushPatel-18 Jan 7, 2026
d5c3332
Implemented initialised friend list for new users, and
KushPatel-18 Jan 7, 2026
eeb2e67
Updated models.py related_names to avoid potential conflicts
KushPatel-18 Jan 7, 2026
260c2fc
Updated friends models.py to initialise a friends list upon account c…
KushPatel-18 Jan 7, 2026
c9a2b79
Updated urls for friends for managing and viewing friendships and fri…
KushPatel-18 Jan 7, 2026
caf6f0e
Implemented friend serializers
KushPatel-18 Jan 7, 2026
d7ab6dc
Updated server urls to include friends url
KushPatel-18 Jan 7, 2026
ea89fd3
migrations
KushPatel-18 Jan 7, 2026
aa8cca6
Implemented search query views for user search
KushPatel-18 Jan 7, 2026
a4a8583
Updated urls for search url
KushPatel-18 Jan 7, 2026
66c4cdb
Added 'me' for current user in user_profile views
KushPatel-18 Jan 8, 2026
1319390
added me url for user_profile
KushPatel-18 Jan 8, 2026
e8007e3
Updated settings.py to for backend frontend communication
KushPatel-18 Jan 8, 2026
f5a1f68
Keeping track of current user and context through authprovider layer
KushPatel-18 Jan 8, 2026
5749303
Implemented user login and sign up forms/pages
KushPatel-18 Jan 8, 2026
ed7b74d
Implemented user friend search, and updated portion of import name fr…
KushPatel-18 Jan 8, 2026
f591a76
Updated user_friends_table to replace mock data with real backend data
KushPatel-18 Jan 8, 2026
b6718cb
Implemented user search modal
KushPatel-18 Jan 8, 2026
7cb52ca
Implemented user search table
KushPatel-18 Jan 8, 2026
99985a1
Implemented friend type
KushPatel-18 Jan 8, 2026
6435b22
Implemented functionality for adding friends from search
KushPatel-18 Jan 8, 2026
6f2452a
Temporary profile picture placeholder
KushPatel-18 Jan 8, 2026
6af90c1
Updated user navbar to login, logout and open friend requests sent an…
KushPatel-18 Jan 8, 2026
299a013
Implemented Recieved and Sent requests modals with functionality to c…
KushPatel-18 Jan 8, 2026
aef6d9f
Updated field name to username, and imports temporary profile picture
KushPatel-18 Jan 8, 2026
30890a7
Implemented logic imported in friend search page for searching users
KushPatel-18 Jan 8, 2026
b70bd60
Implemented api front end to backend calls
KushPatel-18 Jan 8, 2026
bb9e967
implemented api calls for back end and frontend
KushPatel-18 Jan 8, 2026
0e52374
minor layout change
KushPatel-18 Jan 8, 2026
998e5d6
Minor cleanup and layout changes
KushPatel-18 Jan 8, 2026
c68ba5e
Updated remove friend button to actually remove friend
KushPatel-18 Jan 9, 2026
97287f8
Minor Changes
KushPatel-18 Jan 9, 2026
4f133c8
Merge branch 'use_uv' into user_dashboard
KushPatel-18 Jan 9, 2026
bc36ebe
-- Needs work -- Updated Organization dahsboard to be able to switch …
KushPatel-18 Jan 9, 2026
49fcc87
Updated user_navbar to have framework (to be implemented) of organisa…
KushPatel-18 Jan 9, 2026
921c27b
-- Incomplete -- user owned organisations to allow user to switch to …
KushPatel-18 Jan 9, 2026
c915a22
Fixed bug - missing comma
KushPatel-18 Jan 9, 2026
527dc56
Updated User Profile Page to be able to display real number of friend…
KushPatel-18 Jan 9, 2026
7b0a299
Comment notes on how to set profile view of current logged in user vs…
KushPatel-18 Jan 9, 2026
39ac9ae
Changed Link Path to User Profile Page instead of User Page
KushPatel-18 Jan 9, 2026
0cfe5fc
Package Updates
KushPatel-18 Jan 9, 2026
3d3e4b6
Update models.py to Flake8 conventions
KushPatel-18 Jan 9, 2026
753de3e
Update admin.py to comply with Flake8
KushPatel-18 Jan 9, 2026
6fb9999
Update models.py again for Flake8 compliancy
KushPatel-18 Jan 9, 2026
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
3 changes: 2 additions & 1 deletion client/.env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
REACT_EDITOR=code

APP_ENV=DEVELOPMENT
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000/api"
# NEXT_PUBLIC_BACKEND_URL="http://localhost:8000/api"
NEXT_PUBLIC_BACKEND_URL="http://127.0.0.1:8000"
16 changes: 0 additions & 16 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion client/src/components/ui/navbar_organization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ const Header = () => {
// to prevent the blur event from firing when they are clicked.
onMouseDown={(e) => e.preventDefault()}
>
<button className="dropdown-item">Switch to Client</button>
<Link href="/user_dashboard" className="dropdown-item">
{/* <button className="dropdown-item">Switch to Client</button> */}
<button>Switch to Client</button>
</Link>
<button className="dropdown-item">Logout</button>
</div>
)}
Expand Down
54 changes: 54 additions & 0 deletions client/src/components/ui/popups/user_friends_add_popup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import { removeFriend, sendFriendRequest } from "../../../lib/api/friends";
import { OtherUsers } from "../user_tables/user_friends_add_table";

const FriendAddItemModal = ({
user,
onClose,
}: {
user: OtherUsers;
onClose: () => void;
}) => {
const handleSend = async () => {
await sendFriendRequest(user.id);
onClose();
};

const handleRemove = async () => {
await removeFriend(user.id);
onClose();
};

return (
<div className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-40">
<div className="w-[300px] rounded bg-white p-6">
<h2 className="text-lg font-bold">{user.username}</h2>

<div className="mt-4 space-y-2">
{!user.is_friend && !user.request_sent && (
<button
onClick={handleSend}
className="w-full rounded bg-blue-600 py-2 text-white"
>
Send Friend Request
</button>
)}

{user.is_friend && (
<button
onClick={handleRemove}
className="w-full rounded bg-red-600 py-2 text-white"
>
Remove Friend
</button>
)}

<button onClick={onClose} className="w-full rounded border py-2">
Close
</button>
</div>
</div>
</div>
);
};

export default FriendAddItemModal;
101 changes: 101 additions & 0 deletions client/src/components/ui/popups/user_friends_recieved_popup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// src/components/popups/user_groups_select_popup.tsx

// import Link from "next/link";
// import React from "react";
import React, { useEffect, useState } from "react";

import {
acceptFriendRequest,
declineFriendRequest,
getIncomingRequests,
} from "../../../lib/api/friends";

export type FriendRequest = {
id: number;
sender: {
id: number;
username: string;
};
};

type Props = {
isOpen: boolean;
onClose: () => void;
};

function UserFriendsRecievedPopup({ isOpen, onClose }: Props) {
const [requests, setRequests] = useState<FriendRequest[]>([]);
const [loading, setLoading] = useState(false);
useEffect(() => {
if (!isOpen) return;

setLoading(true);
getIncomingRequests()
.then((res) => {
console.log("Incoming requests:", res.data);
setRequests(res.data);
})

.finally(() => setLoading(false));
}, [isOpen]);

if (!isOpen) return null;
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="w-full max-w-md rounded-lg bg-white p-4 shadow-lg">
<div className="mb-3 flex items-center justify-between">
<h2 className="text-lg font-bold">Friend Requests</h2>
<button onClick={onClose} className="text-gray-500 hover:text-black">
</button>
</div>

{loading && <p className="text-gray-500">Loading…</p>}

{!loading && requests.length === 0 && (
<p className="text-gray-500">No friend requests.</p>
)}

<div className="space-y-2">
{requests.map((r) => (
<div
key={r.id}
className="flex items-center justify-between rounded border px-3 py-2"
>
<span className="font-medium">{r.sender.username}</span>

<div className="flex gap-2">
<button
onClick={() =>
acceptFriendRequest(r.id).then(() =>
setRequests((prev) =>
prev.filter((req) => req.id !== r.id),
),
)
}
className="rounded bg-green-600 px-2 py-1 text-sm text-white"
>
Accept
</button>

<button
onClick={() =>
declineFriendRequest(r.id).then(() =>
setRequests((prev) =>
prev.filter((req) => req.id !== r.id),
),
)
}
className="rounded bg-red-500 px-2 py-1 text-sm text-white"
>
Reject
</button>
</div>
</div>
))}
</div>
</div>
</div>
);
}
export default UserFriendsRecievedPopup;
83 changes: 83 additions & 0 deletions client/src/components/ui/popups/user_friends_search_popup.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// src/components/popups/user_groups_add_popup.tsx

import Link from "next/link";
import React from "react";

type ItemModalProps = {
// user={selectedItem;
isOpen: boolean;
onClose: () => void;
};

function UserFriendsSearchPopup({ isOpen, onClose }: ItemModalProps) {
if (!isOpen) return null;
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
<div className="absolute inset-0" onClick={onClose} />
<div className="absolute w-full max-w-md rounded-xl bg-white p-6 shadow-lg">
{/* Header */}
<div className="flex items-center justify-between border-b pb-3">
<h2 className="text-lg font-semibold">Add Friends</h2>
<button
onClick={onClose}
className="text-gray-500 hover:text-gray-800"
>
</button>
</div>

{/* Body */}
<div className="space-y-2 py-4">
{/* Start */}
<div className="w-full min-w-[200px] max-w-sm">
<div className="relative">
<input
className="ease w-full rounded-md border border-slate-200 bg-transparent py-2 pl-3 pr-28 text-sm text-slate-700 shadow-sm transition duration-300 placeholder:text-slate-400 hover:border-slate-300 focus:border-slate-400 focus:shadow focus:outline-none"
placeholder="Eg., Ky Kiske"
/>
<button
type="button"
className="absolute right-1 top-1 flex items-center rounded border border-transparent bg-slate-800 px-2.5 py-1 text-center text-sm text-white shadow-sm transition-all hover:bg-slate-700 hover:shadow focus:bg-slate-700 focus:shadow-none active:bg-slate-700 active:shadow-none disabled:pointer-events-none disabled:opacity-50 disabled:shadow-none"
>
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
className="mr-2 h-4 w-4"
>
<path
fill-rule="evenodd"
d="M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z"
clip-rule="evenodd"
/>
</svg>
Search
</button>
</div>
</div>
{/* End */}
{/* <p><strong>ID:</strong> Ummm ~~ </p> */}
</div>

{/* Footer */}
<div className="flex justify-end gap-3 border-t pt-4">
<Link href="../../../user_friends_search/">
<button className="rounded bg-gray-200 px-4 py-2 hover:bg-gray-300">
Expand
</button>
</Link>
<button
onClick={onClose}
className="rounded bg-gray-200 px-4 py-2 hover:bg-gray-300"
>
Close
</button>
<button className="rounded bg-blue-600 px-4 py-2 text-white hover:bg-blue-700">
Edit
</button>
</div>
</div>
</div>
);
}
export default UserFriendsSearchPopup;
Loading
Loading