Skip to content

Content type picker in dynamic root pickers#15514

Merged
nul800sebastiaan merged 4 commits intoumbraco:contribfrom
bjarnef:feature/dynamic-root-pickers
Feb 14, 2024
Merged

Content type picker in dynamic root pickers#15514
nul800sebastiaan merged 4 commits intoumbraco:contribfrom
bjarnef:feature/dynamic-root-pickers

Conversation

@bjarnef
Copy link
Copy Markdown
Contributor

@bjarnef bjarnef commented Dec 28, 2023

Prerequisites

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

Description

This PR adjust the use of contentTypePicker with changes in #15080 and a bit cleanup in the controllers.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Dec 28, 2023

Hi there @bjarnef, thank you for this contribution! 👍

While we wait for one of the Core Collaborators team to have a look at your work, we wanted to let you know about that we have a checklist for some of the things we will consider during review:

  • It's clear what problem this is solving, there's a connected issue or a description of what the changes do and how to test them
  • The automated tests all pass (see "Checks" tab on this PR)
  • The level of security for this contribution is the same or improved
  • The level of performance for this contribution is the same or improved
  • Avoids creating breaking changes; note that behavioral changes might also be perceived as breaking
  • If this is a new feature, Umbraco HQ provided guidance on the implementation beforehand
  • 💡 The contribution looks original and the contributor is presumably allowed to share it

Don't worry if you got something wrong. We like to think of a pull request as the start of a conversation, we're happy to provide guidance on improving your contribution.

If you realize that you might want to make some changes then you can do that by adding new commits to the branch you created for this work and pushing new commits. They should then automatically show up as updates to this pull request.

Thanks, from your friendly Umbraco GitHub bot 🤖 🙂

@busrasengul
Copy link
Copy Markdown
Contributor

Thank you @bjarnef
First of all, Happy New Year! 🎉
So many people on the Core team are still enjoying the holidays atm, we will get back to reviewing the PRs soon!

Copy link
Copy Markdown
Member

@nul800sebastiaan nul800sebastiaan left a comment

Choose a reason for hiding this comment

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

Hey @bjarnef - something is very wrong here, when I go to an MNTP and add a query step under Dynamic Root Query, then choose "Specific Node" then I am only allowed to choose from content types, not for actual content. Can you please check this?

@bjarnef
Copy link
Copy Markdown
Contributor Author

bjarnef commented Feb 13, 2024

Hi @nul800sebastiaan

Yes, you're right! It should open content, media or member picker as before.
7334782

It is only shown when content is selected though.

<div ng-if="!node && model.value.type === 'content'" class="mt2">

image

Just for fun I noticed when allowing this for media and member as well, member picker allow to select root nodes (All members, and other root nodes based on member type, unlike memberpicker property editor (which use treepicker).

Content and media pickers allow selecting nodes at root level though.

image

If it was enabled here, it would throw an error selecting root nodes.

image

Ideally memberPicker in editorService need entityType set... or pass in this. If developers already use editorService.memberPicker() the root nodes are selectable by default and fail if the root nodes are selected as not supported :)

/umbraco/backoffice/umbracoapi/entity/GetById?id=all-members&type=Member
/umbraco/backoffice/umbracoapi/entity/GetById?id=Member&type=Member

function memberPicker(editor) {
  editor.view = "views/common/infiniteeditors/treepicker/treepicker.html";
  if (!editor.size) editor.size = "small";
  editor.entityType = "Member",
  editor.section = "member";
  editor.treeAlias = "member";
  open(editor);
}

image

@nul800sebastiaan nul800sebastiaan merged commit 8145a90 into umbraco:contrib Feb 14, 2024
@nul800sebastiaan
Copy link
Copy Markdown
Member

Thanks @bjarnef this now works great! 👍

I skimmed through your other comments, but let's keep the scope creep down please. :-)

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