Bug 1443089 - Better UI/UX for empty response panel. r=Honza
authorLaphets <wenqing4@illinois.edu>
Fri, 08 Mar 2019 15:23:13 +0000
changeset 521153 27136b19341e
parent 521057 14778fd00dc5
child 521154 ed3b55f9d326
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersHonza
bugs1443089
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1443089 - Better UI/UX for empty response panel. r=Honza Differential Revision: https://phabricator.services.mozilla.com/D21838
devtools/client/locales/en-US/netmonitor.properties
devtools/client/netmonitor/src/components/ResponsePanel.js
--- a/devtools/client/locales/en-US/netmonitor.properties
+++ b/devtools/client/locales/en-US/netmonitor.properties
@@ -69,16 +69,21 @@ headersFilterText=Filter headers
 # LOCALIZATION NOTE (cookiesEmptyText): This is the text displayed in the
 # cookies tab of the network details pane when there are no cookies available.
 cookiesEmptyText=No cookies for this request
 
 # LOCALIZATION NOTE (cookiesFilterText): This is the text displayed in the
 # cookies tab of the network details pane for the filtering input.
 cookiesFilterText=Filter cookies
 
+# LOCALIZATION NOTE (responseEmptyText): This is the text displayed in the
+# response tab of the network details pane when the response is empty or not
+# available for shown.
+responseEmptyText=No response data available for this request
+
 # LOCALIZATION NOTE (paramsEmptyText): This is the text displayed in the
 # params tab of the network details pane when there are no params available.
 paramsEmptyText=No parameters for this request
 
 # LOCALIZATION NOTE (paramsFilterText): This is the text displayed in the
 # params tab of the network details pane for the filtering input.
 paramsFilterText=Filter request parameters
 
--- a/devtools/client/netmonitor/src/components/ResponsePanel.js
+++ b/devtools/client/netmonitor/src/components/ResponsePanel.js
@@ -23,16 +23,17 @@ const PropertiesView = createFactory(req
 const { div, img } = dom;
 const JSON_SCOPE_NAME = L10N.getStr("jsonScopeName");
 const JSON_FILTER_TEXT = L10N.getStr("jsonFilterText");
 const RESPONSE_IMG_NAME = L10N.getStr("netmonitor.response.name");
 const RESPONSE_IMG_DIMENSIONS = L10N.getStr("netmonitor.response.dimensions");
 const RESPONSE_IMG_MIMETYPE = L10N.getStr("netmonitor.response.mime");
 const RESPONSE_PAYLOAD = L10N.getStr("responsePayload");
 const RESPONSE_PREVIEW = L10N.getStr("responsePreview");
+const RESPONSE_EMPTY_TEXT = L10N.getStr("responseEmptyText");
 const RESPONSE_TRUNCATED = L10N.getStr("responseTruncated");
 
 const JSON_VIEW_MIME_TYPE = "application/vnd.mozilla.json.view";
 
 /**
  * Response panel component
  * Displays the GET parameters and POST data of a request
  */
@@ -167,18 +168,21 @@ class ResponsePanel extends Component {
 
     return null;
   }
 
   render() {
     const { openLink, request } = this.props;
     const { responseContent, url } = request;
 
-    if (!responseContent || typeof responseContent.content.text !== "string") {
-      return null;
+    if (!responseContent || typeof responseContent.content.text !== "string"
+        || !responseContent.content.text) {
+      return div({ className: "empty-notice" },
+        RESPONSE_EMPTY_TEXT
+      );
     }
 
     let { encoding, mimeType, text } = responseContent.content;
 
     if (mimeType.includes("image/")) {
       const { width, height } = this.state.imageDimensions;
 
       return (