Companies show page as record page (#15132)

Example showing two widgets positioned in a vertical list:


https://github.com/user-attachments/assets/cf3e9793-7d80-4cab-b708-aad9f2bca7d8
This commit is contained in:
Baptiste Devessier
2025-10-16 16:45:06 +02:00
committed by GitHub
parent b2247a7a3d
commit 1b6c9e851f
14 changed files with 405 additions and 48 deletions
@@ -1,4 +1,6 @@
import { FIND_ONE_PAGE_LAYOUT } from '@/dashboards/graphql/queries/findOnePageLayout';
import { DEFAULT_PAGE_LAYOUT } from '@/page-layout/constants/DefaultPageLayout';
import { DEFAULT_PAGE_LAYOUT_ID } from '@/page-layout/constants/DefaultPageLayoutId';
import { pageLayoutCurrentLayoutsComponentState } from '@/page-layout/states/pageLayoutCurrentLayoutsComponentState';
import { pageLayoutDraftComponentState } from '@/page-layout/states/pageLayoutDraftComponentState';
import { pageLayoutPersistedComponentState } from '@/page-layout/states/pageLayoutPersistedComponentState';
@@ -24,15 +26,20 @@ export const PageLayoutInitializationQueryEffect = ({
}: PageLayoutInitializationQueryEffectProps) => {
const [isInitialized, setIsInitialized] = useState(false);
const isDefaultLayout = pageLayoutId === DEFAULT_PAGE_LAYOUT_ID;
const { data } = useQuery(FIND_ONE_PAGE_LAYOUT, {
variables: {
id: pageLayoutId,
},
skip: isDefaultLayout,
});
const pageLayout: PageLayout | undefined = data?.getPageLayout
? transformPageLayout(data.getPageLayout)
: undefined;
const pageLayout: PageLayout | undefined = isDefaultLayout
? DEFAULT_PAGE_LAYOUT
: data?.getPageLayout
? transformPageLayout(data.getPageLayout)
: undefined;
const pageLayoutPersistedComponentCallbackState =
useRecoilComponentCallbackState(pageLayoutPersistedComponentState);