refactor(DataService): make abstract #2025
Merged
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 the Angular services and their associated test files, primarily focusing on refactoring and updating dependencies. The most important changes include replacing
DataService
with specific services for students and teachers, removing unnecessary imports, and updating test configurations.Refactoring Services:
src/app/services/data.service.ts
: ChangedDataService
to an abstract class and moved specific methods toStudentDataService
andTeacherDataService
. Updated method signatures and removed thebroadcastCurrentNodeChanged
method. [1] [2]src/assets/wise5/services/studentNodeService.ts
: ReplacedDataService
withStudentDataService
in theStudentNodeService
class.src/assets/wise5/services/teacherNodeService.ts
: Added constructor to injectTeacherDataService
and other dependencies. [1] [2]Updating Test Files:
src/app/services/data.service.spec.ts
: ReplacedDataService
withStudentDataService
and removed unnecessaryprovideHttpClientTesting
import.src/app/services/studentNodeService.spec.ts
: ReplacedDataService
withStudentDataService
in the test setup. [1] [2]src/app/services/teacherNodeService.spec.ts
: ReplacedDataService
withTeacherDataService
andProjectService
withTeacherProjectService
. Removed unnecessaryprovideHttpClientTesting
import.Dependency Updates:
src/app/student-teacher-common-services.module.ts
: AddedTeacherNodeService
,TeacherDataService
, andTeacherWebSocketService
to the providers array. [1] [2] [3]Miscellaneous Changes:
src/assets/wise5/services/studentWebSocketService.ts
: ReplacedStudentDataService
withdataService
for broadcasting and updating node statuses. [1] [2] [3] [4]src/assets/wise5/common/stepTools/step-tools.component.spec.ts
: ReplacedNodeService
withStudentNodeService
and removed unnecessaryprovideHttpClientTesting
import. [1] [2] [3]Test
Application loads and works as before