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

EES-5427 Add file info to data set version summaries in admin #5167

Merged
merged 3 commits into from
Aug 21, 2024
Merged

Conversation

ntsim
Copy link
Collaborator

@ntsim ntsim commented Aug 20, 2024

This PR changes data set version summaries in the admin to return file info:

  • DataSetVersionSummary.File.Id (mapped from ReleaseFile.File.DataSetFileId)
  • DataSetVersionSummary.File.Title (mapped from ReleaseFile.Name)

This can then be used in the frontend to link through to the data set page in the public frontend.

Relevant changes

  • Updated ListVersions endpoint to use a dataSetId query parameter instead of the parameter being inside of the URL. This was previously inconsistent with other data set version endpoints.
  • Fixed ListVersions endpoint not 404ing if the data set can't be found.

@@ -42,7 +42,7 @@ public abstract class DataSetVersionsControllerTests(
{
private const string BaseUrl = "api/public-data/data-set-versions";

public class ListLiveVersionsTests(
public class ListVersionsTests(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we rename this back to ListLiveVersionsTests as we've kept the logic to only return the live ones?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I made this change on purpose as it felt too specific a name for an endpoint that lists versions.

IMO, filtering on 'live' statuses makes sense as a default, but it'd be a good idea to keep the naming more generic to keep the endpoint open to extension for other statuses (e.g. with a query parameter or something) in the future.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't feel too strongly either way. Happy to approve :)

[Produces("application/json")]
public async Task<ActionResult<PaginatedListViewModel<DataSetLiveVersionSummaryViewModel>>> ListLiveVersions(
public async Task<ActionResult<PaginatedListViewModel<DataSetLiveVersionSummaryViewModel>>> ListVersions(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we rename this back to ListLiveVersions as we've kept the logic to only return the live ones?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As above comment

@ntsim ntsim requested a review from jack-hive August 21, 2024 09:41
@ntsim ntsim merged commit 398d24f into dev Aug 21, 2024
7 checks passed
@ntsim ntsim deleted the ees-5427 branch August 21, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants