lots of changes with docker
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
All checks were successful
Build and Push LST Docker Image / docker (push) Successful in 2m57s
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import {
|
||||
Card,
|
||||
CardContent,
|
||||
CardDescription,
|
||||
CardHeader,
|
||||
CardTitle,
|
||||
} from "../../../components/ui/card";
|
||||
import { useAppForm } from "../../../lib/formSutff";
|
||||
import { notificationSubs } from "../../../lib/queries/notificationSubs";
|
||||
import { notifications } from "../../../lib/queries/notifications";
|
||||
|
||||
export default function NotificationsSubCard({ user }: any) {
|
||||
const { data } = useSuspenseQuery(notifications());
|
||||
const { data: ns } = useSuspenseQuery(notificationSubs(user.id));
|
||||
const form = useAppForm({
|
||||
defaultValues: {
|
||||
notificationId: "",
|
||||
emails: [user.email],
|
||||
},
|
||||
onSubmit: async ({ value }) => {
|
||||
const postD = { ...value, userId: user.id };
|
||||
console.log(postD);
|
||||
},
|
||||
});
|
||||
|
||||
let n: any = [];
|
||||
if (data) {
|
||||
n = data.map((i: any) => ({
|
||||
label: i.name,
|
||||
value: i.id,
|
||||
}));
|
||||
}
|
||||
|
||||
console.log(ns);
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Card className="p-3 w-128">
|
||||
<CardHeader>
|
||||
<CardTitle>Notifications</CardTitle>
|
||||
<CardDescription>
|
||||
All currently active notifications you can subscribe to. selecting a
|
||||
notification will give you a brief description on how it works
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<form
|
||||
onSubmit={(e) => {
|
||||
e.preventDefault();
|
||||
form.handleSubmit();
|
||||
}}
|
||||
>
|
||||
<div>
|
||||
<form.AppField name="notificationId">
|
||||
{(field) => (
|
||||
<field.SelectField
|
||||
label="Notifications"
|
||||
placeholder="Select Notification"
|
||||
options={n}
|
||||
/>
|
||||
)}
|
||||
</form.AppField>
|
||||
</div>
|
||||
|
||||
<form.AppField name="emails" mode="array">
|
||||
{(field) => (
|
||||
<field.DynamicInputField
|
||||
label="Notification Emails"
|
||||
description="Add more email addresses for notification delivery."
|
||||
inputType="email"
|
||||
addLabel="Add Email"
|
||||
//initialValue={session?.user.email}
|
||||
/>
|
||||
)}
|
||||
</form.AppField>
|
||||
<div className="flex justify-end mt-6">
|
||||
<form.AppForm>
|
||||
<form.SubmitButton>Subscribe</form.SubmitButton>
|
||||
</form.AppForm>
|
||||
</div>
|
||||
</form>
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
import { createFileRoute, redirect } from "@tanstack/react-router";
|
||||
import { Suspense } from "react";
|
||||
import { toast } from "sonner";
|
||||
import {
|
||||
Card,
|
||||
@@ -9,7 +10,9 @@ import {
|
||||
} from "@/components/ui/card";
|
||||
import { authClient, useSession } from "@/lib/auth-client";
|
||||
import { useAppForm } from "@/lib/formSutff";
|
||||
import { Spinner } from "../../components/ui/spinner";
|
||||
import ChangePassword from "./-components/ChangePassword";
|
||||
import NotificationsSubCard from "./-components/NotificationsSubCard";
|
||||
|
||||
export const Route = createFileRoute("/(auth)/user/profile")({
|
||||
beforeLoad: async () => {
|
||||
@@ -93,6 +96,26 @@ function RouteComponent() {
|
||||
<div>
|
||||
<ChangePassword />
|
||||
</div>
|
||||
<div>
|
||||
<Suspense
|
||||
fallback={
|
||||
<Card className="p-3 w-96">
|
||||
<CardHeader>
|
||||
<CardTitle>Notifications</CardTitle>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="flex justify-center m-auto">
|
||||
<div>
|
||||
<Spinner className="size-32" />
|
||||
</div>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
}
|
||||
>
|
||||
{session && <NotificationsSubCard user={session.user} />}
|
||||
</Suspense>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { TanStackRouterDevtools } from "@tanstack/react-router-devtools";
|
||||
import { Toaster } from "sonner";
|
||||
import Header from "@/components/Header";
|
||||
import { AppSidebar } from "@/components/Sidebar/sidebar";
|
||||
import { SidebarInset, SidebarProvider } from "@/components/ui/sidebar";
|
||||
import { SidebarProvider } from "@/components/ui/sidebar";
|
||||
import { ThemeProvider } from "@/lib/theme-provider";
|
||||
|
||||
const RootLayout = () => (
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { useSuspenseQuery } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
import React from "react";
|
||||
import { toast } from "sonner";
|
||||
import { Card, CardDescription, CardHeader } from "../../../components/ui/card";
|
||||
import { useAppForm } from "../../../lib/formSutff";
|
||||
@@ -33,7 +32,9 @@ export default function FeatureCard({ item }: { item: Setting }) {
|
||||
const { data } = await axios.patch(`/lst/api/settings/${item.name}`, {
|
||||
value: value.value,
|
||||
active: value.active ? "true" : "false",
|
||||
});
|
||||
}, {
|
||||
withCredentials: true,
|
||||
});
|
||||
|
||||
refetch();
|
||||
toast.success(
|
||||
|
||||
@@ -34,7 +34,7 @@ function Index() {
|
||||
<p>
|
||||
This is active in your plant today due to having warehousing activated
|
||||
and new functions needed to be introduced, you should be still using LST
|
||||
as you were before
|
||||
as you were before.
|
||||
</p>
|
||||
<br></br>
|
||||
<p>
|
||||
@@ -50,7 +50,7 @@ function Index() {
|
||||
rel="noopener"
|
||||
>
|
||||
<b>
|
||||
<strong> Here</strong>
|
||||
<strong> Here.</strong>
|
||||
</b>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user