mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Scopes: Fix free text input crash (#89652)
This commit is contained in:
parent
eea7319a67
commit
216ec7cbdf
@ -2904,6 +2904,9 @@ exports[`better eslint`] = {
|
|||||||
"public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx:5381": [
|
"public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx:5381": [
|
||||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
],
|
],
|
||||||
|
"public/app/features/dashboard-scene/scene/Scopes/ScopesInput.tsx:5381": [
|
||||||
|
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||||
|
],
|
||||||
"public/app/features/dashboard-scene/scene/row-actions/RowActions.tsx:5381": [
|
"public/app/features/dashboard-scene/scene/row-actions/RowActions.tsx:5381": [
|
||||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "0"],
|
||||||
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"],
|
||||||
|
@ -35,13 +35,20 @@ export function ScopesInput({
|
|||||||
let titles: string[];
|
let titles: string[];
|
||||||
|
|
||||||
if (path.length > 0) {
|
if (path.length > 0) {
|
||||||
titles = path.map((nodeName) => {
|
titles = path
|
||||||
const { title, nodes } = currentLevel[nodeName];
|
.map((nodeName) => {
|
||||||
|
const cl = currentLevel[nodeName];
|
||||||
|
if (!cl) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
currentLevel = nodes;
|
const { title, nodes } = cl;
|
||||||
|
|
||||||
return title;
|
currentLevel = nodes;
|
||||||
});
|
|
||||||
|
return title;
|
||||||
|
})
|
||||||
|
.filter((title) => title !== null) as string[];
|
||||||
|
|
||||||
if (titles[0] === '') {
|
if (titles[0] === '') {
|
||||||
titles.splice(0, 1);
|
titles.splice(0, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user