Web Inspector: REGRESSION: Audit: default audits aren't added when an existing audit...
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Apr 2019 20:46:34 +0000 (20:46 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 8 Apr 2019 20:46:34 +0000 (20:46 +0000)
commit5ee4175898057bfc7c4457251381a40d002cc377
treea4554073ad22678d10e6e332254f7a98de279f0b
parente12c826295aeec001582a8e708422df4c178addb
Web Inspector: REGRESSION: Audit: default audits aren't added when an existing audit is present
https://bugs.webkit.org/show_bug.cgi?id=196663
<rdar://problem/49660757>

Reviewed by Timothy Hatcher.

Rather than have a button that allows the user to re-add the default audits, prevent them
from being deletable in the first place. "Deleting" a default audit will instead mark it as
disabled (and beep if it is already disabled).

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.loadStoredTests):
(WI.AuditManager.prototype.removeTest):
(WI.AuditManager.prototype._addDefaultTests): Added.
(WI.AuditManager.prototype.addDefaultTestsIfNeeded): Deleted.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._addTest):
(WI.AuditNavigationSidebarPanel.prototype._updateStartStopButtonNavigationItemState):
(WI.AuditNavigationSidebarPanel.prototype._updateNoAuditsPlaceholder):
(WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
* UserInterface/Views/AuditNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.audit.has-results > .content > .message-text-view.no-enabled-audits): Added.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Deleted.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Deleted.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Deleted.

* Localizations/en.lproj/localizedStrings.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244039 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Controllers/AuditManager.js
Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.css
Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js