Skip to content

Commit

Permalink
Fixed add button number of adds.
Browse files Browse the repository at this point in the history
  • Loading branch information
curiousjaki committed Jan 15, 2023
1 parent fea7541 commit c91b935
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 33 deletions.
63 changes: 33 additions & 30 deletions client/tilt-extractor/extract-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

}

Expand All @@ -51,15 +30,39 @@ export default class ExtractButton extends PureComponent {
<button
ref={ this._buttonRef }
className={ classNames('tilt-btn','btn') }
onClick={ () => this.createElement()}>
Click to save TILT document as ...
onClick={ () => this.createTiltObject()}>
Click to create a TILT object...
</button>
</Fill>
</Fragment>;
}
}

ExtractButton.$inject = [
'propertiesPanel',
'injector'
];
'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;
// }
// }
//}
7 changes: 5 additions & 2 deletions client/tilt-properties/props/tilt-property-groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/tilt-properties/tilt-extension-provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {

Expand Down

0 comments on commit c91b935

Please sign in to comment.