Revert "Add infobar about issues panel to console"

This reverts commit 23b1ed62a1.

Reason for revert: <should be behind experiment flag>

Original change's description:
> Add infobar about issues panel to console
> 
> This CL adds a sticky infobar to the console. It shows up whenever
> issues are detected and notifies users about the existence of the new
> issues panel. The bar disappears automatically when the user navigates
> to a page for which no issues are detected.
> 
> Screenshot: https://imgur.com/Jk95x7n
> 
> Fixed: chromium:1061876
> Change-Id: I9ec5aaab510021a77721a2b39b9e1b52197f4abb
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2128132
> Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
> Reviewed-by: Simon Zünd <szuend@chromium.org>

TBR=szuend@chromium.org,wolfi@chromium.org

Change-Id: I936e9743f6f71d7faca9880b9e39c414902ded67
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2137382
Reviewed-by: Wolfgang Beyer <wolfi@chromium.org>
Commit-Queue: Wolfgang Beyer <wolfi@chromium.org>
This commit is contained in:
Wolfgang Beyer
2020-04-06 12:10:38 +00:00
committed by Commit Bot
parent 23b1ed62a1
commit 21ebdb46fc
3 changed files with 5 additions and 55 deletions
+3 -47
View File
@@ -65,7 +65,7 @@ export class ConsoleView extends UI.Widget.VBox {
this._isSidebarOpen = false;
this._filter = new ConsoleViewFilter(this._onFilterChanged.bind(this));
this._consoleToolbarContainer = this.element.createChild('div', 'console-toolbar-container');
const consoleToolbarContainer = this.element.createChild('div', 'console-toolbar-container');
this._splitWidget = new UI.SplitWidget.SplitWidget(
true /* isVertical */, false /* secondIsSidebar */, 'console.sidebar.width', 100);
this._splitWidget.setMainWidget(this._searchableView);
@@ -115,8 +115,8 @@ export class ConsoleView extends UI.Widget.VBox {
const groupSimilarToggle =
new UI.Toolbar.ToolbarSettingCheckbox(this._groupSimilarSetting, Common.UIString.UIString('Group similar'));
const toolbar = new UI.Toolbar.Toolbar('console-main-toolbar', this._consoleToolbarContainer);
const rightToolbar = new UI.Toolbar.Toolbar('', this._consoleToolbarContainer);
const toolbar = new UI.Toolbar.Toolbar('console-main-toolbar', consoleToolbarContainer);
const rightToolbar = new UI.Toolbar.Toolbar('', consoleToolbarContainer);
toolbar.appendToolbarItem(this._splitWidget.createShowHideSidebarButton(ls`console sidebar`));
toolbar.appendToolbarItem(UI.Toolbar.Toolbar.createActionButton(
/** @type {!UI.Action.Action }*/ (self.UI.actionRegistry.action('console.clear'))));
@@ -275,50 +275,6 @@ export class ConsoleView extends UI.Widget.VBox {
SDK.ConsoleModel.ConsoleModel.instance().addEventListener(
SDK.ConsoleModel.Events.CommandEvaluated, this._commandEvaluated, this);
SDK.ConsoleModel.ConsoleModel.instance().messages().forEach(this._addConsoleMessage, this);
const mainTarget = SDK.SDKModel.TargetManager.instance().mainTarget();
if (mainTarget) {
const issuesModel = mainTarget.model(SDK.IssuesModel.IssuesModel);
if (issuesModel) {
issuesModel.addEventListener(SDK.IssuesModel.Events.AggregatedIssueUpdated, this._onIssueAdded.bind(this));
issuesModel.ensureEnabled();
if (issuesModel.numberOfAggregatedIssues()) {
this._onIssueAdded();
}
}
const resourceTreeModel = mainTarget.model(SDK.ResourceTreeModel.ResourceTreeModel);
if (resourceTreeModel) {
resourceTreeModel.addEventListener(
SDK.ResourceTreeModel.Events.MainFrameNavigated, this._onMainFrameNavigated.bind(this));
}
}
}
_onIssueAdded() {
if (!this._issueBarDiv) {
this._issueBarDiv = createElementWithClass('div', 'flex-none');
const issueBar = new UI.Infobar.Infobar(
UI.Infobar.Type.Warning,
ls
`Issues detected. The new issues panel displays information about deprecations, breaking changes and other potential problems.`,
[{
text: ls`Go to Issues`,
highlight: false,
delegate: () => UI.ViewManager.ViewManager.instance().showView('issues-pane'),
dismiss: true,
}]);
this.element.insertBefore(this._issueBarDiv, this._consoleToolbarContainer.nextSibling);
this._issueBarDiv.appendChild(issueBar.element);
issueBar.setParentView(this);
this.doResize();
}
}
_onMainFrameNavigated() {
if (this._issueBarDiv) {
this._issueBarDiv.remove();
this._issueBarDiv = null;
}
}
/**
-6
View File
@@ -147,18 +147,12 @@
<message name="IDS_DEVTOOLS_a092483ed730ed040e5df5776dca49e5" desc="Title of a setting under the Console category in Settings">
Log XMLHttpRequests
</message>
<message name="IDS_DEVTOOLS_a0f3a1128287d0daedd86605ace4b8cd" desc="Infobar text about what the issues panel is">
Issues detected. The new issues panel displays information about deprecations, breaking changes and other potential problems.
</message>
<message name="IDS_DEVTOOLS_a1948ddb50d0bbd31e36f1fbc45479a0" desc="Title of a setting under the Console category that can be invoked through the Command Menu">
Autocomplete from history
</message>
<message name="IDS_DEVTOOLS_a1a6657be79cc0fc1e9b23b9e108f043" desc="Text in Console Pin Pane of the Console panel">
Expression
</message>
<message name="IDS_DEVTOOLS_a334d07d578235272cd75c7a8bd5690d" desc="Label for button linking to issues panel">
Go to Issues
</message>
<message name="IDS_DEVTOOLS_a3eb3c95c4cb8e06fd3682c1f0d70bc0" desc="Tooltip text that appears on the setting when hovering over it in Console View of the Console panel">
Only show messages from the current context (top, iframe, worker, extension)
</message>
+2 -2
View File
@@ -166,7 +166,6 @@ export class IssuesModel extends SDKModel {
}
const aggregatedIssue = this._aggregatedIssuesByCode.get(issue.code());
aggregatedIssue.addInstance(issue);
this.dispatchEventToListeners(Events.AggregatedIssueUpdated, aggregatedIssue);
return aggregatedIssue;
}
@@ -181,7 +180,8 @@ export class IssuesModel extends SDKModel {
for (const issue of issues) {
this._connectIssue(issue);
this._aggregateIssue(issue);
const aggregatedIssue = this._aggregateIssue(issue);
this.dispatchEventToListeners(Events.AggregatedIssueUpdated, aggregatedIssue);
}
}