Skip to content

Move entire free campaign stepper into a Form component (setup & edit) #427

Closed
@tomalec

Description

@tomalec

This is a follow-up from #422 (comment)

The states that we have here [in EditFreeCampaign] essentially serve the same purpose as the form state, we can pull the <Form> component up and wrap the stepper component (see setup ads flow for example reference), then we don't need to have these local states. It would help us save some unnecessary callbacks (i.e. we don't need to pass down those onSettingsChange, onShippingRatesChange and onShippingTimesChange because they would all be in the form's onChange) and unnecessary re-renders.

Technical

We could make a code tad shorter and more readable if we move. We could make <Stepper> Component inside <Form> that would make all steps act as a single form. This should allow us to get rid of duplicated state management and unnecessary on*Change callbacks and workarounds for unitialValues.

Figma link

n/a

Acceptance criteria

  • End-user behavior should not be impaired
  • The end code should be shorter/easier to maintain and less redundant.

Unknowns

  • We could make that change together with refactoring setup code to use shared component, to introduce it in both places at once, and to limit the amount of manual testing to avoid regression issues.

Out of bounds/rabbit holes

  • <Form> component seems to be not well documented and tested, so we may end up using unmaintained features or rely on bugs as on features.

Event tracking

n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: refactorThe issue/PR is related to refactoring.priority: normalThe issue/PR is normal priority—not many people are affected or there’s a workaround, etc.type: technical debtThis issue/PR represents/solves the technical debt of the project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions