Skip to content

Conversation

@leekelleher
Copy link
Member

Description

The server-side migration to compliment the client-side feature #19610.

Adds the database creation scripts for the Bytes and Pixels label data-types, for use with the Media Types, (e.g. Image's height/width/filesize).

Adds migration code, to create those data-types, (if allowed via InstallDefaultDataSettings), and update the Media Types accordingly.

// CC'ing @iOvergaard, to keep in the loop.

How to test?

On either a fresh install or upgraded CMS, check that the "Label (bytes)" and "Label (pixels)" data-types are created. Try uploading an image to the Media section, does the height/width display as pixels? does the file-size display the bytes in friendly way? (e.g. in KBs, with commas).

The server-side migration to compliment the client-side feature #19610
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements database migration and creation scripts for new UFM (User Friendly Media) label data types to enhance media file display in Umbraco CMS. The changes introduce two new specialized label data types: "Label (bytes)" for displaying file sizes in a user-friendly format and "Label (pixels)" for displaying dimensions with pixel units.

Key changes:

  • Adds migration logic to create and update media type properties with new label data types
  • Updates database creation scripts to use the new data types for fresh installations
  • Defines constants for the new data type IDs and GUIDs

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
MigrateMediaTypeLabelProperties.cs New migration class that creates the bytes/pixels label data types and updates existing media types to use them
UmbracoPlan.cs Registers the new migration in the upgrade plan
DatabaseDataCreator.cs Updates initial database creation to use new label data types and improved property names/descriptions
Constants-DataTypes.cs Defines constants for the new LabelBytes and LabelPixels data type IDs and GUIDs

Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

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

Hi @leekelleher - good stuff 💯

I've left a few comments for you to consider.

@leekelleher leekelleher marked this pull request as draft September 3, 2025 07:49
@leekelleher leekelleher marked this pull request as ready for review September 3, 2025 07:57
@leekelleher leekelleher requested a review from kjac September 3, 2025 07:58
@leekelleher
Copy link
Member Author

Thanks @kjac, I've updated the PR based on your feedback.

# Conflicts:
#	src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
Copy link
Contributor

@kjac kjac left a comment

Choose a reason for hiding this comment

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

Looks great and tests out great too 👍

@kjac kjac enabled auto-merge (squash) September 3, 2025 09:19
@kjac kjac merged commit 355f5c3 into main Sep 3, 2025
24 of 25 checks passed
@kjac kjac deleted the v16/feature/label-migration-bytes-pixels branch September 3, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants