Skip to content

Commit

Permalink
v0.3.2
Browse files Browse the repository at this point in the history
- set properties on selected features
- refactored key shortcuts
- refactored state changes and messages, improved error handling
  • Loading branch information
ekuiter committed Sep 8, 2018
1 parent c779fe4 commit 0d67fde
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 10 deletions.
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 @@ -42,7 +42,7 @@ describe('FeaturePanel', () => {

it('renders footer content', () => {
const wrapper = featurePanel(),
footerWrapper = shallow(wrapper.instance().onRenderFooterContent());
expect(footerWrapper.prop('items')).not.toHaveLength(0);
footer = wrapper.instance().onRenderFooterContent();
expect(footer.props.items).not.toHaveLength(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,96 @@ exports[`FeatureContextualMenu renders correctly for a selection of features 1`]
},
"text": "Collapse",
},
Object {
"itemType": 1,
"key": "divider",
},
Object {
"iconProps": Object {
"iconName": "FieldNotChanged",
},
"key": "propertiesMenu",
"subMenuProps": Object {
"items": Array [
Object {
"canCheck": true,
"disabled": false,
"isChecked": false,
"key": "abstract",
"onClick": [Function],
"text": "Abstract",
},
Object {
"canCheck": true,
"disabled": true,
"isChecked": true,
"key": "concrete",
"onClick": [Function],
"text": "Concrete",
},
Object {
"itemType": 1,
"key": "divider",
},
Object {
"canCheck": true,
"isChecked": false,
"key": "hidden",
"onClick": [Function],
"text": "Hidden",
},
Object {
"itemType": 1,
"key": "divider",
},
Object {
"canCheck": true,
"disabled": true,
"isChecked": false,
"key": "mandatory",
"onClick": [Function],
"text": "Mandatory",
},
Object {
"canCheck": true,
"disabled": true,
"isChecked": false,
"key": "optional",
"onClick": [Function],
"text": "Optional",
},
Object {
"itemType": 1,
"key": "divider",
},
Object {
"canCheck": true,
"disabled": false,
"isChecked": false,
"key": "and",
"onClick": [Function],
"text": "And",
},
Object {
"canCheck": true,
"disabled": false,
"isChecked": false,
"key": "or",
"onClick": [Function],
"text": "Or",
},
Object {
"canCheck": true,
"disabled": false,
"isChecked": false,
"key": "alternative",
"onClick": [Function],
"text": "Alternative",
},
],
},
"text": "Properties",
},
]
}
onDismiss={[Function]}
Expand Down Expand Up @@ -257,13 +347,15 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = `
"items": Array [
Object {
"canCheck": true,
"disabled": false,
"isChecked": false,
"key": "abstract",
"onClick": [Function],
"text": "Abstract",
},
Object {
"canCheck": true,
"disabled": true,
"isChecked": true,
"key": "concrete",
"onClick": [Function],
Expand Down Expand Up @@ -294,7 +386,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = `
},
Object {
"canCheck": true,
"disabled": false,
"disabled": true,
"isChecked": true,
"key": "optional",
"onClick": [Function],
Expand All @@ -314,7 +406,7 @@ exports[`FeatureContextualMenu renders correctly for a single feature 1`] = `
},
Object {
"canCheck": true,
"disabled": false,
"disabled": true,
"isChecked": true,
"key": "or",
"onClick": [Function],
Expand Down
12 changes: 6 additions & 6 deletions client/src/server/messageActions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,19 @@ describe('messageActions', () => {

describe('properties', () => {
it('sets the abstract property', () => {
messageActions.featureDiagram.feature.properties.setAbstract('FeatureIDE', true);
messageActions.featureDiagram.feature.properties.setAbstract(['FeatureIDE'], true);
expect(sendMessage).lastCalledWith(
{type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.abstract, value: true});
});

it('sets the hidden property', () => {
messageActions.featureDiagram.feature.properties.setHidden('FeatureIDE', true);
messageActions.featureDiagram.feature.properties.setHidden(['FeatureIDE'], true);
expect(sendMessage).lastCalledWith(
{type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.hidden, value: true});
});

it('sets the mandatory property', () => {
messageActions.featureDiagram.feature.properties.setMandatory('FeatureIDE', true);
messageActions.featureDiagram.feature.properties.setMandatory(['FeatureIDE'], true);
expect(sendMessage).lastCalledWith(
{type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY, feature: 'FeatureIDE', property: propertyTypes.mandatory, value: true});
});
Expand All @@ -70,7 +70,7 @@ describe('messageActions', () => {
});

it('changes the group type to and', () => {
messageActions.featureDiagram.feature.properties.setAnd('FeatureIDE');
messageActions.featureDiagram.feature.properties.setAnd(['FeatureIDE']);
expect(sendMessage).lastCalledWith({
type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY,
feature: 'FeatureIDE',
Expand All @@ -80,7 +80,7 @@ describe('messageActions', () => {
});

it('changes the group type to or', () => {
messageActions.featureDiagram.feature.properties.setOr('FeatureIDE');
messageActions.featureDiagram.feature.properties.setOr(['FeatureIDE']);
expect(sendMessage).lastCalledWith({
type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY,
feature: 'FeatureIDE',
Expand All @@ -90,7 +90,7 @@ describe('messageActions', () => {
});

it('changes the group type to alternative', () => {
messageActions.featureDiagram.feature.properties.setAlternative('FeatureIDE');
messageActions.featureDiagram.feature.properties.setAlternative(['FeatureIDE']);
expect(sendMessage).lastCalledWith({
type: messageTypes.FEATURE_DIAGRAM_FEATURE_SET_PROPERTY,
feature: 'FeatureIDE',
Expand Down

0 comments on commit 0d67fde

Please sign in to comment.