bunch of fixes

This commit is contained in:
2025-01-21 17:18:32 -05:00
parent f0ed5ab8bb
commit 1a59ac8373
12 changed files with 40 additions and 39 deletions

12
.idea/dataSources.xml generated Normal file
View File

@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="r710" uuid="03604df0-e0df-435f-a424-0063df0268b3">
<driver-ref>postgresql</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>org.postgresql.Driver</jdbc-driver>
<jdbc-url>jdbc:postgresql://r710.gofwd.group:5433/postgres</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

View File

@@ -3,7 +3,7 @@ import styles from '../styles.module.css';
import PageHero from "@components/PageHero"; import PageHero from "@components/PageHero";
import UsersTable from "@src/components/admin/UsersTable"; import UsersTable from "@src/components/admin/UsersTable";
import { Suspense } from "react"; import { Suspense } from "react";
import Loading from "@src/app/components/Loading/loading"; import Loading from "@src/components/Loading/loading";
import { ColumnHeadings } from "@src/lib/utils"; import { ColumnHeadings } from "@src/lib/utils";
export default async function UsersPage() { export default async function UsersPage() {

View File

@@ -3,7 +3,7 @@ import styles from '../styles.module.css';
import PageHero from "@components/PageHero"; import PageHero from "@components/PageHero";
import SortTable from "@components/SortTable"; import SortTable from "@components/SortTable";
import { Suspense } from "react"; import { Suspense } from "react";
import Loading from "@src/app/components/Loading/loading"; import Loading from "@src/components/Loading/loading";
export default async function BarrelsPage() { export default async function BarrelsPage() {
const data = await getProductType('Barrels'); const data = await getProductType('Barrels');

View File

@@ -1,26 +1,17 @@
'use client';
import { getUserByUUID } from "@actions/userActions"; import { getUserByUUID } from "@actions/userActions";
import { NextPage } from "next"; import { NextPage } from "next";
import { Herr_Von_Muellerhoff } from "next/font/google"; import { Herr_Von_Muellerhoff } from "next/font/google";
import { useEffect, useState } from "react"; export default async function UserProfilePage(props: any) {
import { useParams, usePathname, useRouter } from "next/navigation";
export default function UserProfilePage(props: any) { let a_user:any = "";
const {uuid} = await props.params;
const router = useRouter(); if (uuid) {
const params = useParams<{ uuid: string }>() a_user = await getUserByUUID(uuid as unknown as string);
const [user, setUser] = useState<{ uuid: string | null; id: string; username: string; email: string; emailVerifiedOn: Date | null; password_hash: string; first_name: string | null; last_name: string | null; full_name: string | null; isAdmin:boolean, buildPrivacySetting: string | null; } | null>(null);
useEffect(() => {
if (params?.uuid) {
getUserByUUID(params?.uuid as unknown as string)
.then((user) => setUser(user))
.catch((error) => console.error("Error fetching user data:", error));
} }
}, [params?.uuid]);
if (!params || !params.uuid || !user ) { if (!props.params || !uuid || !a_user ) {
return <div>Loading...</div>; return <div>Loading...</div>;
} }
return ( return (
@@ -31,15 +22,13 @@ if (!params || !params.uuid || !user ) {
{/* User Info */} {/* User Info */}
<div> <div>
<h1 className="text-3xl font-bold mb-4"> User Profile </h1> <h1 className="text-3xl font-bold mb-4"> User Profile </h1>
<div className="bg-white rounded-lg shadow-md p-4 mb-6"> <div className="bg-white rounded-lg shadow-md p-4 mb-6">
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2> <h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
<h2 className="text-xl font-semibold mb-4">{user.email}</h2> <h2 className="text-xl font-semibold mb-4">{a_user.email}</h2>
<h2 className="text-xl font-semibold mb-4">{user.username} </h2> <h2 className="text-xl font-semibold mb-4">{a_user.username} </h2>
<h2 className="text-xl font-semibold mb-4">{(user.isAdmin)? "True":"False"} </h2> <h2 className="text-xl font-semibold mb-4">{(a_user.isAdmin)? "True":"False"} </h2>
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2> <h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
<h2 className="text-xl font-semibold mb-4">{user.first_name}{" "}{user.last_name} </h2> <h2 className="text-xl font-semibold mb-4">{a_user.first_name}{" "}{a_user.last_name} </h2>
<div className="overflow-x-auto"> <div className="overflow-x-auto">
</div> </div>

View File

@@ -6,7 +6,7 @@ import styles from '../styles.module.css';
import PageHero from "@components/PageHero"; import PageHero from "@components/PageHero";
import { Suspense } from "react"; import { Suspense } from "react";
import Loading from "@src/app/components/Loading/loading"; import Loading from "@src/components/Loading/loading";
import Link from "next/link"; import Link from "next/link";
export default async function AccountsTable( props: any ) { export default async function AccountsTable( props: any ) {
@@ -70,7 +70,7 @@ export default async function AccountsTable( props: any ) {
<tr key={item.uuid}> <tr key={item.uuid}>
<td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 "> <td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 ">
<Link href={`/userProfile/${item.uuid}`}><span className="pl-2"> {item.first_name}</span></Link> <Link href={`/UserProfile/${item.uuid}`}><span className="pl-2"> {item.first_name}</span></Link>
</td> </td>
<td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900"> <td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900">
{item.last_name} {item.last_name}

View File

@@ -1,10 +1,10 @@
"use client"; "use client";
import { FC, useState } from "react"; import { FC, useState } from "react";
import { brandType } from "src/types/brandType"; import { brandType } from "@lib/types/brandType";
import Brand from "./brand"; import Brand from "./brand";
import AddBrand from "./addBrand"; import AddBrand from "./addBrand";
import { addBrand, deleteBrand, editBrand } from "../../actions/brandActions"; import { addBrand, deleteBrand, editBrand } from "../../actions/brandActions";
import Footer from "@src/app/site/Footer/page"; import Footer from "@src/app/(siteInfo)/Footer/page";
import constants from "@src/lib/constants"; import constants from "@src/lib/constants";
interface Props { interface Props {
brands: brandType[]; brands: brandType[];

View File

@@ -1,13 +1,13 @@
"use client"; "use client";
import { FC, useState } from "react"; import { FC, useState } from "react";
import { componentTypeType } from "src/types/componentTypeType"; import { componentTypeType } from "@lib/types/componentTypeType";
import { componentType } from './componentType' import { componentType } from './componentType'
// import AddBrand from "./addBrand"; // import AddBrand from "./addBrand";
import { getData } from "src/actions/componentTypeActions"; import { getData } from "@actions/componentTypeActions";
import constants from "@src/lib/constants"; import constants from "@src/lib/constants";
interface Props { interface Props {
componentType: componentType[]; componentType: any[];
} }
const ComponentTypeList: FC<Props> = ({ componentType }) => { const ComponentTypeList: FC<Props> = ({ componentType }) => {

View File

@@ -1,6 +1,6 @@
"use client"; "use client";
import { ChangeEvent, FC, useState } from "react"; import { ChangeEvent, FC, useState } from "react";
import { componentTypeType } from "src/types/componentTypeType"; import { componentTypeType } from "@lib/types/componentTypeType";
interface Props { interface Props {
componentType: componentTypeType; componentType: componentTypeType;

View File

@@ -3,7 +3,7 @@ import { PlusCircleIcon } from "@heroicons/react/20/solid";
import Image from "next/image"; import Image from "next/image";
import Link from "next/link"; import Link from "next/link";
import { TestProductPage } from "@src/app/components/TestProductPage"; import { TestProductPage } from "@src/components/TestProductPage";
export default async function SortTable(props: any) { export default async function SortTable(props: any) {
return ( return (

View File

@@ -92,7 +92,7 @@ export default async function UsersTable(props: any) {
<tr key={item.uuid}> <tr key={item.uuid}>
<td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 "> <td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 ">
<Link href={`/userProfile/${item.uuid}`}><span className="pl-2"> {item.email}</span></Link> <Link href={`/UserProfile/${item.uuid}`}><span className="pl-2"> {item.email}</span></Link>
</td> </td>
<td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900"> <td className="whitespace-nowrap px-3 py-4 text-xs text-gray-900">
{item.first_name} {item.first_name}