Skip to content

Commit

Permalink
Merge pull request #2377 from Agenta-AI/AGE-1478/-404-page-displays-o…
Browse files Browse the repository at this point in the history
…n-page-refresh-within-app-view

(frontend)[AGE 1478]: 404 page Displays on Page Refresh Within App View
  • Loading branch information
ardaerzin authored Dec 19, 2024
2 parents e9225cf + a0e15e8 commit 38b9fa6
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions agenta-web/cypress/e2e/eval.evaluations.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ describe("Evaluations CRUD Operations Test", function () {
cy.get(".ant-table-row").eq(0).click()
cy.wait(1000)
cy.contains(/create a new test set/i).should("be.visible")
cy.get(".ag-root").should("exist")
cy.wait(3000)
cy.get('[data-cy="testset-header-column-edit-button"]').eq(1).click()
cy.get('[data-cy="testset-header-column-edit-input"]').clear()
cy.get('[data-cy="testset-header-column-edit-input"]').type("answer")
Expand Down
1 change: 0 additions & 1 deletion agenta-web/cypress/support/commands/evaluations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ Cypress.Commands.add("createNewEvaluation", (evaluatorName = "Exact Match") => {

cy.get('[data-cy="evaluation-testset-table"]').find('input[type="radio"]').eq(0).check()

cy.get('[data-cy="evaluation-variant-collapse-header"]').click()
cy.get('[data-cy="evaluation-variant-table"]').find('input[type="checkbox"]').eq(0).check()

cy.get('[data-cy="evaluation-evaluator-collapse-header"]').click()
Expand Down
4 changes: 2 additions & 2 deletions agenta-web/src/components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ type LayoutProps = {
const App: React.FC<LayoutProps> = ({children}) => {
const {user} = useProfileData()
const {appTheme} = useAppTheme()
const {currentApp} = useAppsData()
const {currentApp, isLoading, error} = useAppsData()
const [footerRef, {height: footerHeight}] = useElementSize()
const {project, projects} = useProjectData()
const classes = useStyles({themeMode: appTheme, footerHeight} as StyleProps)
Expand Down Expand Up @@ -207,7 +207,7 @@ const App: React.FC<LayoutProps> = ({children}) => {
// wait unitl we have the app id, if its an app route
if (isAppRoute && !appId) return null

if (appId && !currentApp)
if (appId && !currentApp && !isLoading && !error)
return (
<div className={classes.notFoundContainer}>
<Typography.Text>404 - Page Not Found</Typography.Text>
Expand Down
3 changes: 2 additions & 1 deletion agenta-web/src/contexts/app.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export const getAppValues = () => appContextValues

const AppContextProvider: React.FC<PropsWithChildren> = ({children}) => {
const {data: apps, error, isLoading, mutate} = useApps()
const {isLoading: isProjectLoading} = useProjectData()
const router = useRouter()
const appId = router.query?.app_id as string
const [recentlyVisitedAppId, setRecentlyVisitedAppId] = useLocalStorage<string | null>(
Expand Down Expand Up @@ -115,7 +116,7 @@ const AppContextProvider: React.FC<PropsWithChildren> = ({children}) => {
currentApp,
apps,
error,
isLoading,
isLoading: isLoading || isProjectLoading,
mutate,
modalInstance,
setModalInstance,
Expand Down

0 comments on commit 38b9fa6

Please sign in to comment.