-
Notifications
You must be signed in to change notification settings - Fork 16
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
IBX-1455: Redesign Content Tree for OSS #59
Conversation
@@ -167,22 +207,33 @@ export default class ContentTree extends Component { | |||
); | |||
} | |||
|
|||
isTreeCollapsed = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need this in that way?
const contentTreeContainer = doc.querySelector('.ez-content-tree-container'); | ||
const contentTreeWrapper = doc.querySelector('.ez-content-tree-container__wrapper'); | ||
const btn = doc.querySelector('.ibexa-btn--toggle-content-tree'); | ||
const contentTreeContainer = doc.querySelector('.ibexa-content-tree-container'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question:
Maybe we can change the name of the class because for me wrapper
and container
are interchangeable terms for HTML node that groups other nodes or some content
<li | ||
class="c-popup-actions__item" | ||
key={item.id} | ||
onClick={() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just ?
onClick={() => { | |
onClick={() => setIsExpanded((prevState) => !prevState) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do:
onClick={() => { | |
onClick={toggleExpanded} |
which for me would be the clearest solution.
const itemsStyles = {}; | ||
const allOptions = [...options, ...getHeaderActions()]; | ||
|
||
console.log(allOptions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log(allOptions); |
3cc551d
to
67994bc
Compare
@@ -19,6 +20,15 @@ class ListItem extends Component { | |||
}; | |||
} | |||
|
|||
getPrefixActions() { | |||
const { prefixActions } = window.eZ.adminUiConfig.contentTreeWidget; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the best name. Maybe secondaryItemActions
, beforeItemActions
, preItemActions
?
@@ -167,22 +207,33 @@ export default class ContentTree extends Component { | |||
); | |||
} | |||
|
|||
isTreeCollapsed() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isTreeCollapsed() { | |
checkIsTreeCollapsed() { |
const prefixActionsArr = prefixActions ? [...prefixActions] : []; | ||
|
||
return prefixActionsArr.sort((prefixActionA, prefixActionB) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this would be clearer?
const prefixActionsArr = prefixActions ? [...prefixActions] : []; | |
return prefixActionsArr.sort((prefixActionA, prefixActionB) => { | |
if (!prefixActions) { | |
return []; | |
} | |
return [...prefixActions].sort((prefixActionA, prefixActionB) => { |
const toggleExpanded = () => { | ||
setIsExpanded((prevState) => !prevState); | ||
}; | ||
const getHeaderActions = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it identical to getPrefixActions
from ListItemComponent
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It takes data from different property
<li | ||
class="c-popup-actions__item" | ||
key={item.id} | ||
onClick={() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can do:
onClick={() => { | |
onClick={toggleExpanded} |
which for me would be the clearest solution.
https://issues.ibexa.co/browse/IBX-1455