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

Content & media url endpoints #15832

Merged
merged 6 commits into from
Apr 11, 2024
Merged

Conversation

Migaroez
Copy link
Contributor

@Migaroez Migaroez commented Mar 5, 2024

Prerequisites

  • I have added steps to test this contribution in the description below

Description

  • New dedicated endpoints for retrieving URLs by key (e.g. for displaying picked item URLs in the content/media picker)
  • Async misusage cleanup in factories

Testing

  • Create and publish some documents (preferably some in multiple cultures, don't forget to assign domains)
  • Upload some temporary files and create some media from it (see example payload below)
  • The following endpoints should return the relevant url info for all found documents/media by the keys you supplied /umbraco/amanagement/api/v1/document/urls /umbraco/amanagement/api/v1/media/urls

Example payloads

Media with image cropper backing field

{
    "mediaType": {
        "id": "cc07b313-0843-4aa8-bbda-871c8da728c8"
    },
    "values": [
        {
            "culture": null,
            "segment": null,
            "alias": "umbracoFile",
            "value": {"src":"5344f6ae-d305-47fc-955f-3a7778b6c336"}
        }
    ],
    "variants": [
        {
            "culture": null,
            "segment": null,
            "name": "test media"
        }
    ]
}

Media with a generic file backing field
{
"mediaType": {
"id": "4c52d8ab-54e6-40cd-999c-7a5f24903e4d"
},
"values": [
{
"culture": null,
"segment": null,
"alias": "umbracoFile",
"value": "5344f6ae-d305-47fc-955f-3a7778b6c336"
}
],
"variants": [
{
"culture": null,
"segment": null,
"name": "test file"
}
]
}

Added optimizations for documenturlFactory
Duplicated the endpoint for media
Cleaned up some code marked async that will never hit a long running operation
Copy link
Member

@Zeegaan Zeegaan left a comment

Choose a reason for hiding this comment

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

Had a few comments before getting to testing 😁

@Migaroez Migaroez added the project/bellissima AKA "the new backoffice" label Mar 5, 2024
# Conflicts:
#	src/Umbraco.Cms.Api.Management/Factories/MediaPresentationFactory.cs
Copy link
Member

@Zeegaan Zeegaan left a comment

Choose a reason for hiding this comment

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

@Migaroez I changed the naming on the resourcesets, please confirm these are the correct names, then we are ready to merge 😁

@Migaroez
Copy link
Contributor Author

I am happy with the rename. Merging

@Migaroez Migaroez merged commit 48e9be2 into v14/dev Apr 11, 2024
14 of 16 checks passed
@Migaroez Migaroez deleted the v14/feature/content-url-endpoints branch April 11, 2024 07:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
project/bellissima AKA "the new backoffice"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants