mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fix few null checks to make master green (#25965)
This commit is contained in:
parent
bd27be1351
commit
19d27351e9
@ -86,7 +86,7 @@ export class ConfigEditor extends PureComponent<Props> {
|
|||||||
label="Rollup indicator"
|
label="Rollup indicator"
|
||||||
labelClass={'width-10'}
|
labelClass={'width-10'}
|
||||||
tooltip="Shows up as an info icon in panel headers when data is aggregated"
|
tooltip="Shows up as an info icon in panel headers when data is aggregated"
|
||||||
checked={options.jsonData.rollupIndicatorEnabled}
|
checked={!!options.jsonData.rollupIndicatorEnabled}
|
||||||
onChange={onUpdateDatasourceJsonDataOptionChecked(this.props, 'rollupIndicatorEnabled')}
|
onChange={onUpdateDatasourceJsonDataOptionChecked(this.props, 'rollupIndicatorEnabled')}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
@ -84,6 +84,7 @@ type DebugField = {
|
|||||||
value?: string;
|
value?: string;
|
||||||
href?: string;
|
href?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
function makeDebugFields(derivedFields: DerivedFieldConfig[], debugText: string): DebugField[] {
|
function makeDebugFields(derivedFields: DerivedFieldConfig[], debugText: string): DebugField[] {
|
||||||
return derivedFields
|
return derivedFields
|
||||||
.filter(field => field.name && field.matcherRegex)
|
.filter(field => field.name && field.matcherRegex)
|
||||||
@ -91,7 +92,7 @@ function makeDebugFields(derivedFields: DerivedFieldConfig[], debugText: string)
|
|||||||
try {
|
try {
|
||||||
const testMatch = debugText.match(field.matcherRegex);
|
const testMatch = debugText.match(field.matcherRegex);
|
||||||
const value = testMatch && testMatch[1];
|
const value = testMatch && testMatch[1];
|
||||||
let link: LinkModel<Field>;
|
let link: LinkModel<Field> = null;
|
||||||
|
|
||||||
if (field.url && value) {
|
if (field.url && value) {
|
||||||
link = getFieldLinksForExplore(
|
link = getFieldLinksForExplore(
|
||||||
|
@ -518,7 +518,7 @@ export class LokiDatasource extends DataSourceApi<LokiQuery, LokiOptions> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
showContextToggle = (row?: LogRowModel) => {
|
showContextToggle = (row?: LogRowModel) => {
|
||||||
return row.searchWords && row.searchWords.length > 0;
|
return row && row.searchWords && row.searchWords.length > 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
throwUnless = (err: any, condition: boolean, target: LokiQuery) => {
|
throwUnless = (err: any, condition: boolean, target: LokiQuery) => {
|
||||||
|
@ -502,7 +502,7 @@ class SingleStatCtrl extends MetricsPanelCtrl {
|
|||||||
function addSparkline() {
|
function addSparkline() {
|
||||||
const data: ShowData = ctrl.data;
|
const data: ShowData = ctrl.data;
|
||||||
const width = elem.width();
|
const width = elem.width();
|
||||||
if (width < 30) {
|
if (width && width < 30) {
|
||||||
// element has not gotten it's width yet
|
// element has not gotten it's width yet
|
||||||
// delay sparkline render
|
// delay sparkline render
|
||||||
setTimeout(addSparkline, 30);
|
setTimeout(addSparkline, 30);
|
||||||
|
Loading…
Reference in New Issue
Block a user