Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added setCallbacks method
Browse files Browse the repository at this point in the history
Signed-off-by: Neha Gokhale <[email protected]>
nmgokhale committed Jan 3, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent b7fcd39 commit d13ea59
Showing 1 changed file with 16 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -59,17 +59,7 @@ class PropertiesMain extends React.Component {
this.propertiesController.setLight(props.light);
this.propertiesController.setAppData(props.propertiesInfo.appData);
this.propertiesController.setExpressionInfo(props.propertiesInfo.expressionInfo);
this.propertiesController.setHandlers({
controllerHandler: props.callbacks.controllerHandler,
propertyListener: props.callbacks.propertyListener,
actionHandler: props.callbacks.actionHandler,
buttonHandler: props.callbacks.buttonHandler,
buttonIconHandler: props.callbacks.buttonIconHandler,
validationHandler: props.callbacks.validationHandler,
titleChangeHandler: props.callbacks.titleChangeHandler,
tooltipLinkHandler: props.callbacks.tooltipLinkHandler,
propertyIconHandler: props.callbacks.propertyIconHandler,
});
this.setCallbacks();
this.setForm(props.propertiesInfo, false);
this.previousErrorMessages = {};
// this has to be after setForm because setForm clears all error messages.
@@ -145,17 +135,7 @@ class PropertiesMain extends React.Component {

componentDidUpdate(prevProps) {
if (!isEqual(prevProps.callbacks, this.props.callbacks)) {
this.propertiesController.setHandlers({
controllerHandler: this.props.callbacks.controllerHandler,
propertyListener: this.props.callbacks.propertyListener,
actionHandler: this.props.callbacks.actionHandler,
buttonHandler: this.props.callbacks.buttonHandler,
buttonIconHandler: this.props.callbacks.buttonIconHandler,
validationHandler: this.props.callbacks.validationHandler,
titleChangeHandler: this.props.callbacks.titleChangeHandler,
tooltipLinkHandler: this.props.callbacks.tooltipLinkHandler,
propertyIconHandler: this.props.callbacks.propertyIconHandler,
});
this.setCallbacks();
}
}

@@ -169,6 +149,20 @@ class PropertiesMain extends React.Component {
}
}

setCallbacks() {
this.propertiesController.setHandlers({
controllerHandler: this.props.callbacks.controllerHandler,
propertyListener: this.props.callbacks.propertyListener,
actionHandler: this.props.callbacks.actionHandler,
buttonHandler: this.props.callbacks.buttonHandler,
buttonIconHandler: this.props.callbacks.buttonIconHandler,
validationHandler: this.props.callbacks.validationHandler,
titleChangeHandler: this.props.callbacks.titleChangeHandler,
tooltipLinkHandler: this.props.callbacks.tooltipLinkHandler,
propertyIconHandler: this.props.callbacks.propertyIconHandler,
});
}

setForm(propertiesInfo, sameParameterDefRendered) {
let formData = null;

0 comments on commit d13ea59

Please sign in to comment.