mirror of
https://github.com/eliasstepanik/core.git
synced 2026-01-11 09:08:28 +00:00
Fix: text is not removed from ingest box after API call
This commit is contained in:
parent
26661cfd86
commit
f2608caa82
@ -31,6 +31,8 @@ export const Ingest = () => {
|
||||
},
|
||||
{ method: "POST", action: "/home/dashboard" },
|
||||
);
|
||||
|
||||
setText("");
|
||||
};
|
||||
|
||||
const isLoading = fetcher.state === "submitting";
|
||||
|
||||
@ -45,6 +45,8 @@ const EnvironmentSchema = z.object({
|
||||
AUTH_GOOGLE_CLIENT_ID: z.string().optional(),
|
||||
AUTH_GOOGLE_CLIENT_SECRET: z.string().optional(),
|
||||
|
||||
ENABLE_EMAIL_LOGIN: z.coerce.boolean().default(false),
|
||||
|
||||
//Redis
|
||||
REDIS_HOST: z.string().default("localhost"),
|
||||
REDIS_PORT: z.coerce.number().default(6379),
|
||||
|
||||
@ -35,7 +35,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
{
|
||||
redirectTo,
|
||||
showGoogleAuth: isGoogleAuthSupported,
|
||||
isDevelopment: env.NODE_ENV === "development",
|
||||
emailLoginEnabled: env.ENABLE_EMAIL_LOGIN,
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
@ -47,7 +47,7 @@ export async function loader({ request }: LoaderFunctionArgs) {
|
||||
return typedjson({
|
||||
redirectTo: null,
|
||||
showGoogleAuth: isGoogleAuthSupported,
|
||||
isDevelopment: env.NODE_ENV === "development",
|
||||
emailLoginEnabled: env.ENABLE_EMAIL_LOGIN,
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -80,7 +80,7 @@ export default function LoginPage() {
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{data.isDevelopment && (
|
||||
{data.emailLoginEnabled && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="lg"
|
||||
|
||||
@ -46,8 +46,8 @@ export const meta: MetaFunction = ({ matches }) => {
|
||||
};
|
||||
|
||||
export async function loader({ request }: LoaderFunctionArgs): Promise<any> {
|
||||
if (env.NODE_ENV !== "development") {
|
||||
return typedjson({ isDevelopment: false });
|
||||
if (!env.ENABLE_EMAIL_LOGIN) {
|
||||
return typedjson({ emailLoginEnabled: false });
|
||||
}
|
||||
|
||||
const userId = await getUserId(request);
|
||||
@ -67,7 +67,7 @@ export async function loader({ request }: LoaderFunctionArgs): Promise<any> {
|
||||
|
||||
return typedjson(
|
||||
{
|
||||
isDevelopment: true,
|
||||
emailLoginEnabled: true,
|
||||
magicLinkSent: session.has("core:magiclink"),
|
||||
magicLinkError,
|
||||
},
|
||||
@ -78,8 +78,8 @@ export async function loader({ request }: LoaderFunctionArgs): Promise<any> {
|
||||
}
|
||||
|
||||
export async function action({ request }: ActionFunctionArgs) {
|
||||
if (env.NODE_ENV !== "development") {
|
||||
throw new Error("Magic link login is only available in development mode");
|
||||
if (!env.ENABLE_EMAIL_LOGIN) {
|
||||
throw new Error("Magic link login is not enabled");
|
||||
}
|
||||
|
||||
const clonedRequest = request.clone();
|
||||
@ -110,11 +110,11 @@ export default function LoginMagicLinkPage() {
|
||||
const data = useTypedLoaderData<typeof loader>();
|
||||
const navigate = useNavigation();
|
||||
|
||||
if (!data.isDevelopment) {
|
||||
if (!data.emailLoginEnabled) {
|
||||
return (
|
||||
<LoginPageLayout>
|
||||
<Paragraph className="text-center">
|
||||
Magic link login is only available in development mode.
|
||||
Magic link login is not enabled.
|
||||
</Paragraph>
|
||||
</LoginPageLayout>
|
||||
);
|
||||
|
||||
@ -23,7 +23,7 @@ if (env.AUTH_GOOGLE_CLIENT_ID && env.AUTH_GOOGLE_CLIENT_SECRET) {
|
||||
);
|
||||
}
|
||||
|
||||
if (env.NODE_ENV === "development") {
|
||||
if (env.ENABLE_EMAIL_LOGIN) {
|
||||
addEmailLinkStrategy(authenticator);
|
||||
}
|
||||
|
||||
|
||||
@ -3,8 +3,8 @@ version: "3.8"
|
||||
services:
|
||||
core:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
context: ../
|
||||
dockerfile: ./docker/Dockerfile
|
||||
environment:
|
||||
- NODE_ENV=${NODE_ENV}
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
@ -21,28 +21,37 @@ services:
|
||||
- NEO4J_USERNAME=${NEO4J_USERNAME}
|
||||
- NEO4J_PASSWORD=${NEO4J_PASSWORD}
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- AUTH_GOOGLE_CLIENT_ID=${AUTH_GOOGLE_CLIENT_ID}
|
||||
- AUTH_GOOGLE_CLIENT_SECRET=${AUTH_GOOGLE_CLIENT_SECRET}
|
||||
- ENABLE_EMAIL_LOGIN=${ENABLE_EMAIL_LOGIN}
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
- postgres
|
||||
- redis
|
||||
- neo4j
|
||||
networks:
|
||||
- core
|
||||
|
||||
postgres:
|
||||
image: postgres:15
|
||||
environment:
|
||||
- POSTGRES_USER=${POSTGRES_USER}
|
||||
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
- POSTGRES_DB=${POSTGRES_DB}
|
||||
ports:
|
||||
- "5432:5432"
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
# postgres:
|
||||
# image: postgres:15
|
||||
# environment:
|
||||
# - POSTGRES_USER=${POSTGRES_USER}
|
||||
# - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
|
||||
# - POSTGRES_DB=${POSTGRES_DB}
|
||||
# ports:
|
||||
# - "5432:5432"
|
||||
# volumes:
|
||||
# - postgres_data:/var/lib/postgresql/data
|
||||
# networks:
|
||||
# - core
|
||||
|
||||
redis:
|
||||
image: redis:7
|
||||
ports:
|
||||
- "6379:6379"
|
||||
# redis:
|
||||
# image: redis:7
|
||||
# ports:
|
||||
# - "6379:6379"
|
||||
# networks:
|
||||
# - core
|
||||
|
||||
neo4j:
|
||||
image: neo4j:5
|
||||
@ -53,6 +62,12 @@ services:
|
||||
- "7687:7687"
|
||||
volumes:
|
||||
- neo4j_data:/data
|
||||
networks:
|
||||
- core
|
||||
|
||||
networks:
|
||||
core:
|
||||
driver: bridge
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
|
||||
@ -10,9 +10,7 @@ pnpm --filter @core/database db:migrate:deploy
|
||||
|
||||
# Copy over required prisma files
|
||||
mkdir -p apps/webapp/prisma/
|
||||
mkdir -p apps/webapp/.prisma/
|
||||
cp packages/database/prisma/schema.prisma apps/webapp/prisma/
|
||||
cp -r packages/database/node_modules/@prisma/* apps/webapp/.prisma/
|
||||
# cp node_modules/@prisma/engines/*.node apps/webapp/prisma/
|
||||
|
||||
cd /core/apps/webapp
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user