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

GetCollectionItems use case, for returning dataset, collection and file item types #181

Merged
merged 28 commits into from
Sep 18, 2024

Conversation

GPortas
Copy link
Contributor

@GPortas GPortas commented Aug 22, 2024

What this PR does / why we need it:

Adds GetCollectionItems use case, for returning dataset, collection and file item types. Includes search text and type filtering option.

⚠️ Environment variables should be changed to unstable image tag before merging into develop. IQSS/dataverse#10811 should be merged before applying this change.

Which issue(s) this PR closes:

Related Dataverse PRs:

Special notes for your reviewer:

I have reduced branch test coverage from 95% to 90%.

The pre-commit hook was failing because branch coverage was not being reached in classes where there should be branch coverage, and it was showing 0%. I have created an issue to address this problem separately: #186

In a future iteration we will include collection type results.

Suggestions on how to test this:

Visual inspection of the code and github actions.

@GPortas GPortas changed the title Collection file type results GetCollectionItems use case, for returning dataset and file item types Aug 23, 2024
@GPortas GPortas marked this pull request as ready for review August 23, 2024 12:36
@GPortas GPortas added Size: 3 A percentage of a sprint. 2.1 hours. SPA: Collection Page labels Aug 23, 2024
@GPortas GPortas self-assigned this Aug 27, 2024
@GPortas GPortas changed the title GetCollectionItems use case, for returning dataset and file item types GetCollectionItems use case, for returning dataset, collection and file item types Aug 27, 2024
@GPortas
Copy link
Contributor Author

GPortas commented Aug 28, 2024

Waiting for IQSS/dataverse#10810

@GPortas GPortas removed the Waiting label Aug 30, 2024
@GPortas GPortas removed their assignment Aug 30, 2024
@GPortas
Copy link
Contributor Author

GPortas commented Aug 30, 2024

Waiting for IQSS/dataverse#10810 to be approved.

@GPortas
Copy link
Contributor Author

GPortas commented Sep 16, 2024

parentAlias and parentName

parentAlias and parentName for the DatasetPreview

Thanks @ekraffmiller. We need to extend the API to add those missing properties. Not a big issue, but something to work on before updating this PR: IQSS/dataverse#10846

Adding the waiting tag.

@GPortas
Copy link
Contributor Author

GPortas commented Sep 16, 2024

@ekraffmiller I have already implemented the remaining changes. I thought it was necessary to extend the API, but the properties were already being returned.

@GPortas GPortas removed their assignment Sep 16, 2024
@g-saracca
Copy link
Contributor

g-saracca commented Sep 16, 2024

@GPortas sorry for not realizing this before, something crucial; we are going to need in each preview object (Collection, Dataset and File), the type of collection item it belongs to, so we can easily know in the SPA what type of preview object we are reading and display the correct card component.
A type property would be enough, which can be 'collection' | 'dataset' | 'file', as we use for UpwardHierarchyNode in the SPA for breadcrumbs.

@GPortas
Copy link
Contributor Author

GPortas commented Sep 17, 2024

@GPortas sorry for not realizing this before, something crucial; we are going to need in each preview object (Collection, Dataset and File), the type of collection item it belongs to, so we can easily know in the SPA what type of preview object we are reading and display the correct card component. A type property would be enough, which can be 'collection' | 'dataset' | 'file', as we use for UpwardHierarchyNode in the SPA for breadcrumbs.

No problem. I just added it!

@GPortas GPortas requested a review from g-saracca September 17, 2024 07:45
g-saracca
g-saracca previously approved these changes Sep 17, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

Looks good! Just one comment about the integration test.

expect(actualDatasetPreview.versionInfo.lastUpdateTime).not.toBeUndefined()
expect(actualDatasetPreview.versionInfo.majorNumber).toBeUndefined()
expect(actualDatasetPreview.versionInfo.minorNumber).toBeUndefined()
expect(actualDatasetPreview.versionInfo.state).toBe('DRAFT')
Copy link
Contributor

@ekraffmiller ekraffmiller Sep 17, 2024

Choose a reason for hiding this comment

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

@GPortas I think a test of actualDatasetPreview parentName and parentAlias can be added here?
Edit: Also need a test of type for the Preview objects

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right! I just added those assertions.

ekraffmiller
ekraffmiller previously approved these changes Sep 17, 2024
Copy link
Contributor

@ekraffmiller ekraffmiller left a comment

Choose a reason for hiding this comment

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

looks good to me!

@ekraffmiller ekraffmiller removed their assignment Sep 17, 2024
@g-saracca g-saracca merged commit 0eaf2df into develop Sep 18, 2024
5 checks passed
@g-saracca g-saracca deleted the 170-file-collection-results branch September 18, 2024 11:34
@GPortas GPortas added SPA.Q3.1 Collection page results of all types Original size: 3 labels Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FY5 Sprint 6 FY25 Sprint 6 FY25 Sprint 4 FY25 Sprint 4 FY25 Sprint 5 FY25 sprint 5 GREI Re-arch GREI re-architecture-related Original size: 3 Size: 3 A percentage of a sprint. 2.1 hours. SPA: Collection Page SPA.Q3.1 Collection page results of all types
Projects
Status: Done 🧹
4 participants