Merge pull request #99 from sartography/dmn-from-spreadsheet-395

Dmn from spreadsheet #395
This commit is contained in:
Mike Cullerton 2021-09-14 17:40:25 -04:00 committed by GitHub
commit e5439a5680
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View File

@ -63,7 +63,7 @@
"ngx-markdown": "^12.0.1",
"protractor": "^7.0.0",
"rxjs": "^6.5.3",
"sartography-workflow-lib": "^0.0.556",
"sartography-workflow-lib": "^0.0.558",
"tslib": "^2.3.0",
"uuid": "^8.3.2",
"zone.js": "^0.11.4"

View File

@ -86,4 +86,4 @@
</div>
</div>
<input hidden (change)="onFileSelected($event)" #fileInput type="file" id="file" accept=".bpmn,.dmn,.xml,application/xml,text/xml">
<input hidden (change)="onFileSelected($event)" #fileInput type="file" id="file" accept=".bpmn,.dmn,.xml,.xlsx,application/xml,text/xml">

View File

@ -133,8 +133,24 @@ export class ModelerComponent implements AfterViewInit {
onSubmitFileToOpen() {
this.expandToolbar = false;
/** If it is a spreadsheet, create a DMN from it */
if (this.diagramFile && this.diagramFile.type.toLowerCase() === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet') {
this.api.createDMNFromSS(this.diagramFile).subscribe(file => {
let fileMeta = {
id: 0,
content_type: 'text/xml',
name: 'new_dmn',
type: FileType.DMN,
}
this.diagramFile = newFileFromResponse(fileMeta, file);
console.log(this.diagramFile);
console.log(file);
this.readFile(this.diagramFile);
});
if (this.diagramFile && ModelerComponent.isXmlFile(this.diagramFile)) {
}
else if (this.diagramFile && ModelerComponent.isXmlFile(this.diagramFile)) {
this.readFile(this.diagramFile);
} else {
this.handleImported({