-
-
Notifications
You must be signed in to change notification settings - Fork 883
[#2785] Create unique URL for each phase under My Submission and All Submissions Page #2786
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
base: master
Are you sure you want to change the base?
[#2785] Create unique URL for each phase under My Submission and All Submissions Page #2786
Conversation
@RishabhJain2018 can u please let me know if it's OK. |
…te_unique_url_for_each_challenge_phase
…te_unique_url_for_each_challenge_phase
@Kajol-Kumari can you please fix the build here? |
Codecov Report
@@ Coverage Diff @@
## master #2786 +/- ##
=======================================
Coverage 72.51% 72.51%
=======================================
Files 85 85
Lines 5513 5513
=======================================
Hits 3998 3998
Misses 1515 1515 Continue to review full report at Codecov.
|
), | ||
url( | ||
r"^challenge/(?P<challenge_pk>[0-9]+)/challenge_phase/(?P<challenge_phase_pk>[0-9]+)/count$", | ||
r"^challenge/(?P<challenge_pk>[0-9]+)/challenge_phase/(?P<version>(v1|v2))/(?P<challenge_phase_pk_or_slug>[-a-zA-Z0-9_]+)/count$", |
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.
Hey are we required to do this API also using slug in this PR?
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.
yes, as in vm.getResults()
we are calling both submissions as well as count. So, both will be called using the slug only.
vm.isResult = true; | ||
if (phaseId !== undefined) { | ||
vm.phaseId = phaseId; | ||
vm.mySubmissionPhaseSlug = phaseId; |
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.
@Kajol-Kumari I think you have to work a liitle bit more here as now from the function getResults
, its argument coming as slug not phase id in variable phaseId
so you need to stop setting to controller variable vm.phaseId
in line 813 and also make sure that it is not breaking other functionalities where we might not able to get vm.phaseId
after the removal of line 813.
Codecov Report
@@ Coverage Diff @@
## master #2786 +/- ##
==========================================
+ Coverage 72.93% 75.75% +2.82%
==========================================
Files 83 20 -63
Lines 5368 2924 -2444
==========================================
- Hits 3915 2215 -1700
+ Misses 1453 709 -744
Continue to review full report at Codecov.
|
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.
@Kajol-Kumari instead of passing one field for both slug and phase pk can't you just pass 2 separate fields slug
& challenge_phase_pk
as request param and use one of those based on the API being called on the backend side. That way would be much cleaner to write the backend code. Let me know if you need any help with that.
apps/challenges/views.py
Outdated
return Response(response_data, status=status.HTTP_404_NOT_FOUND) | ||
else: | ||
try: | ||
challenge_phase = ChallengePhase.objects.get( |
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.
@Kajol-Kumari you can use get_challenge_phase_model
here right?
apps/challenges/views.py
Outdated
return Response(response_data, status=status.HTTP_404_NOT_FOUND) | ||
else: | ||
try: | ||
challenge_phase = ChallengePhase.objects.get( |
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.
same here?
apps/jobs/views.py
Outdated
return Response(response_data, status=status.HTTP_400_BAD_REQUEST) | ||
else: | ||
try: | ||
challenge_phase = ChallengePhase.objects.get( |
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.
same here?
…te_unique_url_for_each_challenge_phase
@Ram81 Can you please review this. |
fix: #2785
Added unique url using slug for
All_submissions
of a particular phase.Add unique url for get submissions under
my_submissions
tabAdd the required tests.
GIF for feature added:
