(false);
const resizableItemsList = configs.map(({ hidden, id, title }) => ({
id,
label: title,
@@ -389,12 +359,22 @@ const ResizableGridLayout = ({
}
setCurrentBreakpoint(newBreakpoint);
}}
- onLayoutChange={(currentLayout, allLayouts) => {
- if (!isLoaded || isLayoutConfigEqual(allLayouts, configs)) {
+ onDragStop={() => {
+ setHasLayoutChanged(true);
+ }}
+ onLayoutChange={(currentLayout: Layout[], allLayouts: Layouts) => {
+ if (!isLoaded) {
return;
}
- const serializedLayouts = serializeLayoutsToConfig(allLayouts, configs);
- onConfigUpdate(serializedLayouts);
+
+ if (hasLayoutChanged) {
+ const serializedLayouts = serializeLayoutsToConfig(allLayouts, configs);
+ onConfigUpdate(serializedLayouts);
+ setHasLayoutChanged(false);
+ }
+ }}
+ onResizeStop={() => {
+ setHasLayoutChanged(true);
}}
rowHeight={98}
width={size.width && size.width !== null ? size.width : 1280}
@@ -408,6 +388,7 @@ const ResizableGridLayout = ({
const grid = layout[
currentBreakpoint as keyof IResizableGridLayoutConfig
] as ILayoutItemConfig;
+
return (
{layout.component}
@@ -423,6 +404,7 @@ const ResizableGridLayout = ({
);
-};
+},
+arePropsEqual);
export default ResizableGridLayout;
diff --git a/packages/ui/src/layout/ResizableGridLayout/utils.ts b/packages/ui/src/layout/ResizableGridLayout/utils.ts
index a641d34e6..012b794b0 100644
--- a/packages/ui/src/layout/ResizableGridLayout/utils.ts
+++ b/packages/ui/src/layout/ResizableGridLayout/utils.ts
@@ -38,13 +38,13 @@ export const observedPhenotypeDefaultGridConfig = {
y: 0,
},
xs: {
- h: 4,
+ h: 6,
w: 6,
x: 0,
y: 0,
},
xxs: {
- h: 4,
+ h: 6,
w: 4,
x: 0,
y: 0,
@@ -78,16 +78,16 @@ export const mondoDefaultGridConfig = {
y: 0,
},
xs: {
- h: 4,
+ h: 6,
w: 6,
x: 0,
- y: 4,
+ y: 6,
},
xxs: {
- h: 4,
+ h: 6,
w: 4,
x: 0,
- y: 4,
+ y: 6,
},
};
@@ -122,13 +122,13 @@ export const demographicsDefaultGridConfig = {
h: 2,
w: 6,
x: 0,
- y: 8,
+ y: 12,
},
xxs: {
h: 2,
w: 4,
x: 0,
- y: 8,
+ y: 12,
},
};
@@ -163,13 +163,13 @@ export const ageAtDiagnosisDefaultGridConfig = {
h: 2,
w: 6,
x: 0,
- y: 10,
+ y: 14,
},
xxs: {
h: 2,
w: 4,
x: 0,
- y: 10,
+ y: 14,
},
};
@@ -204,13 +204,13 @@ export const dataCategoryDefaultGridConfig = {
h: 2,
w: 6,
x: 0,
- y: 12,
+ y: 16,
},
xxs: {
h: 2,
w: 4,
x: 0,
- y: 12,
+ y: 16,
},
};
@@ -245,13 +245,13 @@ export const studiesDefaultGridConfig = {
h: 3,
w: 6,
x: 0,
- y: 14,
+ y: 18,
},
xxs: {
h: 3,
w: 4,
x: 0,
- y: 14,
+ y: 18,
},
};
@@ -286,12 +286,12 @@ export const dataTypeDefaultGridConfig = {
h: 4,
w: 6,
x: 0,
- y: 17,
+ y: 21,
},
xxs: {
h: 4,
w: 4,
x: 0,
- y: 17,
+ y: 21,
},
};