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

U4-11272 Added flexible dropdown property value converter #2659

Merged
merged 1 commit into from Jun 18, 2018
Merged

U4-11272 Added flexible dropdown property value converter #2659

merged 1 commit into from Jun 18, 2018

Conversation

jamescoxhead
Copy link
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have linked this PR to an issue on the tracker at http://issues.umbraco.org

Description

Fixes issue U4-11272. Adds a property value converter for the new flexible dropdown property editor introduced in 7.10.

The logic for determining whether the data type returns a single or multiple values is pretty much lifted and shifted from the media picker value converter. Maybe this should become part of the PropertyValueConverterBase class? I think the Nested Content converter uses something very similar too.

@poornimanayar
Copy link
Contributor

Hi,

Many thanks for the PR. We will review your PR in the next 14 days, probably sooner.

Regards,
Poornima

@poornimanayar
Copy link
Contributor

Hey James,

Can you give me an idea on how I can test this locally?

Regards,
Poornima (CPR Team)

@jamescoxhead
Copy link
Contributor Author

Hi Poornima,

I created two data types for a multi-item dropdown and a single item dropdown. I added these to a document type (with a template), and created a page using this document type. I then checked that I could access the values using @(Model.Content.GetPropertyValue<IEnumerable<string>>("multiValue")) and @(Model.Content.GetPropertyValue<string>("singleValue")) for the corresponding dropdowns.

It's also worth checking if models builder creates classes with the correct types. I put models builder into AppData mode, regenerated my models, and then verified that the generated class contained my properties with types IEnumerable<string> and string respectively.

Thanks,
James

@poornimanayar
Copy link
Contributor

Hi James

Many thanks for this. That confirms my line of thoughts. I shall look into your PR.

Poornima

Copy link
Contributor

@poornimanayar poornimanayar left a comment

Choose a reason for hiding this comment

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

Tested and found okay

@nul800sebastiaan
Copy link
Member

Thanks @jamescoxhead ! Looks good to me too!

@nul800sebastiaan nul800sebastiaan merged commit bd76085 into umbraco:dev-v7 Jun 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants