refactor(TeacherDataService, DiscussionService, TeacherDiscussionService): simplify component state retrieval #2014
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
DiscussionService
,TeacherDiscussionService
, and related components and services to simplify and improve the codebase. The most important changes include the removal of unused methods, updates to method signatures, and improvements to code readability.Codebase simplification:
src/app/services/discussionService.spec.ts
: Removed unnecessary method implementations inMockTeacherDataService
and simplified the test structure forgetClassmateResponses
. [1] [2] [3]src/app/services/teacherDiscussionService.spec.ts
: Removed unused service imports and updated theMockTeacherDataService
method signature. [1] [2]src/assets/wise5/components/discussion/discussion-show-work/discussion-show-work.component.ts
: ChangedsetStudentWork
method to private and improved line breaks for readability. [1] [2] [3]Method and constructor updates:
src/assets/wise5/components/discussion/discussionService.ts
: Updated the constructor to use consistent parameter ordering and renamedConfigService
toconfigService
for consistency. [1] [2]src/assets/wise5/components/discussion/teacherDiscussionService.ts
: Added a new private methodgetComponentStates
to simplify fetching component states and updated method calls accordingly. [1] [2]Removal of unused methods:
src/assets/wise5/services/teacherDataService.ts
: Removed unused methodsgetComponentStatesByComponentIds
andgetComponentStatesByWorkgroupIdAndComponentIds
. [1] [2]Test