-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release/v1.3.1 #33
Release/v1.3.1 #33
Changes from all commits
1a04e18
4bfa5bf
81431f6
6a2063e
fac6e3c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ export type HeatMapDataHandlerProps = ComponentProps & HeatMapState & Actions; | |
class HeatMapDataHandler extends Component<HeatMapDataHandlerProps> { | ||
private subscriptionHandles: number[] = []; | ||
private intervalID?: number; | ||
private isRunningAction = false; | ||
private showProgress?: number; | ||
readonly onStopActionbound = this.onStopAction.bind(this); | ||
|
||
render() { | ||
return createElement("div", { className: "widget-charts-wrapper" }, | ||
|
@@ -121,13 +124,27 @@ class HeatMapDataHandler extends Component<HeatMapDataHandlerProps> { | |
} | ||
|
||
private handleOnClick = (options: Data.OnClickOptions<{ x: string, y: string, z: number }, HeatMapContainerProps>) => { | ||
if (options.trace) { | ||
if (!this.isRunningAction && options.trace) { | ||
this.onStartAction(); | ||
const mxObject = this.findSourceObject(options.trace.x, options.trace.y, options.trace.z); | ||
|
||
if (mxObject) { | ||
handleOnClick(options.options, mxObject, options.mxForm); | ||
handleOnClick(options.options, options.mxObject, options.mxForm) | ||
.then(this.onStopActionbound) | ||
.catch((error) => { | ||
mx.ui.error(error); | ||
this.onStopActionbound(); | ||
}); | ||
} else { | ||
this.createDataPoint(options.options, options.trace) | ||
.then(newMxObject => handleOnClick(options.options, newMxObject, options.mxForm)) | ||
.then(newMxObject => { | ||
handleOnClick(options.options, newMxObject, options.mxForm) | ||
.then(this.onStopActionbound) | ||
.catch(error => { | ||
mx.ui.error(error); | ||
this.onStopActionbound(); | ||
}); | ||
}) | ||
.catch(error => mx.ui.error(`An error occured while creating ${options.options.dataEntity} object: ${error}`)); | ||
} | ||
} | ||
|
@@ -168,6 +185,23 @@ class HeatMapDataHandler extends Component<HeatMapDataHandlerProps> { | |
Number(data.get(this.props.valueAttribute)) === z | ||
); | ||
} | ||
|
||
private onStartAction() { | ||
this.isRunningAction = true; | ||
setTimeout(() => { | ||
if (this.isRunningAction) { | ||
this.showProgress = mx.ui.showProgress(); | ||
} | ||
} , 120); | ||
} | ||
|
||
private onStopAction() { | ||
this.isRunningAction = false; | ||
if (this.showProgress) { | ||
mx.ui.hideProgress(this.showProgress); | ||
} | ||
|
||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove empty line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed |
||
} | ||
|
||
const mapStateToProps: MapStateToProps<HeatMapState, ComponentProps, ReduxStore> = (state, props) => | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When new series are added in the WM will they all have new data?