Web Inspector: Audit: show the version number in the UI
authordrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 22:57:12 +0000 (22:57 +0000)
committerdrousso@apple.com <drousso@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 22:57:12 +0000 (22:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195292

Reviewed by Matt Baker.

* UserInterface/Views/AuditNavigationSidebarPanel.js:
(WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
(WI.AuditNavigationSidebarPanel.prototype._updateNoAuditsPlaceholder):
Fix the logic for showing a placeholder when editing or with only disabled tests.

* UserInterface/Views/AuditNavigationSidebarPanel.css:
(.sidebar > .panel.navigation.audit > .content > .message-text-view): Added.
(.audit-version): Added.
Don't obstruct the "Edit" button when showing a placeholder.

* Localizations/en.lproj/localizedStrings.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242395 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js
Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.css
Source/WebInspectorUI/UserInterface/Views/AuditNavigationSidebarPanel.js

index 4627ff5..3a16e76 100644 (file)
@@ -1,3 +1,22 @@
+2019-03-04  Devin Rousso  <drousso@apple.com>
+
+        Web Inspector: Audit: show the version number in the UI
+        https://bugs.webkit.org/show_bug.cgi?id=195292
+
+        Reviewed by Matt Baker.
+
+        * UserInterface/Views/AuditNavigationSidebarPanel.js:
+        (WI.AuditNavigationSidebarPanel.prototype.showDefaultContentView):
+        (WI.AuditNavigationSidebarPanel.prototype._updateNoAuditsPlaceholder):
+        Fix the logic for showing a placeholder when editing or with only disabled tests.
+
+        * UserInterface/Views/AuditNavigationSidebarPanel.css:
+        (.sidebar > .panel.navigation.audit > .content > .message-text-view): Added.
+        (.audit-version): Added.
+        Don't obstruct the "Edit" button when showing a placeholder.
+
+        * Localizations/en.lproj/localizedStrings.js:
+
 2019-03-04  Joseph Pecoraro  <pecoraro@apple.com>
 
         ITMLKit Inspector: Data Bindings / Associated Data for nodes
index 2c7fa68..595bab6 100644 (file)
@@ -137,6 +137,7 @@ localizedStrings["Attributes"] = "Attributes";
 localizedStrings["Audit"] = "Audit";
 localizedStrings["Audit Error: %s"] = "Audit Error: %s";
 localizedStrings["Audit Warning: %s"] = "Audit Warning: %s";
+localizedStrings["Audit version: %s"] = "Audit version: %s";
 localizedStrings["Audits"] = "Audits";
 localizedStrings["Author Stylesheet"] = "Author Stylesheet";
 localizedStrings["Auto Increment"] = "Auto Increment";
index fcbdc51..dd8b716 100644 (file)
     color: var(--glyph-color-disabled);
 }
 
+.sidebar > .panel.navigation.audit > .content > .message-text-view {
+    bottom: var(--navigation-bar-height);
+}
+
 .sidebar > .panel.navigation.audit.has-results:not(.has-tests) > .content > .message-text-view {
     position: initial;
     border-bottom: 1px solid var(--border-color);
     padding: 0;
     vertical-align: 0.5px;
 }
+
+.audit-version {
+    position: absolute;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    z-index: calc(var(--z-index-popover) + 1);
+    padding: 8px;
+    font-size: 13px;
+    text-align: center;
+    color: var(--text-color-secondary);
+}
index 9ec2bf7..496b519 100644 (file)
@@ -60,6 +60,14 @@ WI.AuditNavigationSidebarPanel = class AuditNavigationSidebarPanel extends WI.Na
             contentPlaceholder.appendChild(importHelpElement);
         }
 
+        let versionContainer = contentView.element.appendChild(document.createElement("div"));
+        versionContainer.classList.add("audit-version");
+
+        let version = WI.AuditTestBase.Version;
+        if (InspectorBackend.domains.Audit)
+            version = Math.min(version, InspectorBackend.domains.Audit.VERSION);
+        versionContainer.textContent = WI.UIString("Audit version: %s").format(version);
+
         this.contentBrowser.showContentView(contentView);
     }
 
@@ -208,7 +216,7 @@ WI.AuditNavigationSidebarPanel = class AuditNavigationSidebarPanel extends WI.Na
 
     _updateNoAuditsPlaceholder()
     {
-        if (WI.auditManager.tests.length)
+        if (WI.auditManager.editing || WI.auditManager.tests.some((test) => !test.disabled))
             return;
 
         let contentPlaceholder = WI.createMessageTextView(WI.UIString("No Audits"));