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(Project Authoring): Extract move node location selection feature to component #1394

Merged

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Aug 24, 2023

Notes

  • Please style and clean code/template as you see fit

Changes

  • Extract mode node location selection feature from ProjectAuthoring to ChooseMoveNodeLocationComponent
  • Clean up related code

Test

  • Move node works as before:
    • one node at a time
    • multiple nodes at a time
    • steps
    • groups
    • to/from active and inactive sections

Closes #1393

@hirokiterashima hirokiterashima self-assigned this Aug 24, 2023
@hirokiterashima hirokiterashima changed the title refactor(Project Authoring): Extract mode node location selection feature to component refactor(Project Authoring): Extract move node location selection feature to component Aug 24, 2023
Use ngTemplate to clean up template
Show background color for branch paths
Add test class
#1393
@hirokiterashima hirokiterashima marked this pull request as ready for review August 24, 2023 23:58
Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

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

Functionality works well.

I'm wondering if instead of using ng-templates it would be better to create components. It would simplify the html and the components could be reused in other templates.

This looks like code duplication. It seems like Code Climate doesn't check html files?

<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="10px">
<ng-container
*ngTemplateOutlet="nodeIconAndTitle; context: { nodeId: inactiveChildId }"
></ng-container>
<ng-container
*ngTemplateOutlet="moveAfterButton; context: { nodeId: inactiveChildId }"
></ng-container>
</div>

<div fxLayout="row" fxLayoutAlign="start center" fxLayoutGap="10px">
<ng-container
*ngTemplateOutlet="nodeIconAndTitle; context: { nodeId: inactiveNode.id }"
></ng-container>
<ng-container
*ngTemplateOutlet="moveAfterButton; context: { nodeId: inactiveNode.id }"
></ng-container>
</div>

Updated margins to be RTL friendly.
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 cleaned up some styles and removed unused classes.

I also updated margin styles to be friendly to RTL languages.

@hirokiterashima
Copy link
Member Author

Thanks @breity. Good to remove unused styles. Template files look cleaner now.

@geoffreykwan can you take a final look?

Copy link
Member

@geoffreykwan geoffreykwan left a comment

Choose a reason for hiding this comment

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

When you move a step or a lesson and are in the view to choose the location, the unused lessons and unused steps are not indented correctly.

@hirokiterashima
Copy link
Member Author

Fixed. PTAL.

Copy link
Member

@geoffreykwan geoffreykwan 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.

@hirokiterashima hirokiterashima merged commit 79e6db8 into develop Aug 29, 2023
4 of 5 checks passed
@hirokiterashima hirokiterashima deleted the issue-1393-extract-move-node-location-selection branch August 29, 2023 16:35
@hirokiterashima
Copy link
Member Author

🎉 This PR is included in version 5.108.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

refactor(Project Authoring): Extract move node location selection to new component
3 participants