Fix AppProvider import
This commit is contained in:
parent
681117d3ac
commit
7e5c6dd370
38 changed files with 198 additions and 37 deletions
|
|
@ -5,7 +5,7 @@ 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 "../../../_components/AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
|
|
||||||
export const Setup: FC = () => {
|
export const Setup: FC = () => {
|
||||||
const {
|
const {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
bindTrigger,
|
bindTrigger,
|
||||||
bindMenu,
|
bindMenu,
|
||||||
} from "material-ui-popup-state/hooks";
|
} from "material-ui-popup-state/hooks";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
|
|
||||||
export const AccountButton: FC = () => {
|
export const AccountButton: FC = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC, useState } from "react";
|
||||||
import { useRouter, usePathname } from "next/navigation";
|
import { useRouter, usePathname } from "next/navigation";
|
||||||
import { Button } from "@mui/material";
|
import { Button } from "@mui/material";
|
||||||
import { QuestionMark as QuestionMarkIcon } from "@mui/icons-material";
|
import { QuestionMark as QuestionMarkIcon } from "@mui/icons-material";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
|
|
||||||
export const HelpButton: FC = () => {
|
export const HelpButton: FC = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import { useCookies } from "react-cookie";
|
||||||
import { TopNav } from "./TopNav";
|
import { TopNav } from "./TopNav";
|
||||||
import { Sidebar } from "./Sidebar";
|
import { Sidebar } from "./Sidebar";
|
||||||
import { GettingStartedDialog } from "leafcutter-common";
|
import { GettingStartedDialog } from "leafcutter-common";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
// import { Footer } from "./Footer";
|
// import { Footer } from "./Footer";
|
||||||
|
|
||||||
type LayoutProps = PropsWithChildren<{
|
type LayoutProps = PropsWithChildren<{
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import {
|
||||||
bindTrigger,
|
bindTrigger,
|
||||||
bindMenu,
|
bindMenu,
|
||||||
} from "material-ui-popup-state/hooks";
|
} from "material-ui-popup-state/hooks";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
// import { Tooltip } from "./Tooltip";
|
// import { Tooltip } from "./Tooltip";
|
||||||
|
|
||||||
export const LanguageSelect = () => {
|
export const LanguageSelect = () => {
|
||||||
|
|
|
||||||
|
|
@ -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 "./AppProvider";
|
import { AppProvider } from "leafcutter-common/components/AppProvider";
|
||||||
import { NextAppDirEmotionCacheProvider } from "tss-react/next/appDir";
|
import { NextAppDirEmotionCacheProvider } from "tss-react/next/appDir";
|
||||||
import en from "leafcutter-common/locales/en.json";
|
import en from "leafcutter-common/locales/en.json";
|
||||||
import fr from "leafcutter-common/locales/fr.json";
|
import fr from "leafcutter-common/locales/fr.json";
|
||||||
|
|
|
||||||
|
|
@ -20,7 +20,7 @@ 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 "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
import { Tooltip } from "leafcutter-common";
|
import { Tooltip } from "leafcutter-common";
|
||||||
// import { ArrowCircleRight as ArrowCircleRightIcon } from "@mui/icons-material";
|
// import { ArrowCircleRight as ArrowCircleRightIcon } from "@mui/icons-material";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import LeafcutterLogo from "images/leafcutter-logo.png";
|
||||||
import { AccountButton } from "./AccountButton";
|
import { AccountButton } from "./AccountButton";
|
||||||
import { HelpButton } from "./HelpButton";
|
import { HelpButton } from "./HelpButton";
|
||||||
import { Tooltip } from "leafcutter-common";
|
import { Tooltip } from "leafcutter-common";
|
||||||
import { useAppContext } from "./AppProvider";
|
import { useAppContext } from "leafcutter-common/components/AppProvider";
|
||||||
// import { LanguageSelect } from "./LanguageSelect";
|
// import { LanguageSelect } from "./LanguageSelect";
|
||||||
|
|
||||||
export const TopNav: FC = () => {
|
export const TopNav: FC = () => {
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ 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 "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { PageHeader } from "./PageHeader";
|
import { PageHeader } from "./PageHeader";
|
||||||
import { AboutFeature } from "./AboutFeature";
|
import { AboutFeature } from "./AboutFeature";
|
||||||
import { AboutBox } from "./AboutBox";
|
import { AboutBox } from "./AboutBox";
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { FC, PropsWithChildren } from "react";
|
import { FC, PropsWithChildren } from "react";
|
||||||
import { Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
type AboutBoxProps = PropsWithChildren<{
|
type AboutBoxProps = PropsWithChildren<{
|
||||||
backgroundColor: string;
|
backgroundColor: string;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC } from "react";
|
||||||
import Image from "next/legacy/image";
|
import Image from "next/legacy/image";
|
||||||
import { Grid, Box, GridSize } from "@mui/material";
|
import { Grid, Box, GridSize } from "@mui/material";
|
||||||
import AboutDots from "../images/about-dots.png";
|
import AboutDots from "../images/about-dots.png";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface AboutFeatureProps {
|
interface AboutFeatureProps {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
||||||
161
packages/leafcutter-common/components/AppProvider.tsx
Normal file
161
packages/leafcutter-common/components/AppProvider.tsx
Normal file
|
|
@ -0,0 +1,161 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import {
|
||||||
|
FC,
|
||||||
|
createContext,
|
||||||
|
useContext,
|
||||||
|
useReducer,
|
||||||
|
useState,
|
||||||
|
PropsWithChildren,
|
||||||
|
} from "react";
|
||||||
|
import { colors, typography } from "leafcutter-common/styles/theme";
|
||||||
|
|
||||||
|
const basePath = process.env.GITLAB_CI
|
||||||
|
? "/link/link-stack/apps/leafcutter"
|
||||||
|
: "";
|
||||||
|
const imageURL = (image: any) =>
|
||||||
|
typeof image === "string" ? `${basePath}${image}` : `${basePath}${image.src}`;
|
||||||
|
|
||||||
|
const AppContext = createContext({
|
||||||
|
colors,
|
||||||
|
typography,
|
||||||
|
imageURL,
|
||||||
|
query: null as any,
|
||||||
|
updateQuery: null as any,
|
||||||
|
updateQueryType: null as any,
|
||||||
|
replaceQuery: null as any,
|
||||||
|
clearQuery: null as any,
|
||||||
|
foundCount: 0,
|
||||||
|
setFoundCount: null as any,
|
||||||
|
});
|
||||||
|
|
||||||
|
export const AppProvider: FC<PropsWithChildren> = ({ children }) => {
|
||||||
|
const initialState = {
|
||||||
|
incidentType: {
|
||||||
|
display: "Incident Type",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
relativeDate: {
|
||||||
|
display: "Relative Date",
|
||||||
|
queryType: null,
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
startDate: {
|
||||||
|
display: "Start Date",
|
||||||
|
queryType: null,
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
endDate: {
|
||||||
|
display: "End Date",
|
||||||
|
queryType: null,
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
targetedGroup: {
|
||||||
|
display: "Targeted Group",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
platform: {
|
||||||
|
display: "Platform",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
device: {
|
||||||
|
display: "Device",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
service: {
|
||||||
|
display: "Service",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
maker: {
|
||||||
|
display: "Maker",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
country: {
|
||||||
|
display: "Country",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
subregion: {
|
||||||
|
display: "Subregion",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
continent: {
|
||||||
|
display: "Continent",
|
||||||
|
queryType: "include",
|
||||||
|
values: [],
|
||||||
|
},
|
||||||
|
};
|
||||||
|
const reducer = (state: any, action: any) => {
|
||||||
|
const key = action.payload?.[0];
|
||||||
|
if (!key) {
|
||||||
|
throw new Error("Unknown key");
|
||||||
|
}
|
||||||
|
const newState = { ...state };
|
||||||
|
switch (action.type) {
|
||||||
|
case "UPDATE":
|
||||||
|
newState[key].values = action.payload[key].values;
|
||||||
|
return newState;
|
||||||
|
case "UPDATE_TYPE":
|
||||||
|
newState[key].queryType = action.payload[key].queryType;
|
||||||
|
return newState;
|
||||||
|
case "REPLACE":
|
||||||
|
return Object.keys(action.payload).reduce((acc: any, cur: string) => {
|
||||||
|
if (["startDate", "endDate"].includes(cur)) {
|
||||||
|
const rawDate = action.payload[cur].values[0];
|
||||||
|
const date = new Date(rawDate);
|
||||||
|
acc[cur] = {
|
||||||
|
...action.payload[cur],
|
||||||
|
values: rawDate && date ? [date] : [],
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
acc[cur] = action.payload[cur];
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc;
|
||||||
|
}, {});
|
||||||
|
case "CLEAR":
|
||||||
|
return initialState;
|
||||||
|
default:
|
||||||
|
throw new Error("Unknown action type");
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const [query, dispatch] = useReducer(reducer, initialState);
|
||||||
|
const updateQuery = (payload: any) => dispatch({ type: "UPDATE", payload });
|
||||||
|
const updateQueryType = (payload: any) =>
|
||||||
|
dispatch({ type: "UPDATE_TYPE", payload });
|
||||||
|
const replaceQuery = (payload: any) => dispatch({ type: "REPLACE", payload });
|
||||||
|
const clearQuery = () => dispatch({ type: "CLEAR" });
|
||||||
|
const [foundCount, setFoundCount] = useState(0);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<AppContext.Provider
|
||||||
|
// eslint-disable-next-line react/jsx-no-constructed-context-values
|
||||||
|
value={{
|
||||||
|
colors,
|
||||||
|
typography,
|
||||||
|
imageURL,
|
||||||
|
query,
|
||||||
|
updateQuery,
|
||||||
|
updateQueryType,
|
||||||
|
replaceQuery,
|
||||||
|
clearQuery,
|
||||||
|
foundCount,
|
||||||
|
setFoundCount,
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</AppContext.Provider>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export function useAppContext() {
|
||||||
|
return useContext(AppContext);
|
||||||
|
}
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
import { Button as MUIButton } from "@mui/material";
|
import { Button as MUIButton } from "@mui/material";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface ButtonProps {
|
interface ButtonProps {
|
||||||
text: string;
|
text: string;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ 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 "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { PageHeader } from "./PageHeader";
|
import { PageHeader } from "./PageHeader";
|
||||||
import { VisualizationBuilder } from "./VisualizationBuilder";
|
import { VisualizationBuilder } from "./VisualizationBuilder";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { useTranslate } from "react-polyglot";
|
||||||
import { Box, Grid } from "@mui/material";
|
import { Box, Grid } from "@mui/material";
|
||||||
import { PageHeader } from "./PageHeader";
|
import { PageHeader } from "./PageHeader";
|
||||||
import { Question } from "./Question";
|
import { Question } from "./Question";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import FaqHeader from "../images/faq-header.svg";
|
import FaqHeader from "../images/faq-header.svg";
|
||||||
|
|
||||||
export const FAQ: FC = () => {
|
export const FAQ: FC = () => {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ import leafcutterLogo from "../images/leafcutter-logo.png";
|
||||||
import footerLogo from "../images/footer-logo.png";
|
import footerLogo from "../images/footer-logo.png";
|
||||||
import twitterLogo from "../images/twitter-logo.png";
|
import twitterLogo from "../images/twitter-logo.png";
|
||||||
import gitlabLogo from "../images/gitlab-logo.png";
|
import gitlabLogo from "../images/gitlab-logo.png";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const Footer: FC = () => {
|
export const Footer: FC = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Dialog, Box, Grid, Checkbox, IconButton } from "@mui/material";
|
||||||
import { Close as CloseIcon } from "@mui/icons-material";
|
import { Close as CloseIcon } from "@mui/icons-material";
|
||||||
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
type CheckboxItemProps = {
|
type CheckboxItemProps = {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import { useCookies } from "react-cookie";
|
||||||
import { Welcome } from "./Welcome";
|
import { Welcome } from "./Welcome";
|
||||||
import { WelcomeDialog } from "./WelcomeDialog";
|
import { WelcomeDialog } from "./WelcomeDialog";
|
||||||
import { VisualizationCard } from "./VisualizationCard";
|
import { VisualizationCard } from "./VisualizationCard";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
type HomeProps = {
|
type HomeProps = {
|
||||||
visualizations: any;
|
visualizations: any;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
"use client";
|
"use client";
|
||||||
|
|
||||||
import { FC, useEffect, useState } from "react";
|
import { FC, useEffect, useState } from "react";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { RawDataViewer } from "./RawDataViewer";
|
import { RawDataViewer } from "./RawDataViewer";
|
||||||
|
|
||||||
export const LiveDataViewer: FC = () => {
|
export const LiveDataViewer: FC = () => {
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ import {
|
||||||
Public as PublicIcon,
|
Public as PublicIcon,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { VisualizationDetailDialog } from "./VisualizationDetailDialog";
|
import { VisualizationDetailDialog } from "./VisualizationDetailDialog";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface MetricSelectCardProps {
|
interface MetricSelectCardProps {
|
||||||
visualizationID: string;
|
visualizationID: string;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
/* eslint-disable react/require-default-props */
|
/* eslint-disable react/require-default-props */
|
||||||
import { FC, PropsWithChildren } from "react";
|
import { FC, PropsWithChildren } from "react";
|
||||||
import { Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
type PageHeaderProps = PropsWithChildren<{
|
type PageHeaderProps = PropsWithChildren<{
|
||||||
backgroundColor: string;
|
backgroundColor: string;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ import taxonomy from "../config/taxonomy.json";
|
||||||
import { QueryBuilderSection } from "./QueryBuilderSection";
|
import { QueryBuilderSection } from "./QueryBuilderSection";
|
||||||
import { QueryListSelector } from "./QueryListSelector";
|
import { QueryListSelector } from "./QueryListSelector";
|
||||||
import { QueryDateRangeSelector } from "./QueryDateRangeSelector";
|
import { QueryDateRangeSelector } from "./QueryDateRangeSelector";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { Tooltip } from "./Tooltip";
|
import { Tooltip } from "./Tooltip";
|
||||||
|
|
||||||
interface QueryBuilderProps {}
|
interface QueryBuilderProps {}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ import {
|
||||||
ExpandMore as ExpandMoreIcon,
|
ExpandMore as ExpandMoreIcon,
|
||||||
Help as HelpIcon,
|
Help as HelpIcon,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface QueryBuilderSectionProps {
|
interface QueryBuilderSectionProps {
|
||||||
name: string;
|
name: string;
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { FC, useState, useEffect } from "react";
|
||||||
import { Box, Grid, TextField, Select, MenuItem } from "@mui/material";
|
import { Box, Grid, TextField, Select, MenuItem } from "@mui/material";
|
||||||
import { DatePicker } from "@mui/x-date-pickers-pro";
|
import { DatePicker } from "@mui/x-date-pickers-pro";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface QueryDateRangeSelectorProps {}
|
interface QueryDateRangeSelectorProps {}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import { FC, useState, useEffect } from "react";
|
import { FC, useState, useEffect } from "react";
|
||||||
import { Box, Grid, Tooltip } from "@mui/material";
|
import { Box, Grid, Tooltip } from "@mui/material";
|
||||||
import { DataGridPro, GridColDef } from "@mui/x-data-grid-pro";
|
import { DataGridPro, GridColDef } from "@mui/x-data-grid-pro";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface QueryListSelectorProps {
|
interface QueryListSelectorProps {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Box, Grid } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import taxonomy from "../config/taxonomy.json";
|
import taxonomy from "../config/taxonomy.json";
|
||||||
import { colors } from "../styles/theme";
|
import { colors } from "../styles/theme";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const QueryText: FC = () => {
|
export const QueryText: FC = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ import {
|
||||||
ExpandMore as ExpandMoreIcon,
|
ExpandMore as ExpandMoreIcon,
|
||||||
Circle as CircleIcon,
|
Circle as CircleIcon,
|
||||||
} from "@mui/icons-material";
|
} from "@mui/icons-material";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface QuestionProps {
|
interface QuestionProps {
|
||||||
question: string;
|
question: string;
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ import {
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { Close as CloseIcon } from "@mui/icons-material";
|
import { Close as CloseIcon } from "@mui/icons-material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface TooltipProps {
|
interface TooltipProps {
|
||||||
title: string;
|
title: string;
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { Grid, Box } from "@mui/material";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { PageHeader } from "./PageHeader";
|
import { PageHeader } from "./PageHeader";
|
||||||
import { VisualizationCard } from "./VisualizationCard";
|
import { VisualizationCard } from "./VisualizationCard";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
type TrendsProps = {
|
type TrendsProps = {
|
||||||
visualizations: any;
|
visualizations: any;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ import { Tooltip } from "./Tooltip";
|
||||||
import visualizationMap from "../config/visualizationMap.json";
|
import visualizationMap from "../config/visualizationMap.json";
|
||||||
import { VisualizationSelectCard } from "./VisualizationSelectCard";
|
import { VisualizationSelectCard } from "./VisualizationSelectCard";
|
||||||
import { MetricSelectCard } from "./MetricSelectCard";
|
import { MetricSelectCard } from "./MetricSelectCard";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface VisualizationBuilderProps {
|
interface VisualizationBuilderProps {
|
||||||
templates: any[];
|
templates: any[];
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
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 "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { VisualizationDetailDialog } from "./VisualizationDetailDialog";
|
import { VisualizationDetailDialog } from "./VisualizationDetailDialog";
|
||||||
|
|
||||||
interface VisualizationCardProps {
|
interface VisualizationCardProps {
|
||||||
|
|
|
||||||
|
|
@ -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 "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface VisualizationDetailProps {
|
interface VisualizationDetailProps {
|
||||||
id: string;
|
id: string;
|
||||||
|
|
|
||||||
|
|
@ -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 "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
import { VisualizationDetail } from "./VisualizationDetail";
|
import { VisualizationDetail } from "./VisualizationDetail";
|
||||||
|
|
||||||
interface VisualizationDetailDialogProps {
|
interface VisualizationDetailDialogProps {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ import lineStacked from "../images/line-stacked.svg";
|
||||||
import dataTable from "../images/data-table.svg";
|
import dataTable from "../images/data-table.svg";
|
||||||
import metric from "../images/metric.svg";
|
import metric from "../images/metric.svg";
|
||||||
import tagCloud from "../images/tag-cloud.svg";
|
import tagCloud from "../images/tag-cloud.svg";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
interface VisualizationSelectCardProps {
|
interface VisualizationSelectCardProps {
|
||||||
visualizationType: string;
|
visualizationType: string;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
import { Box, Grid } from "@mui/material";
|
import { Box, Grid } from "@mui/material";
|
||||||
import { useSession } from "next-auth/react";
|
import { useSession } from "next-auth/react";
|
||||||
import { useTranslate } from "react-polyglot";
|
import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const Welcome = () => {
|
export const Welcome = () => {
|
||||||
const t = useTranslate();
|
const t = useTranslate();
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import { Box, Grid, Dialog, Button } from "@mui/material";
|
||||||
import { useRouter, useSearchParams } from "next/navigation";
|
import { useRouter, useSearchParams } from "next/navigation";
|
||||||
// import { useSession } from "next-auth/react";
|
// import { useSession } from "next-auth/react";
|
||||||
// import { useTranslate } from "react-polyglot";
|
// import { useTranslate } from "react-polyglot";
|
||||||
import { useAppContext } from "../../../apps/leafcutter/app/_components/AppProvider";
|
import { useAppContext } from "./AppProvider";
|
||||||
|
|
||||||
export const WelcomeDialog = () => {
|
export const WelcomeDialog = () => {
|
||||||
// const t = useTranslate();
|
// const t = useTranslate();
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@
|
||||||
"**/*.ts",
|
"**/*.ts",
|
||||||
"**/*.tsx",
|
"**/*.tsx",
|
||||||
"**/*.png, **/*.svg",
|
"**/*.png, **/*.svg",
|
||||||
"../../apps/leafcutter/app/_components/AppProvider.tsx",
|
"components/AppProvider.tsx",
|
||||||
"../../apps/leafcutter/app/_components/LanguageSelect.tsx",
|
"../../apps/leafcutter/app/_components/LanguageSelect.tsx",
|
||||||
"../../apps/leafcutter/app/_components/MultiProvider.tsx",
|
"../../apps/leafcutter/app/_components/MultiProvider.tsx",
|
||||||
"../../apps/leafcutter/app/_components/Sidebar.tsx",
|
"../../apps/leafcutter/app/_components/Sidebar.tsx",
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue