Fix/remove ee fe (#4690)

* Remove ee imports from FE

* Remove ee imports from FE

* Style
This commit is contained in:
Chris Weaver
2025-05-11 19:31:04 -07:00
committed by GitHub
parent b19515e25d
commit b8f3ad3e5d
26 changed files with 45 additions and 33 deletions

View File

@@ -2,7 +2,7 @@ import { SourceIcon } from "@/components/SourceIcon";
import React from "react";
import { FiBookmark, FiTag, FiX } from "react-icons/fi";
import { FilterManager } from "@/lib/hooks";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
const displayTimeRange = (timeRange: DateRangePickerValue) => {
if (timeRange.selectValue) {

View File

@@ -1,7 +1,7 @@
import React from "react";
import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert";
import { CircleAlert, Info } from "lucide-react";
import { BillingInformation, BillingStatus } from "./interfaces";
import { BillingInformation, BillingStatus } from "@/lib/billing/interfaces";
export function BillingAlerts({
billingInformation,

View File

@@ -3,7 +3,10 @@
import { useRouter } from "next/navigation";
import { useEffect } from "react";
import { usePopup } from "@/components/admin/connectors/Popup";
import { fetchCustomerPortal, useBillingInformation } from "./utils";
import {
fetchCustomerPortal,
useBillingInformation,
} from "@/lib/billing/utils";
import {
Card,

View File

@@ -1,6 +1,6 @@
import React from "react";
import { InfoItem } from "./InfoItem";
import { statusToDisplay } from "./utils";
import { statusToDisplay } from "@/lib/billing/utils";
interface SubscriptionSummaryProps {
billingInformation: any;

View File

@@ -8,9 +8,9 @@ import {
convertDateToEndOfDay,
convertDateToStartOfDay,
getXDaysAgo,
} from "./dateUtils";
import { THIRTY_DAYS } from "./DateRangeSelector";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
} from "../../../../components/dateRangeSelectors/dateUtils";
import { THIRTY_DAYS } from "../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
export const useTimeRange = () => {
return useState<DateRangePickerValue>({

View File

@@ -1,7 +1,7 @@
import { usePopup } from "@/components/admin/connectors/Popup";
import { Button } from "@/components/ui/button";
import { useRef, useState } from "react";
import { DateRange } from "../DateRangeSelector";
import { DateRange } from "../../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import { FaSpinner, FaRegArrowAltCircleUp } from "react-icons/fa";
import { withRequestId, withDateRange } from "./utils";
import {

View File

@@ -23,7 +23,10 @@ import { timestampToReadableDate } from "@/lib/dateUtils";
import { FiFrown, FiMinus, FiSmile, FiMeh } from "react-icons/fi";
import { Dispatch, SetStateAction, useCallback, useState } from "react";
import { Feedback, TaskStatus } from "@/lib/types";
import { DateRange, DateRangeSelector } from "../DateRangeSelector";
import {
DateRange,
AdminDateRangeSelector,
} from "../../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import { PageSelector } from "@/components/PageSelector";
import Link from "next/link";
import { FeedbackBadge } from "./FeedbackBadge";
@@ -319,7 +322,7 @@ export function QueryHistoryTable() {
}}
/>
<DateRangeSelector
<AdminDateRangeSelector
value={dateRange}
onValueChange={onTimeRangeChange}
/>

View File

@@ -1,4 +1,4 @@
import { DateRange } from "../DateRangeSelector";
import { DateRange } from "../../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import { START_QUERY_HISTORY_EXPORT_URL } from "./constants";
export const withRequestId = (url: string, requestId: string): string =>

View File

@@ -3,7 +3,7 @@ import { getDatesList, useQueryAnalytics } from "../lib";
import Text from "@/components/ui/text";
import Title from "@/components/ui/title";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import CardSection from "@/components/admin/CardSection";
import { AreaChartDisplay } from "@/components/ui/areaChart";

View File

@@ -1,6 +1,6 @@
import { ThreeDotsLoader } from "@/components/Loading";
import { getDatesList, useOnyxBotAnalytics } from "../lib";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import Text from "@/components/ui/text";
import Title from "@/components/ui/title";
import CardSection from "@/components/admin/CardSection";

View File

@@ -6,7 +6,7 @@ import {
usePersonaUniqueUsers,
} from "../lib";
import { useAssistants } from "@/components/context/AssistantsContext";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import Text from "@/components/ui/text";
import Title from "@/components/ui/title";
import CardSection from "@/components/admin/CardSection";

View File

@@ -1,6 +1,6 @@
"use client";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { getDatesList, useQueryAnalytics, useUserAnalytics } from "../lib";
import { ThreeDotsLoader } from "@/components/Loading";
import { AreaChartDisplay } from "@/components/ui/areaChart";

View File

@@ -24,7 +24,7 @@ import { humanReadableFormat, humanReadableFormatWithTime } from "@/lib/time";
import { ErrorCallout } from "@/components/ErrorCallout";
import { PageSelector } from "@/components/PageSelector";
import { Separator } from "@/components/ui/separator";
import { DateRangePickerValue } from "../DateRangeSelector";
import { DateRangePickerValue } from "../../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import {
Popover,
PopoverContent,

View File

@@ -1,6 +1,6 @@
"use client";
import { DateRangeSelector } from "../DateRangeSelector";
import { AdminDateRangeSelector } from "../../../../../components/dateRangeSelectors/AdminDateRangeSelector";
import { OnyxBotChart } from "./OnyxBotChart";
import { FeedbackChart } from "./FeedbackChart";
import { QueryPerformanceChart } from "./QueryPerformanceChart";
@@ -20,7 +20,7 @@ export default function AnalyticsPage() {
title="Usage Statistics"
icon={<FiActivity size={32} />}
/>
<DateRangeSelector
<AdminDateRangeSelector
value={timeRange}
onValueChange={(value) => setTimeRange(value as any)}
/>

View File

@@ -3,9 +3,9 @@ import { ThreeDotsLoader } from "@/components/Loading";
import { getDatesList } from "@/app/ee/admin/performance/lib";
import { useEffect, useState, useMemo } from "react";
import {
DateRangeSelector,
AdminDateRangeSelector,
DateRange,
} from "@/app/ee/admin/performance/DateRangeSelector";
} from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { useAssistants } from "@/components/context/AssistantsContext";
import { AssistantIcon } from "@/components/assistants/AssistantIcon";
import { Card, CardContent, CardHeader } from "@/components/ui/card";
@@ -146,7 +146,10 @@ export function AssistantStats({ assistantId }: { assistantId: number }) {
<Card className="w-full">
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<p className="text-base font-normal text-2xl">Assistant Analytics</p>
<DateRangeSelector value={dateRange} onValueChange={setDateRange} />
<AdminDateRangeSelector
value={dateRange}
onValueChange={setDateRange}
/>
</CardHeader>
<CardContent>
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 mb-6">

View File

@@ -24,7 +24,7 @@ export type DateRange =
}
| undefined;
export const DateRangeSelector = memo(function DateRangeSelector({
export const AdminDateRangeSelector = memo(function AdminDateRangeSelector({
value,
onValueChange,
}: {

View File

@@ -1,11 +1,11 @@
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { FiCalendar, FiChevronDown, FiXCircle } from "react-icons/fi";
import { CustomDropdown } from "../Dropdown";
import { timeRangeValues } from "@/app/config/timeRange";
import { TimeRangeSelector } from "@/components/filters/TimeRangeSelector";
import { cn } from "@/lib/utils";
export function DateRangeSelector({
export function SearchDateRangeSelector({
value,
onValueChange,
isHorizontal,

View File

@@ -1,7 +1,7 @@
"use client";
import { FiLock } from "react-icons/fi";
import ErrorPageLayout from "./ErrorPageLayout";
import { fetchCustomerPortal } from "@/app/ee/admin/billing/utils";
import { fetchCustomerPortal } from "@/lib/billing/utils";
import { useState } from "react";
import { useRouter } from "next/navigation";
import { Button } from "@/components/ui/button";

View File

@@ -11,8 +11,8 @@ import {
FiTag,
FiX,
} from "react-icons/fi";
import { DateRangeSelector } from "@/components/search/DateRangeSelector";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { SearchDateRangeSelector } from "@/components/dateRangeSelectors/SearchDateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { listSourceMetadata } from "@/lib/sources";
import { SourceIcon } from "@/components/SourceIcon";
import { TagFilter } from "@/components/search/filtering/TagFilter";
@@ -330,7 +330,10 @@ export function HorizontalFilters({
<div className="b">
<div className="flex gap-x-3">
<div className="w-52">
<DateRangeSelector value={timeRange} onValueChange={setTimeRange} />
<SearchDateRangeSelector
value={timeRange}
onValueChange={setTimeRange}
/>
</div>
<FilterDropdown

View File

@@ -10,7 +10,7 @@ import { Calendar } from "@/components/ui/calendar"; // or wherever your Calenda
import { FilterDropdown } from "@/components/search/filtering/FilterDropdown";
import { listSourceMetadata } from "@/lib/sources";
import { getDateRangeString } from "@/lib/dateUtils";
import { DateRangePickerValue } from "../../../app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "../../dateRangeSelectors/AdminDateRangeSelector";
import { Tag } from "@/lib/types";
import { SourceIcon } from "@/components/SourceIcon";
export interface SourceSelectorProps {

View File

@@ -1,4 +1,4 @@
import { BillingInformation } from "./page";
import { BillingInformation } from "./interfaces";
import useSWR, { mutate } from "swr";
export const updateSubscriptionQuantity = async (seats: number) => {

View File

@@ -11,7 +11,7 @@ import {
import useSWR, { mutate, useSWRConfig } from "swr";
import { errorHandlingFetcher } from "./fetcher";
import { useContext, useEffect, useMemo, useState } from "react";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { SourceMetadata } from "./search/interfaces";
import {
destructureValue,

View File

@@ -1,4 +1,4 @@
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
import { Tag, ValidSources } from "../types";
import { Persona } from "@/app/admin/assistants/interfaces";

View File

@@ -1,6 +1,6 @@
import { Tag, ValidSources } from "../types";
import { Filters, OnyxDocument, SourceMetadata } from "./interfaces";
import { DateRangePickerValue } from "@/app/ee/admin/performance/DateRangeSelector";
import { DateRangePickerValue } from "@/components/dateRangeSelectors/AdminDateRangeSelector";
export const buildFilters = (
sources: SourceMetadata[],