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

refactor(FAQ): Extract common code to parent #1487

Merged

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Oct 24, 2023

Changes

  • Extract common code in TeacherFaqComponent and StudentFaqComponent to new FaqComponent (in new help/faq directory)
  • Move common styles to faq.component.scss
  • Clean up FaqComponent code a bit using pipe() and filter()

Test

  • Teacher and Student FAQ pages work as before
    • links take you to the right place
    • styles look the same as before

@hirokiterashima hirokiterashima added this to the Tech Debt 19 -> 18 milestone Oct 24, 2023
@hirokiterashima hirokiterashima self-assigned this Oct 24, 2023
@hirokiterashima hirokiterashima marked this pull request as ready for review October 24, 2023 21:55
- Use routerLink and fragment for anchor links
- Make GettingStarted component extend FaqComponent to reduce duplication
Copy link
Member

@breity breity left a comment

Choose a reason for hiding this comment

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

Looks good. 👍

I updated a bit to remove unnecessary CSS and also converted the table of contents links to use native Angular anchor scrolling. (I also fixed anchor scrolling in the main app, as it was broken.)

I modified the GettingStarted component to extend FaqComponent as well, since it uses the same functionality as the student and teacher FAQ components.

@hirokiterashima
Copy link
Member Author

Thanks. The new styles and anchors look good.

It feels a bit strange that GettingStartedComponent extends the FaqComponent. It may make sense in the future to make a HelpPageComponent that is extended by [Student/Teacher]FaqComponent and GettingStartedComponent.

@hirokiterashima hirokiterashima merged commit 1a522be into develop Oct 27, 2023
2 checks passed
@hirokiterashima hirokiterashima deleted the refactor-faq-extract-common-code-to-faq-component branch October 27, 2023 21:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants