refactor(StudentDataService, VLEParentComponent): simplify logic for node retrieval #2012
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
This pull request includes several changes to improve the
StudentDataService
and related components. The most important changes involve the removal of thegetLatestNodeEnteredEventNodeIdWithExistingNode
method, updates to theVLEParentComponent
to enhance initialization logic, and the upgrade of the TypeScript target version.Removal of unnecessary method:
src/app/services/studentDataService.spec.ts
: Removed the test case forshouldGetLatestNodeEnteredEventNodeIdWithExistingNode
and its associated method. [1] [2]src/assets/wise5/services/studentDataService.ts
: Removed thegetLatestNodeEnteredEventNodeIdWithExistingNode
method and its helperisNodeExistAndActive
.Enhancements to
VLEParentComponent
:src/assets/wise5/vle/vle-parent/vle-parent.component.spec.ts
: Added initialization logic for student data and updated theexpectSetCurrentNode
function to handle both preview and student initialization. [1] [2] [3] [4]src/assets/wise5/vle/vle-parent/vle-parent.component.ts
: Refactored thegetStartingNodeId
method to use the newgetLastNodeEnteredEvent
method and updated the data service references. [1] [2]TypeScript configuration update:
src/assets/wise5/vle/tsconfig.json
: Updated the TypeScript target version toes2023
and adjusted thelib
andinclude
settings accordingly.Minor changes:
src/assets/wise5/services/studentDataService.ts
: Removed the'use strict';
directive.src/messages.xlf
: Updated line numbers in translation context due to code changes.Test