diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index c323f2f6..28ab550a 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -18,5 +18,22 @@ $ProjectFileDir$ + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://34.141.53.52:5432/basemind + + + + $ProjectFileDir$ + diff --git a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx index 89f35194..8bb3a1a3 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page.tsx @@ -13,6 +13,7 @@ import { PromptConfigGeneralInfo } from '@/components/projects/[projectId]/appli import { PromptConfigGeneralSettings } from '@/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-general-settings'; import { PromptConfigTesting } from '@/components/projects/[projectId]/applications/[applicationId]/configs/[configId]/prompt-config-testing'; import { TabData, TabNavigation } from '@/components/tab-navigation'; +import { PromptConfigPageTab } from '@/constants'; import { useAuthenticatedUser } from '@/hooks/use-authenticated-user'; import { useHandleError } from '@/hooks/use-handle-error'; import { useProjectBootstrap } from '@/hooks/use-project-bootstrap'; @@ -23,14 +24,6 @@ import { useSetPromptConfigs, } from '@/stores/api-store'; -enum TAB_NAME { - OVERVIEW, - TESTING, - SETTINGS, -} - -export { TAB_NAME as PromptConfigPageTab }; - export default function PromptConfiguration({ params: { projectId, applicationId, promptConfigId }, }: { @@ -51,7 +44,9 @@ export default function PromptConfiguration({ const project = useProject(projectId); const projects = useProjects(); - const [selectedTab, setSelectedTab] = useState(TAB_NAME.OVERVIEW); + const [selectedTab, setSelectedTab] = useState( + PromptConfigPageTab.OVERVIEW, + ); const { isLoading } = useSWR( promptConfig ? null : { applicationId, projectId }, @@ -79,26 +74,26 @@ export default function PromptConfiguration({ return null; } - const tabs: TabData[] = [ + const tabs: TabData[] = [ { icon: , - id: TAB_NAME.OVERVIEW, + id: PromptConfigPageTab.OVERVIEW, text: t('overview'), }, { icon: , - id: TAB_NAME.TESTING, + id: PromptConfigPageTab.TESTING, text: t('test'), }, { icon: , - id: TAB_NAME.SETTINGS, + id: PromptConfigPageTab.SETTINGS, text: t('settings'), }, ]; - const tabComponents: Record = { - [TAB_NAME.OVERVIEW]: memo(() => ( + const tabComponents: Record = { + [PromptConfigPageTab.OVERVIEW]: memo(() => ( <> )), - [TAB_NAME.TESTING]: memo(() => ( + [PromptConfigPageTab.TESTING]: memo(() => ( )), - [TAB_NAME.SETTINGS]: memo(() => ( + [PromptConfigPageTab.SETTINGS]: memo(() => ( <> 1} />
- + tabs={tabs} selectedTab={selectedTab} onTabChange={setSelectedTab} diff --git a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/page.tsx index efd9794b..c5be91cd 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/page.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/applications/[applicationId]/page.tsx @@ -11,18 +11,11 @@ import { ApplicationDeletion } from '@/components/projects/[projectId]/applicati import { ApplicationGeneralSettings } from '@/components/projects/[projectId]/applications/[applicationId]/application-general-settings'; import { ApplicationPromptConfigs } from '@/components/projects/[projectId]/applications/[applicationId]/application-prompt-configs'; import { TabData, TabNavigation } from '@/components/tab-navigation'; +import { ApplicationPageTabNames } from '@/constants'; import { useAuthenticatedUser } from '@/hooks/use-authenticated-user'; import { useProjectBootstrap } from '@/hooks/use-project-bootstrap'; import { useApplication, useProject, useProjects } from '@/stores/api-store'; -enum TAB_NAME { - OVERVIEW, - API_KEYS, - SETTINGS, -} - -export { TAB_NAME as applicationPageTabNames }; - export default function Application({ params: { projectId, applicationId }, }: { @@ -36,22 +29,24 @@ export default function Application({ const project = useProject(projectId); const projects = useProjects(); - const [selectedTab, setSelectedTab] = useState(TAB_NAME.OVERVIEW); + const [selectedTab, setSelectedTab] = useState( + ApplicationPageTabNames.OVERVIEW, + ); - const tabs: TabData[] = [ + const tabs: TabData[] = [ { icon: , - id: TAB_NAME.OVERVIEW, + id: ApplicationPageTabNames.OVERVIEW, text: t('overview'), }, { icon: , - id: TAB_NAME.API_KEYS, + id: ApplicationPageTabNames.API_KEYS, text: t('apiKeys'), }, { icon: , - id: TAB_NAME.SETTINGS, + id: ApplicationPageTabNames.SETTINGS, text: t('settings'), }, ]; @@ -60,8 +55,8 @@ export default function Application({ return null; } - const tabComponents: Record = { - [TAB_NAME.OVERVIEW]: memo(() => ( + const tabComponents: Record = { + [ApplicationPageTabNames.OVERVIEW]: memo(() => ( <> )), - [TAB_NAME.API_KEYS]: memo(() => ( + [ApplicationPageTabNames.API_KEYS]: memo(() => ( )), - [TAB_NAME.SETTINGS]: memo(() => ( + [ApplicationPageTabNames.SETTINGS]: memo(() => ( <> )}
- + tabs={tabs} selectedTab={selectedTab} onTabChange={setSelectedTab} diff --git a/frontend/src/app/[locale]/projects/[projectId]/page.tsx b/frontend/src/app/[locale]/projects/[projectId]/page.tsx index b8f6f68e..fa2ae2a6 100644 --- a/frontend/src/app/[locale]/projects/[projectId]/page.tsx +++ b/frontend/src/app/[locale]/projects/[projectId]/page.tsx @@ -13,17 +13,11 @@ import { ProjectGeneralSettings } from '@/components/projects/[projectId]/projec import { ProjectMembers } from '@/components/projects/[projectId]/project-members'; import { ProjectProviderKeys } from '@/components/projects/[projectId]/project-provider-keys'; import { TabData, TabNavigation } from '@/components/tab-navigation'; +import { ProjectPageTabNames } from '@/constants'; import { useAuthenticatedUser } from '@/hooks/use-authenticated-user'; import { useProjectBootstrap } from '@/hooks/use-project-bootstrap'; import { useProject, useProjects } from '@/stores/api-store'; -enum TAB_NAME { - OVERVIEW, - MEMBERS, - PROVIDER_KEYS, - SETTINGS, -} - export default function ProjectOverview({ params: { projectId }, }: { @@ -34,30 +28,32 @@ export default function ProjectOverview({ const t = useTranslations('projectOverview'); - const [selectedTab, setSelectedTab] = useState(TAB_NAME.OVERVIEW); + const [selectedTab, setSelectedTab] = useState( + ProjectPageTabNames.OVERVIEW, + ); const project = useProject(projectId); const projects = useProjects(); - const tabs: TabData[] = [ + const tabs: TabData[] = [ { icon: , - id: TAB_NAME.OVERVIEW, + id: ProjectPageTabNames.OVERVIEW, text: t('overview'), }, { icon: , - id: TAB_NAME.MEMBERS, + id: ProjectPageTabNames.MEMBERS, text: t('members'), }, { icon: , - id: TAB_NAME.PROVIDER_KEYS, + id: ProjectPageTabNames.PROVIDER_KEYS, text: t('providerKeys'), }, { icon: , - id: TAB_NAME.SETTINGS, + id: ProjectPageTabNames.SETTINGS, text: t('settings'), }, ]; @@ -66,14 +62,14 @@ export default function ProjectOverview({ return null; } - const tabComponents: Record = { - [TAB_NAME.OVERVIEW]: memo(() => ( + const tabComponents: Record = { + [ProjectPageTabNames.OVERVIEW]: memo(() => (
)), - [TAB_NAME.MEMBERS]: memo(() => ( + [ProjectPageTabNames.MEMBERS]: memo(() => (
@@ -81,12 +77,12 @@ export default function ProjectOverview({
)), - [TAB_NAME.PROVIDER_KEYS]: memo(() => ( + [ProjectPageTabNames.PROVIDER_KEYS]: memo(() => (
)), - [TAB_NAME.SETTINGS]: memo(() => ( + [ProjectPageTabNames.SETTINGS]: memo(() => (
@@ -113,7 +109,7 @@ export default function ProjectOverview({
)}
- + tabs={tabs} selectedTab={selectedTab} onTabChange={setSelectedTab} diff --git a/frontend/src/components/projects/[projectId]/applications/[applicationId]/application-prompt-configs-table.tsx b/frontend/src/components/projects/[projectId]/applications/[applicationId]/application-prompt-configs-table.tsx index 886e5661..0fac1e7a 100644 --- a/frontend/src/components/projects/[projectId]/applications/[applicationId]/application-prompt-configs-table.tsx +++ b/frontend/src/components/projects/[projectId]/applications/[applicationId]/application-prompt-configs-table.tsx @@ -2,8 +2,7 @@ import { useRouter } from 'next/navigation'; import { useTranslations } from 'next-intl'; import { CheckCircle, Front, PencilFill, Search } from 'react-bootstrap-icons'; -import { PromptConfigPageTab } from '@/app/[locale]/projects/[projectId]/applications/[applicationId]/configs/[promptConfigId]/page'; -import { Navigation } from '@/constants'; +import { Navigation, PromptConfigPageTab } from '@/constants'; import { modelTypeToLocaleMap, modelVendorToLocaleMap, diff --git a/frontend/src/components/projects/[projectId]/project-applications-list-table.tsx b/frontend/src/components/projects/[projectId]/project-applications-list-table.tsx index 08ff8f7f..7fed2a28 100644 --- a/frontend/src/components/projects/[projectId]/project-applications-list-table.tsx +++ b/frontend/src/components/projects/[projectId]/project-applications-list-table.tsx @@ -2,8 +2,7 @@ import { useRouter } from 'next/navigation'; import { useTranslations } from 'next-intl'; import { PencilFill } from 'react-bootstrap-icons'; -import { applicationPageTabNames } from '@/app/[locale]/projects/[projectId]/applications/[applicationId]/page'; -import { Navigation } from '@/constants'; +import { ApplicationPageTabNames, Navigation } from '@/constants'; import { Application, PromptConfig } from '@/types'; import { setRouteParams } from '@/utils/navigation'; @@ -80,7 +79,7 @@ export function ProjectApplicationsListTable({ applicationId, projectId, }, - applicationPageTabNames.SETTINGS, + ApplicationPageTabNames.SETTINGS, ), ); }} diff --git a/frontend/src/constants/navigation.ts b/frontend/src/constants/navigation.ts index fc29426d..9838af9b 100644 --- a/frontend/src/constants/navigation.ts +++ b/frontend/src/constants/navigation.ts @@ -16,3 +16,22 @@ export enum Navigation { } export const DISCORD_INVITE_LINK = 'https://discord.gg/Urxchkcq'; export const SUPPORT_EMAIL = 'support@basemind.ai'; + +export enum PromptConfigPageTab { + OVERVIEW, + TESTING, + SETTINGS, +} + +export enum ApplicationPageTabNames { + OVERVIEW, + API_KEYS, + SETTINGS, +} + +export enum ProjectPageTabNames { + OVERVIEW, + MEMBERS, + PROVIDER_KEYS, + SETTINGS, +}