Integrated the CheckboxWithTooltip component into the modal windows for adding new resources in the Course and Cooperation [ Close #2345 ]
Integrated the CheckboxWithTooltip component (that was developed in PR #2333 ) into the modal windows for adding new resources in the Course and Cooperation:
[ PR #2365 ]
Added the possibility to add a resource to a Cooperation in two ways: by duplicating or linking
Added the possibility for a user to add a resource only once as a link and multiple times as a copy of the current resource.
[x] If the checkbox 'Make a copy of the selected lesson/quiz/attachment' is not checked, the user can add resources that have not been added before as a link.
[x] If the checkbox 'Make a copy of the selected lesson/quiz/attachment' is checked, all resources become available to add, and the user can add a copy of these resources as many times as they want.
[x] Added isDuplicate=true in cooperation redux store when a resource is added as a copy. If a resource is added as a link, the isDuplicate field is omitted:
[ PR #2369 ]
Added the possibility to add a resource to a Course in two ways: by duplicating or linking
Added the possibility for a user to add a resource only once as a link and multiple times as a copy of the current resource.
[x] If the checkbox 'Make a copy of the selected lesson/quiz/attachment' is not checked, the user can add resources that have not been added before as a link.
[x] If the checkbox 'Make a copy of the selected lesson/quiz/attachment' is checked, all resources become available to add, and the user can add a copy of these resources as many times as they want.
[x] Added isDuplicate=true field when a resource is added as a copy. If a resource is added as a link, the isDuplicate field is omitted:
[ PR #2372 ]
Updated icon display for resources added via Link & Duplicate Copy
[x] Updated the icon display logic to distinguish between resources added as links and those added as duplicate copies
Disabled already linked resources in Course/Cooperation in choosing resources modals
Users are now prevented from duplicating links when adding resources to a course or cooperation. The modal for selecting resources displays a list of available resources, including those already added as links to the course or cooperation. Resources that have already been added as links are disabled, allowing users to add only new resources:
[ PR #2388 ]
Fixed drag-and-drop functionality and unique ID generation issues
The drag-and-drop functionality for rearranging sections in Courses and Cooperations is now working properly. Additionally, when a course or cooperation has more than two sections, the generated IDs are unique, which resolves the issue where deleting one section would lead to the deletion of all sections within the course or cooperation
The implemented changes now properly handle unique IDs and correctly update the order of sections:
[x] Fixed implementation of the drag-and-drop functionality for rearranging sections in Course.
[x] Fixed implementation of the drag-and-drop functionality for rearranging sections in Cooperation.
[x] Fixed issue with deleting one of the sections that cause deleting all sections in Course and Cooperation.
[x] Ensured that unique IDs were assigned to each section, even when there were multiple sections within a Course or Cooperation. Specifically, the ID is assigned to each section when it is created and updated as necessary.
[x] Fixed the issue where the same unique 'key' is assigned to each child in the list during edit mode of Cooperation. This fix prevents the screen from freezing and ensures that users can change the order of sections, delete them, or access other functionality as intended.
[ PR #2392 ]
Fixed "Cast to ObjectId failed" error when adding duplicate resource to Course & Cooperation
Previously, when adding a resource as a duplicate copy to a Course or Cooperation and trying to Save, a "Cast to ObjectId failed" error occurs due to a BSONTypeError. This issue prevented the resource from being properly saved in the database. To resolve the "Cast to ObjectId failed" error when adding duplicate resources, the following changes were implemented:
To resolve this issue, it _was decided not to generate _id using uuidv4() for new resources_, as was previously implemented. Since we use the useDndSensor hook, which only accepts an id, we need to generate an id for every resource added to a Cooperation or Course.
Resource Addition Scenarios:
[x] Resource added as a link: In addition to the existing external _id, we generate a new id using uuidv4().
[x] Resource added as a duplicate copy: We generate a new id using uuidv4() and reset the existing external _id to an empty string (this was necessary due to multiple type errors when setting _id as optional and always deleting). We also set isDuplicate to true.
In response, we receive:
[x] Resource added as a link: The generated id created by uuidv4() and the external _id.
[x] Resource added as a duplicate copy: The generated id created by uuidv4() and the external _id of the recently created resource in the proper entity (Lesson, Quiz, or Attachment).
Additionally:
[x] Created a utility function isValidUUID for testing purposes to verify the validity of the generated id.
Link: https://excalidraw.com/#json=7kpXFBlTDdFpOw4ERottv,BXDnxwSefLtlilkxienKZQ
[ PR #2358 ]
Integrated the
CheckboxWithTooltip
component into the modal windows for adding new resources in theCourse
andCooperation
[ Close #2345 ]Integrated the
CheckboxWithTooltip
component (that was developed in PR #2333 ) into the modal windows for adding new resources in theCourse
andCooperation
:[ PR #2365 ]
Added the possibility to add a resource to a
Cooperation
in two ways: by duplicating or linkingAdded the possibility for a user to add a resource only once as a link and multiple times as a copy of the current resource.
Make a copy of the selected lesson/quiz/attachment
' is not checked, the user can add resources that have not been added before as a link.Make a copy of the selected lesson/quiz/attachment
' is checked, all resources become available to add, and the user can add a copy of these resources as many times as they want.isDuplicate=true
in cooperation redux store when a resource is added as a copy. If a resource is added as a link, theisDuplicate
field is omitted:[ PR #2369 ]
Added the possibility to add a resource to a
Course
in two ways: by duplicating or linkingAdded the possibility for a user to add a resource only once as a link and multiple times as a copy of the current resource.
Make a copy of the selected lesson/quiz/attachment
' is not checked, the user can add resources that have not been added before as a link.Make a copy of the selected lesson/quiz/attachment
' is checked, all resources become available to add, and the user can add a copy of these resources as many times as they want.isDuplicate=true
field when a resource is added as a copy. If a resource is added as a link, theisDuplicate
field is omitted:[ PR #2372 ]
Updated icon display for resources added via Link & Duplicate Copy
[ PR #2379 ]
Disabled already linked resources in
Course
/Cooperation
in choosing resources modalsUsers are now prevented from duplicating links when adding resources to a course or cooperation. The modal for selecting resources displays a list of available resources, including those already added as links to the course or cooperation. Resources that have already been added as links are disabled, allowing users to add only new resources:
[ PR #2388 ]
Fixed drag-and-drop functionality and unique ID generation issues
The drag-and-drop functionality for rearranging sections in
Courses
andCooperations
is now working properly. Additionally, when a course or cooperation has more than two sections, the generated IDs are unique, which resolves the issue where deleting one section would lead to the deletion of all sections within the course or cooperation The implemented changes now properly handle unique IDs and correctly update the order of sections:Course
.Cooperation
.Course
andCooperation
.Course
orCooperation
. Specifically, the ID is assigned to each section when it is created and updated as necessary.Cooperation
. This fix prevents the screen from freezing and ensures that users can change the order of sections, delete them, or access other functionality as intended.[ PR #2392 ]
Fixed "Cast to ObjectId failed" error when adding duplicate resource to
Course
&Cooperation
Previously, when adding a resource as a duplicate copy to a
Course
orCooperation
and trying toSave
, a "Cast to ObjectId failed
" error occurs due to aBSONTypeError
. This issue prevented the resource from being properly saved in the database. To resolve the "Cast to ObjectId failed
" error when adding duplicate resources, the following changes were implemented:To resolve this issue, it _was decided not to generate
_id
usinguuidv4()
for new resources_, as was previously implemented. Since we use theuseDndSensor
hook, which only accepts anid
, we need to generate anid
for every resource added to aCooperation
orCourse
.Resource Addition Scenarios:
_id
, we generate a newid
usinguuidv4()
.id
usinguuidv4()
and reset the existing external_id
to an empty string (this was necessary due to multiple type errors when setting_id
as optional and always deleting). We also setisDuplicate
totrue
.In response, we receive:
id
created byuuidv4()
and the external_id
.id
created byuuidv4()
and the external_id
of the recently created resource in the proper entity (Lesson
,Quiz
, orAttachment
).Additionally:
isValidUUID
for testing purposes to verify the validity of the generatedid
.Tests Coverage for New Code:
#
🟣 Merged PRs:
#
🟢 Closed Issues: