Artikel DB struktur geändert von CODEX
This commit is contained in:
1 parent
0c0a678eaa
commit
9c18234efe
95 files changed
+3872
-2316
No files matched your search
@@ -1,37 +1,40 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
import { articleFindById } from "../../../../actions/article.actions";
|
||||
import { ArticleMainForm } from "../../../../components/article/articleMain.form";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
import { manufacturerFindAll } from "../../../../actions/manufacturer.actions";
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>
|
||||
|
||||
}
|
||||
export default async function CatergoryUpdate({ params }: PageProps) {
|
||||
|
||||
|
||||
const { id } = await params
|
||||
const article = await articleFindById(id);
|
||||
const cats = await categoryFindAll();
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
|
||||
if(!article._id) {
|
||||
return (<div>
|
||||
<div>Artikel nicht gefunden</div>
|
||||
<div>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.article.url}>zurück1</Link>
|
||||
</div>
|
||||
</div>)
|
||||
}
|
||||
const {name,category,variants} = article;
|
||||
console.log('Varianten:',article.variants)
|
||||
import Link from 'next/link';
|
||||
import { sites } from '../../../../_config/sites';
|
||||
import {
|
||||
articleFindById,
|
||||
articleGroupsFindAll,
|
||||
} from '../../../../actions/article.actions';
|
||||
import { ArticleMainForm } from '../../../../components/article/articleMain.form';
|
||||
import { categoryFindAll } from '../../../../actions/category.actions';
|
||||
import { manufacturerFindAll } from '../../../../actions/manufacturer.actions';
|
||||
|
||||
export default async function ArticleUpdatePage({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ id: string }>;
|
||||
}) {
|
||||
const { id } = await params;
|
||||
const [article, categories, manufacturer, groups] = await Promise.all([
|
||||
articleFindById(id),
|
||||
categoryFindAll(),
|
||||
manufacturerFindAll(),
|
||||
articleGroupsFindAll(),
|
||||
]);
|
||||
return (
|
||||
<div className="h-screen">
|
||||
<ArticleMainForm initData={article} categories={cats} manufacturer={manufacturer}></ArticleMainForm>
|
||||
<Link className="cursor-pointer p-2 border-1 border-sky-500 bg-sky-500 text-white rounded-full m-1 hover:bg-sky-700 " href={sites.article.url}>zurück</Link>
|
||||
<div>
|
||||
{article ? (
|
||||
<ArticleMainForm
|
||||
initData={article}
|
||||
categories={categories}
|
||||
manufacturer={manufacturer}
|
||||
groups={groups}
|
||||
/>
|
||||
) : (
|
||||
<p>Artikel nicht gefunden.</p>
|
||||
)}
|
||||
<Link className="text-sky-700 p-6" href={sites.article.url}>
|
||||
Zurück zu den Artikeln
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,27 +1,26 @@
|
||||
import { manufacturerFindAll } from "../../../../actions/manufacturer.actions";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
import { ArticleMainForm } from "../../../../components/article/articleMain.form";
|
||||
import { articleCreate, articleFindAll } from "../../../../actions/article.actions";
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../../../apps/frontend/_config/sites";
|
||||
//import { sites } from "@/";
|
||||
import { manufacturerFindAll } from '../../../../actions/manufacturer.actions';
|
||||
import { categoryFindAll } from '../../../../actions/category.actions';
|
||||
import { articleGroupsFindAll } from '../../../../actions/article.actions';
|
||||
import { ArticleMainForm } from '../../../../components/article/articleMain.form';
|
||||
import Link from 'next/link';
|
||||
import { sites } from '../../../../_config/sites';
|
||||
|
||||
|
||||
interface Props {
|
||||
|
||||
}
|
||||
|
||||
export default async function ArticlePage({ }: Props) {
|
||||
|
||||
const cats = await categoryFindAll();
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
const artikel = await articleFindAll();
|
||||
|
||||
if(!manufacturer) return <div>Keine Hersteller gefunden</div>
|
||||
|
||||
return <>
|
||||
<ArticleMainForm categories={cats} manufacturer={manufacturer}></ArticleMainForm>
|
||||
<Link href={`${sites.article.url}`} className="text-sky-300">zurück</Link>
|
||||
|
||||
export default async function ArticleNewPage() {
|
||||
const [categories, manufacturer, groups] = await Promise.all([
|
||||
categoryFindAll(),
|
||||
manufacturerFindAll(),
|
||||
articleGroupsFindAll(),
|
||||
]);
|
||||
return (
|
||||
<>
|
||||
<ArticleMainForm
|
||||
categories={categories}
|
||||
manufacturer={manufacturer}
|
||||
groups={groups}
|
||||
/>
|
||||
<Link className="text-sky-700 p-6" href={sites.article.url}>
|
||||
Zurück zu den Artikeln
|
||||
</Link>
|
||||
</>
|
||||
}
|
||||
);
|
||||
}
|
||||
@@ -1,26 +1,33 @@
|
||||
import { manufacturerFindAll } from "../../../actions/manufacturer.actions";
|
||||
import { articleFindAll } from "../../../actions/article.actions";
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../../apps/frontend/_config/sites";
|
||||
import { ArticleList } from "../../../components/article/articleList";
|
||||
import { Icon, CirclePlus } from "lucide-react";
|
||||
import {
|
||||
articleFindAll,
|
||||
articleMigrationStatus,
|
||||
} from '../../../actions/article.actions';
|
||||
import Link from 'next/link';
|
||||
import { sites } from '../../../_config/sites';
|
||||
import { ArticleList } from '../../../components/article/articleList';
|
||||
|
||||
interface Props { }
|
||||
|
||||
export default async function ArticlePage({ }: Props) {
|
||||
|
||||
|
||||
const manufacturer = await manufacturerFindAll();
|
||||
const artikel = await articleFindAll();
|
||||
|
||||
if (!manufacturer) return <div>Keine Hersteller gefunden</div>
|
||||
|
||||
return <div className="p-4 mb-4">
|
||||
<div className="">
|
||||
<Link href={`${sites.article.new.url}`} className="text-sky-300 text-black"><CirclePlus color="green" />neu </Link>
|
||||
</div>
|
||||
<ArticleList articles={artikel}></ArticleList>
|
||||
<Link href={`${sites.main.url}`} className="text-sky-300">zurück</Link>
|
||||
</div>
|
||||
|
||||
}
|
||||
export default async function ArticlePage() {
|
||||
const [articles, migration] = await Promise.all([
|
||||
articleFindAll(),
|
||||
articleMigrationStatus(),
|
||||
]);
|
||||
return (
|
||||
<main className="p-6">
|
||||
<h1 className="text-xl mb-4">Artikel</h1>
|
||||
<Link className="text-sky-700" href={sites.article.new.url}>
|
||||
Artikel anlegen
|
||||
</Link>
|
||||
{migration.pendingLegacyArticles > 0 && (
|
||||
<p role="status" className="border rounded p-3 my-3">
|
||||
Es gibt noch {migration.pendingLegacyArticles} bisherige Artikel, die
|
||||
vor ihrer Nutzung in die neue Artikelstruktur übernommen werden
|
||||
müssen.
|
||||
</p>
|
||||
)}
|
||||
<ArticleList articles={articles} />
|
||||
<Link className="text-sky-700" href={sites.main.url}>
|
||||
Zurück
|
||||
</Link>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
@@ -1,27 +1,31 @@
|
||||
import Link from "next/link";
|
||||
import { sites } from "../../../../_config/sites";
|
||||
import { LocationForm } from "../../../../components/location/location.form";
|
||||
import { articleFindAll } from "../../../../actions/article.actions";
|
||||
import { locationFindAll, locationTree } from "../../../../actions/location.actions";
|
||||
import { StockForm } from "../../../../components/stock/stock.form";
|
||||
import { categoryFindAll } from "../../../../actions/category.actions";
|
||||
import Link from 'next/link';
|
||||
import { sites } from '../../../../_config/sites';
|
||||
import { articleFindAll } from '../../../../actions/article.actions';
|
||||
import { locationTree } from '../../../../actions/location.actions';
|
||||
import {
|
||||
stockContentFindAll,
|
||||
stockFindAll,
|
||||
} from '../../../../actions/stock.actions';
|
||||
import { StockForm } from '../../../../components/stock/stock.form';
|
||||
|
||||
|
||||
|
||||
export default async function StockMovmentNewPage() {
|
||||
|
||||
const artikel = await articleFindAll();
|
||||
const orte = await locationTree();
|
||||
const kategorien = await categoryFindAll();
|
||||
|
||||
return (
|
||||
<div className="h-screen flex flex-col gap-4">
|
||||
<div>
|
||||
{sites.location.new.name}
|
||||
<StockForm article={artikel} orte={orte} categories={kategorien}></StockForm>
|
||||
</div>
|
||||
|
||||
<Link href={sites.location.url}>zurück zu {sites.location.name}</Link>
|
||||
</div>
|
||||
);
|
||||
export default async function StockMovementPage() {
|
||||
const [article, orte, stocks, contents] = await Promise.all([
|
||||
articleFindAll(),
|
||||
locationTree(),
|
||||
stockFindAll(),
|
||||
stockContentFindAll(),
|
||||
]);
|
||||
return (
|
||||
<main>
|
||||
<StockForm
|
||||
article={article}
|
||||
orte={orte}
|
||||
stocks={stocks}
|
||||
contents={contents}
|
||||
/>
|
||||
<Link className="text-sky-700 p-6" href={sites.main.url}>
|
||||
Zurück
|
||||
</Link>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user