This repository was archived by the owner on Nov 19, 2025. It is now read-only.
fix: default image in workspaces for image types#2108
Merged
Conversation
🦋 Changeset detectedLatest commit: 1e2e10b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
abp6318
commented
Oct 31, 2025
abp6318
commented
Oct 31, 2025
packages/common/src/core/schemas/internal/getThumbnailUiSchemaElement.ts
Show resolved
Hide resolved
abp6318
commented
Oct 31, 2025
packages/common/src/core/schemas/internal/getThumbnailUiSchemaElement.ts
Show resolved
Hide resolved
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes the default thumbnail image display for Image-type items in workspaces by passing the item's data URL as the default thumbnail. The solution leverages the existing arcgis-hub-image-picker component rather than adding new custom logic.
Key Changes:
- Added
getDefaultImageEntityThumbnailhelper function to determine if content is an Image type and return its data URL - Modified
getThumbnailUiSchemaElementto accept an optionaldefaultThumbnailUrlparameter - Updated
buildUiSchemain ContentUiSchemaEdit to pass the Image entity's data URL as the default thumbnail
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| packages/common/src/core/schemas/internal/getThumbnailUiSchemaElement.ts | Added getDefaultImageEntityThumbnail helper and updated function signature to accept optional default thumbnail URL |
| packages/common/src/content/_internal/ContentUiSchemaEdit.ts | Updated thumbnail UI schema call to include default image for Image-type content |
| packages/common/test/core/schemas/internal/getThumbnailUiSchemaElement.spec.ts | Added tests for new getDefaultImageEntityThumbnail function |
| .changeset/giant-poets-fall.md | Added changeset documenting the fix |
packages/common/src/core/schemas/internal/getThumbnailUiSchemaElement.ts
Show resolved
Hide resolved
packages/common/src/core/schemas/internal/getThumbnailUiSchemaElement.ts
Show resolved
Hide resolved
packages/common/test/core/schemas/internal/getThumbnailUiSchemaElement.spec.ts
Show resolved
Hide resolved
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
I realized there was a much nicer way to do this vs what I thought was needed previously. All we need to do is pass in a default thumbnail image string if the item is of type
Image. Thearcgis-hub-image-pickerdoes all the work that I thought we'd need to add around the default imageInstructions for testing: see https://github.com/ArcGIS/opendata-ui/pull/15367
Closes Issues: https://devtopia.esri.com/dc/hub/issues/14191
Updated meaningful TSDoc to methods including Parameters and Returns, see Documentation Guide
Either ran
npm run changesetor this change does not require a release.These changes have been verified by QA using a
?uiVersionthat includes a PR-Preview of this branch and thev_reqlabel has been applied to the issue.OD-UI E2E tests pass against these changes using a
?uiVersionthat includes a PR-Preview of this branch