From 86b80951fdc85a8f4329d576ee7dda795dec91ec Mon Sep 17 00:00:00 2001 From: Biliana Valeva Date: Wed, 28 Feb 2018 09:51:10 +0100 Subject: [PATCH] Display message to indicate no selected source in Outline tab (#5266) (#5506) * Display message to indicate no selected source in Outline tab (#5266) * Fix incorrect comment * Use the positive conditional in the ternary --- assets/panel/debugger.properties | 3 +++ src/components/PrimaryPanes/Outline.js | 10 +++++----- yarn.lock | 6 +++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/assets/panel/debugger.properties b/assets/panel/debugger.properties index fb26f29444..40eb08f02c 100644 --- a/assets/panel/debugger.properties +++ b/assets/panel/debugger.properties @@ -556,6 +556,9 @@ outline.header=Outline # LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display outline.noFunctions=No functions +# LOCALIZATION NOTE (outline.noFileSelected): Outline text when there are no files selected +outline.noFileSelected=No file selected + # LOCALIZATION NOTE (sources.search): Sources left sidebar prompt # e.g. Cmd+P to search. On a mac, we use the command unicode character. # On windows, it's ctrl. diff --git a/src/components/PrimaryPanes/Outline.js b/src/components/PrimaryPanes/Outline.js index 8f4f47baf5..865ebfc854 100644 --- a/src/components/PrimaryPanes/Outline.js +++ b/src/components/PrimaryPanes/Outline.js @@ -38,11 +38,11 @@ export class Outline extends Component { } renderPlaceholder() { - return ( -
- {L10N.getStr("outline.noFunctions")} -
- ); + const placeholderMessage = this.props.selectedSource + ? L10N.getStr("outline.noFunctions") + : L10N.getStr("outline.noFileSelected"); + + return
{placeholderMessage}
; } renderFunction(func: SymbolDeclaration) { diff --git a/yarn.lock b/yarn.lock index 3052b1521a..50194ab653 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3882,9 +3882,9 @@ eslint-plugin-jest@^21.5.0: version "21.7.0" resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.7.0.tgz#651f1c6ce999af3ac59ab8bf8a376d742fd0fc23" -eslint-plugin-mozilla@0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.9.0.tgz#1c924e585b1a6272206e181b8e5522f0dd663cd0" +eslint-plugin-mozilla@^0.9.0: + version "0.9.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.9.1.tgz#af77cb5f9d2bc3a403c201c858902caacf8c1f7c" dependencies: ini-parser "0.0.2" sax "1.2.4"