Skip to content

LibrarieJS UI changes#109

Merged
QilongTang merged 11 commits intomasterfrom
LibrarieJS-update
Dec 11, 2017
Merged

LibrarieJS UI changes#109
QilongTang merged 11 commits intomasterfrom
LibrarieJS-update

Conversation

@ramramps
Copy link
Collaborator

@ramramps ramramps commented Dec 6, 2017

This PR is for LibrarieJS UI Changes.

  1. Introduced "coregroup" for elements defined in Layoutspec.
  2. Introduced "class" for elements defined in Layoutspec
  3. Removed arrows for "coregroup"
  4. Auto expand "coregroup" elements.
  5. New icons

giphy 2

@mjkkirschner @alfarok @ColinDayOrg

FYI Changes are made after review from @Racel

@ramramps ramramps changed the title [WIP] LibrarieJS UI changes LibrarieJS UI changes Dec 8, 2017
arrowIcon = require("../resources/ui/indent-arrow-down-wo-lines.svg");
}

return <img className={"CategoryArrow"} src={arrowIcon} onError={this.onImageLoadFail} />;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

for arrow alignment on category

this.setState({ expanded: !currentlyExpanded });

//auto expand the coregroup elements
if(this.props.data.itemType === "category" ) {
Copy link
Member

Choose a reason for hiding this comment

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

does this work for nested categories?

Copy link
Collaborator Author

@ramramps ramramps Dec 8, 2017

Choose a reason for hiding this comment

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

No. this is only for the top level categories.

Copy link
Member

Choose a reason for hiding this comment

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

@Racel curious if this case was considered?

Copy link

Choose a reason for hiding this comment

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

@mjkkirschner Only needed for top level categories.

"text": "Color",
"iconUrl": "",
"elementType": "group",
"elementType": "class",
Copy link
Member

@mjkkirschner mjkkirschner Dec 8, 2017

Choose a reason for hiding this comment

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

so when does class get used? When should it be used opposed to group? Can you add these types to the documentation files? / wiki?

Do we ever generate classes or coreGroups when importing some other library which is not defined in the layout spec?

Copy link
Member

Choose a reason for hiding this comment

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

@ramramps also, so you will need to update the layoutspec in revit and dynamo as a consequence of this PR as well to get the same behavior right?

Copy link
Member

@mjkkirschner mjkkirschner Dec 8, 2017

Choose a reason for hiding this comment

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

First, I understand this work is being done to accomplish the particular design requirements.
I think it would be useful for someone to enumerate the rules that are now encoded in this repo.
I could be wrong, but they seem pretty complicated to me.

I will take a shot:

  • Top Level categories display Icons
  • groups or classes do not display icons
  • Nested categories do not expand when their parent categories are clicked on.
  • Top Level categories expand their child groups when clicked on.
  • other stuff?

I do not think we will be able to maintain this matrix of interactions without properly documenting it and the new classes/ groups, etc...

This is not a criticism of the implementation here. I am fine with this approach, but would be happier if we did not need to introduce new types to accomplish this, just apply the minimal logic required to existing types throughout the library with no special logic for items in the layout spec - remember we'll need another giant layout spec for TS.

at a minimum let us please document these rules thoroughly.

Copy link
Collaborator Author

@ramramps ramramps Dec 9, 2017

Choose a reason for hiding this comment

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

@mjkkirschner Thanks for the comments.

  1. Dynamo and Revit layoutspec needs a change.
  2. This is definitely to get that particular design. This was easy in WPF. But in librarie.js, everything is dependent on elementType. I don't have a choice other than adding a new one.
  3. Auto expand - as per the task, it is only for top level. Per my understanding from layoutspec, this is the order after the changesection-category-coregroup-group-none. All the nested category gets group by default.
  4. Before the change, the order is section-category-group-none. So, there is no clear distinction between the top level and nested categories. Well, we can leave it this way too. Without introducing this new type, everything is group and no way to get this design based on other data. The other approach is to use a config file and white list the top level element.
  5. I am afraid that if layoutspec is auto generated, then achieving this design will get complicated and requires careful look of how it is made today.
    6.I will add a wiki page with rules per my understanding.

Also, I will rename coregroup to groups. So, the top level has groups of group.

Copy link
Member

Choose a reason for hiding this comment

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

@ramramps thanks for the detailed response - have you added the wiki page yet (6) on your list?

Copy link
Collaborator Author

@ramramps ramramps Dec 11, 2017

Choose a reason for hiding this comment

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

not yet. the rules are simplified now. no big change required in layoutspec. I will start the wiki , and let @Racel add the rules. She knows better than me.

@mjkkirschner
Copy link
Member

@ramramps looks good implementation wise - some questions about other approaches not requiring new types, but LGTM if you have thought about that already.

@ramramps
Copy link
Collaborator Author

ramramps commented Dec 10, 2017

@mjkkirschner @Racel After giving it another shot, there is another way to achieve it.
No updates to layoutspec is required. group to coregroup is changed on the fly now.
So, no major updates required for layoutspec in revit or dynamo.
There is no other way for class update. that has to be made in layoutspec.

@Racel Let me know where and when to update class. I mean some kind of rulebook. I will update the wiki or readme section.

child.childElements.forEach((grp: LayoutElement) => {
if(grp.elementType != "class") {
grp.elementType = "coregroup";
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could have used underscore, but I find this way more explicit for someone to understand what we are doing (underscore does this implicit).

Copy link
Member

Choose a reason for hiding this comment

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

cool - looks good, can you add just a bit more description to the summary of the behavior - something like: changes categories topLevel children itemType from groups to coreGroups.... or something like that.

}, 500);
});

it("coregroup items should auto expand", function () {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this test covers the major part.

Copy link
Member

Choose a reason for hiding this comment

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

👍

onError={[Function]}
src="test-file-stub"
/>
<img
Copy link
Member

Choose a reason for hiding this comment

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

so I think you might need to update the tests file after you merge with master as I think this will undo what Keith added.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ah..I think I discarded that change. Will check the master file.


export function search(text: string, item: ItemData) {
if (item.itemType !== "group") {
if (item.itemType !== "group" && item.itemType !== "coregroup") {
Copy link
Member

@mjkkirschner mjkkirschner Dec 11, 2017

Choose a reason for hiding this comment

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

should we also ignore class during search?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I don't think so. the idea is to change to class and use the search

@mjkkirschner
Copy link
Member

mjkkirschner commented Dec 11, 2017

@ramramps thanks for taking another look at this - just a few more comments. Then LGTM.

@ramramps
Copy link
Collaborator Author

@Racel https://wiki.autodesk.com/display/GEN/Rule+book
Here is a very basic one. We can update / remove contents from this.

@ramramps
Copy link
Collaborator Author

@Racel @mjkkirschner Let me know whether I can merge this code.
I will send PR for Dynamo after that.

@Racel
Copy link

Racel commented Dec 11, 2017

LGTM. Lets merge and see how it goes...

@Racel
Copy link

Racel commented Dec 11, 2017

@ramramps - Before you merge, can you remove the arrow from the very top level category? I think it is too much...

@QilongTang
Copy link
Contributor

@ramramps We will just merge this one and create different defect for UI improment. Thanks

@QilongTang QilongTang merged commit 6131cfb into master Dec 11, 2017
@QilongTang QilongTang deleted the LibrarieJS-update branch December 11, 2017 15:56
@QilongTang QilongTang mentioned this pull request Dec 11, 2017
7 tasks
this.props.data.itemType !== "section" &&
this.props.data.itemType !== "coregroup" &&
this.props.data.itemType !== "class" &&
this.props.data.itemType == "none") {
Copy link
Contributor

Choose a reason for hiding this comment

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

should be this.props.data.itemType !== "none"

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="iso-8859-1"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

This icon does not seem referenced anywhere!

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
Copy link
Contributor

Choose a reason for hiding this comment

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

This icon does not seem referenced anywhere!

this.props.data.itemType !== "section" &&
this.props.data.itemType !== "coregroup" &&
this.props.data.itemType !== "class" &&
this.props.data.itemType == "none") {
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be !== will address in a different PR

@QilongTang QilongTang mentioned this pull request Dec 11, 2017
<style type="text/css">
.st0{fill:#808080;}
</style>
<title>indent-arrow-right</title>
Copy link
Contributor

Choose a reason for hiding this comment

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

You may want to update titles as well

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.

5 participants