Web Inspector: Audit: add default tests
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 02:14:44 +0000 (02:14 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Nov 2018 02:14:44 +0000 (02:14 +0000)
commitdd6c7faf0c60076a1171c4561079ea6921e432bf
tree3ff972062084f01e0f46f0818e4aafdf817adaa7
parent4f92253b33465755375d6714a14a993318edba29
Web Inspector: Audit: add default tests
https://bugs.webkit.org/show_bug.cgi?id=191758

Reviewed by Matt Baker.

* UserInterface/Controllers/AuditManager.js:
(WI.AuditManager.prototype.loadStoredTests):
(WI.AuditManager.prototype.addDefaultTestsIfNeeded): Added.
If there are no previously saved tests in the database, automatically add the default set.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype._addTest):
(WI.AuditNavigationSidebarPanel.prototype._addResult):
(WI.AuditNavigationSidebarPanel.prototype._handleAuditTestRemoved):
* UserInterface/Views/AuditNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view): Added.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > .message): Added.
(.sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view > button): Added.
When the last test is removed, show a placeholder message that allows the user to re-add the
default set of tests.

* UserInterface/Views/NavigationSidebarPanel.js:
(WI.NavigationSidebarPanel.prototype.showEmptyContentPlaceholder):
(WI.NavigationSidebarPanel.prototype._createEmptyContentPlaceholderIfNeeded):

* Localizations/en.lproj/localizedStrings.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@238334 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
Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js