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