Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "display warning state when status check has no data (#22178) … #22709

Merged
merged 1 commit into from
Sep 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,13 @@ exports[`statusCheckState checking status 1`] = `
component="div"
grow={true}
>
<Content
text="custom status check description"
/>
<EuiText
grow={true}
>
<p>
custom status check description
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem
component="div"
Expand Down Expand Up @@ -292,9 +296,13 @@ exports[`statusCheckState failed status check - error 1`] = `
component="div"
grow={true}
>
<Content
text="custom status check description"
/>
<EuiText
grow={true}
>
<p>
custom status check description
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem
component="div"
Expand Down Expand Up @@ -322,7 +330,7 @@ exports[`statusCheckState failed status check - error 1`] = `
/>
</UNDEFINED>,
"key": "checkStatusStep",
"status": "danger",
"status": "complete",
"title": "custom title",
},
]
Expand Down Expand Up @@ -420,9 +428,13 @@ exports[`statusCheckState failed status check - no data 1`] = `
component="div"
grow={true}
>
<Content
text="custom status check description"
/>
<EuiText
grow={true}
>
<p>
custom status check description
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem
component="div"
Expand Down Expand Up @@ -450,7 +462,7 @@ exports[`statusCheckState failed status check - no data 1`] = `
/>
</UNDEFINED>,
"key": "checkStatusStep",
"status": "warning",
"status": "complete",
"title": "custom title",
},
]
Expand Down Expand Up @@ -548,9 +560,13 @@ exports[`statusCheckState initial state - no check has been attempted 1`] = `
component="div"
grow={true}
>
<Content
text="custom status check description"
/>
<EuiText
grow={true}
>
<p>
custom status check description
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem
component="div"
Expand Down Expand Up @@ -671,9 +687,13 @@ exports[`statusCheckState successful status check 1`] = `
component="div"
grow={true}
>
<Content
text="custom status check description"
/>
<EuiText
grow={true}
>
<p>
custom status check description
</p>
</EuiText>
</EuiFlexItem>
<EuiFlexItem
component="div"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import {
} from '@kbn/ui-framework/components';
import { Instruction } from './instruction';
import { ParameterForm } from './parameter_form';
import { Content } from './content';
import { getDisplayText } from '../../../../common/tutorials/instruction_variant';
import {
EuiTabs,
Expand All @@ -35,6 +34,7 @@ import {
EuiSteps,
EuiFlexGroup,
EuiFlexItem,
EuiText,
EuiButton,
EuiCallOut,
} from '@elastic/eui';
Expand Down Expand Up @@ -110,32 +110,17 @@ export class InstructionSet extends React.Component {
);
}

getStepStatus(statusCheckState) {
switch (statusCheckState) {
case undefined:
case StatusCheckStates.NOT_CHECKED:
case StatusCheckStates.FETCHING:
return 'incomplete';
case StatusCheckStates.HAS_DATA:
return 'complete';
case StatusCheckStates.NO_DATA:
return 'warning';
case StatusCheckStates.ERROR:
return 'danger';
default:
throw new Error(`Unexpected status check state ${statusCheckState}`);
}
}

renderStatusCheck() {
const { statusCheckState, statusCheckConfig, onStatusCheck } = this.props;
const checkStatusStep = (
<Fragment>
<EuiFlexGroup justifyContent="spaceBetween" alignItems="center">
<EuiFlexItem>
<Content
text={statusCheckConfig.text}
/>
<EuiText>
<p>
{statusCheckConfig.text}
</p>
</EuiText>
</EuiFlexItem>

<EuiFlexItem
Expand All @@ -156,9 +141,11 @@ export class InstructionSet extends React.Component {
</Fragment>
);

const stepStatus = statusCheckState === StatusCheckStates.NOT_CHECKED ||
statusCheckState === StatusCheckStates.FETCHING ? 'incomplete' : 'complete';
return {
title: statusCheckConfig.title || 'Status Check',
status: this.getStepStatus(statusCheckState),
status: stepStatus,
children: checkStatusStep,
key: 'checkStatusStep'
};
Expand Down