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

(frontend)[AGE 1478]: 404 page Displays on Page Refresh Within App View #2377

Merged
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
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()
bekossy marked this conversation as resolved.
Show resolved Hide resolved
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
Loading