From df66fb23abfffaf98856cfc1a8f0502b5a5b2ba5 Mon Sep 17 00:00:00 2001 From: sabaimran Date: Sun, 8 Dec 2024 17:57:27 -0800 Subject: [PATCH] Centralize definition of the content security policy and add in-app chat - in-app chat is meant for support requests and currently is only in the settings page, where users are most likely to go if confused IMO --- src/interface/web/app/agents/layout.tsx | 14 ++------ src/interface/web/app/automations/layout.tsx | 12 ++++--- src/interface/web/app/chat/layout.tsx | 14 ++------ src/interface/web/app/common/layoutHelper.tsx | 16 +++++++++ .../components/chatWoot/ChatwootWidget.tsx | 35 +++++++++++++++++++ src/interface/web/app/layout.tsx | 14 ++------ src/interface/web/app/search/layout.tsx | 8 ++++- src/interface/web/app/settings/layout.tsx | 15 +++----- src/interface/web/app/share/chat/layout.tsx | 13 ++----- 9 files changed, 78 insertions(+), 63 deletions(-) create mode 100644 src/interface/web/app/common/layoutHelper.tsx create mode 100644 src/interface/web/app/components/chatWoot/ChatwootWidget.tsx diff --git a/src/interface/web/app/agents/layout.tsx b/src/interface/web/app/agents/layout.tsx index c7779b06..5749ef4c 100644 --- a/src/interface/web/app/agents/layout.tsx +++ b/src/interface/web/app/agents/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import { noto_sans, noto_sans_arabic } from "@/app/fonts"; import "../globals.css"; +import { ContentSecurityPolicy } from "../common/layoutHelper"; export const metadata: Metadata = { title: "Khoj AI - Agents", @@ -32,18 +33,7 @@ export default function RootLayout({ }>) { return ( - + {children} ); diff --git a/src/interface/web/app/automations/layout.tsx b/src/interface/web/app/automations/layout.tsx index 05686bef..aca8ec50 100644 --- a/src/interface/web/app/automations/layout.tsx +++ b/src/interface/web/app/automations/layout.tsx @@ -2,6 +2,7 @@ import type { Metadata } from "next"; import { Toaster } from "@/components/ui/toaster"; import "../globals.css"; +import { ContentSecurityPolicy } from "../common/layoutHelper"; export const metadata: Metadata = { title: "Khoj AI - Automations", @@ -32,9 +33,12 @@ export default function RootLayout({ children: React.ReactNode; }>) { return ( -
- {children} - -
+ + + + {children} + + + ); } diff --git a/src/interface/web/app/chat/layout.tsx b/src/interface/web/app/chat/layout.tsx index 4e4661f1..83778d80 100644 --- a/src/interface/web/app/chat/layout.tsx +++ b/src/interface/web/app/chat/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import { noto_sans, noto_sans_arabic } from "@/app/fonts"; import "../globals.css"; +import { ContentSecurityPolicy } from "../common/layoutHelper"; export const metadata: Metadata = { title: "Khoj AI - Chat", @@ -33,18 +34,7 @@ export default function RootLayout({ }>) { return ( - + {children}