Skip to content

Commit e3b2764

Browse files
chore: update dependencies (#615)
* fix grid * update stuff * Prettified Code! * fix * aaaaah * Prettified Code! * update filter --------- Co-authored-by: Gustav-Eikaas <[email protected]>
1 parent 7e61bac commit e3b2764

File tree

7 files changed

+6813
-5574
lines changed

7 files changed

+6813
-5574
lines changed

packages/filter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@equinor/workspace-filter",
3-
"version": "4.0.2",
3+
"version": "4.0.3",
44
"type": "module",
55
"sideEffects": false,
66
"license": "MIT",

packages/filter/src/lib/components/toggleHideFilterPopover/ToggleHideFilterPopover.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { tokens } from '@equinor/eds-tokens';
33
import { useState, useRef } from 'react';
44
import { ReactSortable } from 'react-sortablejs';
55
import { StyledButton, StyledItemWrapper, StyledPopoverList } from './toggleHideFilterPopover.styles';
6+
import styled from 'styled-components';
67

78
interface ShowHideFilterButtonProps {
89
allFilters: FilterType[];
@@ -61,7 +62,7 @@ export const ToggleHideFilterPopover = ({ allFilters, setFilterOrder }: ShowHide
6162
<Popover.Header>
6263
<Popover.Title>Filter types</Popover.Title>
6364
</Popover.Header>
64-
<Popover.Content style={{ maxHeight: '60vh', overflowY: 'auto', overflowX: 'hidden' }}>
65+
<R style={{ maxHeight: '60vh', overflowY: 'auto', overflowX: 'hidden' }}>
6566
<StyledPopoverList>
6667
<ReactSortable
6768
animation={200}
@@ -87,9 +88,17 @@ export const ToggleHideFilterPopover = ({ allFilters, setFilterOrder }: ShowHide
8788
))}
8889
</ReactSortable>
8990
</StyledPopoverList>
90-
</Popover.Content>
91+
</R>
9192
</Popover>
9293
)}
9394
</>
9495
);
9596
};
97+
98+
const R = styled(Popover.Content)`
99+
& *:first-child {
100+
padding-top: 0px;
101+
padding-bottom: 0px;
102+
}
103+
padding: 0px;
104+
`;

packages/filter/src/lib/components/toggleHideFilterPopover/toggleHideFilterPopover.styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export const StyledItemWrapper = styled.div`
1111
display: grid;
1212
grid-template-columns: auto 1fr auto;
1313
14-
align-items: center;
14+
align-items: normal;
1515
width: 100%;
1616
height: 32px;
1717
min-width: 200px;

packages/workspace-fusion/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,13 @@
115115
"@equinor/workspace-react": "workspace:^",
116116
"@tanstack/react-query": "^5.32.0",
117117
"re-resizable": "^6.9.16",
118-
"react": "^18.3.1",
119-
"react-dom": "^18.3.1",
120118
"react-error-boundary": "^4.0.13",
121-
"vite-plugin-environment": "^1.1.3"
119+
"vite-plugin-environment": "^1.1.3",
120+
"react": ">= 18",
121+
"react-dom": ">= 18"
122122
},
123123
"peerDependencies": {
124-
"react-dom": ">= 16.8.0",
125-
"react-is": ">= 16.8.0",
126-
"styled-components": "^5.3.6"
124+
"styled-components": ">= 5"
127125
},
128126
"devDependencies": {
129127
"@types/jest": "29.5.12",

packages/workspace-fusion/src/modules/grid/components/GridOptionsPopover.tsx

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const GridOptionPopover = ({ anchor, excelExport, filterState }: GridOpti
5555
</StyledPopoverHeaderLine>
5656
</Popover.Header>
5757
<Popover.Content style={{ overflow: 'hidden' }}>
58-
<ButtContainer>
58+
<ButtonContainer>
5959
{isError && (
6060
<DumpsterFireDialog
6161
text={
@@ -65,14 +65,14 @@ export const GridOptionPopover = ({ anchor, excelExport, filterState }: GridOpti
6565
}
6666
/>
6767
)}
68-
<Button
68+
<ButtonButton
6969
disabled={excelExport == undefined}
70-
style={{ width: '130px' }}
70+
style={{ width: '130px', padding: '0px' }}
7171
onClick={!isPending ? handleExportToExcel : undefined}
7272
>
7373
{isPending ? <Progress.Dots color={'neutral'} /> : 'Export to Excel'}
74-
</Button>
75-
</ButtContainer>
74+
</ButtonButton>
75+
</ButtonContainer>
7676
</Popover.Content>
7777
</Popover>,
7878
anchor
@@ -88,7 +88,14 @@ const StyledPopoverHeaderLine = styled.div`
8888
align-items: center;
8989
`;
9090

91-
const ButtContainer = styled.div`
91+
const ButtonButton = styled(Button)`
92+
& *:first-child {
93+
padding-top: 0px;
94+
padding-bottom: 0px;
95+
}
96+
padding: 0px;
97+
`;
98+
const ButtonContainer = styled.div`
9299
display: flex;
93100
justify-content: center;
94101
align-items: center;

packages/workspace-fusion/src/modules/grid/components/GridWrapper.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEffect, useRef } from 'react';
1+
import { useEffect, useRef, useState } from 'react';
22
import { GridApi, GridOptions, ServerGrid } from '@equinor/workspace-ag-grid';
33
import { useFilterContext } from '@equinor/workspace-filter';
44
import { tokens } from '@equinor/eds-tokens';
@@ -28,6 +28,7 @@ export const GridWrapper = <
2828
getIdentifier,
2929
}: GridWrapperProps<TData, TContext, TFilter>) => {
3030
const ref = useRef(null);
31+
const [gridApi, setGridApi] = useState<GridApi | null>(null);
3132

3233
const { selectItem, selection } = useWorkspace();
3334
const { filterState } = useFilterContext();
@@ -43,7 +44,7 @@ export const GridWrapper = <
4344
* There is no real consequence to doing it this way
4445
*/
4546
filterStateCopy.current = filterState;
46-
config.gridOptions && config.gridOptions.api?.onFilterChanged();
47+
gridApi?.onFilterChanged();
4748
}, [filterState]);
4849

4950
const [_, height] = useResizeObserver(ref);
@@ -75,6 +76,9 @@ export const GridWrapper = <
7576
ref={ref}
7677
>
7778
<ServerGrid<TData>
79+
onGridReady={(event) => {
80+
setGridApi(event.api);
81+
}}
7882
getRows={async (params) => {
7983
await config.getRows(params, filterStateCopy.current as TFilter);
8084
handleSelectionEvent(selection, params.api);

0 commit comments

Comments
 (0)