diff --git a/packages/neos-ui-editors/src/Editors/NodeType/index.js b/packages/neos-ui-editors/src/Editors/NodeType/index.js index 196e4c8cff..ceffa6c31a 100644 --- a/packages/neos-ui-editors/src/Editors/NodeType/index.js +++ b/packages/neos-ui-editors/src/Editors/NodeType/index.js @@ -59,16 +59,18 @@ export default class NodeType extends PureComponent { } // Show all nodetypes if is site root node - const rawOptions = isSiteNode ? nodeTypesRegistry.getSubTypesOf(nodeTypesRegistry.getRole('document')) : allowedSiblingNodeTypesForFocusedNode; - const options = rawOptions - // Filter out system nodetypes (i.e. without groups) - // ToDo: move this logic to some more generic place, maybe nodeTypesRegistry - .filter(nodeType => $get('ui.group', nodeTypesRegistry.get(nodeType))) - .map(nodeType => ({ - icon: $get('ui.icon', nodeTypesRegistry.get(nodeType)), - label: i18nRegistry.translate($get('ui.label', nodeTypesRegistry.get(nodeType))) || nodeType, - value: nodeType - })); + const nodeTypeFilter = isSiteNode ? nodeTypesRegistry.getSubTypesOf(nodeTypesRegistry.getRole('document')) : allowedSiblingNodeTypesForFocusedNode; + const options = nodeTypesRegistry.getGroupedNodeTypeList(nodeTypeFilter).reduce((result, group) => { + group.nodeTypes.forEach(nodeType => { + result.push({ + icon: $get('ui.icon', nodeType), + label: i18nRegistry.translate(nodeType.label) || nodeType.name, + value: nodeType.name, + group: i18nRegistry.translate(group.label) + }); + }); + return result; + }, []); if (options.length) { return ; diff --git a/packages/react-ui-components/src/SelectBox/style.css b/packages/react-ui-components/src/SelectBox/style.css index 828c44f8e8..83681d9cea 100644 --- a/packages/react-ui-components/src/SelectBox/style.css +++ b/packages/react-ui-components/src/SelectBox/style.css @@ -39,3 +39,10 @@ .selectBox__item { border-top: 1px solid var(--brandColorsContrastDarker); } + +.selectBox__groupHeader { + background-color: var(--brandColorsContrastDark); + font-weight: bold; + padding-left: var(--spacing); + line-height: var(--goldenUnit); +} diff --git a/packages/react-ui-components/src/SelectBox_ListPreviewGrouped/selectBox_ListPreviewGrouped.js b/packages/react-ui-components/src/SelectBox_ListPreviewGrouped/selectBox_ListPreviewGrouped.js index 8d3a705a2b..2b23045660 100644 --- a/packages/react-ui-components/src/SelectBox_ListPreviewGrouped/selectBox_ListPreviewGrouped.js +++ b/packages/react-ui-components/src/SelectBox_ListPreviewGrouped/selectBox_ListPreviewGrouped.js @@ -20,7 +20,8 @@ export default class SelectBox_ListPreviewGrouped extends PureComponent { theme: PropTypes.shape({ 'selectBox__item': PropTypes.string, - 'selectBox__item--isGroup': PropTypes.string + 'selectBox__item--isGroup': PropTypes.string, + 'selectBox__groupHeader': PropTypes.string }), // API with SelectBox @@ -69,9 +70,9 @@ export default class SelectBox_ListPreviewGrouped extends PureComponent { }); return (
  • - +
    {groupLabel} - +
      {optionsList.map(this.renderOption)}
    @@ -83,7 +84,8 @@ export default class SelectBox_ListPreviewGrouped extends PureComponent { const { ListPreviewElement, optionValueAccessor, - focusedValue + focusedValue, + theme } = this.props; const isHighlighted = optionValueAccessor(option) === focusedValue; @@ -93,7 +95,7 @@ export default class SelectBox_ListPreviewGrouped extends PureComponent { } return ( -
  • +