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

Remove the ability to create typed objects from the CreateCustom component #170

Merged
merged 2 commits into from
Nov 27, 2019

Conversation

adecler
Copy link
Member

@adecler adecler commented Nov 12, 2019

NOTE: Depends on

BHoM/BHoM_UI#160

Additional comments

See BHoM/BHoM_UI#160 for more details

Copy link
Member

@awakeman awakeman left a comment

Choose a reason for hiding this comment

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

Comments in relevant areas.

Additionally the CreateCustomFormula needs to be changed to inherit from SingleOptionCallerFormula as opposed to CallerFormula so that it gets a button on the ribbon and not menu of types
image


List<string> props = inputs[0] as List<string>;
List<object> values = inputs[1] as List<object>;
if (props.Count == values.Count)
{
for (int i = 0; i < props.Count; i++)
Engine.Reflection.Modify.SetPropertyValue(obj, props[i], values[i]);
obj.CustomData[InputParams[i].Name] = inputs[i];
Copy link
Member

Choose a reason for hiding this comment

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

This doesn't work, it will always have an object with 2 CustomData properties of "Properties" (the list of of property keys) and "Values" (the list of objects). Expected behaviour is that the CustomData dictionary would be populated akin to CreateDictionary and that properties that exist on the CustomObject type (like Name) be populated accordingly and not placed in CustomData

Excel_UI/UI/Components/oM/CreateCustom.cs Show resolved Hide resolved
@adecler
Copy link
Member Author

adecler commented Nov 19, 2019

Thanks @awakeman . I'd suggest you take this PR over and make the changes needed. I've not touched the Excel toolkit in 2 years so you're definitely more fit for the job.

@awakeman
Copy link
Member

OK, no problem.

@adecler adecler assigned awakeman and unassigned adecler Nov 21, 2019
@adecler
Copy link
Member Author

adecler commented Nov 22, 2019

@awakeman , any ETA on this?
I am blind, just saw your last commit. Do you plan on doing more changes or is it down to getting reviewed and merged? Who's best to review this?

@awakeman awakeman dismissed their stale review November 22, 2019 09:00

fixed, requires review by someone else

@awakeman
Copy link
Member

@adecler yeah, this should work. suggest @IsakNaslundBh should review.

@adecler
Copy link
Member Author

adecler commented Nov 26, 2019

I have added a couple more reviewers in the hope that one of them can unlock this PR as it is been stale for a while now.

Copy link
Contributor

@FraserGreenroyd FraserGreenroyd left a comment

Choose a reason for hiding this comment

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

LGTM, have run an old script and that looks fine, and have looked at the CreateCustom function (component?) and no type is being asked for, so am happy with this 😄

@adecler adecler merged commit c3f2b87 into master Nov 27, 2019
@adecler adecler deleted the BHoM_UI-#159-RemoveSelectedItemFromCreateCustom branch November 27, 2019 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:compliance Non-conforming to code guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants