Record page layout edition frontend (#17519)
Hidden behind a new feature flag: `IS_RECORD_PAGE_LAYOUT_EDITING_ENABLED` https://github.com/user-attachments/assets/112f5a8d-0dd0-4b9f-8825-9980db35fcbd
This commit is contained in:
committed by
GitHub
parent
97a37604bd
commit
b15d092abd
+10
-2
@@ -29,7 +29,7 @@ import styled from '@emotion/styled';
|
||||
import { type MouseEvent } from 'react';
|
||||
import { ErrorBoundary } from 'react-error-boundary';
|
||||
import { IconLock } from 'twenty-ui/display';
|
||||
import { WidgetType } from '~/generated/graphql';
|
||||
import { PageLayoutType, WidgetType } from '~/generated/graphql';
|
||||
|
||||
const StyledNoAccessContainer = styled.div`
|
||||
align-items: center;
|
||||
@@ -79,6 +79,9 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
|
||||
|
||||
const isLastWidget = useIsCurrentWidgetLastOfTab(widget.id);
|
||||
|
||||
const isReorderEnabled =
|
||||
currentPageLayout.type !== PageLayoutType.RECORD_PAGE;
|
||||
|
||||
// TODO: when we have more widgets without headers, we should use a more generic approach to hide the header
|
||||
// each widget type could have metadata (e.g., hasHeader: boolean or headerMode: 'always' | 'editOnly' | 'never')
|
||||
const isRichTextWidget = widget.type === WidgetType.STANDALONE_RICH_TEXT;
|
||||
@@ -144,6 +147,7 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
|
||||
variant={variant}
|
||||
isInEditMode={isPageLayoutInEditMode}
|
||||
isResizing={isResizing}
|
||||
isReorderEnabled={isReorderEnabled}
|
||||
title={widget.title}
|
||||
onRemove={handleRemove}
|
||||
actions={actions}
|
||||
@@ -158,7 +162,11 @@ export const WidgetRenderer = ({ widget }: WidgetRendererProps) => {
|
||||
/>
|
||||
)}
|
||||
|
||||
<WidgetCardContent variant={variant} hasHeader={showHeader}>
|
||||
<WidgetCardContent
|
||||
variant={variant}
|
||||
hasHeader={showHeader}
|
||||
isEditable={isPageLayoutInEditMode}
|
||||
>
|
||||
{hasAccess ? (
|
||||
<ErrorBoundary
|
||||
FallbackComponent={PageLayoutWidgetInvalidConfigDisplay}
|
||||
|
||||
Reference in New Issue
Block a user