From 27b742c5c260fbeaafbccdfd2f629f4960ab395d Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Mon, 16 Dec 2024 10:48:44 +0100 Subject: [PATCH 1/3] hot fix(frontend): improved 404 screen conditional --- agenta-web/src/components/Layout/Layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/agenta-web/src/components/Layout/Layout.tsx b/agenta-web/src/components/Layout/Layout.tsx index 8b471ce51e..84e34c144e 100644 --- a/agenta-web/src/components/Layout/Layout.tsx +++ b/agenta-web/src/components/Layout/Layout.tsx @@ -119,7 +119,7 @@ type LayoutProps = { const App: React.FC = ({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) @@ -207,7 +207,7 @@ const App: React.FC = ({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 (
404 - Page Not Found From e6497e95beef27bdb36fc8d0f6c84c5b8ab64f56 Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Mon, 16 Dec 2024 11:08:35 +0100 Subject: [PATCH 2/3] minor fix(frontend) --- agenta-web/src/contexts/app.context.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/agenta-web/src/contexts/app.context.tsx b/agenta-web/src/contexts/app.context.tsx index 548aa34f39..a713fcf0e4 100644 --- a/agenta-web/src/contexts/app.context.tsx +++ b/agenta-web/src/contexts/app.context.tsx @@ -73,6 +73,7 @@ export const getAppValues = () => appContextValues const AppContextProvider: React.FC = ({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( @@ -118,7 +119,7 @@ const AppContextProvider: React.FC = ({children}) => { currentApp, apps, error, - isLoading, + isLoading: isLoading || isProjectLoading, mutate, modalInstance, setModalInstance, From a0e15e86fff6583f4eb4931edd03d9104629717e Mon Sep 17 00:00:00 2001 From: Kaosiso Ezealigo Date: Thu, 19 Dec 2024 14:41:15 +0100 Subject: [PATCH 3/3] fixed failing cypress test(frontend) --- agenta-web/cypress/e2e/eval.evaluations.cy.ts | 2 ++ agenta-web/cypress/support/commands/evaluations.ts | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/agenta-web/cypress/e2e/eval.evaluations.cy.ts b/agenta-web/cypress/e2e/eval.evaluations.cy.ts index 2324923abb..fee60cf455 100644 --- a/agenta-web/cypress/e2e/eval.evaluations.cy.ts +++ b/agenta-web/cypress/e2e/eval.evaluations.cy.ts @@ -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") diff --git a/agenta-web/cypress/support/commands/evaluations.ts b/agenta-web/cypress/support/commands/evaluations.ts index c01d83092b..57004db6d5 100644 --- a/agenta-web/cypress/support/commands/evaluations.ts +++ b/agenta-web/cypress/support/commands/evaluations.ts @@ -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()