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

Prevent querying for cart on homepage & fix admin download table queries #1250

Merged
merged 3 commits into from
May 12, 2022

Conversation

louise-davies
Copy link
Member

Description

With the new SciGateway change to allow unauthenticated access to the homepage, it meant the user was seeing errors as the cart was requested on the homepage. I justed jiggled the code around to create an extra component so that the cart is only requested on "actual" dataview pages.

The second change is to fix some of the querying in the admin download table - there were UPPERs being applied too liberally and breaking things (e.g. the sorting) so I only kept the UPPERs where necessary - for text filters. Also, I noticed that only setting the to field in a date filter threw an error when done against an Oracle DB due to Oracle not accepting the year being 0 (this issue is also present on TopCAT). So I set it to 1 instead which avoids the error.

Testing instructions

Add a set up instructions describing how the reviewer should test the code

  • Review code
  • Check Actions build
  • Review changes to test coverage
  • Run dataview in scigateway and verify that no requests are sent when you're on the DG homepage
  • test out the sorting and filtering in the admin download table

Agile board tracking

No issue as these are things I found whilst doing the DLS demo so I made hotfixes for them.

- if viewing homepage when not logged in then the request will throw an error
- Removed unnecessary UPPERs which were breaking sorts (also just removed any that weren't broken but unecessary)
- Set not set start date to 0001 rather than 0000 to avoid Oracle error
… files

- this makes it easier to have facility specific config files ignored
@codecov
Copy link

codecov bot commented May 11, 2022

Codecov Report

Merging #1250 (4611480) into develop (cdc9344) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff            @@
##           develop    #1250   +/-   ##
========================================
  Coverage    97.47%   97.48%           
========================================
  Files          133      133           
  Lines         6785     6787    +2     
  Branches      2059     2059           
========================================
+ Hits          6614     6616    +2     
  Misses         155      155           
  Partials        16       16           
Flag Coverage Δ
common 98.14% <ø> (ø)
dataview 97.98% <100.00%> (+<0.01%) ⬆️
download 94.85% <100.00%> (ø)
search 97.37% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...eway-dataview/src/page/pageContainer.component.tsx 97.53% <100.00%> (+0.03%) ⬆️
...nloadStatus/adminDownloadStatusTable.component.tsx 98.92% <100.00%> (ø)

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 cdc9344...4611480. Read the comment docs.

@louise-davies louise-davies merged commit 1d3ebe0 into develop May 12, 2022
@louise-davies louise-davies deleted the bugfix/minor-fixes-dls branch May 12, 2022 13:19
@louise-davies louise-davies added the bug Something isn't working label Jun 21, 2022
@louise-davies louise-davies mentioned this pull request Jul 4, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants