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

added option to disable automatic expand of single nc item #12261

Merged
merged 4 commits into from
May 25, 2022
Merged

added option to disable automatic expand of single nc item #12261

merged 4 commits into from
May 25, 2022

Conversation

beliskner
Copy link
Contributor

This feature is a reimplementation of PR: #9883 of @patrickdemooij9 to add an option to disable nested content automatically expanding if the max items is set to 1 and the slider is turned off.
Visual of how this works is posted in attached closed PR.

Can be checked with:

  • Create a new nested content with min 0, max 1.
  • Whenever you open it on a node, it will automatically open if you have an item in it.
  • If you uncheck the new option, it'll not automatically open on load.

@mikecp
Copy link
Contributor

mikecp commented Apr 15, 2022

Hi @beliskner,

Thanks for porting the PR of @patrickdemooij9 to V9 as it was a nice addition! 👍

Referring to one of the remarks in the original PR, I will check with HQ if we really need to limit this logic to the situations where there is max 1 item or if we can update the current logic and change it to "apply whenever there is only 1 item".

I also would also suggest to reword a little bit the description of the new property to clarify its usage, but let's first wait for HQ feedback on the logic 😊

I'll come back to you as soon as I have news.

@mikecp mikecp self-requested a review April 15, 2022 01:57
@beliskner
Copy link
Contributor Author

Hi @mikecp,

Thank you for your response. Looking forward to the feedback. Any suggestion on correct phrasing?

@mikecp
Copy link
Contributor

mikecp commented Apr 16, 2022

HI @beliskner,
Not sure yet as this will depend on the feedback, but if we leave it as it is now, probably something like "Item is automatically expanded when there is one item available and maximum one item allowed."
If we adapt the logic to just take the property value into account, I would put something like "Item is automatically expanded when there is a single item available"

I keep you posted on the answer from HQ.

Copy link
Contributor

@mikecp mikecp left a comment

Choose a reason for hiding this comment

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

Hi @beliskner ,

Coming back to you with some feedback from my discussion with HQ.

So, the good news is that we can leave out the "min-max" check and just apply the property value check in all cases where there is only 1 item 🎉

The somewhat "less good" news here is that HQ has released v9.5 RC this week, which is the last minor version of V9. This means that you will need to retarget your PR to the branch V10/contrib, which has just been created and is available in the repository.
But since it is thanks to this switch to V10 that we can simplify the logic (which is a breaking change and would not have been allowed in v9), this is not such a bad news after all I think 😁

I hope you won't mind doing this update, don't hesitate to reach out if you have problems with the retarget.

Thanks!

@mikecp mikecp changed the base branch from v9/contrib to v10/contrib May 13, 2022 09:45
beliskner added 2 commits May 17, 2022 14:11

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
remove max item 1 conditional to set current node

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
removed description of first item conditional
@@ -23,6 +23,9 @@ public class NestedContentConfiguration
[ConfigurationField("showIcons", "Show Icons", "boolean", Description = "Show the Element Type icons.")]
public bool ShowIcons { get; set; } = true;

[ConfigurationField("expandsOnLoad", "Expands on load", "boolean", Description = "First item is automatically expanded")]
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe replace "First item" by "A single item" to be more accurate?

Copy link
Contributor

@mikecp mikecp left a comment

Choose a reason for hiding this comment

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

Thanks @beliskner for the update!
I just left a tiny comment, let me know what you think.
Cheers!

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
change copy to more accurately describe the feature
@beliskner
Copy link
Contributor Author

Hi @mikecp thanks for the feedback! I adjusted the copy as per your request. If there's anything else you would like me to change please let me know :)

@beliskner beliskner requested a review from mikecp May 24, 2022 07:17
@mikecp
Copy link
Contributor

mikecp commented May 25, 2022

Hi @beliskner , sorry for the delay, I just re-checked and it all works fine! So we're all ready to merge 😁

Thanks again for this PR! And since it is your first contribution to the CMS, @nul800sebastiaan will be happy to assign our shiny contributor's badge to you 🎉
All you have to do is provide your account name on Our so that we can link the badge!

Cheers!

@beliskner
Copy link
Contributor Author

Hi @beliskner , sorry for the delay, I just re-checked and it all works fine! So we're all ready to merge 😁

Thanks again for this PR! And since it is your first contribution to the CMS, @nul800sebastiaan will be happy to assign our shiny contributor's badge to you 🎉 All you have to do is provide your account name on Our so that we can link the badge!

Cheers!

Awesome, thanks! https://our.umbraco.com/members/beliskner/ is my Our profile. Looking forward to contributing more!

@nul800sebastiaan
Copy link
Member

Contrib badge added! 👍 Thanks again @beliskner!

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.

None yet

3 participants