Refactors Dmp import, Dmp Profile import and Dataset import dialogues.
This commit is contained in:
parent
9a14a73b86
commit
e8067b8620
|
@ -55,13 +55,13 @@ export class DatasetProfileCriteriaComponent extends BaseCriteriaComponent imple
|
|||
message: this.language.instant('DATASET-WIZARD.UPLOAD.UPLOAD-XML-FILE-TITLE'),
|
||||
confirmButton: this.language.instant('DATASET-WIZARD.UPLOAD.UPLOAD-XML'),
|
||||
cancelButton: this.language.instant('DATASET-WIZARD.UPLOAD.UPLOAD-XML-FILE-CANCEL'),
|
||||
name: this.language.instant('DATASET-WIZARD.UPLOAD.UPLOAD-XML-NAME'),
|
||||
name: "",
|
||||
file: FileList,
|
||||
sucsess: false
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
|
||||
if (data.sucsess && data.name != null && data.file != null) {
|
||||
if (data && data.sucsess && data.name != null && data.file != null) {
|
||||
this.datasetService.uploadFile(data.file, data.name)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe();
|
||||
|
|
|
@ -5,19 +5,21 @@
|
|||
</div>
|
||||
<div class="col-auto">
|
||||
<input class="hidden" type="file" #imgFileInput (change)="selectXML($event)" accept="text/xml" />
|
||||
<button mat-raised-button class="col-auto" color="{{btnColore}}" (click)="imgFileInput.click()"
|
||||
type="button"><mat-icon>attach_file</mat-icon></button>
|
||||
<button mat-icon-button class="col-auto" (click)="imgFileInput.click()" type="button">
|
||||
<mat-icon color="{{btnColore}}">attach_file</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<mat-form-field class="col-12">
|
||||
<input matInput placeholder="{{'DATASET-WIZARD.UPLOAD.UPLOAD-XML-NAME'| translate}}"
|
||||
name="datasetProfileName" [(ngModel)]="data.name">
|
||||
<input matInput placeholder="{{'DATASET-WIZARD.UPLOAD.UPLOAD-XML-NAME'| translate}}" name="datasetProfileName" [(ngModel)]="data.name">
|
||||
</mat-form-field>
|
||||
<div class="col-auto"><button mat-raised-button color="primary" type="button"
|
||||
(click)="cancel()">{{ data.cancelButton }}</button></div>
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button color="primary" type="button" (click)="cancel()">{{ data.cancelButton }}</button>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto"><button mat-raised-button color="primary" type="button"
|
||||
(click)="confirm()" [disabled]="!hasProfile()">{{ data.confirmButton }}</button></div>
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button color="primary" type="button" (click)="confirm()" [disabled]="!hasProfile()">{{ data.confirmButton }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,23 +1,25 @@
|
|||
<div class="confirmation-dialog">
|
||||
<div class="row">
|
||||
<div class="confirmation-message col">
|
||||
<div class="confirmation-message col-auto align-self-center">
|
||||
<h4>{{ data.message }}</h4>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<input class="hidden" type="file" #imgFileInput (change)="selectXML($event)" accept="text/xml" />
|
||||
<button mat-raised-button class="col-auto" color="{{btnColore}}" (click)="imgFileInput.click()"
|
||||
type="button">{{ 'DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-IMPORT' | translate }}</button>
|
||||
<button mat-icon-button class="col-auto" (click)="imgFileInput.click()" type="button">
|
||||
<mat-icon color="{{btnColore}}">attach_file</mat-icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<mat-form-field class="col-12">
|
||||
<input matInput placeholder="{{'DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-NAME'| translate}}"
|
||||
name="datasetProfileName" [(ngModel)]="data.name">
|
||||
<input matInput placeholder="{{'DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-NAME'| translate}}" name="datasetProfileName" [(ngModel)]="data.name">
|
||||
</mat-form-field>
|
||||
<div class="col-auto"><button mat-raised-button color="primary" type="button"
|
||||
(click)="cancel()">{{ data.cancelButton }}</button></div>
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button color="primary" type="button" (click)="cancel()">{{ data.cancelButton }}</button>
|
||||
</div>
|
||||
<div class="col"></div>
|
||||
<div class="col-auto"><button mat-raised-button color="primary" type="button"
|
||||
(click)="confirm()" [disabled]="!hasProfile()">{{ data.confirmButton }}</button></div>
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button color="primary" type="button" (click)="confirm()" [disabled]="!hasProfile()">{{ data.confirmButton }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -59,13 +59,13 @@ export class DmpProfileCriteriaComponent extends BaseCriteriaComponent implement
|
|||
message: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-TITLE'),
|
||||
confirmButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML'),
|
||||
cancelButton: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-FILE-CANCEL'),
|
||||
name: this.language.instant('DMP-PROFILE-LISTING.UPLOAD.UPLOAD-XML-NAME'),
|
||||
name: '',
|
||||
file: FileList,
|
||||
sucsess: false
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(data => {
|
||||
if (data.sucsess && data.name != null && data.file != null) {
|
||||
if (data && data.sucsess && data.name != null && data.file != null) {
|
||||
this.dmpProfileService.uploadFile(data.file, data.name)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe();
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
<h4>{{'CRITERIA.FILTERS'| translate}}</h4>
|
||||
</mat-card-title>
|
||||
<div class="col"></div>
|
||||
<button class="uploadButton" mat-raised-button color="primary" (click)="fileSave($event)" type="button col-auto">
|
||||
{{'DMP-UPLOAD.UPLOAD-BUTTON' | translate}}
|
||||
<button class="importButton" mat-raised-button color="primary" (click)="fileSave($event)" type="button col-auto">
|
||||
{{'DMP-UPLOAD.ACTIONS.IMPORT' | translate}}
|
||||
</button>
|
||||
</mat-card-header>
|
||||
<div class="row">
|
||||
|
|
|
@ -1,21 +1,19 @@
|
|||
<div class="confirmation-dialog">
|
||||
<div class="confirmation-message">
|
||||
<div class="row">
|
||||
<div class="col-auto align-self-center">
|
||||
<h4>{{'DMP-UPLOAD.TITLE' | translate}}</h4>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
{{'DMP-UPLOAD.TITLE' | translate}}
|
||||
</div>
|
||||
<div class="uploadButton">
|
||||
<button mat-raised-button color="primary" (click)="fileInput.click()" type="button col-auto">
|
||||
{{'DMP-UPLOAD.UPLOAD-BUTTON' | translate}}
|
||||
<button mat-icon-button class="col-auto" (click)="fileInput.click()" type="button">
|
||||
<mat-icon color="primary">attach_file</mat-icon>
|
||||
</button>
|
||||
<input class="hidden" #fileInput type="file" (change)="uploadFile($event)">
|
||||
<input class="hidden" #fileInput type="file" (change)="uploadFile($event)" accept="text/xml">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<mat-form-field class="col">
|
||||
<div class="row">
|
||||
<mat-form-field class="col-12">
|
||||
<input class="uploadInput" [(ngModel)]="dmpTitle" matInput placeholder="DMP Name" name="uploadFileInput">
|
||||
</mat-form-field>
|
||||
<div class="row">
|
||||
<div class="col-auto">
|
||||
<button mat-raised-button color="primary" type="button" (click)="cancel()">{{'DMP-UPLOAD.ACTIONS.CANCEL' | translate}}</button>
|
||||
</div>
|
||||
|
|
|
@ -216,7 +216,7 @@
|
|||
}
|
||||
},
|
||||
"DMP-UPLOAD": {
|
||||
"TITLE": "Upload Data Managment Plan via XML",
|
||||
"TITLE": "Import Data Managment Plan",
|
||||
"UPLOAD-BUTTON": "Upload",
|
||||
"ACTIONS": {
|
||||
"IMPORT": "Import",
|
||||
|
@ -256,7 +256,7 @@
|
|||
},
|
||||
"UPLOAD": {
|
||||
"UPLOAD-XML": "Import",
|
||||
"UPLOAD-XML-FILE-TITLE": "Select Xml file with Dataset Profile to Upload",
|
||||
"UPLOAD-XML-FILE-TITLE": "Import Dataset Profile",
|
||||
"UPLOAD-XML-NAME": "Name Of Dataset Profile",
|
||||
"UPLOAD-XML-IMPORT": "File",
|
||||
"UPLOAD-XML-FILE-CANCEL": "Cancel"
|
||||
|
@ -387,7 +387,7 @@
|
|||
},
|
||||
"UPLOAD": {
|
||||
"UPLOAD-XML": "Import",
|
||||
"UPLOAD-XML-FILE-TITLE": "Select Xml file with Dmp Profile to Upload",
|
||||
"UPLOAD-XML-FILE-TITLE": "Import Data Managment Plan Profile",
|
||||
"UPLOAD-XML-NAME": "Name Of Dmp Profile",
|
||||
"UPLOAD-XML-IMPORT": "File",
|
||||
"UPLOAD-XML-FILE-CANCEL": "Cancel"
|
||||
|
|
Loading…
Reference in New Issue