Skip to content

Commit

Permalink
element options fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rrmerugu committed Jun 2, 2021
1 parent 6a04c16 commit 285940b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
26 changes: 14 additions & 12 deletions src/web/interface/element-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@ export default class ElementOptions extends DefaultRemoteComponent {
// }

componentDidMount() {
super.componentDidMount();
console.log("VO componentDidMount")
console.log("======", this.props, this.requestBuilder);
this.getElementInitialConfig();
if (this.props.elementOptionsToShow && this.props.elementOptionsToShow.label) {

super.componentDidMount();
console.log("VO componentDidMount")
console.log("======", this.props, this.requestBuilder);
this.getElementInitialConfig();
}
}

getElementLabel() {
Expand Down Expand Up @@ -69,14 +71,14 @@ export default class ElementOptions extends DefaultRemoteComponent {

componentDidUpdate(prevProps) {
console.log("VO componentDidUpdate")
// const label = this.getElementLabel();

const prevGroupName = prevProps.elementOptionsToShow ? prevProps.elementOptionsToShow.label : null;
const thisPropGroupName = this.props.elementOptionsToShow ? this.props.elementOptionsToShow.label : null;
if (prevGroupName !== thisPropGroupName) {
// already data exist
this.setState({nodeOptions: null});
this.getElementInitialConfig();
if (this.props.elementOptionsToShow && this.props.elementOptionsToShow.label) {
const prevGroupName = prevProps.elementOptionsToShow ? prevProps.elementOptionsToShow.label : null;
const thisPropGroupName = this.props.elementOptionsToShow ? this.props.elementOptionsToShow.label : null;
if ((prevGroupName && thisPropGroupName) && (prevGroupName !== thisPropGroupName)) {
// already data exist
this.setState({nodeOptions: null});
this.getElementInitialConfig();
}
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/web/viewlets/canvas/graph-canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,9 @@ export default class GraphCanvas extends DefaultRemoteComponent {
: <React.Fragment/>
}
{
this.state.modalContentName === "element-options" && this.state.elementOptionsToShow
this.state.modalContentName === "element-options"
&& this.state.elementOptionsToShow
&& this.state.elementOptionsToShow.label
? <Modal
className={"border-0 "}
size="lg"
Expand Down

0 comments on commit 285940b

Please sign in to comment.