mirror of
https://github.com/sartography/cr-connect-bpmn.git
synced 2025-02-17 02:47:16 +00:00
Make changes so that file upload is easier to do
This commit is contained in:
parent
65e89f1cac
commit
216dcb9fc0
@ -49,10 +49,6 @@
|
||||
<mat-icon>code</mat-icon>
|
||||
Open from XML File
|
||||
</button>
|
||||
<button mat-menu-item (click)="openMethod = 'url'; expandToolbar = true">
|
||||
<mat-icon>link</mat-icon>
|
||||
Open from URL
|
||||
</button>
|
||||
</mat-menu>
|
||||
|
||||
<button mat-button (click)="saveChanges()" [disabled]="!hasChanged()"><mat-icon>save</mat-icon></button>
|
||||
@ -80,26 +76,17 @@
|
||||
</mat-form-field>
|
||||
</ng-container>
|
||||
|
||||
<ng-container *ngIf="openMethod === 'file'">
|
||||
<mat-form-field (click)="fileInput.click()">
|
||||
<span matPrefix><mat-icon>folder_open</mat-icon> </span>
|
||||
<input matInput disabled [value]="getFileName()" type="text">
|
||||
</mat-form-field>
|
||||
<input hidden (change)="onFileSelected($event)" #fileInput type="file" id="file" accept=".bpmn,.dmn,.xml,application/xml,text/xml">
|
||||
</ng-container>
|
||||
<ng-container *ngIf="openMethod === 'url'">
|
||||
<mat-form-field>
|
||||
<span matPrefix><mat-icon>link</mat-icon> </span>
|
||||
<input name="diagramUrl" [(ngModel)]="diagramUrl" matInput placeholder="Open diagram from URL" type="text">
|
||||
</mat-form-field>
|
||||
</ng-container>
|
||||
|
||||
|
||||
<button
|
||||
mat-flat-button
|
||||
(click)="onSubmitFileToOpen()"
|
||||
(click)="fileInput.click()"
|
||||
[disabled]="!diagramFile"
|
||||
color="primary"
|
||||
id="open_file_button"
|
||||
>Open file <mat-icon>arrow_forward</mat-icon></button>
|
||||
>Open file <mat-icon>arrow_forward</mat-icon>
|
||||
<input hidden (change)="onFileSelected($event)" #fileInput type="file" id="file" accept=".bpmn,.dmn,.xml,application/xml,text/xml">
|
||||
</button>
|
||||
<span fxFlex></span>
|
||||
<button mat-icon-button (click)="expandToolbar = false"><mat-icon>close</mat-icon></button>
|
||||
</mat-toolbar-row>
|
||||
|
@ -128,6 +128,8 @@ export class ModelerComponent implements AfterViewInit {
|
||||
|
||||
onFileSelected($event: Event) {
|
||||
this.diagramFile = ($event.target as HTMLFormElement).files[0];
|
||||
this.onSubmitFileToOpen()
|
||||
this.isNew = true;
|
||||
}
|
||||
|
||||
// Arrow function here preserves this context
|
||||
|
Loading…
x
Reference in New Issue
Block a user