Skip to content

Commit b7753c2

Browse files
authored
EZP-31367: Content tree should display the root location of the section (#264)
1 parent badb2c6 commit b7753c2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Resources/public/scss/modules/content-tree/_list.item.scss

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,6 @@ $list-item-height: calculateRem(20px);
116116
overflow: hidden;
117117
}
118118

119-
&--is-root-item {
120-
> .c-list {
121-
padding-left: 0;
122-
}
123-
}
124-
125119
&--has-sub-items {
126120
> #{$list-item}__label {
127121
#{$list-item}__toggler {

src/modules/content-tree/components/list-item/list.item.component.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,19 @@ class ListItem extends Component {
9494
* @returns {JSX.Element}
9595
*/
9696
renderIcon() {
97-
const { contentTypeIdentifier, selected } = this.props;
97+
const { contentTypeIdentifier, selected, locationId } = this.props;
9898
const iconAttrs = {
9999
extraClasses: `ez-icon--small ez-icon--${selected ? 'light' : 'dark'}`,
100100
};
101101

102102
if (!this.state.isLoading || this.props.subitems.length) {
103-
iconAttrs.customPath =
104-
eZ.helpers.contentType.getContentTypeIconUrl(contentTypeIdentifier) || eZ.helpers.contentType.getContentTypeIconUrl('file');
103+
if (locationId === 1) {
104+
iconAttrs.customPath = eZ.helpers.contentType.getContentTypeIconUrl('folder');
105+
} else {
106+
iconAttrs.customPath =
107+
eZ.helpers.contentType.getContentTypeIconUrl(contentTypeIdentifier) ||
108+
eZ.helpers.contentType.getContentTypeIconUrl('file');
109+
}
105110
} else {
106111
iconAttrs.name = 'spinner';
107112
iconAttrs.extraClasses = `${iconAttrs.extraClasses} ez-spin`;
@@ -153,11 +158,12 @@ class ListItem extends Component {
153158
}
154159

155160
renderItemLabel() {
156-
if (this.props.isRootItem) {
161+
const { totalSubitemsCount, href, name, selected, locationId } = this.props;
162+
163+
if (locationId === 1) {
157164
return null;
158165
}
159166

160-
const { totalSubitemsCount, href, name, selected } = this.props;
161167
const togglerClassName = 'c-list-item__toggler';
162168
const togglerAttrs = {
163169
className: togglerClassName,

0 commit comments

Comments
 (0)