Skip to content

Commit ca66bb0

Browse files
committed
adding currentDropInItemAtom back as removing it broke the drop on functionality
1 parent a55c795 commit ca66bb0

3 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/Components/DnDLayout/ConvertWidgetMapping.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { WidgetMapping } from '@patternfly/widgetized-dashboard';
55
import { ScalprumComponent } from '@scalprum/react-core';
66
import { WidgetMapping as ScalprumWidgetMapping } from '../../api/dashboard-templates';
77
import HeaderIcon from '../Icons/HeaderIcon';
8+
import './WidgetSkeleton.scss';
89

910
/**
1011
* Adapter to convert Scalprum WidgetMapping to PatternFly WidgetMapping.
@@ -28,7 +29,7 @@ const convertWidgetMapping = (scalprumMapping: ScalprumWidgetMapping): WidgetMap
2829
},
2930
renderWidget: (_widgetId: string) => (
3031
<ScalprumComponent
31-
fallback={<Skeleton style={{ borderRadius: 0 }} shape="square" width="100%" height="100%" />}
32+
fallback={<Skeleton shape="square" width="100%" height="100%" />}
3233
scope={scalprumWidget.scope}
3334
module={scalprumWidget.module}
3435
importName={scalprumWidget.importName}

src/Components/DnDLayout/GridLayout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import ResizeHandleSVG from './resize-handle.svg';
88
import { widgetMappingAtom } from '../../state/widgetMappingAtom';
99
import { layoutVariantAtom } from '../../state/layoutAtom';
1010
import { templateAtom, templateIdAtom } from '../../state/templateAtom';
11+
import { currentDropInItemAtom } from '../../state/currentDropInItemAtom';
1112
import DebouncePromise from 'awesome-debounce-promise';
1213
import {
1314
LayoutTypes,
@@ -59,8 +60,8 @@ const debouncedPatchDashboardTemplate = DebouncePromise(patchDashboardTemplate,
5960
onlyResolvesLast: true,
6061
});
6162

62-
const getResizeHandle = (resizeHandleAxis: string, ref: React.Ref<HTMLElement>) => (
63-
<div ref={ref as React.Ref<HTMLDivElement>} className={`react-resizable-handle react-resizable-handle-${resizeHandleAxis}`}>
63+
const getResizeHandle = (resizeHandleAxis: string, ref: React.Ref<HTMLDivElement>) => (
64+
<div ref={ref} className={`react-resizable-handle react-resizable-handle-${resizeHandleAxis}`}>
6465
<img src={ResizeHandleSVG} alt="" aria-hidden="true" />
6566
</div>
6667
);
@@ -76,6 +77,7 @@ const GridLayout = ({ isLayoutLocked = false, layoutType = 'landingPage' }: { is
7677
const addNotification = useAddNotification();
7778
const setCurrentlyUsedWidgets = useSetAtom(currentlyUsedWidgetsAtom);
7879
const setDrawerExpanded = useSetAtom(drawerExpandedAtom);
80+
const currentDropInItem = useAtomValue(currentDropInItemAtom);
7981
const { analytics } = useChrome();
8082

8183
// Convert Scalprum mapping to PatternFly mapping
@@ -199,6 +201,7 @@ const GridLayout = ({ isLayoutLocked = false, layoutType = 'landingPage' }: { is
199201
showEmptyState={!isLoaded}
200202
onDrawerExpandChange={handleDrawerExpandChange}
201203
onActiveWidgetsChange={handleActiveWidgetsChange}
204+
droppingWidgetType={currentDropInItem}
202205
/>
203206
)}
204207
</div>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// Widget loading skeleton styles
2+
// Target skeletons inside the widget layout container
3+
#widget-layout-container .pf-v6-c-skeleton {
4+
border-radius: 0;
5+
}

0 commit comments

Comments
 (0)