Skip to content

Commit

Permalink
[Logs UI] Revert unintended inversion of loading state meaning (elast…
Browse files Browse the repository at this point in the history
…ic#33152)

This fixes a problem introduced with elastic#32009, in which the meaning of the `isLoading` property for the `<ProgressEntry>` component was inverted.
  • Loading branch information
weltenwort committed Mar 18, 2019
1 parent 91e50c1 commit 9acbafa
Showing 1 changed file with 1 addition and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,20 @@ interface ProgressEntryProps {
class ProgressEntry extends React.PureComponent<ProgressEntryProps, {}> {
public render() {
const { alignment, children, className, color, isLoading } = this.props;
const progressProps = {};
// NOTE: styled-components seems to make all props in EuiProgress required, so this
// style attribute hacking replaces styled-components here for now until that can be fixed
// see: https://github.com/elastic/eui/issues/1655
const alignmentStyle =
alignment === 'top' ? { top: 0, bottom: 'initial' } : { top: 'initial', bottom: 0 };

if (isLoading) {
// @ts-ignore
progressProps.max = 1;
// @ts-ignore
progressProps.value = 1;
}

return (
<ProgressEntryWrapper className={className}>
<EuiProgress
style={alignmentStyle}
color={color}
size="xs"
position="absolute"
{...progressProps}
{...(!isLoading ? { max: 1, value: 1 } : {})}
/>
{children}
</ProgressEntryWrapper>
Expand Down

0 comments on commit 9acbafa

Please sign in to comment.