-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Database creation/migration for UFM Label editor data-types #20055
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
Conversation
The server-side migration to compliment the client-side feature #19610
There was a problem hiding this 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 |
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Outdated
Show resolved
Hide resolved
…MediaTypeLabelProperties.cs Co-authored-by: Copilot <[email protected]>
src/Umbraco.Infrastructure/Migrations/Install/DatabaseDataCreator.cs
Outdated
Show resolved
Hide resolved
…tor.cs Co-authored-by: Kenn Jacobsen <[email protected]>
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Outdated
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Show resolved
Hide resolved
src/Umbraco.Infrastructure/Migrations/Upgrade/V_16_3_0/MigrateMediaTypeLabelProperties.cs
Outdated
Show resolved
Hide resolved
kjac
left a comment
There was a problem hiding this 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.
Co-authored-by: Kenn Jacobsen <[email protected]>
Co-authored-by: Kenn Jacobsen <[email protected]>
Co-authored-by: Kenn Jacobsen <[email protected]>
Co-authored-by: Kenn Jacobsen <[email protected]>
Co-authored-by: Kenn Jacobsen <[email protected]>
|
Thanks @kjac, I've updated the PR based on your feedback. |
# Conflicts: # src/Umbraco.Infrastructure/Migrations/Upgrade/UmbracoPlan.cs
kjac
left a comment
There was a problem hiding this 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 👍
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).