Skip to content
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

BC-6352 - Deleting the creator field causes the files not to be displayed anymore #3396

Merged
merged 9 commits into from
Mar 8, 2024

Conversation

bn-pass
Copy link
Contributor

@bn-pass bn-pass commented Jan 25, 2024

…ters to see files created by them) in homeworks

Description

Links to Tickets or other pull requests

https://ticketsystem.dbildungscloud.de/browse/BC-6352

Changes

Data Security

Deployment

New Repos, NPM packages or vendor scripts

Screenshots of UI changes

Approval for review

  • QA: In addition to review, the code has been manually tested (if manual testing is possible)
  • All points were discussed with the ticket creator, support-team or product owner. The code upholds all quality guidelines from the PR-template.
  • DEV: Every new component is implemented having accessibility in mind (e.g. aria-label, role property)

Notice: Please remove the WIP label if the PR is ready to review, otherwise nobody will review it.

…ters to see files created by them) in homeworks
Comment on lines 598 to 602
submissionFilesStorageData.files = filesStorage.files.filter((file) => submitters.has(file.creatorId));
submissionFilesStorageData.readonly = readonly || (!isCreator && isTeacher);

const gradeFilesStorageData = _.clone(filesStorage);
gradeFilesStorageData.files = filesStorage.files.filter((file) => teachers.has(file.creatorId));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you remove it completly? What is with other user? For example:
you has removed a Student, but a Teacher or other Student look this submission wath than?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SevenWaysDP It just removes a requirement for the creator to be present among the person that can access the file which can be sometimes not true as we have to remove the creator reference from the files. The files should remain accessible to everyone that have access to it.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @bn-pass but I would like to test this again briefly. There are so many scenarios

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

there is a problem

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, there is another way, or, yes, this is a real problem? ;)

This is a real problem!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SevenWaysDP where did you spot that behaviour? Was it on the testing environment for this branch or on your local development machine and you only checked out this branch in the schulcloud-client? I'm afraid it could be related to the changes made to the "authorization" logic in the backend (on the same branch)... I don't think changes made here (in the schulcloud-client) could cause that behaviour as I've only removed the check for the creator presence among the submitters or teachers (as we still want to be able to access some files uploaded by no longer "present" user.

This is a problem if you remove because submission and grading files have parentType = submission and we sort them by creatorId in Frondend

#3396 (comment)

Copy link
Contributor

@SevenWaysDP SevenWaysDP Feb 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bn-pass Please do not merge, I will clarify this with Cedric and Ingwert.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dyedwiper @SevenWaysDP As the ticket has received a higher priority I've modified the solution to a bit safer approach which came from a fact that the issue has not been created by this particular ticket's changes (as it hasn't added the files' creatorId removal - it has been added in another ticket, already merged to main so it will already happen on all the executed data deletion requests). I think it's a sweet spot between what is available right now to us and what we want to achieve in the follow-up ticket (BC-6609).

So thanks to the changes made within the 4e555a6 commit, the filter will now be applied to all the files that still have the creatorId reference defined, but the files that do not have this reference will simply be added to every tab (will be selected by any filter) - thanks to this any files should not be left unavailable in any case. And after the BC-6609 will be developed and merged this inconvenience will be fixed (but unfortunately not for the old files as they will already have the creatorId reference removed) as we'll then be able to decide whether it's a submission-related file or grading-related file based on some flag or something.

Please re-review all the changes and let me know what's the conclusion - in my opinion it should be enough to not block this PR anymore, but you have the final voice of course.

@bn-pass bn-pass added the do_not_merge Do not merge label Feb 19, 2024
Copy link

sonarqubecloud bot commented Mar 8, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@bn-pass bn-pass requested review from SevenWaysDP and dyedwiper March 8, 2024 02:14
Copy link
Contributor

@SevenWaysDP SevenWaysDP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is ok for me

@bn-pass bn-pass removed the do_not_merge Do not merge label Mar 8, 2024
@bn-pass bn-pass merged commit a476dd7 into main Mar 8, 2024
46 of 47 checks passed
@bn-pass bn-pass deleted the BC-6352-no-creator-ref-case branch March 8, 2024 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants