mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
## Summary (closes #32512, closes #32508) This fixes a bug where element stats was causing a failure due to not every element being an `expressionRenderable` all the time... when first added, `TimeFilter` is `expressionContext` and should be considered `pending`. This PR also fixes an issue where `resolvedArgs` was not being reset between workpad loads, causing element stats to be compounded. Co-authored-by: Spencer <email@spalger.com>
This commit is contained in:
parent
da4d4643eb
commit
53d41bfcbd
3 changed files with 11 additions and 1 deletions
|
@ -14,7 +14,7 @@ export const ElementConfig = ({ elementStats }) => {
|
|||
}
|
||||
|
||||
const { total, ready, error } = elementStats;
|
||||
const progress = Math.round(((ready + error) / total) * 100);
|
||||
const progress = total > 0 ? Math.round(((ready + error) / total) * 100) : 100;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
|
|
@ -10,6 +10,7 @@ import { get } from 'lodash';
|
|||
import { prepend } from '../../lib/modify_path';
|
||||
import * as actions from '../actions/resolved_args';
|
||||
import { flushContext, flushContextAfterIndex } from '../actions/elements';
|
||||
import { setWorkpad } from '../actions/workpad';
|
||||
|
||||
/*
|
||||
Resolved args are a way to handle async values. They track the status, value, and error
|
||||
|
@ -130,6 +131,9 @@ export const resolvedArgsReducer = handleActions(
|
|||
return state;
|
||||
}, transientState);
|
||||
},
|
||||
[setWorkpad]: (transientState, {}) => {
|
||||
return set(transientState, 'resolvedArgs', {});
|
||||
},
|
||||
},
|
||||
{}
|
||||
);
|
||||
|
|
|
@ -90,6 +90,12 @@ export function getElementCounts(state) {
|
|||
Object.keys(resolvedArgs).forEach(resolvedArg => {
|
||||
const arg = resolvedArgs[resolvedArg];
|
||||
const { expressionRenderable } = arg;
|
||||
|
||||
if (!expressionRenderable) {
|
||||
results.pending++;
|
||||
return;
|
||||
}
|
||||
|
||||
const { value, state } = expressionRenderable;
|
||||
|
||||
if (value && value.as === 'error') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue