-
Notifications
You must be signed in to change notification settings - Fork 16
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
Added event handlers and a Redux store for cooperation #2061
Conversation
0956821
to
53b196b
Compare
useEffect(() => { | ||
if (!sections?.length && !isAddedClicked && isNewActivity) { | ||
addNewSection() | ||
} | ||
|
||
if (selectedCourse && !sections.length && isAddedClicked) { | ||
if (selectedCourse && !sections?.length && isAddedClicked) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This requires further investigation of all the useEffect
logic. It will be addressed in issue #2064.
Also, I think we should delete unnecessary user action values (such as isActivityCreated
, isAddedClicked
, etc.) in the Redux store for Cooperation.
28ced44
to
0d1f3e7
Compare
….com/ita-social-projects/SpaceToStudy-Client into feature/2270/apply-main-changes-into-cooperation
…tps://github.com/ita-social-projects/SpaceToStudy-Client into feature/2070/change-create-course-functionality-to-new-handlers
Great work! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huge work done! Keep going!
…e Course & Cooperation
… by duplicating or linking
…tip, CourseSectionContainer, CooperationActivitiesList
…uplicating or linking
…ation-add-resource-in-two-ways Added the possibility to add a resource to a Cooperation in two ways: by duplicating or linking
…-create-course-functionality-to-new-handlers Replaced functionality of create course in order to use new handlers #2070
…main-changes-into-cooperation Refactored Cooperation & Course by Applying Main Requested Changes
…op-unique-id-section-issue Fixed drag-and-drop functionality and unique ID generation
…e-already-linked-resources Disabled already linked resources in Course/Cooperation in choose resources modals
…s-duplicate-icon-update Updated icon display based on resource addition method (link vs copy)
…-add-resource-in-two-ways Added the possibility to add a resource to a Course in two ways: by duplicating or linking
…licate-resource-validation Resolved BSONTypeError when adding duplicate resources to Course/Cooperation
…source-in-two-ways-duplicate-and-link Added the possibility to add a resource to a Cooperation / Course in two ways: by duplicating or linking
Quality Gate passedIssues Measures |
Refactored components by Single Responsibility Principle & added event handlers
The components have been refactored to follow to the SRP and decoupling the storage logic from presentation logic that makes the components to be reusable across different contexts. The refactored approach can be viewed via the following link: https://excalidraw.com/#json=7kpXFBlTDdFpOw4ERottv,BXDnxwSefLtlilkxienKZQ
[ PR #2061 ]
Implemented ability to change the availability status in '
My Cooperations
' and store this information in the Redux storeNow, all changes to the availability status of resources on
ResourceItems
are persisted in the store:When the publish type is set to '
Open manually
', the availability of all resources is automatically changed to 'Closed
', and these changes are persisted in the store:Additionally, logic has been implemented to store the sort order of resources as individual items within each section. Previously, sorting was only implemented by group type, specifically for attachments, lessons, and quizzes, which only sorted groups but not the resources within them:
Breaking changes:
CreateCourse
component. [ Already implemented and fixed in Issue (SP: 3) Replace functionality of create course in order to use new handlers #2070 and PR Replaced functionality of create course in order to use new handlers #2070 #2316 ][ PR #2168 ]
Combined lessons, quizzes, and attachments into
activities
array in the cooperation storeChanged the cooperation store to combine the logic of storing attachments (
lessons
,quizzes
, andattachments
) into a single variable -activities
. Also removed theorder
field:[ PR #2290 ]
Refactored Cooperation & Course by Applying Main Requested Changes
Changed the name of the array
activities
toresources
and the type of resources from[lessons, quizzes, attachments, questions]
to[lesson, quiz, attachment, question]
. Current structure Cooperation and Course:[ PR #2303 ]
Fixed date serialization and mask input issues in DatePicker component
availability.date
is properly serialized to ISO string before dispatching actions:A non-serializable value (
Date
object) was detected in the state, specifically in the path: cooperations.sections.0.resources.0.resource.availability.date. This warning is raised because Redux state should only contain plain serializable objects, arrays, and primitives. The reducer handling this action type iscooperationsSlice/updateResource
.DatePicker
component to use fixed-length date parts to resolve mask input warning.[ PR #2316 ]
Replaced functionality of create course in order to use new handlers
Updated the create course functionality to utilize the new handlers developed in PR #2061 after refactoring. The changes ensure that the course creation process works correctly when adding resources with the required entity data structure, as specified in PR #2290.
[ PR #2334 ]
Fixed [Error 409 (Conflict)] when saving cooperation with empty title or description
Resolved an issue where saving a cooperation with a section that has an empty title or description resulted in an Axios error with the message 'Request failed with status code 409'. After changes, it now shows a proper error popup message.
Tests Coverage for New Code:
🟣 Merged PRs:
🟢 Closed Issues:
Based on this epic Epic: Rewrite cooperation activities #1921, the following issues were implemented: