-
Notifications
You must be signed in to change notification settings - Fork 140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add delete action for multi element context #939
Conversation
253b990
to
d89bcf4
Compare
d89bcf4
to
be76f0c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add "Related to..." clause to the commit body. We do it to backlink without referring to a PR.
}; | ||
|
||
ContextPadProvider.prototype._isDeleteAllowed = function(elements) { | ||
var baseAllowed = this._rules.allowed('elements.delete', { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[question] Why is it called baseAllowed
? I know that this is the way it's called in bpmn-js, but we could reflect on this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just reused it, but i'll reword it to make it clear that it could be an array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renamed it to allowedOrAllowedElements
or do you have a better suggestion?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good enough!
@@ -166,6 +166,60 @@ describe('features - context-pad', function() { | |||
}) | |||
); | |||
|
|||
describe('multi remove', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style convention which should but is not part of eslint ruleset. One empty line after describe, two empty lines between test cases.
describe('multi remove', function() { | |
describe('multi remove', function() { | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you have a link to this style convention? I was looking for it but couldn't find it yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is how we've been writing the code for years (e.g. https://github.com/bpmn-io/bpmn-js/blob/develop/test/spec/features/drilldown/DrilldownSpec.js), but it's unfortunately undocumented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
expect(deleteAction([ shape1, shape2 ])).to.exist; | ||
} | ||
)); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style convention (see previous comment).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
The contribution looks good! The code is clean, and there are only a few suggestions/questions to address. |
be76f0c
to
c3960ee
Compare
Related to camunda/camunda-modeler#4554
Proposed Changes
Adds ContextPad actions for multi selections. The only action added for now is the delete action. Selecting multiple shapes and deleting with keyboard also works.
recording-dmn-multi-delete.mov
Checklist
To ensure you provided everything we need to look at your PR:
@bpmn-io/sr
toolCloses {LINK_TO_ISSUE}
orRelated to {LINK_TO_ISSUE}