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

Feat: Stepper #2

Merged
merged 12 commits into from
Feb 7, 2024
Merged

Feat: Stepper #2

merged 12 commits into from
Feb 7, 2024

Conversation

mariaozamiz
Copy link
Contributor

@mariaozamiz mariaozamiz commented Jan 29, 2024

📌 References

📝 Implementation

Using wizard component

📹 Screenshots/Screen capture

Captura de pantalla 2024-01-29 a las 14 04 55

🔥 Notes to the tester

check /#/analysis page

@mariaozamiz mariaozamiz requested a review from eperedo January 29, 2024 13:13
@mariaozamiz mariaozamiz changed the base branch from master to development January 29, 2024 13:15
Copy link
Contributor

@eperedo eperedo left a comment

Choose a reason for hiding this comment

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

Thanks @mariaozamiz code looks good! Just a couple of observations about reusing repeated components.

Also we're waiting for a beta version for the wizard component in order to mark a step as completed. EyeSeeTea/d2-ui-components#235

);
});

const Container = styled.section`
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're repeating the same Container and Title component we can extract both into a separate file and reuse them for all the steps:

// ./components/step-container/StepContainer.tsx
import styled from "styled-components";

export const StepContainer = styled.section`
    height: 39.125rem;
`;

export const StepTitle = styled.h2`
    color: blue;
`;

and use them in each step:

export const ConfigurationStep: React.FC<PageProps> = React.memo(props => {
    const { name } = props;
    return (
        <StepContainer>
            <StepTitle>{i18n.t("Configuration")}</StepTitle>
        </StepContainer>
    );
});

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This one might need a layout, as we should insert the table and filters inside the step container later on. What do you think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just to be sure I'm following the idea, do you mean something like:

// StepLayout.tsx
<StepLayout>
   <StepContainer> 
       <StepTitle>{i18n.t("Configuration")}</StepTitle>
    </StepContainer>
    {children} 
</StepLayout>

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In my head is like:

// StepLayout.tsx
<StepLayout or StepContainer>
  <Header>
     <StepTitle>{i18n.t("Configuration")}</StepTitle>
     <Filters />
  </Header>
   {children} // table
</StepLayout or StepContainer>

Maybe it's just an early abstraction 🤔 and might get difficult later on to relate table and filters. To deal with the duplicated code I can delete the styling for now and add it later on in the project.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree, we don't have all the information to do this abstraction.

src/webapp/pages/Router.tsx Outdated Show resolved Hide resolved
src/webapp/pages/analysis/AnalysisPage.tsx Outdated Show resolved Hide resolved
@mariaozamiz mariaozamiz requested a review from eperedo January 31, 2024 08:34
@Ramon-Jimenez Ramon-Jimenez merged commit c872268 into development Feb 7, 2024
1 check passed
@Ramon-Jimenez Ramon-Jimenez deleted the feat/stepper branch February 7, 2024 14:05
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.

3 participants