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

ISW - Add Start Input Step #21163

Merged
merged 30 commits into from
Dec 12, 2024
Merged

ISW - Add Start Input Step #21163

merged 30 commits into from
Dec 12, 2024

Conversation

grotlue
Copy link
Contributor

@grotlue grotlue commented Dec 11, 2024

Description

Closes #20567

Requires #21164 for the rollback

/nocl

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@grotlue grotlue requested a review from gally47 December 11, 2024 11:21
@grotlue grotlue linked an issue Dec 11, 2024 that may be closed by this pull request
Copy link
Contributor

@gally47 gally47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, I added some comments below:


useEffect(() => {
setStepsConfig(initialStepsConfig);
setWizardData({ ...wizardData, input }); // eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have to omit the dependencies here? Because it's usually not recommended, it breaks React mental model, it's hard to maintain and might cause bugs, I think we should at least explicitly document why they were omitted.

Copy link
Contributor Author

@grotlue grotlue Dec 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as this should really just happen on initial load. Otherwise, it will end up in an endless loop as it is updating a context used by a parent. I can add a comment though 👍

const withInitialStepsData = updateStepConfigOrData(stepsData, currentStepName, defaultStepData);

setStepsData(withInitialStepsData);
}
} // eslint-disable-next-line react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here.

@@ -67,28 +67,59 @@ const ConntectedPipelinesList = styled.ul`
padding-left: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can use theme spacing here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally I agree but in this case I prefer a fixed spacing as it is influencing the space around the bullet point of a <li> (it is also kind of reverting the removal of this spacing)

stopInput();

if (routingStepData.shouldCreateNewPipeline) {
if (createdPipelineId) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here if we only have one nested condition we can just use 1 if (routingStepData.shouldCreateNewPipeline && createdPipelineId)

const hasPreviousStep = checkHasPreviousStep(orderedSteps, activeStep);
const hasNextStep = checkHasNextStep(orderedSteps, activeStep);
const isNextStepDisabled = checkIsNextStepDisabled(orderedSteps, activeStep, stepsConfig);
const [startInputStatus, setStartInputStatus] = useState<'NOT_STARTED' | 'RUNNING' | 'SUCCESS' | 'FAILED' | 'ROLLED_BACK' | 'ROLLING_BACK'>('NOT_STARTED');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to have a reusable specific type for InputStatus?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now I don't think it is needed, as the type itself is only used in this line.
As this state is being typed we don't really need an as const for the values.

@grotlue grotlue requested a review from gally47 December 12, 2024 09:48
Copy link
Contributor

@gally47 gally47 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@grotlue grotlue merged commit 4b8e798 into master Dec 12, 2024
7 checks passed
@grotlue grotlue deleted the feat/20567/isw-start-input branch December 12, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ISW - Wizard Step: Start Input Step
2 participants