From c91b935b6b72ca951af0a65cce26a3d39ea1faf9 Mon Sep 17 00:00:00 2001 From: ciphersmaug <39407479+ciphersmaug@users.noreply.github.com> Date: Sun, 15 Jan 2023 17:39:45 +0100 Subject: [PATCH] Fixed add button number of adds. --- client/tilt-extractor/extract-button.js | 63 ++++++++++--------- .../props/tilt-property-groups.js | 7 ++- .../tilt-extension-provider.js | 2 +- 3 files changed, 39 insertions(+), 33 deletions(-) diff --git a/client/tilt-extractor/extract-button.js b/client/tilt-extractor/extract-button.js index 36902b3..cd2413d 100644 --- a/client/tilt-extractor/extract-button.js +++ b/client/tilt-extractor/extract-button.js @@ -4,7 +4,7 @@ import { Fill } from 'camunda-modeler-plugin-helpers/components'; import classNames from 'classnames'; export default class ExtractButton extends PureComponent { - constructor(eventBus, editorActions, canvas, elementRegistry,config) { + constructor(eventBus, bpmnRules, editorActions, canvas, commandStack, elementRegistry, modeling, config) { super(); this.eventBus = eventBus; this.editorActions = editorActions; @@ -13,30 +13,9 @@ export default class ExtractButton extends PureComponent { this.config = config; this._buttonRef = React.createRef(); } - - async saveFile2(){ - navigator.clipboard.writeText("HELLO WORLD"); - alert("This is currently not available as it needs to be implemented.") - return; - } - async saveFile(){ - try { - // Show the file save dialog. - const handle = await window.showSaveFilePicker(); - // Write to the file. - const writable = await handle.createWritable(); - debugger; - await writable.write("Hello World"); - await writable.close(); - return; - } catch (err) { - if (err.name !== 'AbortError') { - console.error(err.name, err.message); - return; - } - } - } - createElement(){ + createTiltObject(){ + alert("Hello World") + debugger; } @@ -51,8 +30,8 @@ export default class ExtractButton extends PureComponent { ; @@ -60,6 +39,30 @@ export default class ExtractButton extends PureComponent { } ExtractButton.$inject = [ - 'propertiesPanel', - 'injector' -]; \ No newline at end of file + 'eventBus', 'bpmnRules', 'editorActions', 'canvas', 'commandStack', 'elementRegistry', 'modeling','config' +]; + + + + //async saveFile2(){ + // navigator.clipboard.writeText("HELLO WORLD"); + // alert("This is currently not available as it needs to be implemented.") + // return; + //} + //async saveFile(){ + // try { + // // Show the file save dialog. + // const handle = await window.showSaveFilePicker(); + // // Write to the file. + // const writable = await handle.createWritable(); + // debugger; + // await writable.write("Hello World"); + // await writable.close(); + // return; + // } catch (err) { + // if (err.name !== 'AbortError') { + // console.error(err.name, err.message); + // return; + // } + // } + //} \ No newline at end of file diff --git a/client/tilt-properties/props/tilt-property-groups.js b/client/tilt-properties/props/tilt-property-groups.js index f50b261..65c91da 100644 --- a/client/tilt-properties/props/tilt-property-groups.js +++ b/client/tilt-properties/props/tilt-property-groups.js @@ -83,7 +83,10 @@ function createExistingPropertyGroupsList(element, injector){ var property_name_to_add; for (let i = 0; i < extensions.length; i++) { - property_name_to_add = extensions[i].$type.split(":")[1] + property_name_to_add = extensions[i].$type.split(":")[1]; + property_name_to_add = property_name_to_add.charAt(0).toLowerCase() + property_name_to_add.slice(1); + + //property_name_to_add = extensions[i].$type.split(":")[1].toLowerCase(); if(!field_counter.hasOwnProperty(property_name_to_add)){ field_counter[property_name_to_add] = 0; } @@ -118,7 +121,7 @@ function createExistingPropertyGroupsList(element, injector){ export function createTiltPropertiesGroup(element, injector, blueprint_array = [], max_extensions_to_create = [1]){ var existing_groups = createExistingPropertyGroupsList(element, injector) var items_list = existing_groups[0], field_counter = existing_groups[1] - + debugger; // return nothing if there are no tilt Elements to create and if there is no tilt Element to add: if (items_list.length == 0 && blueprint_array.length == 0){ return null diff --git a/client/tilt-properties/tilt-extension-provider.js b/client/tilt-properties/tilt-extension-provider.js index 13f25f6..13076ad 100644 --- a/client/tilt-properties/tilt-extension-provider.js +++ b/client/tilt-properties/tilt-extension-provider.js @@ -42,7 +42,7 @@ export default class TiltPropertiesExtensionProvider { groups.push(createTiltPropertiesGroup(element,this._injector,[ new PropertyBlueprint("tilt:Controller",{representative:[]},null) - ])); + ],[1])); }else if(is(element, 'bpmn:DataObjectReference')) {