Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): removed capitalization from app name #2296

Merged
merged 1 commit into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions agenta-web/src/components/AppSelector/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {Card, Dropdown, Button, Typography, Tag} from "antd"
import {MoreOutlined} from "@ant-design/icons"
import {deleteApp} from "@/services/app-selector/api"
import {useState} from "react"
import {renameVariablesCapitalizeAll} from "@/lib/helpers/utils"
import {createUseStyles} from "react-jss"
import {JSSTheme, ListAppsItem} from "@/lib/Types"
import {useAppsData} from "@/contexts/app.context"
Expand Down Expand Up @@ -83,7 +82,7 @@ const AppCard: React.FC<{
<>
<Card
className={classes.card}
title={renameVariablesCapitalizeAll(app.app_name)}
title={app.app_name}
onClick={() => router.push(`/apps/${app.app_id}/overview`)}
extra={
<Dropdown
Expand Down
5 changes: 2 additions & 3 deletions agenta-web/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {Breadcrumb, Layout, Modal, Space, Typography, theme} from "antd"
import Sidebar from "../Sidebar/Sidebar"
import {GithubFilled, LinkedinFilled, TwitterOutlined} from "@ant-design/icons"
import Link from "next/link"
import {isDemo, renameVariablesCapitalizeAll} from "@/lib/helpers/utils"
import {isDemo} from "@/lib/helpers/utils"
import {useAppTheme} from "./ThemeContextProvider"
import {useElementSize} from "usehooks-ts"
import {createUseStyles} from "react-jss"
Expand Down Expand Up @@ -84,7 +84,6 @@ const App: React.FC<LayoutProps> = ({children}) => {
const {user} = useProfileData()
const {appTheme} = useAppTheme()
const {currentApp} = useAppsData()
const capitalizedAppName = renameVariablesCapitalizeAll(currentApp?.app_name || "")
const [footerRef, {height: footerHeight}] = useElementSize()
const classes = useStyles({themeMode: appTheme, footerHeight} as StyleProps)
const router = useRouter()
Expand Down Expand Up @@ -190,7 +189,7 @@ const App: React.FC<LayoutProps> = ({children}) => {
</div>
),
},
{title: capitalizedAppName},
{title: currentApp?.app_name || ""},
]}
/>
<div className={classes.topRightBar}>
Expand Down
5 changes: 2 additions & 3 deletions agenta-web/src/components/Sidebar/config.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {useAppId} from "@/hooks/useAppId"
import {useSession} from "@/hooks/useSession"
import {dynamicContext} from "@/lib/helpers/dynamic"
import {isDemo, renameVariablesCapitalizeAll} from "@/lib/helpers/utils"
import {isDemo} from "@/lib/helpers/utils"
import {AppstoreOutlined, DatabaseOutlined, RocketOutlined, GithubFilled} from "@ant-design/icons"
import {useEffect, useState} from "react"
import {
Expand Down Expand Up @@ -41,7 +41,6 @@ export const useSidebarConfig = () => {
const appId = useAppId()
const {doesSessionExist} = useSession()
const {currentApp, recentlyVisitedAppId, apps} = useAppsData()
const capitalizedAppName = renameVariablesCapitalizeAll(currentApp?.app_name || "")
const isOss = !isDemo()
const [useOrgData, setUseOrgData] = useState<Function>(() => () => "")

Expand Down Expand Up @@ -80,7 +79,7 @@ export const useSidebarConfig = () => {
},
{
key: `${currentApp?.app_name || ""}_key`,
title: capitalizedAppName,
title: currentApp?.app_name || "",
icon: <></>,
header: true,
},
Expand Down
4 changes: 1 addition & 3 deletions agenta-web/src/pages/apps/[app_id]/overview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import VariantsOverview from "@/components/pages/overview/variants/VariantsOverv
import {useAppsData} from "@/contexts/app.context"
import {useAppId} from "@/hooks/useAppId"
import {dynamicComponent} from "@/lib/helpers/dynamic"
import {renameVariablesCapitalizeAll} from "@/lib/helpers/utils"
import {Environment, JSSTheme, Variant} from "@/lib/Types"
import {fetchSingleProfile, fetchVariants} from "@/services/api"
import {deleteApp} from "@/services/app-selector/api"
Expand Down Expand Up @@ -44,7 +43,6 @@ export default function Overview() {
const appId = useAppId()
const classes = useStyles()
const {currentApp} = useAppsData()
const capitalizedAppName = renameVariablesCapitalizeAll(currentApp?.app_name || "")
const [variants, setVariants] = useState<Variant[]>([])
const [isVariantLoading, setIsVariantLoading] = useState(false)
const [isDeleteAppModalOpen, setIsDeleteAppModalOpen] = useState(false)
Expand Down Expand Up @@ -118,7 +116,7 @@ export default function Overview() {
<>
<div className={classes.container}>
<Space className="justify-between">
<Title>{capitalizedAppName}</Title>
<Title>{currentApp?.app_name || ""}</Title>

<Dropdown
trigger={["click"]}
Expand Down