usnistgov / oar-pdr

The NIST Open Access to Research (OAR) Public Data Repository (PDR) system software
12 stars 10 forks source link

Fix/metrics performance #256

Closed chuanlin2018 closed 2 years ago

chuanlin2018 commented 2 years ago

This version fixed following issues. It also included the change in PR#255 (keyword filter dropdown display nothing when user removed one selected keyword)

  1. Fixed metrics info display: display spinner at right side of the green title bar before metrics data is ready.
  2. Fixed the font in metrics info: defined the font family in style.scss to make it global. Set the font size locally.
  3. Fixed "Visit Home Page" button color: I realized that it displayed science theme color all the time.
  4. Made keyword suggestion list case-insensitive.
  5. Display spinner in the search result section while loading: current version displayed "0 dataset found" first, then the number was updated.
deoyani commented 2 years ago

@chuanlin2018 I tested all the changes except the metrics spinner etc, it is not obvious to me, can you confirm whether metrics API is called ? I do not see in the network calls in javascript console. Try using 8C401B5C708647B8E05324570681610A2081 as it has the data for metrics in oardev.

chuanlin2018 commented 2 years ago

Let me check.

chuanlin2018 commented 2 years ago

This is the url to get metrics data: https://oardev.nist.gov/rmm/usagemetrics/files?exclude=_id&include=ediid,filepath,success_get,download_size&ediid=8C401B5C708647B8E05324570681610A2081

chuanlin2018 commented 2 years ago

I just ran it locally and I realized that line 206 in styles.scss need be commented out in order to see the spinner. I will check in the fix soon: Screen Shot 2022-06-06 at 11 23 28 AM

deoyani commented 2 years ago

This is the url to get metrics data: https://oardev.nist.gov/rmm/usagemetrics/files?exclude=_id&include=ediid,filepath,success_get,download_size&ediid=8C401B5C708647B8E05324570681610A2081

Thats right but it does not seem to get called when I was testing this branch locally.

chuanlin2018 commented 2 years ago

The spinner class in styles.scss is used by other components. I renamed the one in metricsinfo css. Now it should work.

chuanlin2018 commented 2 years ago

The link was copied from console log. I added a console log right before the url was called...

chuanlin2018 commented 2 years ago

Just checked in the fix to the spinner css.

chuanlin2018 commented 2 years ago

The spinner might be hard to see if the server response very quick. To test it locally I set a timeout to simulate the delay in landingpage.component.ts: Screen Shot 2022-06-06 at 11 43 56 AM

deoyani commented 2 years ago

@chuanlin2018 there is error in one of the tests, can you check and confirm?

chuanlin2018 commented 2 years ago

It didn't get to Angular test yet. I just restarted the test...

chuanlin2018 commented 2 years ago

It failed again in Python tests: Screen Shot 2022-06-07 at 2 14 50 PM I am not sure how to fix it except restart the process...

RayPlante commented 2 years ago

It looks like we may have it an docker hub access limit; we may need to wait until tomorrow to rerun

RayPlante commented 2 years ago

All tests have now passed.

deoyani commented 2 years ago

Everything works! Metrics spinner needs testing on the server.