Load views on user load and read in cache (#3552)

* WIP

* Poc

* Use cached root query + remove proloaded views state

* Fix storybook test + fix codegen

* Return default schema if token is absent, unauthenticated if token is invalid

* Use enum instead of bool

---------

Co-authored-by: Thomas Trompette <thomast@twenty.com>
Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
Thomas Trompette
2024-01-22 16:00:16 +01:00
committed by GitHub
parent 764374f6b8
commit f1b3d1537a
19 changed files with 324 additions and 113 deletions

View File

@ -8,6 +8,7 @@ import { DefaultLayout } from '@/ui/layout/page/DefaultLayout';
import { PageTitle } from '@/ui/utilities/page-title/PageTitle';
import { CommandMenuEffect } from '~/effect-components/CommandMenuEffect';
import { GotoHotkeysEffect } from '~/effect-components/GotoHotkeysEffect';
import { useDefaultHomePagePath } from '~/hooks/useDefaultHomePagePath';
import { CreateProfile } from '~/pages/auth/CreateProfile';
import { CreateWorkspace } from '~/pages/auth/CreateWorkspace';
import { PlanRequired } from '~/pages/auth/PlanRequired';
@ -39,7 +40,10 @@ import { getPageTitleFromPath } from '~/utils/title-utils';
export const App = () => {
const { pathname } = useLocation();
const { defaultHomePagePath } = useDefaultHomePagePath();
const pageTitle = getPageTitleFromPath(pathname);
return (
<>
<PageTitle title={pageTitle} />
@ -54,7 +58,7 @@ export const App = () => {
<Route path={AppPath.CreateWorkspace} element={<CreateWorkspace />} />
<Route path={AppPath.CreateProfile} element={<CreateProfile />} />
<Route path={AppPath.PlanRequired} element={<PlanRequired />} />
<Route path="/" element={<Navigate to="/objects/companies" />} />
<Route path="/" element={<Navigate to={defaultHomePagePath} />} />
<Route path={AppPath.TasksPage} element={<Tasks />} />
<Route path={AppPath.Impersonate} element={<ImpersonateEffect />} />