Skip to content

Commit

Permalink
* (bluefox) Allowed to show only specific root in SelectIDDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanBluefox committed May 9, 2023
1 parent 900e00e commit 6fdb4e9
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 89 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -661,6 +661,9 @@ socket.getObjectViewCustom('custom', 'state', 'startKey', 'endKey')
-->

## Changelog
### **WORK IN PROGRESS**
* (bluefox) Allowed to show only specific root in SelectIDDialog

### 4.0.26 (2023-05-08)
* (bluefox) Added IDs to the buttons in the dialog for GUI tests

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"@mui/x-date-pickers": "6.3.1",
"@iobroker/socket-client": "^2.0.7",
"react-cropper": "^2.3.3",
"@sentry/browser": "^7.51.0",
"@sentry/integrations": "^7.51.0",
"@sentry/browser": "^7.51.2",
"@sentry/integrations": "^7.51.2",
"@types/iobroker": "^4.0.5",
"react-color": "^2.19.3",
"react-colorful": "^5.6.1",
Expand All @@ -55,7 +55,7 @@
"devDependencies": {
"@alcalzone/release-script": "^3.5.9",
"@alcalzone/release-script-plugin-license": "^3.5.9",
"@types/node": "^20.1.0",
"@types/node": "^20.1.1",
"@babel/core": "^7.21.8",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-transform-runtime": "^7.21.4",
Expand Down
16 changes: 9 additions & 7 deletions src/Components/JsonConfigComponent/ConfigObjectId.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,26 @@ import DialogSelectID from './wrapper/Dialogs/SelectID';

import ConfigGeneric from './ConfigGeneric';

const styles = theme => ({
const styles = () => ({
fullWidth: {
width: '100%'
width: '100%',
},
flex: {
display: 'flex'
display: 'flex',
},
button: {
height: 48,
marginLeft: 4,
minWidth: 48,
}
},
});

class ConfigObjectId extends ConfigGeneric {
async componentDidMount() {
super.componentDidMount();
const { data, attr } = this.props;
const value = ConfigGeneric.getValue(data, attr) || '';
this.setState({ value, initialized: true});
this.setState({ value, initialized: true });
}

renderItem(error, disabled, defaultValue) {
Expand All @@ -54,7 +54,7 @@ class ConfigObjectId extends ConfigGeneric {
onChange={e => {
const value = e.target.value;
this.setState({ value }, () =>
this.onChange(attr, value))
this.onChange(attr, value));
}}
/>
<Button
Expand All @@ -69,11 +69,13 @@ class ConfigObjectId extends ConfigGeneric {
imagePrefix={this.props.imagePrefix === undefined ? '../..' : this.props.imagePrefix}
dateFormat={this.props.dateFormat}
isFloatComma={this.props.isFloatComma}
dialogName={'admin.' + this.props.adapterName}
dialogName={`admin.${this.props.adapterName}`}
themeType={this.props.themeType}
types={schema.type ? [schema.type] : undefined}
socket={socket}
statesOnly={schema.all === undefined ? true : schema.all}
selected={value}
root={schema.root}
onClose={() => this.setState({ showSelectId: false })}
onOk={value =>
this.setState({ showSelectId: false, value }, () =>
Expand Down
2 changes: 2 additions & 0 deletions src/Components/JsonConfigComponent/ConfigPanel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import ConfigFile from './ConfigFile';
import ConfigFileSelector from './ConfigFileSelector';
import ConfigFunc from './ConfigFunc';
import ConfigIP from './ConfigIP';
import ConfigImageSendTo from './ConfigImageSendTo';
import ConfigImageUpload from './ConfigImageUpload';
import ConfigInstanceSelect from './ConfigInstanceSelect';
import ConfigJsonEditor from './ConfigJsonEditor';
Expand Down Expand Up @@ -80,6 +81,7 @@ const components = {
func: ConfigFunc,
header: ConfigStaticHeader,
image: ConfigImageUpload,
imageSendTo: ConfigImageSendTo,
instance: ConfigInstanceSelect,
ip: ConfigIP,
jsonEditor: ConfigJsonEditor,
Expand Down
Loading

0 comments on commit 6fdb4e9

Please sign in to comment.