Skip to content

Allow deselection of colour picker property#19174

Merged
iOvergaard merged 1 commit intov16/devfrom
v16/bugfix/allow-color-picker-deselect
Apr 28, 2025
Merged

Allow deselection of colour picker property#19174
iOvergaard merged 1 commit intov16/devfrom
v16/bugfix/allow-color-picker-deselect

Conversation

@AndyButland
Copy link
Contributor

Prerequisites

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

Fixes: #19165

Description

As the linked issue shows, you can't currently deselect a previously selected colour from a property. This PR allows that.

Testing

  • Create a property on a document type based on the "Approved colour" data type, with one or more available colours.
  • Create content based on the document type, set a value for the colour property and save.
  • Click to unselect the value and save again.
  • Verify that with the PR applied the empty value is persisted. With the current code it will be restored to the previously selected value.

Release

Can cherry-pick into release/16.0 when approved and merged.

Copilot AI review requested due to automatic review settings April 28, 2025 04:34
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 allows users to deselect a previously selected color by ensuring that an empty (undefined) value is properly persisted.

  • Consolidated the early return into a concise ternary assignment.
  • Improved the handling of undefined values to support deselection.
Comments suppressed due to low confidence (1)

src/Umbraco.Web.UI.Client/src/packages/property-editors/color-picker/property-editor-ui-color-picker.element.ts:20

  • Consider adding specific test cases to verify that setting the value to undefined correctly clears the color property in the persistence layer.
this.#value = value ? this.#ensureHashPrefix(value) : undefined;

@AndyButland AndyButland changed the title Allow deselection of color picker property. Allow deselection of colour picker property Apr 28, 2025
@iOvergaard iOvergaard merged commit 5469d98 into v16/dev Apr 28, 2025
28 checks passed
@iOvergaard iOvergaard deleted the v16/bugfix/allow-color-picker-deselect branch April 28, 2025 13:50
madsrasmussen added a commit that referenced this pull request May 1, 2025
…#19201)

* Incorrect forum and security urls when raising issue (#19080)

* Add 'ManifestWithDynamicConditions' to ManifestHeaderApp so Header Apps can be conditionally shown/loaded (#19124)

* V15 QA Added acceptance tests for bulk trash dialog (#19125)

* Added tests for bulk trash content dialog

* Updated tests for trash content dialog

* Added tests for trash and bulk trash media dialog

* Moved trash content tests into a folder

* Bumped version

* Make trash tests run in the pipeline

* Make trash tests run in the pipeline

* Fixed comments

* Reverted npm command

* readme shield for forum

* Allow deselection of color picker property. (#19174)

* V15 Added acceptance tests for tiptap statusbar (#19131)

* Updated tests for tiptap RTE

* Moved tests for titptap toolbar to another class

* Added tests for titptap toolbar

* Added tests for tiptap statusbar

* Bumped version

* Make tiptap tests run in the pipeline

* Bumped version

* Reverted npm command

* build: restores some of the behavior from V13 in relation to StaticAssets (#19189)

In v13, the StaticAssets build was only triggered based on the existence of either the output folder or a preserve.* marker file. Here, we also additionally check for the node_modules/.package-lock.json file before reinstalling npm dependencies. We also now only run `npm install` rather than `npm ci` to optimise the build.

* filter search to only include element types

* V16 QA update failing nightly tests (#19190)

* Fixed tests

* More updates for tests

* Bumped version of testhelpers

* Fixed notifications in tests

* Last fixes

* Revert "Merge branch 'v16/dev' into v16/hotfix/filter-element-type-search-for-block-types"

This reverts commit 7b8b5c2, reversing
changes made to 6d4ddb7.

* disable not pickable search results

* correct use of pickable filter

---------

Co-authored-by: Lotte Pitcher <[email protected]>
Co-authored-by: Warren Buckley <[email protected]>
Co-authored-by: Nhu Dinh <[email protected]>
Co-authored-by: Sebastiaan Janssen <[email protected]>
Co-authored-by: Lotte Pitcher <[email protected]>
Co-authored-by: Andy Butland <[email protected]>
Co-authored-by: Jacob Overgaard <[email protected]>
Co-authored-by: Andreas Zerbst <[email protected]>
Co-authored-by: mole <[email protected]>
Co-authored-by: Niels Lyngsø <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants