Skip to content

Commit

Permalink
Lint changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wederbn committed Aug 25, 2023
1 parent 82c83da commit c7bbd8f
Show file tree
Hide file tree
Showing 8 changed files with 704 additions and 431 deletions.
51 changes: 27 additions & 24 deletions components/bpmn-q/modeler-component/editor/ModelerHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@ import BpmnPalletteModule from "bpmn-js/lib/features/palette";
import {
BpmnPropertiesPanelModule,
BpmnPropertiesProviderModule,
CamundaPlatformPropertiesProviderModule
CamundaPlatformPropertiesProviderModule,
} from "bpmn-js-properties-panel";
import CamundaExtensionModule from 'camunda-bpmn-moddle/resources/camunda.json';
import CamundaExtensionModule from "camunda-bpmn-moddle/resources/camunda.json";
import CustomPopupMenuModule from "./popup/";
import { getAdditionalModules, getModdleExtension } from "./plugin/PluginHandler";
import {
getAdditionalModules,
getModdleExtension,
} from "./plugin/PluginHandler";
import ModelerRulesModule from "./rules/";
import LintModule from 'bpmn-js-bpmnlint';
import bpmnlintConfig from '../../.bpmnlintrc';
import LintModule from "bpmn-js-bpmnlint";
import bpmnlintConfig from "../../.bpmnlintrc";

import Clipboard from 'diagram-js/lib/features/clipboard/Clipboard';
let camundaModdleDescriptor = require('camunda-bpmn-moddle/resources/camunda.json');
import Clipboard from "diagram-js/lib/features/clipboard/Clipboard";
let camundaModdleDescriptor = require("camunda-bpmn-moddle/resources/camunda.json");

/**
* Handler which manages the creation of bpmn-js modeler instances. It controls the access to the modeler instance currently
Expand All @@ -31,18 +34,17 @@ let modeler = undefined;
* @returns {Modeler} The created bpmn-js modeler instance
*/
export function createModeler(containerId, propertiesParentId) {

modeler = new BpmnModeler({
container: containerId,
propertiesPanel: {
parent: propertiesParentId
parent: propertiesParentId,
},
additionalModules: getModules(),
keyboard: {
bindTo: document
bindTo: document,
},
linting: {
bpmnlint: bpmnlintConfig
bpmnlint: bpmnlintConfig,
},
moddleExtensions: getExtensions(),
});
Expand All @@ -56,11 +58,9 @@ export function createModeler(containerId, propertiesParentId) {
*/
export function createPlainModeler() {
return new BpmnModeler({
additionalModules: [
CamundaExtensionModule,
],
additionalModules: [CamundaExtensionModule],
keyboard: {
bindTo: document
bindTo: document,
},
moddleExtensions: {
camunda: camundaModdleDescriptor,
Expand All @@ -78,7 +78,7 @@ export function createTempModeler() {
return new BpmnModeler({
additionalModules: getModules(),
keyboard: {
bindTo: document
bindTo: document,
},
moddleExtensions: getExtensions(),
});
Expand Down Expand Up @@ -130,7 +130,7 @@ export function getModeler() {
function getModules() {
const pluginModules = getAdditionalModules();
var clipboardModule = {
'clipboard': [ 'value', new Clipboard() ]
clipboard: ["value", new Clipboard()],
};
let additionalModules = [
BpmnPalletteModule,
Expand All @@ -141,10 +141,10 @@ function getModules() {
CustomPopupMenuModule,
LintModule,
clipboardModule,
ModelerRulesModule
ModelerRulesModule,
].concat(pluginModules);

console.log('\n Additional modules of the modeler: ');
console.log("\n Additional modules of the modeler: ");
console.log(additionalModules);

return additionalModules;
Expand All @@ -154,12 +154,15 @@ function getModules() {
* Returns all moddle extensions for the bpmn-js modeler necessary to use all modelling extensions of the active plugins.
*/
function getExtensions() {
let moddleExtension = Object.assign({
camunda: camundaModdleDescriptor,
}, getModdleExtension());
let moddleExtension = Object.assign(
{
camunda: camundaModdleDescriptor,
},
getModdleExtension()
);

console.log('\n Moddle extensions of the modeler: ');
console.log("\n Moddle extensions of the modeler: ");
console.log(moddleExtension);

return moddleExtension;
}
}
Loading

0 comments on commit c7bbd8f

Please sign in to comment.