TSK-593: bugfix: reload workbasket and classification list after import
This commit is contained in:
parent
b5c4d583e4
commit
13f31c7b93
|
@ -5,7 +5,8 @@
|
|||
<button type="button" (click)="addClassification()" data-toggle="tooltip" title="Add" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-plus green-blue" aria-hidden="true"></span>
|
||||
</button>
|
||||
<taskana-import-export-component [currentSelection]="selectionToImport"></taskana-import-export-component>
|
||||
<taskana-import-export-component [currentSelection]="selectionToImport" (importSucessful)="refreshClassificationList()">
|
||||
</taskana-import-export-component>
|
||||
<taskana-classification-types-selector class="pull-right" [classificationTypes]="classificationsTypes" [(classificationTypeSelected)]="classificationTypeSelected"
|
||||
(classificationTypeChanged)=selectClassificationType($event)></taskana-classification-types-selector>
|
||||
</div>
|
||||
|
|
|
@ -119,6 +119,10 @@ export class ClassificationListComponent implements OnInit, OnDestroy {
|
|||
|
||||
}
|
||||
|
||||
refreshClassificationList() {
|
||||
this.performRequest(true);
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
if (this.classificationServiceSubscription) { this.classificationServiceSubscription.unsubscribe(); }
|
||||
if (this.classificationTypeServiceSubscription) { this.classificationTypeServiceSubscription.unsubscribe(); }
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { Component, Input, OnInit, Output, EventEmitter } from '@angular/core';
|
||||
import { ClassificationDefinitionService } from 'app/administration/services/classification-definition/classification-definition.service';
|
||||
import { WorkbasketDefinitionService } from 'app/administration/services/workbasket-definition/workbasket-definition.service';
|
||||
import { DomainService } from 'app/services/domain/domain.service';
|
||||
|
@ -14,6 +14,10 @@ import { ErrorModalService } from 'app/services/errorModal/error-modal.service';
|
|||
export class ImportExportComponent implements OnInit {
|
||||
|
||||
@Input() currentSelection: ImportType;
|
||||
|
||||
@Output() importSucessful = new EventEmitter();
|
||||
|
||||
|
||||
domains: string[] = [];
|
||||
|
||||
constructor(private domainService: DomainService, private workbasketDefinitionService: WorkbasketDefinitionService,
|
||||
|
@ -44,11 +48,11 @@ export class ImportExportComponent implements OnInit {
|
|||
|
||||
const reader = new FileReader();
|
||||
if (this.currentSelection === ImportType.WORKBASKETS) {
|
||||
reader.onload = <Event>(e) => {
|
||||
this.workbasketDefinitionService.importWorkbasketDefinitions(e.target.result);
|
||||
}
|
||||
reader.onload = <Event>(e) => this.workbasketDefinitionService.importWorkbasketDefinitions(e.target.result);
|
||||
this.importSucessful.emit();
|
||||
} else {
|
||||
reader.onload = <Event>(e) => this.classificationDefinitionService.importClassifications(e.target.result);
|
||||
this.importSucessful.emit();
|
||||
}
|
||||
reader.readAsText(file);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<button type="button" (click)="addWorkbasket()" data-toggle="tooltip" title="Add" class="btn btn-default">
|
||||
<span class="glyphicon glyphicon-plus green-blue" aria-hidden="true"></span>
|
||||
</button>
|
||||
<taskana-import-export-component [currentSelection]="selectionToImport"></taskana-import-export-component>
|
||||
<taskana-import-export-component (importSucessful)="importEvent()" [currentSelection]="'selectionToImport'"></taskana-import-export-component>
|
||||
</div>
|
||||
<div class="pull-right margin-right">
|
||||
<taskana-sort
|
||||
|
|
|
@ -38,6 +38,7 @@ export class WorkbasketListToolbarComponent implements OnInit {
|
|||
@Input() workbaskets: Array<WorkbasketSummary>;
|
||||
@Output() performSorting = new EventEmitter<SortingModel>();
|
||||
@Output() performFilter = new EventEmitter<FilterModel>();
|
||||
@Output() importSucessful = new EventEmitter();
|
||||
workbasketServiceSubscription: Subscription;
|
||||
selectionToImport = ImportType.WORKBASKETS;
|
||||
sortingFields = new Map([['name', 'Name'], ['key', 'Key'], ['description', 'Description'], ['owner', 'Owner'], ['type', 'Type']]);
|
||||
|
@ -66,4 +67,8 @@ export class WorkbasketListToolbarComponent implements OnInit {
|
|||
this.workbasketService.selectWorkBasket(undefined);
|
||||
this.router.navigate([{ outlets: { detail: ['new-workbasket'] } }], { relativeTo: this.route });
|
||||
}
|
||||
|
||||
importEvent() {
|
||||
this.importSucessful.emit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
<div class="workbasket-list-full-height">
|
||||
<div class="footer-space">
|
||||
<div #wbToolbar>
|
||||
<taskana-workbasket-list-toolbar [workbaskets]="workbaskets" (performFilter)="performFilter($event)" (performSorting)="performSorting($event)"></taskana-workbasket-list-toolbar>
|
||||
<taskana-workbasket-list-toolbar [workbaskets]="workbaskets" (performFilter)="performFilter($event)" (performSorting)="performSorting($event)"
|
||||
(importSucessful)="refreshWorkbasketList()"></taskana-workbasket-list-toolbar>
|
||||
</div>
|
||||
<div *ngIf="(workbaskets && workbaskets.length > 0) else empty_workbaskets">
|
||||
<ul #wbList id="wb-list-container" class="list-group">
|
||||
|
|
|
@ -78,7 +78,7 @@ export class WorkbasketListComponent implements OnInit, OnDestroy {
|
|||
this.performRequest();
|
||||
}
|
||||
|
||||
private refreshWorkbasketList() {
|
||||
refreshWorkbasketList() {
|
||||
const toolbarSize = this.toolbarElement.nativeElement.offsetHeight;
|
||||
const cardHeight = 75;
|
||||
const unusedHeight = 145
|
||||
|
|
Loading…
Reference in New Issue