-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: internalize multi-command executor
Reduces unnecessary ties to properties panel.
- Loading branch information
Showing
7 changed files
with
46 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { | ||
forEach | ||
} from 'min-dash'; | ||
|
||
/** | ||
* A handler that combines and executes multiple commands. | ||
* | ||
* All updates are bundled on the command stack and executed in one step. | ||
* This also makes it possible to revert the changes in one step. | ||
* | ||
* Example use case: remove the camunda:formKey attribute and in addition | ||
* add all form fields needed for the camunda:formData property. | ||
*/ | ||
export default class MultiCommandHandler { | ||
constructor(commandStack) { | ||
this._commandStack = commandStack; | ||
} | ||
|
||
preExecute(context) { | ||
const commandStack = this._commandStack; | ||
|
||
forEach(context, function(command) { | ||
commandStack.execute(command.cmd, command.context); | ||
}); | ||
} | ||
} | ||
|
||
MultiCommandHandler.$inject = [ 'commandStack' ]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters