diff --git a/.travis.yml b/.travis.yml index cd33698..2cd7a05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,9 @@ services: before_install: - | - if [[ $TRAVIS_BRANCH =~ ^(dev|testing|demo|training|staging|rrt\/.*)$ ]]; then + if [[ $TRAVIS_BRANCH =~ ^(feature\/.*)$ ]]; then + export E2E_TAG="dev" + elif [[ $TRAVIS_BRANCH =~ ^(dev|testing|demo|training|staging|rrt\/.*)$ ]]; then export E2E_TAG="${TRAVIS_BRANCH//\//_}" else export E2E_TAG="latest" diff --git a/package-lock.json b/package-lock.json index 8b2a2ac..25b7fa5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12050,9 +12050,9 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sartography-workflow-lib": { - "version": "0.0.342", - "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.342.tgz", - "integrity": "sha512-cNW0INFMuN7lFwn69mjWiY9xvv+mIMLpyUzNYt7ZYifPIPLCdt4MU28wZxYvWfTjWC6kY+c+8hovgY56NFpwyg==" + "version": "0.0.376", + "resolved": "https://registry.npmjs.org/sartography-workflow-lib/-/sartography-workflow-lib-0.0.376.tgz", + "integrity": "sha512-TRL0mBnCyX9WRX/IB+Lt/xj/Q81qMKX0aJZ6arpEibDM68bXABhuSDKqzRZIV4WdZ4iOtXZaJAEE33aFimeOUw==" }, "sass": { "version": "1.26.3", diff --git a/package.json b/package.json index 2a3ff7c..041f4c8 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "ngx-file-drop": "^8.0.8", "ngx-markdown": "^9.1.1", "rxjs": "~6.5.4", - "sartography-workflow-lib": "0.0.342", + "sartography-workflow-lib": "0.0.376", "tslib": "^1.13.0", "uuid": "^7.0.2", "zone.js": "^0.10.3" diff --git a/src/app/diagram/diagram.component.ts b/src/app/diagram/diagram.component.ts index 9c79237..fcc4fe0 100644 --- a/src/app/diagram/diagram.component.ts +++ b/src/app/diagram/diagram.component.ts @@ -63,13 +63,13 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { onTouched() { } - initializeModeler(diagramType: FileType) { + initializeModeler(diagramType: FileType): DmnModeler | BpmnModeler { this.clearElements(); if (diagramType === FileType.DMN) { - this.initializeDMNModeler(); + return this.initializeDMNModeler() as DmnModeler; } else { - this.initializeBPMNModeler(); + return this.initializeBPMNModeler() as BpmnModeler; } } @@ -103,7 +103,7 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { openDiagram(xml?: string, diagramType?: FileType) { this.diagramType = diagramType || getDiagramTypeFromXml(xml); this.xml = xml; - this.initializeModeler(diagramType); + const modeler = this.initializeModeler(diagramType); return this.zone.run(() => { if (!xml) { @@ -111,6 +111,7 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { xml = defaultXml.replace(/REPLACE_ME/gi, () => this.getRandomString(7)); } + // Add an arbitrary string to get the save button to enable this.modeler.importXML(xml, (e, w) => this.onImport(e, w)); }); } @@ -180,7 +181,7 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { }); } - private initializeBPMNModeler() { + private initializeBPMNModeler(): BpmnModeler { this.modeler = new BpmnModeler({ container: this.containerRef.nativeElement, propertiesPanel: { @@ -202,9 +203,11 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { }); } }); + + return this.modeler as BpmnModeler; } - private initializeDMNModeler() { + private initializeDMNModeler(): DmnModeler { this.modeler = new DmnModeler({ container: this.containerRef.nativeElement, drd: { @@ -244,6 +247,8 @@ export class DiagramComponent implements ControlValueAccessor, AfterViewInit { }); } }); + + return this.modeler as DmnModeler; } private clearElements() { diff --git a/src/app/modeler/modeler.component.ts b/src/app/modeler/modeler.component.ts index 60b9914..be0fa3c 100644 --- a/src/app/modeler/modeler.component.ts +++ b/src/app/modeler/modeler.component.ts @@ -92,7 +92,7 @@ export class ModelerComponent implements AfterViewInit { this.importError = error; this.importWarnings = warnings; - this.draftXml = this.xml; + this.draftXml = this.xml + ' '; } onSubmitFileToOpen() {