-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/hidden problems #106
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
Open
XanderVertegaal
wants to merge
10
commits into
develop
Choose a base branch
from
feature/hidden-problems
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
672fce1
Add 'hidden' field to Problem model; create migration
XanderVertegaal a9c4b49
Add 'hidden' to ProblemSerializer and add permission helper method to…
XanderVertegaal 32717d1
Add set-visibility action
XanderVertegaal 550f1f2
Add VisibilityToggleComponent
XanderVertegaal 8f84ba0
Update frontend user types
XanderVertegaal 59594db
Change visibility toggle component to button with banner
XanderVertegaal 9317ec1
Add hidden filter
XanderVertegaal 186583c
Fix backend tests
XanderVertegaal 5b34f10
Fix and append to frontend tests
XanderVertegaal e2e9123
Change line-endings in SearchComponent test file
XanderVertegaal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Generated by Django 4.2.27 on 2026-05-13 07:30 | ||
|
|
||
| from django.db import migrations, models | ||
|
|
||
|
|
||
| class Migration(migrations.Migration): | ||
|
|
||
| dependencies = [ | ||
| ("problem", "0008_delete_knowledgebase"), | ||
| ] | ||
|
|
||
| operations = [ | ||
| migrations.AddField( | ||
| model_name="problem", | ||
| name="hidden", | ||
| field=models.BooleanField(default=False), | ||
| ), | ||
| ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
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.
I find this strange. Asking for a problem with a particular ID, which you're not allowed to see, and then getting another problem with a different ID instead. That will look like a bug to legitimate non-masters. Why not just return a 404?
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.
The reasoning behind this is that this view is also used by users who change their filters in such a way that the problem they are currently viewing is excluded. It feels a bit heavy-handed to hit them with a 404, but I'm happy to be convinced otherwise.
Maybe we can return a 404 if there are no filters applied (since the user will then be looking for a specific problem, e.g. by manipulating the URL) anyway, and return the first available problem (as it is) otherwise?
A separate suggestion would be to show a small toast/pop-up message when a different problem is returned, so it is more obvious to the user that they have been 'redirected' to the first available problem, not the problem they requested.
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.
The justification you're giving sounds like a list endpoint, where the query might return zero or more problems. In that case, if the list was filtered by a particular ID, I would expect it to return an empty list if the user cannot see the problem with that ID. Only if there was no ID-based filter criterion, would I expect that the user might get other results than the one they had in mind initially.
The test code I'm reading, on the other hand, seems to suggest that this is an endpoint that is supposed to return exactly one problem. If that is the case, the problem either exists or it doesn't (from the point of view of the user). In this case, where the user is not allowed to see the problem in question, there are two ways in which you can present this: "it exists but you're not allowed to see it" (403) or (I'm going to pretend) "it doesn't exist" (404).
Letting a user select one particular ID, like in this test, and then showing a problem with a different ID is never correct, as far as I'm concerned.
Perhaps the frontend is using this endpoint in a way that I'm not aware of? We can discuss this tomorrow or the day after if necessary.