Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,7 @@ export const BasicExample: React.FunctionComponent = () => {
<WidgetLayout
widgetMapping={widgetMapping}
initialTemplate={template}
onTemplateChange={(newTemplate) => {
setTemplate(newTemplate);
}}
onTemplateChange={setTemplate}
documentationLink="https://www.patternfly.org"
initialDrawerOpen={true}
/>
Expand Down
13 changes: 11 additions & 2 deletions packages/module/src/WidgetLayout/GridLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,22 @@
WidgetMapping,
ExtendedTemplateConfig,
AnalyticsTracker,
WidgetConfiguration,
} from './types';
import { Button, EmptyState, EmptyStateActions, EmptyStateBody, EmptyStateVariant, PageSection } from '@patternfly/react-core';
import { ExternalLinkAltIcon, GripVerticalIcon, PlusCircleIcon } from '@patternfly/react-icons';
import { columns, breakpoints, droppingElemId, getWidgetIdentifier, extendLayout, getGridDimensions } from './utils';

export const defaultBreakpoints = breakpoints;

const createSerializableConfig = (config?: WidgetConfiguration) => {
if (!config) return undefined;

Check failure on line 23 in packages/module/src/WidgetLayout/GridLayout.tsx

View workflow job for this annotation

GitHub Actions / call-build-lint-test-workflow / lint

Expected { after 'if' condition
return {
...(config.title && { title: config.title }),
...(config.headerLink && { headerLink: config.headerLink })
};
};

// SVG resize handle as inline data URI
const resizeHandleSvg = 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTE2IDEuMTQyODZMMTQuODU3MSAwTDAgMTQuODU3MVYxNkgxLjE0Mjg2TDE2IDEuMTQyODZaIiBmaWxsPSIjRDJEMkQyIi8+Cjwvc3ZnPgo=';

Expand Down Expand Up @@ -115,7 +124,7 @@
i: droppingElemId,
widgetType: currentDropInItem,
title: 'New title',
config: widget.config,
config: createSerializableConfig(widget.config)
};
}
return undefined;
Expand Down Expand Up @@ -161,7 +170,7 @@
widgetType: data,
i: getWidgetIdentifier(data),
title: 'New title',
config: widget.config,
config: createSerializableConfig(widget.config)
};
return {
...acc,
Expand Down
Loading