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

Fix team filter on All submissions page #3424

Merged
merged 8 commits into from
Jun 5, 2021

Conversation

gautamjajoo
Copy link
Member

@gautamjajoo gautamjajoo commented May 22, 2021

Problem: When we filter the team name on all submission page, the data is different than expected. It is because whichever api call is taking the most time that is being displayed on the page.

Fix:

  1. Fixed it by checking if the api call for data displayed is same as entered.
  2. The pagination of filter submissions is also fixed. Since the pagination number is taken from the URL and when we filter the team name, the URL changes as well.
filter.3.mp4

@RishabhJain2018 @Ram81 @Kajol-Kumari

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2021

Codecov Report

Merging #3424 (2fcefc4) into master (96968d6) will decrease coverage by 0.49%.
The diff coverage is 34.80%.

@@            Coverage Diff             @@
##           master    #3424      +/-   ##
==========================================
- Coverage   72.93%   72.44%   -0.50%     
==========================================
  Files          83       20      -63     
  Lines        5368     3175    -2193     
==========================================
- Hits         3915     2300    -1615     
+ Misses       1453      875     -578     
Impacted Files Coverage Δ
frontend/src/js/controllers/authCtrl.js 53.91% <6.38%> (-12.95%) ⬇️
frontend/src/js/controllers/profileCtrl.js 79.76% <20.00%> (-13.10%) ⬇️
frontend/src/js/controllers/permissionCtrl.js 36.36% <22.22%> (-63.64%) ⬇️
frontend/src/js/controllers/challengeCtrl.js 65.17% <33.64%> (-8.52%) ⬇️
frontend/src/js/controllers/updateProfileCtrl.js 82.55% <44.44%> (-10.30%) ⬇️
frontend/src/js/controllers/challengeListCtrl.js 95.74% <50.00%> (+1.06%) ⬆️
...ntend/src/js/controllers/challengeHostTeamsCtrl.js 70.50% <66.66%> (-1.18%) ⬇️
frontend/src/js/controllers/teamsCtrl.js 71.17% <75.00%> (ø)
frontend/src/js/controllers/ChallengeInviteCtrl.js 100.00% <100.00%> (ø)
frontend/src/js/controllers/SubmissionFilesCtrl.js 95.45% <100.00%> (ø)
... and 30 more
Impacted Files Coverage Δ
frontend/src/js/controllers/authCtrl.js 53.91% <6.38%> (-12.95%) ⬇️
frontend/src/js/controllers/profileCtrl.js 79.76% <20.00%> (-13.10%) ⬇️
frontend/src/js/controllers/permissionCtrl.js 36.36% <22.22%> (-63.64%) ⬇️
frontend/src/js/controllers/challengeCtrl.js 65.17% <33.64%> (-8.52%) ⬇️
frontend/src/js/controllers/updateProfileCtrl.js 82.55% <44.44%> (-10.30%) ⬇️
frontend/src/js/controllers/challengeListCtrl.js 95.74% <50.00%> (+1.06%) ⬆️
...ntend/src/js/controllers/challengeHostTeamsCtrl.js 70.50% <66.66%> (-1.18%) ⬇️
frontend/src/js/controllers/teamsCtrl.js 71.17% <75.00%> (ø)
frontend/src/js/controllers/ChallengeInviteCtrl.js 100.00% <100.00%> (ø)
frontend/src/js/controllers/SubmissionFilesCtrl.js 95.45% <100.00%> (ø)
... and 30 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93e6c2d...2fcefc4. Read the comment docs.

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

[Issue] Tho we are able to show consistent data to the users but we aren't avoiding the redundant api calls which we could have achieved using switchMap @gautamjajoo

\cc @Ram81

@gautamjajoo gautamjajoo marked this pull request as draft May 28, 2021 12:08
@gautamjajoo gautamjajoo marked this pull request as ready for review May 29, 2021 16:13
@gautamjajoo
Copy link
Member Author

@Ram81 @Kajol-Kumari Reverted back the changes. We are now ignoring the previous API calls. Also, added it to the participant-team name filter.

Copy link
Member

@Ram81 Ram81 left a comment

Choose a reason for hiding this comment

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

@Kajol-Kumari could you test this locally once

/**
*Check whether team name is filtered
*/
isTeamFiltered: boolean = true;
Copy link
Member

Choose a reason for hiding this comment

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

@gautamjajoo the logic is not clear to me. Is this flag used to check if the query matches what we passed as parameter to filter API?

Copy link
Member Author

Choose a reason for hiding this comment

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

So, basically the pagination number is taken from the URL and when we filter the team name, the URL changes as well, hence we use this flag to check if there is a filter added then we change our URL to a different one.

Copy link
Member

@Kajol-Kumari Kajol-Kumari left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@Ram81 Ram81 left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@RishabhJain2018 RishabhJain2018 merged commit bf6094e into Cloud-CV:master Jun 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants