feat(dm): buttons to the nav bar if customs are made
This commit is contained in:
@@ -1,78 +1,23 @@
|
|||||||
import {
|
|
||||||
DropdownMenu,
|
|
||||||
DropdownMenuContent,
|
|
||||||
DropdownMenuItem,
|
|
||||||
DropdownMenuLabel,
|
|
||||||
DropdownMenuSeparator,
|
|
||||||
DropdownMenuTrigger,
|
|
||||||
} from "@/components/ui/dropdown-menu";
|
|
||||||
import OrderImport from "./OrderImport";
|
import OrderImport from "./OrderImport";
|
||||||
import StandardOrderTemplate from "./StandardOrderTemplate";
|
|
||||||
import { Button } from "@/components/ui/button";
|
|
||||||
import StandardForecastTemplate from "./StandardForecastTemplate";
|
|
||||||
import ForecastImport from "./ForecastImport";
|
|
||||||
import { useSettingStore } from "@/lib/store/useSettings";
|
import { useSettingStore } from "@/lib/store/useSettings";
|
||||||
|
|
||||||
export default function DMButtons() {
|
export default function DMButtons() {
|
||||||
const { settings } = useSettingStore();
|
const { settings } = useSettingStore();
|
||||||
|
|
||||||
const plantToken = settings.filter((n) => n.name === "plantToken");
|
const plantToken = settings.filter((n) => n.name === "plantToken");
|
||||||
console.log(plantToken);
|
//console.log(plantToken);
|
||||||
return (
|
return (
|
||||||
<div className="flex flex-row-reverse">
|
<div className="flex flex-row-reverse gap-1">
|
||||||
<div className="m-2">
|
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button>Standard DM</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuLabel>
|
|
||||||
Standard templates and imports
|
|
||||||
</DropdownMenuLabel>
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
<DropdownMenuItem>
|
|
||||||
<StandardOrderTemplate />
|
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>
|
|
||||||
<OrderImport
|
|
||||||
fileType={"standard"}
|
|
||||||
name={"Standard Order Import"}
|
|
||||||
/>
|
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
<DropdownMenuItem>
|
|
||||||
<StandardForecastTemplate />
|
|
||||||
</DropdownMenuItem>
|
|
||||||
<DropdownMenuItem>
|
|
||||||
<ForecastImport
|
|
||||||
fileType={"standard"}
|
|
||||||
name={"Standard Forecast Import"}
|
|
||||||
/>
|
|
||||||
</DropdownMenuItem>
|
|
||||||
</DropdownMenuContent>
|
|
||||||
</DropdownMenu>
|
|
||||||
</div>
|
|
||||||
{plantToken[0]?.value === "usday1" && (
|
{plantToken[0]?.value === "usday1" && (
|
||||||
<div className="m-2">
|
<div className="flex flex-row gap-2">
|
||||||
<DropdownMenu>
|
|
||||||
<DropdownMenuTrigger asChild>
|
|
||||||
<Button>Dayton Customs</Button>
|
|
||||||
</DropdownMenuTrigger>
|
|
||||||
<DropdownMenuContent>
|
|
||||||
<DropdownMenuLabel>
|
|
||||||
Custom import templates
|
|
||||||
</DropdownMenuLabel>
|
|
||||||
<DropdownMenuSeparator />
|
|
||||||
|
|
||||||
<DropdownMenuItem>
|
|
||||||
<OrderImport
|
<OrderImport
|
||||||
fileType={"abbott"}
|
fileType={"abbott"}
|
||||||
name={"Abbott truck list"}
|
name={"Abbott truck list"}
|
||||||
/>
|
/>
|
||||||
</DropdownMenuItem>
|
<OrderImport
|
||||||
<DropdownMenuSeparator />
|
fileType={"energizer"}
|
||||||
</DropdownMenuContent>
|
name={"Energizer Truck List"}
|
||||||
</DropdownMenu>
|
/>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
import { LstCard } from "@/components/extendedUI/LstCard";
|
import { LstCard } from "@/components/extendedUI/LstCard";
|
||||||
import { Separator } from "@/components/ui/separator";
|
import { Separator } from "@/components/ui/separator";
|
||||||
|
import OrderImport from "./OrderImport";
|
||||||
|
import StandardOrderTemplate from "./StandardOrderTemplate";
|
||||||
|
import ForecastImport from "./ForecastImport";
|
||||||
|
import StandardForecastTemplate from "./StandardForecastTemplate";
|
||||||
|
|
||||||
export default function DmPage() {
|
export default function DmPage() {
|
||||||
return (
|
return (
|
||||||
@@ -9,6 +13,13 @@ export default function DmPage() {
|
|||||||
<h4 className="text-center underline text-2xl">
|
<h4 className="text-center underline text-2xl">
|
||||||
Simple instructions for creating/updating orders
|
Simple instructions for creating/updating orders
|
||||||
</h4>
|
</h4>
|
||||||
|
<div className="flex flex-row gap-3 m-1">
|
||||||
|
<OrderImport
|
||||||
|
fileType={"standard"}
|
||||||
|
name={"Standard Order Import"}
|
||||||
|
/>
|
||||||
|
<StandardOrderTemplate />
|
||||||
|
</div>
|
||||||
<Separator />
|
<Separator />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -36,6 +47,7 @@ export default function DmPage() {
|
|||||||
<h4 className="text-center underline text-2xl">
|
<h4 className="text-center underline text-2xl">
|
||||||
Some notes to consider
|
Some notes to consider
|
||||||
</h4>
|
</h4>
|
||||||
|
|
||||||
<ul className="list-disc mr-2">
|
<ul className="list-disc mr-2">
|
||||||
<li>
|
<li>
|
||||||
No longer need to add in the invoice id, we take the
|
No longer need to add in the invoice id, we take the
|
||||||
@@ -80,8 +92,15 @@ export default function DmPage() {
|
|||||||
<h4 className="text-center underline text-2xl">
|
<h4 className="text-center underline text-2xl">
|
||||||
Simple instructions for creating forecast
|
Simple instructions for creating forecast
|
||||||
</h4>
|
</h4>
|
||||||
|
<div className="flex flex-row gap-3 m-1">
|
||||||
|
<ForecastImport
|
||||||
|
fileType={"standard"}
|
||||||
|
name={"Standard Forecast Import"}
|
||||||
|
/>
|
||||||
|
<StandardForecastTemplate />
|
||||||
<Separator className="my-4" />
|
<Separator className="my-4" />
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div className="m-5">
|
<div className="m-5">
|
||||||
<ul className="list-disc mr-2">
|
<ul className="list-disc mr-2">
|
||||||
<li>
|
<li>
|
||||||
|
|||||||
Reference in New Issue
Block a user