Skip to content

Conversation

@ekraffmiller
Copy link
Contributor

What this PR does / why we need it:

Implements a use case for calling the MyData API endpoint, used in the SPA Accounts Page -> My Data section.
Returns a collection of CollectionItems, similar to the GetCollectionItems use case.

Which issue(s) this PR closes:

Suggestions on how to test this:

Review code and tests

@github-actions github-actions bot added FY25 Sprint 21 FY25 Sprint 21 (2025-04-09 - 2025-04-23) FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) GREI Re-arch GREI re-architecture-related SPA.Q2.1 Account Page: My Data Section labels Apr 24, 2025
@ekraffmiller ekraffmiller moved this to Ready for Review ⏩ in IQSS Dataverse Project Apr 25, 2025
@g-saracca
Copy link
Contributor

Hi @ekraffmiller, should we already create a js-dataverse use case for this endpoint?
Doesn't it still have a lot of bugs to solve and things that might change because of them?
IMO it may be too early to try to make a Use Case and a frontend integration.

@ekraffmiller ekraffmiller moved this from Ready for Review ⏩ to In Progress 💻 in IQSS Dataverse Project Apr 28, 2025
@ekraffmiller
Copy link
Contributor Author

Hi @ekraffmiller, should we already create a js-dataverse use case for this endpoint? Doesn't it still have a lot of bugs to solve and things that might change because of them? IMO it may be too early to try to make a Use Case and a frontend integration.

That's true there are bug fixes to wait for, I just wasn't sure if we needed to work with what we have since I'm not sure when they will be fixed. But I can put a waiting tag on this and work on other things until we decide what to do.

@g-saracca
Copy link
Contributor

g-saracca commented Apr 29, 2025

That's true there are bug fixes to wait for, I just wasn't sure if we needed to work with what we have since I'm not sure when they will be fixed. But I can put a waiting tag on this and work on other things until we decide what to do.

Ok, so if you did any temporary patch/fix to avoid the bugs please mention it in the PR. If you believe that there are no big patches to do to make it work it's ok otherwise I would wait but prioritising the API bug fixes to be fixed as soon as possible.

@ekraffmiller
Copy link
Contributor Author

ekraffmiller commented Apr 29, 2025

That's true there are bug fixes to wait for, I just wasn't sure if we needed to work with what we have since I'm not sure when they will be fixed. But I can put a waiting tag on this and work on other things until we decide what to do.

Ok, so if you did any temporary patch/fix to avoid the bugs please mention it in the PR. If you believe that there are no big patches to do to make it work it's ok otherwise I would wait but prioritising the API bug fixes to be fixed as soon as possible.

Ok, to summarize the issues on the API -

  1. The per-page param doesn't work, it always returns 10 items. #10528
  2. The empty results are thrown as an error from the API. #11447
  3. There is no permissions check for using the otherIdentifier param. #11451
  4. The datasets in harvested dataverses are not being returned. #11083

These errors don't affect the logic of the use case, just the testing. When 2 and 3 are fixed, we need to update the tests. Number 2 affects the SPA handling empty results. So I think we can set it to waiting until 2 is fixed, as you said, it shouldn't be a big change.

@ekraffmiller ekraffmiller moved this from In Progress 💻 to Ready for Review ⏩ in IQSS Dataverse Project Apr 29, 2025
@g-saracca
Copy link
Contributor

@ekraffmiller ok, it doesn't sound too bad right?
So I believe we can continue with this Use Case 👍🏼, and it should be a temporary workaround in the SPA integration regarding the 2nd item.
Thanks! I will review this PR

Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

Nice job, looks great! 🎉 Just some minor comments.
It's awesome that MyData endpoint returns the same properties(different naming) as the Search endpoint so we can share Collection, Dataset and File Previews models between these two use cases!
One more thing, could you add integration tests regarding filtering in the GetMyDataCollectionItems use case as we have with the GetCollectionItems use case?

@ekraffmiller
Copy link
Contributor Author

Hi @g-saracca I finally fixed the tests! when I used createCollectionViaApi, the collection didn't appear in the results, but when I used the use case instead (createCollection.execute()) it works. I don't know why, since the collection seems to be created correctly in both instances. Also, when I create the new user, I have to give it superuser privileges in order to have the permission to create a subcollection within the test collection.

Copy link
Contributor

@g-saracca g-saracca left a comment

Choose a reason for hiding this comment

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

Approving!

@github-project-automation github-project-automation bot moved this from In Review 🔎 to Ready for QA ⏩ in IQSS Dataverse Project May 5, 2025
@ofahimIQSS ofahimIQSS self-assigned this May 5, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project May 5, 2025
@ofahimIQSS
Copy link
Contributor

Tests are passing - merging.

@ofahimIQSS ofahimIQSS merged commit 40db91c into develop May 5, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project May 5, 2025
@ofahimIQSS ofahimIQSS deleted the 283-implement-my-data-use-case branch May 5, 2025 15:18
@ofahimIQSS ofahimIQSS removed their assignment May 5, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project May 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 21 FY25 Sprint 21 (2025-04-09 - 2025-04-23) FY25 Sprint 22 FY25 Sprint 22 (2025-04-23 - 2025-05-07) GREI Re-arch GREI re-architecture-related SPA.Q2.1 Account Page: My Data Section

Projects

Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Implement use case for getting My Data section data

4 participants