Import updates
This commit is contained in:
parent
73fdb6e5d1
commit
53514d68cb
40 changed files with 85 additions and 90 deletions
|
|
@ -6,10 +6,10 @@ import Image from "next/legacy/image";
|
||||||
import { Box, Grid, Container, IconButton } from "@mui/material";
|
import { Box, Grid, Container, IconButton } from "@mui/material";
|
||||||
import { Apple as AppleIcon, Google as GoogleIcon } from "@mui/icons-material";
|
import { Apple as AppleIcon, Google as GoogleIcon } from "@mui/icons-material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { LanguageSelect } from "@/app/_components/LanguageSelect";
|
import { LanguageSelect } from "app/_components/LanguageSelect";
|
||||||
import LeafcutterLogoLarge from "images/leafcutter-logo-large.png";
|
import LeafcutterLogoLarge from "images/leafcutter-logo-large.png";
|
||||||
import { signIn } from "next-auth/react";
|
import { signIn } from "next-auth/react";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
|
|
||||||
type LoginProps = {
|
type LoginProps = {
|
||||||
session: any;
|
session: any;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,8 @@ import { useTranslate } from "react-polyglot";
|
||||||
import Image from "next/legacy/image";
|
import Image from "next/legacy/image";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Grid, Container, Box, Button } from "@mui/material";
|
import { Grid, Container, Box, Button } from "@mui/material";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import { PageHeader } from "@/app/_components/PageHeader";
|
import { PageHeader } from "app/_components/PageHeader";
|
||||||
import { AboutFeature } from "./AboutFeature";
|
import { AboutFeature } from "./AboutFeature";
|
||||||
import { AboutBox } from "./AboutBox";
|
import { AboutBox } from "./AboutBox";
|
||||||
import AbstractDiagram from "images/abstract-diagram.png";
|
import AbstractDiagram from "images/abstract-diagram.png";
|
||||||
|
|
@ -161,4 +161,3 @@ export const About: FC = () => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import { useTranslate } from "react-polyglot";
|
||||||
import { useRouter, usePathname } from "next/navigation";
|
import { useRouter, usePathname } from "next/navigation";
|
||||||
import { Box, Grid } from "@mui/material";
|
import { Box, Grid } from "@mui/material";
|
||||||
import { useCookies } from "react-cookie";
|
import { useCookies } from "react-cookie";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import { PageHeader } from "@/app/_components/PageHeader";
|
import { PageHeader } from "app/_components/PageHeader";
|
||||||
import { VisualizationBuilder } from "@/app/_components/VisualizationBuilder";
|
import { VisualizationBuilder } from "app/_components/VisualizationBuilder";
|
||||||
|
|
||||||
type CreateProps = {
|
type CreateProps = {
|
||||||
templates: any;
|
templates: any;
|
||||||
|
|
@ -62,4 +62,3 @@ export const Create: FC<CreateProps> = ({ templates }) => {
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,8 @@
|
||||||
import { getTemplates } from "@/app/_lib/opensearch";
|
import { getTemplates } from "app/_lib/opensearch";
|
||||||
import { Create } from "./_components/Create";
|
import { Create } from "./_components/Create";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const templates = await getTemplates(100);
|
const templates = await getTemplates(100);
|
||||||
|
|
||||||
return <Create templates={templates} />;
|
return <Create templates={templates} />;
|
||||||
};
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,9 @@
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { Box, Grid } from "@mui/material";
|
import { Box, Grid } from "@mui/material";
|
||||||
import { PageHeader } from "@/app/_components/PageHeader";
|
import { PageHeader } from "app/_components/PageHeader";
|
||||||
import { Question } from "@/app/_components/Question";
|
import { Question } from "app/_components/Question";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import FaqHeader from "images/faq-header.svg";
|
import FaqHeader from "images/faq-header.svg";
|
||||||
|
|
||||||
export const FAQ: FC = () => {
|
export const FAQ: FC = () => {
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
/* eslint-disable no-underscore-dangle */
|
/* eslint-disable no-underscore-dangle */
|
||||||
import { RawDataViewer } from "@/app/_components/RawDataViewer";
|
import { RawDataViewer } from "app/_components/RawDataViewer";
|
||||||
import { VisualizationDetail } from "@/app/_components/VisualizationDetail";
|
import { VisualizationDetail } from "app/_components/VisualizationDetail";
|
||||||
|
|
||||||
interface PreviewProps {
|
interface PreviewProps {
|
||||||
visualization: any;
|
visualization: any;
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,9 @@ import { useLayoutEffect } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
import { Grid, CircularProgress } from "@mui/material";
|
import { Grid, CircularProgress } from "@mui/material";
|
||||||
import Iframe from "react-iframe";
|
import Iframe from "react-iframe";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
|
|
||||||
export const Setup:FC = () => {
|
export const Setup: FC = () => {
|
||||||
const {
|
const {
|
||||||
colors: { leafcutterElectricBlue },
|
colors: { leafcutterElectricBlue },
|
||||||
} = useAppContext();
|
} = useAppContext();
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, } from "react";
|
import { FC } from "react";
|
||||||
import { Grid, Box } from "@mui/material";
|
import { Grid, Box } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { PageHeader } from "@/app/_components/PageHeader";
|
import { PageHeader } from "app/_components/PageHeader";
|
||||||
import { VisualizationCard } from "@/app/_components/VisualizationCard";
|
import { VisualizationCard } from "app/_components/VisualizationCard";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
|
|
||||||
type TrendsProps = {
|
type TrendsProps = {
|
||||||
visualizations: any;
|
visualizations: any;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { getTrends } from "@/app/_lib/opensearch";
|
import { getTrends } from "app/_lib/opensearch";
|
||||||
import { Trends } from "./_components/Trends";
|
import { Trends } from "./_components/Trends";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
/* eslint-disable no-underscore-dangle */
|
/* eslint-disable no-underscore-dangle */
|
||||||
import { Client } from "@opensearch-project/opensearch";
|
import { Client } from "@opensearch-project/opensearch";
|
||||||
import { VisualizationDetail } from "@/app/_components/VisualizationDetail";
|
import { VisualizationDetail } from "app/_components/VisualizationDetail";
|
||||||
|
|
||||||
const getVisualization = async (visualizationID: string) => {
|
const getVisualization = async (visualizationID: string) => {
|
||||||
const node = `https://${process.env.OPENSEARCH_USERNAME}:${process.env.OPENSEARCH_PASSWORD}@${process.env.OPENSEARCH_URL}`;
|
const node = `https://${process.env.OPENSEARCH_USERNAME}:${process.env.OPENSEARCH_PASSWORD}@${process.env.OPENSEARCH_URL}`;
|
||||||
|
|
@ -31,18 +31,16 @@ const getVisualization = async (visualizationID: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
return visualization;
|
return visualization;
|
||||||
}
|
};
|
||||||
|
|
||||||
type PageProps = {
|
type PageProps = {
|
||||||
params: {
|
params: {
|
||||||
visualizationID: string;
|
visualizationID: string;
|
||||||
};
|
};
|
||||||
}
|
};
|
||||||
|
|
||||||
export default async function Page({ params: { visualizationID } }: PageProps) {
|
export default async function Page({ params: { visualizationID } }: PageProps) {
|
||||||
const visualization = await getVisualization(visualizationID);
|
const visualization = await getVisualization(visualizationID);
|
||||||
|
|
||||||
return <VisualizationDetail {...visualization} editing={false}/>;
|
return <VisualizationDetail {...visualization} editing={false} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
useState,
|
useState,
|
||||||
PropsWithChildren,
|
PropsWithChildren,
|
||||||
} from "react";
|
} from "react";
|
||||||
import { colors, typography } from "@/app/_styles/theme";
|
import { colors, typography } from "app/_styles/theme";
|
||||||
|
|
||||||
const basePath = process.env.GITLAB_CI
|
const basePath = process.env.GITLAB_CI
|
||||||
? "/link/link-stack/apps/leafcutter"
|
? "/link/link-stack/apps/leafcutter"
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,10 @@ import ReactMarkdown from "react-markdown";
|
||||||
import { Grid, Button } from "@mui/material";
|
import { Grid, Button } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useCookies } from "react-cookie";
|
import { useCookies } from "react-cookie";
|
||||||
import { Welcome } from "@/app/_components/Welcome";
|
import { Welcome } from "app/_components/Welcome";
|
||||||
import { WelcomeDialog } from "@/app/_components/WelcomeDialog";
|
import { WelcomeDialog } from "app/_components/WelcomeDialog";
|
||||||
import { VisualizationCard } from "@/app/_components/VisualizationCard";
|
import { VisualizationCard } from "app/_components/VisualizationCard";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
|
|
||||||
type HomeProps = {
|
type HomeProps = {
|
||||||
visualizations: any;
|
visualizations: any;
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { CookiesProvider } from "react-cookie";
|
||||||
import { I18n } from "react-polyglot";
|
import { I18n } from "react-polyglot";
|
||||||
import { AdapterDateFns } from "@mui/x-date-pickers-pro/AdapterDateFns";
|
import { AdapterDateFns } from "@mui/x-date-pickers-pro/AdapterDateFns";
|
||||||
import { LocalizationProvider } from "@mui/x-date-pickers-pro";
|
import { LocalizationProvider } from "@mui/x-date-pickers-pro";
|
||||||
import { AppProvider } from "@/app/_components/AppProvider";
|
import { AppProvider } from "app/_components/AppProvider";
|
||||||
import { NextAppDirEmotionCacheProvider } from "tss-react/next/appDir";
|
import { NextAppDirEmotionCacheProvider } from "tss-react/next/appDir";
|
||||||
import en from "app/_locales/en.json";
|
import en from "app/_locales/en.json";
|
||||||
import fr from "app/_locales/fr.json";
|
import fr from "app/_locales/fr.json";
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC, useState, useEffect } from "react";
|
||||||
import { Box, Grid } from "@mui/material";
|
import { Box, Grid } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import taxonomy from "app/_config/taxonomy.json";
|
import taxonomy from "app/_config/taxonomy.json";
|
||||||
import { colors } from "@/app/_styles/theme";
|
import { colors } from "app/_styles/theme";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const QueryText: FC = () => {
|
export const QueryText: FC = () => {
|
||||||
|
|
|
||||||
|
|
@ -20,8 +20,8 @@ import {
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { usePathname } from "next/navigation";
|
import { usePathname } from "next/navigation";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import { Tooltip } from "@/app/_components/Tooltip";
|
import { Tooltip } from "app/_components/Tooltip";
|
||||||
// import { ArrowCircleRight as ArrowCircleRightIcon } from "@mui/icons-material";
|
// import { ArrowCircleRight as ArrowCircleRightIcon } from "@mui/icons-material";
|
||||||
|
|
||||||
const MenuItem = ({
|
const MenuItem = ({
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,9 @@ import Image from "next/legacy/image";
|
||||||
import { AppBar, Grid, Box } from "@mui/material";
|
import { AppBar, Grid, Box } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import LeafcutterLogo from "images/leafcutter-logo.png";
|
import LeafcutterLogo from "images/leafcutter-logo.png";
|
||||||
import { AccountButton } from "@/app/_components/AccountButton";
|
import { AccountButton } from "app/_components/AccountButton";
|
||||||
import { HelpButton } from "@/app/_components/HelpButton";
|
import { HelpButton } from "app/_components/HelpButton";
|
||||||
import { Tooltip } from "@/app/_components/Tooltip";
|
import { Tooltip } from "app/_components/Tooltip";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
// import { LanguageSelect } from "./LanguageSelect";
|
// import { LanguageSelect } from "./LanguageSelect";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ import {
|
||||||
RemoveCircle as RemoveCircleIcon,
|
RemoveCircle as RemoveCircleIcon,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { QueryBuilder } from "@/app/_components/QueryBuilder";
|
import { QueryBuilder } from "app/_components/QueryBuilder";
|
||||||
import { QueryText } from "@/app/_components/QueryText";
|
import { QueryText } from "app/_components/QueryText";
|
||||||
import { LiveDataViewer } from "@/app/_components/LiveDataViewer";
|
import { LiveDataViewer } from "app/_components/LiveDataViewer";
|
||||||
import { Tooltip } from "@/app/_components/Tooltip";
|
import { Tooltip } from "app/_components/Tooltip";
|
||||||
import visualizationMap from "app/_config/visualizationMap.json";
|
import visualizationMap from "app/_config/visualizationMap.json";
|
||||||
import { VisualizationSelectCard } from "./VisualizationSelectCard";
|
import { VisualizationSelectCard } from "./VisualizationSelectCard";
|
||||||
import { MetricSelectCard } from "./MetricSelectCard";
|
import { MetricSelectCard } from "./MetricSelectCard";
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,8 @@
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import { Grid, Card, Box } from "@mui/material";
|
import { Grid, Card, Box } from "@mui/material";
|
||||||
import Iframe from "react-iframe";
|
import Iframe from "react-iframe";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import { VisualizationDetailDialog } from "@/app/_components/VisualizationDetailDialog";
|
import { VisualizationDetailDialog } from "app/_components/VisualizationDetailDialog";
|
||||||
|
|
||||||
interface VisualizationCardProps {
|
interface VisualizationCardProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC } from "react";
|
||||||
// import Link from "next/link";
|
// import Link from "next/link";
|
||||||
import { Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
import Iframe from "react-iframe";
|
import Iframe from "react-iframe";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
|
|
||||||
interface VisualizationDetailProps {
|
interface VisualizationDetailProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
@ -26,7 +26,7 @@ export const VisualizationDetail: FC<VisualizationDetailProps> = ({
|
||||||
typography: { h4, p },
|
typography: { h4, p },
|
||||||
} = useAppContext();
|
} = useAppContext();
|
||||||
const finalURL = `${process.env.NEXT_PUBLIC_NEXTAUTH_URL}${url}&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-3y%2Cto%3Anow))`;
|
const finalURL = `${process.env.NEXT_PUBLIC_NEXTAUTH_URL}${url}&_g=(filters%3A!()%2CrefreshInterval%3A(pause%3A!t%2Cvalue%3A0)%2Ctime%3A(from%3Anow-3y%2Cto%3Anow))`;
|
||||||
console.log({finalURL})
|
console.log({ finalURL });
|
||||||
return (
|
return (
|
||||||
<Box key={id}>
|
<Box key={id}>
|
||||||
{!editing ? (
|
{!editing ? (
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
TextField,
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "@/app/_components/AppProvider";
|
import { useAppContext } from "app/_components/AppProvider";
|
||||||
import { VisualizationDetail } from "./VisualizationDetail";
|
import { VisualizationDetail } from "./VisualizationDetail";
|
||||||
|
|
||||||
interface VisualizationDetailDialogProps {
|
interface VisualizationDetailDialogProps {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import NextAuth from "next-auth";
|
import NextAuth from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
|
|
||||||
const handler = NextAuth(authOptions);
|
const handler = NextAuth(authOptions);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { getUserMetadata, saveUserMetadata } from "@/app/_lib/opensearch";
|
import { getUserMetadata, saveUserMetadata } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const POST = async (req: NextRequest) => {
|
export const POST = async (req: NextRequest) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { getUserMetadata, saveUserMetadata } from "@/app/_lib/opensearch";
|
import { getUserMetadata, saveUserMetadata } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const POST = async (req: NextRequest) => {
|
export const POST = async (req: NextRequest) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { getUserMetadata } from "@/app/_lib/opensearch";
|
import { getUserMetadata } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const GET = async () => {
|
export const GET = async () => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import { getTrends } from "@/app/_lib/opensearch";
|
import { getTrends } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const GET = async () => {
|
export const GET = async () => {
|
||||||
const results = await getTrends(5);
|
const results = await getTrends(5);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { createUserVisualization } from "@/app/_lib/opensearch";
|
import { createUserVisualization } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const POST = async (req: NextRequest) => {
|
export const POST = async (req: NextRequest) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { deleteUserVisualization } from "@/app/_lib/opensearch";
|
import { deleteUserVisualization } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const POST = async (req: NextRequest, res: NextResponse) => {
|
export const POST = async (req: NextRequest, res: NextResponse) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { performQuery } from "@/app/_lib/opensearch";
|
import { performQuery } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const GET = async (req: NextRequest) => {
|
export const GET = async (req: NextRequest) => {
|
||||||
const searchQuery = req.nextUrl.searchParams.get("searchQuery");
|
const searchQuery = req.nextUrl.searchParams.get("searchQuery");
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { NextRequest, NextResponse } from "next/server";
|
import { NextRequest, NextResponse } from "next/server";
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "@/app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { updateUserVisualization } from "@/app/_lib/opensearch";
|
import { updateUserVisualization } from "app/_lib/opensearch";
|
||||||
|
|
||||||
export const POST = async (req: NextRequest) => {
|
export const POST = async (req: NextRequest) => {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,14 @@
|
||||||
import { getServerSession } from "next-auth";
|
import { getServerSession } from "next-auth";
|
||||||
import { authOptions } from "app/_lib/auth";
|
import { authOptions } from "app/_lib/auth";
|
||||||
import { getUserVisualizations } from "@/app/_lib/opensearch";
|
import { getUserVisualizations } from "app/_lib/opensearch";
|
||||||
import { Home } from "@/app/_components/Home";
|
import { Home } from "app/_components/Home";
|
||||||
|
|
||||||
export default async function Page() {
|
export default async function Page() {
|
||||||
const session = await getServerSession(authOptions);
|
const session = await getServerSession(authOptions);
|
||||||
const { user: { email } }: any = session;
|
const {
|
||||||
const visualizations = await getUserVisualizations(
|
user: { email },
|
||||||
email ?? "none",
|
}: any = session;
|
||||||
20
|
const visualizations = await getUserVisualizations(email ?? "none", 20);
|
||||||
);
|
|
||||||
|
|
||||||
return <Home visualizations={visualizations} />;
|
return <Home visualizations={visualizations} />;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ import Link from "next/link";
|
||||||
import Image from "next/image";
|
import Image from "next/image";
|
||||||
import LinkLogo from "public/link-logo-small.png";
|
import LinkLogo from "public/link-logo-small.png";
|
||||||
import { useSession, signOut } from "next-auth/react";
|
import { useSession, signOut } from "next-auth/react";
|
||||||
import { getTicketOverviewCountsQuery } from "@/app/_graphql/getTicketOverviewCountsQuery";
|
import { getTicketOverviewCountsQuery } from "app/_graphql/getTicketOverviewCountsQuery";
|
||||||
|
|
||||||
const openWidth = 270;
|
const openWidth = 270;
|
||||||
const closedWidth = 100;
|
const closedWidth = 100;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { ZammadWrapper } from "@/app/(main)/_components/ZammadWrapper";
|
import { ZammadWrapper } from "app/(main)/_components/ZammadWrapper";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Zammad",
|
title: "Zammad",
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { ZammadWrapper } from "@/app/(main)/_components/ZammadWrapper";
|
import { ZammadWrapper } from "app/(main)/_components/ZammadWrapper";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Knowledge Base",
|
title: "Knowledge Base",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC } from "react";
|
||||||
import { Grid, Box } from "@mui/material";
|
import { Grid, Box } from "@mui/material";
|
||||||
import { GridColDef } from "@mui/x-data-grid-pro";
|
import { GridColDef } from "@mui/x-data-grid-pro";
|
||||||
import { StyledDataGrid } from "../../../_components/StyledDataGrid";
|
import { StyledDataGrid } from "../../../_components/StyledDataGrid";
|
||||||
import { typography } from "@/app/_styles/theme";
|
import { typography } from "app/_styles/theme";
|
||||||
import { useRouter } from "next/navigation";
|
import { useRouter } from "next/navigation";
|
||||||
|
|
||||||
interface TicketListProps {
|
interface TicketListProps {
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { TicketList } from "./TicketList";
|
import { TicketList } from "./TicketList";
|
||||||
import { getTicketsByOverviewQuery } from "@/app/_graphql/getTicketsByOverviewQuery";
|
import { getTicketsByOverviewQuery } from "app/_graphql/getTicketsByOverviewQuery";
|
||||||
|
|
||||||
type ZammadOverviewProps = {
|
type ZammadOverviewProps = {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { Metadata } from "next";
|
import { Metadata } from "next";
|
||||||
import { ZammadWrapper } from "@/app/(main)/_components/ZammadWrapper";
|
import { ZammadWrapper } from "app/(main)/_components/ZammadWrapper";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: "Profile",
|
title: "Profile",
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import {
|
||||||
TextField,
|
TextField,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { useSWRConfig } from "swr";
|
import { useSWRConfig } from "swr";
|
||||||
import { updateTicketMutation } from "@/app/_graphql/updateTicketMutation";
|
import { updateTicketMutation } from "app/_graphql/updateTicketMutation";
|
||||||
|
|
||||||
interface ArticleCreateDialogProps {
|
interface ArticleCreateDialogProps {
|
||||||
ticketID: string;
|
ticketID: string;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { FC, useState } from "react";
|
import { FC, useState } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { getTicketQuery } from "@/app/_graphql/getTicketQuery";
|
import { getTicketQuery } from "app/_graphql/getTicketQuery";
|
||||||
import {
|
import {
|
||||||
Grid,
|
Grid,
|
||||||
Box,
|
Box,
|
||||||
|
|
|
||||||
|
|
@ -1,18 +1,18 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useState } from "react";
|
import { FC, /* useEffect, */ useState } from "react";
|
||||||
import {
|
import {
|
||||||
Grid,
|
Grid,
|
||||||
Box,
|
Box,
|
||||||
Typography,
|
// Typography,
|
||||||
TextField,
|
// TextField,
|
||||||
Stack,
|
Stack,
|
||||||
Chip,
|
Chip,
|
||||||
Select,
|
Select,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import useSWR, { useSWRConfig } from "swr";
|
import { /* useSWR, */ useSWRConfig } from "swr";
|
||||||
import { updateTicketMutation } from "@/app/_graphql/updateTicketMutation";
|
import { updateTicketMutation } from "app/_graphql/updateTicketMutation";
|
||||||
import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css";
|
import "@chatscope/chat-ui-kit-styles/dist/default/styles.min.css";
|
||||||
|
|
||||||
interface TicketEditProps {
|
interface TicketEditProps {
|
||||||
|
|
@ -24,7 +24,7 @@ export const TicketEdit: FC<TicketEditProps> = ({ ticket }) => {
|
||||||
const [selectedOwner, setSelectedOwner] = useState(1);
|
const [selectedOwner, setSelectedOwner] = useState(1);
|
||||||
const [selectedPriority, setSelectedPriority] = useState(1);
|
const [selectedPriority, setSelectedPriority] = useState(1);
|
||||||
const [selectedState, setSelectedState] = useState(1);
|
const [selectedState, setSelectedState] = useState(1);
|
||||||
const [selectedTags, setSelectedTags] = useState(["tag1", "tag2"]);
|
const [selectedTags] = useState(["tag1", "tag2"]);
|
||||||
const handleDelete = () => {
|
const handleDelete = () => {
|
||||||
console.info("You clicked the delete icon.");
|
console.info("You clicked the delete icon.");
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ import Head from "next/head";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
import { NextPage } from "next";
|
import { NextPage } from "next";
|
||||||
import { Grid } from "@mui/material";
|
import { Grid } from "@mui/material";
|
||||||
import { TicketDetail } from "@/app/_components/TicketDetail";
|
import { TicketDetail } from "app/_components/TicketDetail";
|
||||||
import { TicketEdit } from "@/app/_components/TicketEdit";
|
import { TicketEdit } from "app/_components/TicketEdit";
|
||||||
import { getTicketQuery } from "@/app/_graphql/getTicketQuery";
|
import { getTicketQuery } from "app/_graphql/getTicketQuery";
|
||||||
|
|
||||||
type TicketProps = {
|
type TicketProps = {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue