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:
committed by
GitHub
parent
b2247a7a3d
commit
1b6c9e851f
+10
-3
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user