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

Refine the CreateObject component #152

Merged
merged 11 commits into from
Nov 9, 2019
Merged

Conversation

adecler
Copy link
Member

@adecler adecler commented Nov 6, 2019

Issues addressed by this PR

Closes #151

Test files

Just play with the CreateOBject component and the global menu

Changelog

  • New Input selection menu for the CreateObject component
  • Listing properties in text representation of generated constructors
  • Improved behaviour of the WPF menus (used in Dynamo)
  • Default value for all inputs of CreateObject component

Additional comments

See #147 for a full discussion regarding those new features

@adecler adecler added the type:feature New capability or enhancement label Nov 6, 2019
@adecler adecler added this to the BHoM 3.0 β MVP milestone Nov 6, 2019
@adecler adecler self-assigned this Nov 6, 2019
Copy link
Member

@epignatelli epignatelli left a comment

Choose a reason for hiding this comment

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

Thanks @adecler! That's veeery very nice 😄

Can I be anal and ask for 2 changes?

  • Can we avoid triggering the auto-close of the Override Inputs menu after you click on a property? And maybe rename it to something more human-like rather than machine-like? Maybe Add/Remove Inputs?
  • Can we remove Name as well? I don't see why it should be an exception to the properties. We still need to remove the input every time we want to create an object if the properties is not relevant (which is 80% of the cases).

I'll do some further tests in the meanwhile!

<Compile Include="Templates\SelectorMenu_Wpf.cs" />
<Compile Include="Templates\ItemSelectorMenu.cs" />
<Compile Include="Templates\ItemSelectorMenu_WinForm.cs" />
<Compile Include="Templates\ItemSelectorMenu_Wpf.cs" />
Copy link
Member

Choose a reason for hiding this comment

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

❤️

@al-fisher
Copy link
Member

First testing - this is really nice @adecler 😸 - I think the syntax we have gone with works well! Thanks

On @epignatelli comment above:

Can we remove Name as well? I don't see why it should be an exception to the properties. We still need to remove the input every time we want to create an object if the properties is not relevant (which is 80% of the cases).

I personally would give the exception to Name. Is the inherited property that is used most frequently.

Will be useful to have defaults set though for the properties, although @adecler I think you mentioned this was not trivial to reflect?
In that case - perhaps we can hard code defaults for Properties with Primative types. i.e. string would be "", int 0, double 0.0
Is that is a good idea?

@epignatelli
Copy link
Member

Maybe I have the wrong picture, but I thought that the cases where we are using Name are just a few. Where is it exactly used? Is it used a lot? If not, my case was that it would be most beneficial to support the most frequent case.

Using a default value is definitely a nice option as well!

@al-fisher
Copy link
Member

A point on the way the Method signature is rendered in the menu:
We are including Guid, FragmentSet etc. in the menu description - which are not the actual component inputs.

image

@adecler
Copy link
Member Author

adecler commented Nov 7, 2019

I have added default values. Know that you will need BHoM/BHoM_Engine#1308 for this to work properly so important to merge both together (although it doesn't actually depends on it in the regular sense of the word)

@adecler
Copy link
Member Author

adecler commented Nov 7, 2019

Alright guys, I think I have addressed all your requests.

The only one I haven't touched is the question of including/excluding Name in the initial list of inputs. Here's my 2 cents on it:

  • Initially I had decided to keep it because it is the most likely to be used and it is easier to remove an input than to go in the menu to add one.
  • Now that we have default values, it makes even more sense to keep it since you can just ignore it.

@epignatelli epignatelli self-requested a review November 7, 2019 09:50
Copy link
Member

@epignatelli epignatelli left a comment

Choose a reason for hiding this comment

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

Thanks @adecler this looks amazing to me!

I still have some other comments, but I will raise a separate issue for them, so we can merge and iterate again!

Edit:
Issues raised from this PR: #154, #155, #156, #157

@epignatelli epignatelli added the status:do-not-merge For instance, test PR, for discussion, or dependant PRs not ready for merge label Nov 7, 2019
@epignatelli
Copy link
Member

Adding do-not-merge because dependencies have not been merged yet. Feel free to remove the label and merge when they will.

Copy link
Member

@al-fisher al-fisher left a comment

Choose a reason for hiding this comment

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

Gosh - sorry @adecler - I am not getting the same behaviour as yourself and @epignatelli with the new menu on the Create Component.
See below - Add/Remove Support for instance is having no effect.
I certainly think I am not doing anything wrong here, but will certainly recheck all repos etc. in the morning. Can sanity check together on call tomorrow too perhaps.
Other than this!! (🤦‍♂ sorry!!) - all looking really good with latest subtle tweaks!

CreateMenu

@adecler
Copy link
Member Author

adecler commented Nov 8, 2019

@al-fisher , we'll have to debug on your machine because it's all working fine for me even reproducing your exact example (down to where you click)

@al-fisher
Copy link
Member

As expected - this was user error on my part! Thanks @adecler 😄
As discussed will complete review and aim to merge today now - to pick up the newly raised issues as additions.

@al-fisher
Copy link
Member

Approving based on testing and behaviours of the Add/Remove menus working really well! Not withstanding @epignatelli’s further improvement issues.
Thanks @adecler!

Leaving do-not-merge label on though as currently building Excel_Toolkit against this PR branch gives the below errors for me. I say for me - as worth you double checking @adecler after this morning! 😄

BHoM_UI and Excel_Toolkit do seem to build fine both on master for me though.

The type or namespace name 'ISelector' could not be found (are you missing a using directive or an assembly reference?) Excel_UI C:\BHoMGitHub\Excel_Toolkit\Excel_UI\UI\Templates\SelectorMenuUtil.cs 42

The type or namespace name 'SelectorMenu<,>' could not be found (are you missing a using directive or an assembly reference?) Excel_UI C:\BHoMGitHub\Excel_Toolkit\Excel_UI\UI\Templates\SelectorMenu_RibbonXml.cs 39

@awakeman FYI

@adecler
Copy link
Member Author

adecler commented Nov 9, 2019

@al-fisher, thanks for checking that. I forgot Excel toolkit is not exactly interfacing with the BHoM_UI the same way.

I have created a PR that fixes th eproblem here: https://github.com/BHoM/Excel_Toolkit/pull/169.
It doesn't clash with the existing PR so all should be fine.

@al-fisher al-fisher removed the status:do-not-merge For instance, test PR, for discussion, or dependant PRs not ready for merge label Nov 9, 2019
@al-fisher
Copy link
Member

Thanks @adecler - approved the raised Excel PR also now. Cheers

@al-fisher al-fisher merged commit c603786 into master Nov 9, 2019
@al-fisher al-fisher deleted the BHoM_UI-#151-RefineCreateObject branch November 9, 2019 13:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refine the CreateObject component
3 participants