Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Packages 912 #420

Merged
merged 3 commits into from
Sep 12, 2024
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
12 changes: 5 additions & 7 deletions MIGRATION_4_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,17 @@ If you still have questions, try to find an answer [here](https://mui.com/guides
- Look for calls of custom like

```jsx
this.props.socket._socket.emit('getObjectView', 'system', 'custom', {startKey: '', endKey:'\u9999'}, (err, objs) => {
(objs?.rows || [])
.forEach(item => console.log(item.id, item.value));
this.props.socket._socket.emit('getObjectView', 'system', 'custom', { startKey: '', endKey: '\u9999' }, (err, objs) => {
(objs?.rows || []).forEach(item => console.log(item.id, item.value));
});
```

to

```jsx
socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
.then(objects => {
Object.keys(objects).forEach(obj => console.log(obj._id));
});
socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey').then(objects => {
Object.keys(objects).forEach(obj => console.log(obj._id));
});
```

- Replace all `socket.log.error('text')` to `socket.log('text', 'error')`
Expand Down
18 changes: 9 additions & 9 deletions MIGRATION_5_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ After:

```typescript jsx
const styles: Record<string, any> = {
dialog: (theme: IobTheme) => ({
height: `calc(100% - ${theme => theme.mixins.toolbar.minHeight}px)`,
p: 1, // or 8px, padding is OK too
m: '16px', // or 2, margin is OK too
gap: '5px',
borderRadius: '5px',
ml: '10px', // mt, mr, mb, but marginLeft, marginRight, marginBottom is OK too
pl: '10px', // pt, pr, pb, but paddingTop, paddingRight, paddingBottom is OK too
}),
dialog: (theme: IobTheme) => ({
height: `calc(100% - ${theme => theme.mixins.toolbar.minHeight}px)`,
p: 1, // or 8px, padding is OK too
m: '16px', // or 2, margin is OK too
gap: '5px',
borderRadius: '5px',
ml: '10px', // mt, mr, mb, but marginLeft, marginRight, marginBottom is OK too
pl: '10px', // pt, pr, pb, but paddingTop, paddingRight, paddingBottom is OK too
}),
};
```

Expand Down
16 changes: 13 additions & 3 deletions MIGRATION_6_7.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
# Migration from adapter-react-v5@6.x to adapter-react-v5@7.x

Only MUI library was updated from v5 to v6.

## No `withStyles` at all

`withStyles` was removed completely. So you have to replace all `withStyles` with `sx` or `style` properties.

## slotProps

`inputProps` and `InputProps` are now in `slotProps`

Examples:
Before:

```jsx
<TextField inputProps={{ readOnly: true }} InputProps={{ endAdornment: <IconButton />}}/>
```
<TextField
inputProps={{ readOnly: true }}
InputProps={{ endAdornment: <IconButton /> }}
/>
```

```jsx
<TextField
Expand All @@ -23,6 +31,8 @@ Before:
},
}}
/>
```
```

## SelectID dialog

`SelectID` dialog now requires `theme` property. Without this property, the dialog will crash.
Loading
Loading