diff --git a/client/src/components/commands.js b/client/src/components/commands.js index 156e9263..3468baa2 100644 --- a/client/src/components/commands.js +++ b/client/src/components/commands.js @@ -238,22 +238,22 @@ const commands = { }); }, selection: (isSelectMultipleFeatures, onSetSelectMultipleFeatures, - selectedFeatureNames, onDeselectAllFeatures, onCollapseFeature, - onExpandFeature, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel) => ({ + selectedFeatureNames, onDeselectAllFeatures, onCollapseFeatures, + onExpandFeatures, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel) => ({ key: 'selection', text: i18n.t('commands.featureDiagram.feature.selection')(isSelectMultipleFeatures, selectedFeatureNames), onClick: () => onSetSelectMultipleFeatures(!isSelectMultipleFeatures), // TODO: tell the user he can choose features now subMenuProps: isSelectMultipleFeatures ? {items: commands.featureDiagram.feature.selectionItems(selectedFeatureNames, onDeselectAllFeatures, - onCollapseFeature, onExpandFeature, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel)} + onCollapseFeatures, onExpandFeatures, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel)} : null }), - selectionItems: (selectedFeatureNames, onDeselectAllFeatures, onCollapseFeature, - onExpandFeature, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel) => [ + selectionItems: (selectedFeatureNames, onDeselectAllFeatures, onCollapseFeatures, + onExpandFeatures, onCollapseFeaturesBelow, onExpandFeaturesBelow, featureModel) => [ commands.featureDiagram.feature.newAbove(selectedFeatureNames, onDeselectAllFeatures, featureModel), commands.featureDiagram.feature.removeMenu(featureModel.getFeatures(selectedFeatureNames), onDeselectAllFeatures), commands.featureDiagram.feature.collapseMenu(featureModel.getFeatures(selectedFeatureNames), - onCollapseFeature, onExpandFeature, onCollapseFeaturesBelow, onExpandFeaturesBelow, onDeselectAllFeatures) + onCollapseFeatures, onExpandFeatures, onCollapseFeaturesBelow, onExpandFeaturesBelow, onDeselectAllFeatures) ], selectAll: onSelectAll => ({ key: 'selectAll', @@ -267,7 +267,7 @@ const commands = { secondaryText: getShortcutText('featureDiagram.feature.deselectAll'), onClick: onDeselectAll }), - collapseMenu: (features, onCollapseFeature, onExpandFeature, + collapseMenu: (features, onCollapseFeatures, onExpandFeatures, onCollapseFeaturesBelow, onExpandFeaturesBelow, onClick, iconOnly = false) => { const isSingleFeature = features.length === 1, isCollapsedSingleFeature = isSingleFeature && features[0].isCollapsed, @@ -282,9 +282,9 @@ const commands = { onClick: isSingleFeature ? () => { if (features[0].isCollapsed) - onExpandFeature([features[0].name]); + onExpandFeatures([features[0].name]); else - onCollapseFeature([features[0].name]); + onCollapseFeatures([features[0].name]); onClick(); } : null, @@ -300,9 +300,9 @@ const commands = { iconProps: {iconName: features[0].isCollapsed ? 'ExploreContentSingle' : 'CollapseContentSingle'}, onClick: () => { if (features[0].isCollapsed) - onExpandFeature([features[0].name]); + onExpandFeatures([features[0].name]); else - onCollapseFeature([features[0].name]); + onCollapseFeatures([features[0].name]); onClick(); } }] @@ -312,7 +312,7 @@ const commands = { secondaryText: getShortcutText('featureDiagram.feature.collapse'), iconProps: {iconName: 'CollapseContentSingle'}, onClick: () => { - onCollapseFeature(featureNames); + onCollapseFeatures(featureNames); onClick(); } }, { @@ -321,7 +321,7 @@ const commands = { secondaryText: getShortcutText('featureDiagram.feature.expand'), iconProps: {iconName: 'ExploreContentSingle'}, onClick: () => { - onExpandFeature(featureNames); + onExpandFeatures(featureNames); onClick(); } }], diff --git a/client/src/components/featureDiagram/treeLayout/AbstractTreeLayout.js b/client/src/components/featureDiagram/treeLayout/AbstractTreeLayout.js index 49ed4dba..fcb0b553 100644 --- a/client/src/components/featureDiagram/treeLayout/AbstractTreeLayout.js +++ b/client/src/components/featureDiagram/treeLayout/AbstractTreeLayout.js @@ -26,7 +26,7 @@ export default class extends React.Component { onSetSelectMultipleFeatures: PropTypes.func.isRequired, onSelectFeature: PropTypes.func.isRequired, onDeselectFeature: PropTypes.func.isRequired, - onExpandFeature: PropTypes.func.isRequired, + onExpandFeatures: PropTypes.func.isRequired, onDeselectAllFeatures: PropTypes.func.isRequired, isSelectMultipleFeatures: PropTypes.bool.isRequired, selectedFeatureNames: PropTypes.arrayOf(PropTypes.string).isRequired @@ -44,7 +44,7 @@ export default class extends React.Component { props.isSelectMultipleFeatures, this.setActiveNode.bind(this), this.props.onShowOverlay, - this.props.onExpandFeature); + this.props.onExpandFeatures); this.treeLink = new TreeLink( props.settings, this.getParentCoordinateFn('currentCoordinates'), diff --git a/client/src/components/featureDiagram/treeLayout/AbstractTreeNode.js b/client/src/components/featureDiagram/treeLayout/AbstractTreeNode.js index dcd4c1bb..f9cf681f 100644 --- a/client/src/components/featureDiagram/treeLayout/AbstractTreeNode.js +++ b/client/src/components/featureDiagram/treeLayout/AbstractTreeNode.js @@ -51,12 +51,12 @@ function makeText(settings, selection, isGettingRectInfo, textStyle) { } export default class { - constructor(settings, isSelectMultipleFeatures, setActiveNode, onShowOverlay, onExpandFeature) { + constructor(settings, isSelectMultipleFeatures, setActiveNode, onShowOverlay, onExpandFeatures) { this.settings = settings; this.isSelectMultipleFeatures = isSelectMultipleFeatures; this.setActiveNode = setActiveNode; this.onShowOverlay = onShowOverlay; - this.onExpandFeature = onExpandFeature; + this.onExpandFeatures = onExpandFeatures; } x(_node) { @@ -112,7 +112,7 @@ export default class { .on('dblclick', d => actions.server.featureDiagram.feature.properties.toggleGroup(d.feature())); this.treeLink.drawGroup(arcSegment, arcSlice, arcClick); - const expandFeature = d => d.feature().isCollapsed && this.onExpandFeature(d.feature().name); + const expandFeature = d => d.feature().isCollapsed && this.onExpandFeatures(d.feature().name); i = 0; bboxes = []; nodeEnter.insert('text', 'path.arcClick') diff --git a/client/src/components/overlays/FeatureCallout.js b/client/src/components/overlays/FeatureCallout.js index c0c7b3d9..52861f59 100644 --- a/client/src/components/overlays/FeatureCallout.js +++ b/client/src/components/overlays/FeatureCallout.js @@ -17,8 +17,8 @@ export default class extends FeatureComponent({doUpdate: true}) { isOpen: PropTypes.bool.isRequired, featureDiagramLayout: LayoutType.isRequired, onShowOverlay: PropTypes.func.isRequired, - onCollapseFeature: PropTypes.func.isRequired, - onExpandFeature: PropTypes.func.isRequired, + onCollapseFeatures: PropTypes.func.isRequired, + onExpandFeatures: PropTypes.func.isRequired, onCollapseFeaturesBelow: PropTypes.func.isRequired, onExpandFeaturesBelow: PropTypes.func.isRequired, settings: SettingsType.isRequired @@ -51,7 +51,7 @@ export default class extends FeatureComponent({doUpdate: true}) { commands.featureDiagram.feature.newMenu(feature.name, onDismiss, true), commands.featureDiagram.feature.removeMenu([feature], onDismiss, true), commands.featureDiagram.feature.collapseMenu( - [feature], this.props.onCollapseFeature, this.props.onExpandFeature, + [feature], this.props.onCollapseFeatures, this.props.onExpandFeatures, this.props.onCollapseFeaturesBelow, this.props.onExpandFeaturesBelow, onDismiss, true), ]} farItems={[ diff --git a/client/src/components/overlays/FeatureCallout.test.js b/client/src/components/overlays/FeatureCallout.test.js index fa4ec0be..3d767c1a 100644 --- a/client/src/components/overlays/FeatureCallout.test.js +++ b/client/src/components/overlays/FeatureCallout.test.js @@ -21,8 +21,8 @@ describe('FeatureCallout', () => { featureDiagramLayout={layoutTypes.verticalTree} settings={defaultSettings} onShowOverlay={mock} - onCollapseFeature={mock} - onExpandFeature={mock} + onCollapseFeatures={mock} + onExpandFeatures={mock} onCollapseFeaturesBelow={mock} onExpandFeaturesBelow={mock} featureModel={featureModel} diff --git a/client/src/components/overlays/FeatureContextualMenu.js b/client/src/components/overlays/FeatureContextualMenu.js index 5a32573e..d02eb446 100644 --- a/client/src/components/overlays/FeatureContextualMenu.js +++ b/client/src/components/overlays/FeatureContextualMenu.js @@ -13,8 +13,8 @@ export default class extends FeatureComponent({doUpdate: true}) { static propTypes = { onDismiss: PropTypes.func.isRequired, onDeselectAllFeatures: PropTypes.func.isRequired, - onCollapseFeature: PropTypes.func.isRequired, - onExpandFeature: PropTypes.func.isRequired, + onCollapseFeatures: PropTypes.func.isRequired, + onExpandFeatures: PropTypes.func.isRequired, isSelectMultipleFeatures: PropTypes.bool.isRequired, selectedFeatureNames: PropTypes.arrayOf(PropTypes.string).isRequired, featureModel: FeatureModelType.isRequired, @@ -45,13 +45,13 @@ export default class extends FeatureComponent({doUpdate: true}) { : DirectionalHint.rightCenter} items={isSelectMultipleFeatures ? commands.featureDiagram.feature.selectionItems(selectedFeatureNames, onDeselectAllFeatures, - this.props.onCollapseFeature, this.props.onExpandFeature, this.props.onCollapseFeaturesBelow, + this.props.onCollapseFeatures, this.props.onExpandFeatures, this.props.onCollapseFeaturesBelow, this.props.onExpandFeaturesBelow, featureModel) : [ commands.featureDiagram.feature.newMenu(feature.name, onDismiss), commands.featureDiagram.feature.removeMenu([feature], onDismiss), commands.featureDiagram.feature.collapseMenu( - [feature], this.props.onCollapseFeature, this.props.onExpandFeature, + [feature], this.props.onCollapseFeatures, this.props.onExpandFeatures, this.props.onCollapseFeaturesBelow, this.props.onExpandFeaturesBelow, onDismiss), makeDivider(), commands.featureDiagram.feature.rename(feature.name, this.props.onShowOverlay), diff --git a/client/src/components/overlays/FeatureContextualMenu.test.js b/client/src/components/overlays/FeatureContextualMenu.test.js index 95b40908..7e700066 100644 --- a/client/src/components/overlays/FeatureContextualMenu.test.js +++ b/client/src/components/overlays/FeatureContextualMenu.test.js @@ -23,8 +23,8 @@ describe('FeatureContextualMenu', () => { settings={defaultSettings} onShowOverlay={mock} onDeselectAllFeatures={mock} - onCollapseFeature={mock} - onExpandFeature={mock} + onCollapseFeatures={mock} + onExpandFeatures={mock} onCollapseFeaturesBelow={mock} onExpandFeaturesBelow={mock} featureModel={featureModel} diff --git a/client/src/components/overlays/FeaturePanel.js b/client/src/components/overlays/FeaturePanel.js index f6cc3179..310d7ae9 100644 --- a/client/src/components/overlays/FeaturePanel.js +++ b/client/src/components/overlays/FeaturePanel.js @@ -17,8 +17,8 @@ export default class extends FeatureComponent({onDismissProp: 'onDismissed'}) { featureName: PropTypes.string.isRequired, isOpen: PropTypes.bool.isRequired, onShowOverlay: PropTypes.func.isRequired, - onCollapseFeature: PropTypes.func.isRequired, - onExpandFeature: PropTypes.func.isRequired, + onCollapseFeatures: PropTypes.func.isRequired, + onExpandFeatures: PropTypes.func.isRequired, onCollapseFeaturesBelow: PropTypes.func.isRequired, onExpandFeaturesBelow: PropTypes.func.isRequired }; @@ -31,7 +31,7 @@ export default class extends FeatureComponent({onDismissProp: 'onDismissed'}) { ])} overflowItems={[ commands.featureDiagram.feature.collapseMenu( - [this.feature], this.props.onCollapseFeature, this.props.onExpandFeature, + [this.feature], this.props.onCollapseFeatures, this.props.onExpandFeatures, this.props.onCollapseFeaturesBelow, this.props.onExpandFeaturesBelow, this.props.onDismissed), commands.featureDiagram.feature.rename(this.props.featureName, this.props.onShowOverlay), commands.featureDiagram.feature.setDescription(this.props.featureName, this.props.onShowOverlay), diff --git a/client/src/components/overlays/FeaturePanel.test.js b/client/src/components/overlays/FeaturePanel.test.js index 576e6715..321d6c32 100644 --- a/client/src/components/overlays/FeaturePanel.test.js +++ b/client/src/components/overlays/FeaturePanel.test.js @@ -15,8 +15,8 @@ describe('FeaturePanel', () => { isOpen={true} onDismissed={mock} onShowOverlay={mock} - onCollapseFeature={mock} - onExpandFeature={mock} + onCollapseFeatures={mock} + onExpandFeatures={mock} onCollapseFeaturesBelow={mock} onExpandFeaturesBelow={mock} featureModel={featureModel} diff --git a/client/src/containers/CommandBarContainer.js b/client/src/containers/CommandBarContainer.js index 36280df1..04ae72ec 100644 --- a/client/src/containers/CommandBarContainer.js +++ b/client/src/containers/CommandBarContainer.js @@ -41,8 +41,8 @@ const CommandBarContainer = props => ( props.onSetSelectMultipleFeatures, props.selectedFeatureNames, props.onDeselectAllFeatures, - props.onCollapseFeature, - props.onExpandFeature, + props.onCollapseFeatures, + props.onExpandFeatures, props.onCollapseFeaturesBelow, props.onExpandFeaturesBelow, props.featureModel) @@ -101,8 +101,8 @@ export default connect( onDeselectAllFeatures: () => dispatch(actions.ui.featureDiagram.feature.deselectAll()), onCollapseAllFeatures: () => dispatch(actions.ui.featureDiagram.feature.collapseAll()), onExpandAllFeatures: () => dispatch(actions.ui.featureDiagram.feature.expandAll()), - onCollapseFeature: featureNames => dispatch(actions.ui.featureDiagram.feature.collapse(featureNames)), - onExpandFeature: featureNames => dispatch(actions.ui.featureDiagram.feature.expand(featureNames)), + onCollapseFeatures: featureNames => dispatch(actions.ui.featureDiagram.feature.collapse(featureNames)), + onExpandFeatures: featureNames => dispatch(actions.ui.featureDiagram.feature.expand(featureNames)), onCollapseFeaturesBelow: featureNames => dispatch(actions.ui.featureDiagram.feature.collapseBelow(featureNames)), onExpandFeaturesBelow: featureNames => dispatch(actions.ui.featureDiagram.feature.expandBelow(featureNames)), onShowOverlay: (...args) => dispatch(actions.ui.overlay.show(...args)), @@ -116,11 +116,11 @@ export default connect( getShortcutKeyBinding('featureDiagram.feature.deselectAll', ({props}) => props.onDeselectAllFeatures()), getShortcutKeyBinding('featureDiagram.feature.collapse', ({props}) => props.isSelectMultipleFeatures - ? props.onCollapseFeature(props.selectedFeatureNames) + ? props.onCollapseFeatures(props.selectedFeatureNames) : props.onCollapseAllFeatures()), getShortcutKeyBinding('featureDiagram.feature.expand', ({props}) => props.isSelectMultipleFeatures - ? props.onExpandFeature(props.selectedFeatureNames) + ? props.onExpandFeatures(props.selectedFeatureNames) : props.onExpandAllFeatures()), getShortcutKeyBinding('featureDiagram.feature.remove', ({props}) => props.isSelectMultipleFeatures && diff --git a/client/src/containers/featureDiagram/FeatureDiagramContainer.js b/client/src/containers/featureDiagram/FeatureDiagramContainer.js index b34e6158..ddb63a1f 100644 --- a/client/src/containers/featureDiagram/FeatureDiagramContainer.js +++ b/client/src/containers/featureDiagram/FeatureDiagramContainer.js @@ -21,7 +21,7 @@ export default connect( onSetSelectMultipleFeatures: isSelectMultipleFeatures => dispatch(actions.ui.featureDiagram.feature.setSelectMultiple(isSelectMultipleFeatures)), onSelectFeature: featureName => dispatch(actions.ui.featureDiagram.feature.select(featureName)), onDeselectFeature: featureName => dispatch(actions.ui.featureDiagram.feature.deselect(featureName)), - onExpandFeature: featureName => dispatch(actions.ui.featureDiagram.feature.expand(featureName)), + onExpandFeatures: featureName => dispatch(actions.ui.featureDiagram.feature.expand(featureName)), onDeselectAllFeatures: () => dispatch(actions.ui.featureDiagram.feature.deselectAll()) }) )(props => diff --git a/client/src/containers/overlays/OverlayContainer.js b/client/src/containers/overlays/OverlayContainer.js index 5ec035c3..a096a889 100644 --- a/client/src/containers/overlays/OverlayContainer.js +++ b/client/src/containers/overlays/OverlayContainer.js @@ -33,8 +33,8 @@ const OverlayContainer = props => ( isOpen={true} onDismissed={props.onHideOverlayFn(overlayTypes.featurePanel)} onShowOverlay={props.onShowOverlay} - onCollapseFeature={props.onCollapseFeature} - onExpandFeature={props.onExpandFeature} + onCollapseFeatures={props.onCollapseFeatures} + onExpandFeatures={props.onExpandFeatures} onCollapseFeaturesBelow={props.onCollapseFeaturesBelow} onExpandFeaturesBelow={props.onExpandFeaturesBelow} featureModel={props.featureModel} @@ -68,8 +68,8 @@ const OverlayContainer = props => ( featureDiagramLayout={props.featureDiagramLayout} settings={props.settings} onShowOverlay={props.onShowOverlay} - onCollapseFeature={props.onCollapseFeature} - onExpandFeature={props.onExpandFeature} + onCollapseFeatures={props.onCollapseFeatures} + onExpandFeatures={props.onExpandFeatures} onCollapseFeaturesBelow={props.onCollapseFeaturesBelow} onExpandFeaturesBelow={props.onExpandFeaturesBelow} featureModel={props.featureModel} @@ -83,8 +83,8 @@ const OverlayContainer = props => ( settings={props.settings} onShowOverlay={props.onShowOverlay} onDeselectAllFeatures={props.onDeselectAllFeatures} - onCollapseFeature={props.onCollapseFeature} - onExpandFeature={props.onExpandFeature} + onCollapseFeatures={props.onCollapseFeatures} + onExpandFeatures={props.onExpandFeatures} onCollapseFeaturesBelow={props.onCollapseFeaturesBelow} onExpandFeaturesBelow={props.onExpandFeaturesBelow} featureModel={props.featureModel} @@ -112,8 +112,8 @@ export default connect( onDeselectAllFeatures: () => dispatch(actions.ui.featureDiagram.feature.deselectAll()), onSetSetting: (path, value) => dispatch(actions.settings.set(path, value)), onResetSettings: () => dispatch(actions.settings.reset()), - onCollapseFeature: featureNames => dispatch(actions.ui.featureDiagram.feature.collapse(featureNames)), - onExpandFeature: featureNames => dispatch(actions.ui.featureDiagram.feature.expand(featureNames)), + onCollapseFeatures: featureNames => dispatch(actions.ui.featureDiagram.feature.collapse(featureNames)), + onExpandFeatures: featureNames => dispatch(actions.ui.featureDiagram.feature.expand(featureNames)), onCollapseFeaturesBelow: featureNames => dispatch(actions.ui.featureDiagram.feature.collapseBelow(featureNames)), onExpandFeaturesBelow: featureNames => dispatch(actions.ui.featureDiagram.feature.expandBelow(featureNames)) }) @@ -130,7 +130,7 @@ export default connect( !props.isSelectMultipleFeatures && props.onShowOverlay(overlayTypes.featurePanel, {featureName: props.overlayProps.featureName})), getShortcutKeyBinding('featureDiagram.feature.collapse', ({props}) => - props.onCollapseFeature(props.selectedFeatureNames)), + props.onCollapseFeatures(props.selectedFeatureNames)), getShortcutKeyBinding('featureDiagram.feature.expand', ({props}) => - props.onExpandFeature(props.selectedFeatureNames)) + props.onExpandFeatures(props.selectedFeatureNames)) )(OverlayContainer)); \ No newline at end of file