Skip to content

Commit

Permalink
Merge pull request Ferlab-Ste-Justine#352 from Ferlab-Ste-Justine/fix…
Browse files Browse the repository at this point in the history
…/SKFP-852/summary

fix(grid): SKFP-852 remove breakpoint, rgl should manage it by himself
  • Loading branch information
lflangis authored Nov 20, 2023
2 parents ffbae11 + 1387299 commit 6ae3ad7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 18 deletions.
3 changes: 3 additions & 0 deletions packages/ui/Release.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 7.14.9 2023-11-20
- fix: SKFP-852 remove breakpoint loading system, let rgl manage it by himself

### 7.14.8 2023-11-08
- fix: SKFP-852 prevent the grid to be saved while the grid is still loading

Expand Down
4 changes: 2 additions & 2 deletions packages/ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ferlab/ui",
"version": "7.14.8",
"version": "7.14.9",
"description": "Core components for scientific research data portals",
"publishConfig": {
"access": "public"
Expand Down
16 changes: 1 addition & 15 deletions packages/ui/src/layout/ResizableGridLayout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ const ResizableGridLayout = ({
const [isLoaded, setIsLoaded] = useState(false);
const [isDraggable, setIsDraggable] = useState(false);
const [isResizable, setIsResizable] = useState(false);
const [currentBreakpoint, setCurrentBreakpoint] = useState<string>('md');
const configs = deserialize(defaultLayouts, layouts);
const responsiveDefaultLayouts = serializeConfigToLayouts(configs);
const resizableItemsList = configs.map(({ hidden, id, title }) => ({
Expand Down Expand Up @@ -389,12 +388,6 @@ const ResizableGridLayout = ({
layouts={responsiveDefaultLayouts}
margin={[12, 12]}
maxRows={10}
onBreakpointChange={(newBreakpoint: string, newCols: number) => {
if (newBreakpoint === currentBreakpoint) {
return;
}
setCurrentBreakpoint(newBreakpoint);
}}
onLayoutChange={(currentLayout, allLayouts) => {
if (!isLoaded || isLayoutConfigEqual(allLayouts, configs)) {
return;
Expand All @@ -410,14 +403,7 @@ const ResizableGridLayout = ({
if (layout.hidden) {
return;
}
return (
<div
data-grid={layout[currentBreakpoint as keyof IResizableGridLayoutConfig]}
key={layout.id}
>
{layout.component}
</div>
);
return <div key={layout.id}>{layout.component}</div>;
})}
</ResponsiveGridLayout>
)}
Expand Down

0 comments on commit 6ae3ad7

Please sign in to comment.