Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

Commit 86b8095

Browse files
BiliejasonLaster
authored andcommitted
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
1 parent abf2574 commit 86b8095

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

assets/panel/debugger.properties

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,9 @@ outline.header=Outline
556556
# LOCALIZATION NOTE (outline.noFunctions): Outline text when there are no functions to display
557557
outline.noFunctions=No functions
558558

559+
# LOCALIZATION NOTE (outline.noFileSelected): Outline text when there are no files selected
560+
outline.noFileSelected=No file selected
561+
559562
# LOCALIZATION NOTE (sources.search): Sources left sidebar prompt
560563
# e.g. Cmd+P to search. On a mac, we use the command unicode character.
561564
# On windows, it's ctrl.

src/components/PrimaryPanes/Outline.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ export class Outline extends Component<Props> {
3838
}
3939

4040
renderPlaceholder() {
41-
return (
42-
<div className="outline-pane-info">
43-
{L10N.getStr("outline.noFunctions")}
44-
</div>
45-
);
41+
const placeholderMessage = this.props.selectedSource
42+
? L10N.getStr("outline.noFunctions")
43+
: L10N.getStr("outline.noFileSelected");
44+
45+
return <div className="outline-pane-info">{placeholderMessage}</div>;
4646
}
4747

4848
renderFunction(func: SymbolDeclaration) {

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,9 +3882,9 @@ eslint-plugin-jest@^21.5.0:
38823882
version "21.7.0"
38833883
resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-21.7.0.tgz#651f1c6ce999af3ac59ab8bf8a376d742fd0fc23"
38843884

3885-
3886-
version "0.9.0"
3887-
resolved "https://registry.yarnpkg.com/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.9.0.tgz#1c924e585b1a6272206e181b8e5522f0dd663cd0"
3885+
eslint-plugin-mozilla@^0.9.0:
3886+
version "0.9.1"
3887+
resolved "https://registry.yarnpkg.com/eslint-plugin-mozilla/-/eslint-plugin-mozilla-0.9.1.tgz#af77cb5f9d2bc3a403c201c858902caacf8c1f7c"
38883888
dependencies:
38893889
ini-parser "0.0.2"
38903890
sax "1.2.4"

0 commit comments

Comments
 (0)