Skip to content

Commit

Permalink
## Changelog
Browse files Browse the repository at this point in the history
### __WORK IN PROGRESS__
* (Bluefox) Fixed the select ID dialog
  • Loading branch information
GermanBluefox committed Sep 6, 2020
1 parent 9d7c5cc commit f9ef199
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 5 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,17 @@ And then call "npm run build".
- heating profile (future releases)
- ...

<!--
Placeholder for the next version (at the beginning of the line):
### __WORK IN PROGRESS__
-->

## Changelog
### __WORK IN PROGRESS__
* (Bluefox) Fixed the select ID dialog

### 4.7.2 (2020-09-05)
* (Bluefox) Fixed blockly problem
* chore: release v4.7.0

### 4.7.1 (2020-09-04)
* (Bluefox) Fixed styling
Expand Down
4 changes: 2 additions & 2 deletions src/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"@material-ui/core": "^4.11.0",
"@material-ui/icons": "^4.9.1",
"@material-ui/lab": "^4.0.0-alpha.56",
"@iobroker/adapter-react": "^1.2.2",
"@iobroker/adapter-react": "^1.2.3",
"@sentry/browser": "^5.22.3",
"@sentry/integrations": "^5.22.3",
"classnames": "^2.2.6",
Expand Down Expand Up @@ -44,4 +44,4 @@
"not op_mini all"
],
"devDependencies": {}
}
}
31 changes: 29 additions & 2 deletions src/src/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -968,15 +968,42 @@ class Editor extends React.Component {

getSelectIdDialog() {
if (this.state.showSelectId) {
let selectedId = this.selectId.callback ? this.selectId.initValue || '' : this.getSelect ? this.getSelect() : '';
// it could be:
// - 'id.xx'/* aksjdhsdf*/
// - "id.xx"/* aksjdhsdf*/
// - "id.xx"//
let pos = selectedId.indexOf('/*');
if (pos !== -1) {
selectedId = selectedId.substring(0, pos);
}
pos = selectedId.indexOf('//');
if (pos !== -1) {
selectedId = selectedId.substring(0, pos);
}
let m = selectedId.match(/"([^"]+)"/);
if (m) {
selectedId = m[1];
}
m = selectedId.match(/'([^']+)'/);
if (m) {
selectedId = m[1];
}

return <DialogSelectID
key="dialogSelectID1"
prefix={'../..'}
themeName={this.props.themeName}
themeType={this.state.themeType}
socket={this.props.socket}
selected={this.selectId.callback ? this.selectId.initValue || '' : this.getSelect ? this.getSelect() : ''}
selected={selectedId}
statesOnly={true}
onClose={() => this.setState({showSelectId: false})}
onClose={() => {
this.setState({showSelectId: false});
if (this.selectId.callback) {
this.selectId.callback = null;
}
}}
onOk={(selected, name) => {
this.selectId.initValue = null;
if (this.selectId.callback) {
Expand Down

0 comments on commit f9ef199

Please sign in to comment.