mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
more work
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { users } from "@schemas/schema";
|
||||
import { getAllUsersOrdrByLastname } from "@actions/userActions";
|
||||
import AccountsTable from "@components/AccountsTable"; // Adjust the import path as necessary
|
||||
import React, { Suspense } from 'react';
|
||||
import { ColumnHeadings } from "@src/lib/bb_utils";
|
||||
import { ColumnHeadings } from "@src/lib/utils";
|
||||
import PageHero from "@components/PageHero";
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import { getData } from "@actions/userActions";
|
||||
import styles from '../styles.module.css';
|
||||
//import styles from '../styles.module.css';
|
||||
import PageHero from "@components/PageHero";
|
||||
import UsersTable from "@src/components/admin/UsersTable";
|
||||
import { Suspense } from "react";
|
||||
import Loading from "@src/components/Loading/loading";
|
||||
import { ColumnHeadings } from "@src/lib/bb_utils";
|
||||
import { ColumnHeadings } from "@src/lib/utils";
|
||||
|
||||
export default async function UsersPage() {
|
||||
const data = await getData();
|
||||
@@ -16,7 +16,7 @@ export default async function UsersPage() {
|
||||
<PageHero title="Users" />
|
||||
|
||||
<div className="container mx-auto">
|
||||
<Suspense fallback="Loading...">
|
||||
<Suspense fallback={<Loading/>}>
|
||||
<UsersTable data={data} newColumnHeadings={columnHeadings}></UsersTable>
|
||||
</Suspense>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from "react";
|
||||
import { ChevronDownIcon } from "@heroicons/react/20/solid";
|
||||
import { PlusCircleIcon } from "@heroicons/react/20/solid";
|
||||
import { ColumnHeadings } from "@src/lib/bb_utils";
|
||||
import { ColumnHeadings } from "@src/lib/utils";
|
||||
import styles from '../styles.module.css';
|
||||
import PageHero from "@components/PageHero";
|
||||
|
||||
@@ -66,6 +66,7 @@ export default async function AccountsTable( props: any ) {
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody className=" divide-y divide-gray-200 bg-white">
|
||||
<Suspense fallback={<Loading />}>
|
||||
{props.data.map((item: any) => (
|
||||
<tr key={item.uuid}>
|
||||
<td className="whitespace-wrap flex items-center py-4 pl-4 pr-3 text-xs font-medium text-gray-900 ">
|
||||
@@ -96,6 +97,7 @@ export default async function AccountsTable( props: any ) {
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
</Suspense>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { pgTableCreator, integer, varchar, text, numeric, timestamp, unique, check, bigserial, date, boolean, uuid, bigint, real, doublePrecision, primaryKey, pgView, index, serial } from "drizzle-orm/pg-core"
|
||||
import { ConsoleLogWriter, relations, sql } from "drizzle-orm"
|
||||
import { pgTableCreator, integer, varchar, text, numeric, timestamp, unique, check, date, boolean, uuid, bigint, real, doublePrecision, primaryKey, pgView, index, serial } from "drizzle-orm/pg-core";
|
||||
import { relations, sql } from "drizzle-orm";
|
||||
import { DATABASE_PREFIX as prefix } from "@lib/constants";
|
||||
|
||||
export const pgTable = pgTableCreator((name) => (prefix == "" || prefix == null) ? name: `${prefix}_${name}`);
|
||||
|
||||
@@ -14,6 +14,7 @@ export class ColumnHeadings {
|
||||
this.headingNames = headingNames;
|
||||
this.current = 0;
|
||||
}
|
||||
|
||||
getHeading = () => {
|
||||
|
||||
const returnedHeading:string = this.headingNames[this.current];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
export default {
|
||||
const constants = {
|
||||
APP_NAME: 'Ballistic Builder',
|
||||
SITE_NAME: 'Ballistic Builder',
|
||||
COMPANY_NAME: 'Forward Group, LLC',
|
||||
@@ -7,10 +7,12 @@ export default {
|
||||
AUTHOR: 'Forward Group, LLC',
|
||||
META_KEYWORDS: 'Pew Pew',
|
||||
META_DESCRIPTION: 'Pow Pow',
|
||||
DESCRIPTION: 'Generated by Forward Group, LLC',
|
||||
DESCRIPTION: 'Developed by Forward Group, LLC',
|
||||
PJAM_RAINIER: 'https://api.pepperjamnetwork.com/20120402/publisher/creative/product?apiKey=17c11367569cc10dce51e6a5900d0c7c8b390c9cb2d2cecc25b3ed53a3b8649b&format=json&programIds=8713',
|
||||
PJAM_BARRETTA: 'https://api.pepperjamnetwork.com/20120402/publisher/creative/product?apiKey=17c11367569cc10dce51e6a5900d0c7c8b390c9cb2d2cecc25b3ed53a3b8649b&format=json&programIds=8342'
|
||||
}
|
||||
};
|
||||
|
||||
export default constants;
|
||||
|
||||
|
||||
export enum SITE_CONT_TYPE {
|
||||
@@ -23,10 +25,10 @@ export enum SITE_CONT_TYPE {
|
||||
DISCLOSURE="DISCLOSURE"
|
||||
}
|
||||
|
||||
export const APP_TITLE = "BB Test";
|
||||
export const APP_TITLE = "Ballistics Builder";
|
||||
export const DATABASE_PREFIX = "";
|
||||
export const TEST_DB_PREFIX = "test_acme";
|
||||
export const EMAIL_SENDER = '"BB" <don@goforward.group>';
|
||||
export const EMAIL_SENDER = '"Ballistics Builder" <don@goforward.group>';
|
||||
|
||||
export enum Paths {
|
||||
Home = "/",
|
||||
|
||||
@@ -6,4 +6,11 @@ export type brandType = {
|
||||
export type manufacturerType = {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
};
|
||||
|
||||
//field is named componentType
|
||||
export type componentTypeType = {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
export type brandType = {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
|
||||
export default brandType;
|
||||
@@ -1,5 +0,0 @@
|
||||
//field is named componentType
|
||||
export type componentTypeType = {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
export type manufacturerType = {
|
||||
id: number;
|
||||
name: string;
|
||||
};
|
||||
@@ -54,3 +54,22 @@ export function formatPrice(
|
||||
export function absoluteUrl(path: string) {
|
||||
return new URL(path, env.NEXT_PUBLIC_APP_URL).href
|
||||
}
|
||||
|
||||
/** Ballistic Builder cusom functions */
|
||||
|
||||
export class ColumnHeadings {
|
||||
headingNames: string[];
|
||||
current: number;
|
||||
|
||||
constructor(headingNames: string[]) {
|
||||
console.log(headingNames.length);
|
||||
this.headingNames = headingNames;
|
||||
this.current = 0;
|
||||
}
|
||||
|
||||
getHeading = () => {
|
||||
const returnedHeading:string = this.headingNames[this.current];
|
||||
this.current = this.current+1;
|
||||
return returnedHeading;
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import { AuthenticationError } from "@/app/(main)/util";
|
||||
import { createSession, generateSessionToken, validateRequest } from "@lib/wdcStarter/auth";
|
||||
import { cache } from "react";
|
||||
import { cookies } from "next/headers";
|
||||
import { UserId } from "@/use-cases/types";
|
||||
import { UserId } from "@src/use-cases/types";
|
||||
|
||||
const SESSION_COOKIE_NAME = "session";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user