Skip to content

Commit

Permalink
Refactored 'feature' to 'features'
Browse files Browse the repository at this point in the history
  • Loading branch information
ekuiter committed Sep 7, 2018
1 parent f8f2dbe commit c18b86d
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 51 deletions.
26 changes: 13 additions & 13 deletions client/src/components/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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,
Expand All @@ -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,
Expand All @@ -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();
}
}]
Expand All @@ -312,7 +312,7 @@ const commands = {
secondaryText: getShortcutText('featureDiagram.feature.collapse'),
iconProps: {iconName: 'CollapseContentSingle'},
onClick: () => {
onCollapseFeature(featureNames);
onCollapseFeatures(featureNames);
onClick();
}
}, {
Expand All @@ -321,7 +321,7 @@ const commands = {
secondaryText: getShortcutText('featureDiagram.feature.expand'),
iconProps: {iconName: 'ExploreContentSingle'},
onClick: () => {
onExpandFeature(featureNames);
onExpandFeatures(featureNames);
onClick();
}
}],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/overlays/FeatureCallout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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={[
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/overlays/FeatureCallout.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions client/src/components/overlays/FeatureContextualMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/overlays/FeatureContextualMenu.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions client/src/components/overlays/FeaturePanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
Expand All @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/overlays/FeaturePanel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
12 changes: 6 additions & 6 deletions client/src/containers/CommandBarContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)),
Expand All @@ -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 &&
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 =>
Expand Down
20 changes: 10 additions & 10 deletions client/src/containers/overlays/OverlayContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand All @@ -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}
Expand Down Expand Up @@ -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))
})
Expand All @@ -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));

0 comments on commit c18b86d

Please sign in to comment.