Allow dashboard panels to detect rendering cycles and arrest stack overflows

Summary:
Ref T4986. Ref T4983. Panels will soon be able to contain other panels, either via Remarkup (`{W1}`) or maybe through new types of meta-panels.

Allow panels to detect that they are being rendered very deeply and/or within themselves.

Test Plan: Faked some errors, got failed panel renders. Since panels can't //really// contain other panels yet, this doesn't really have an impact.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: chad, epriestley

Maniphest Tasks: T4983, T4986

Differential Revision: https://secure.phabricator.com/D9140
This commit is contained in:
epriestley
2014-05-15 19:21:36 -07:00
parent e5e95352c7
commit 63acd90cef
6 changed files with 96 additions and 32 deletions

View File

@@ -10,6 +10,7 @@ JX.behavior('dashboard-async-panel', function(config) {
panel.style.opacity = '0.5';
new JX.Workflow(config.uri)
.setData({parentPanelPHIDs: config.parentPanelPHIDs.join(',')})
.setHandler(function(r) {
JX.DOM.replace(panel, JX.$H(r.panelMarkup));
})