Skip to content

Commit

Permalink
fix: All steps after an error step as labeled as errors
Browse files Browse the repository at this point in the history
Since the search can't complete once an error has been encountered in a
step, all subsequent steps are labeled as errors as well. This should
make it clear that the search has failed and at what stage.
  • Loading branch information
neomorphic committed Sep 27, 2024
1 parent 3ce20c5 commit ba0dde5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/components/CustomSearch/SearchSteps.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import CompleteStep from "./CompleteStep";
import "./SearchSteps.css";

function stepState(step, current, error) {
if (step === current && error) {
if (step >= current && error) {
return "error";
}
if (step === current) {
Expand Down
1 change: 1 addition & 0 deletions src/components/CustomSearch/SearchSteps.stories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const CompleteStepWithErrors = Template.bind({});
CompleteStepWithErrors.args = {
search: {
errorMessage: "It went badly, like really badly, there was a lot of smoke and some of the servers will never recover. I don't think they are going to bring the data center back online for months",
state: "complete",
nTotalMatches: 0,
step: 4,
},
Expand Down

0 comments on commit ba0dde5

Please sign in to comment.