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(NodeService): Clean up getPrevNodeId() for AT/CM modes #1496

Merged
merged 1 commit into from
Oct 27, 2023

Conversation

hirokiterashima
Copy link
Member

@hirokiterashima hirokiterashima commented Oct 26, 2023

Changes

  • Call DataService.getCurrentNodeId() to simplify code at the beginning of the function
  • Move check for mode closer to where it's actually used
  • Use ternary check for application node/group node check
  • Change let to const where appropriate

Test

  • Going to the previous node using the prev arrow in the step tools in CM, AT, Student VLE and Preview works as before.

@hirokiterashima hirokiterashima self-assigned this Oct 26, 2023
@hirokiterashima hirokiterashima marked this pull request as ready for review October 26, 2023 22:06
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. You could probably reduce the complexity more by moving that block of code to a new function.

@hirokiterashima
Copy link
Member Author

Yes, let's add it to our future refactoring todo. This is a good start to help us get there.

@hirokiterashima hirokiterashima merged commit 87367ee into develop Oct 27, 2023
2 checks passed
@hirokiterashima hirokiterashima deleted the refactor-nodeService-getPrevNodeId branch October 27, 2023 16:47
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.

2 participants