From eafbe7ef997988a6922d004703dcd35dd28bf991 Mon Sep 17 00:00:00 2001 From: Yoav Schneiderman Date: Tue, 17 Dec 2019 22:10:31 +0200 Subject: Add details in template list popup Issue-ID: VID-730 Signed-off-by: Yoav Schneiderman Change-Id: I7042e85a1e12e7d5d9a19b5cc1eb92c65ea08134 --- .../instantiation.templates.modal.component.ts | 23 ++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts') diff --git a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts index 9681113e8..b37d7f9a2 100644 --- a/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts +++ b/vid-webpack-master/src/app/shared/components/genericFormPopup/instantiationTemplatesModal/instantiation.templates.modal.component.ts @@ -7,7 +7,11 @@ import {InstantiationTemplatesModalService} from "./instantiation.templates.moda import {InstantiationTemplatesRowModel} from "./instantiation.templates.row.model"; import {DrawingBoardModes} from "../../../../drawingBoard/service-planning/drawing-board.modes"; import {InstantiationStatusComponentService} from "../../../../instantiationStatus/instantiationStatus.component.service"; - +import {AaiService} from "../../../services/aaiService/aai.service"; +import {NgRedux} from "@angular-redux/store"; +import {AppState} from "../../../store/reducers"; +import * as _ from 'lodash'; +import {forkJoin} from "rxjs"; @Component({ selector: 'template-modal', templateUrl: 'instantiation.templates.modal.component.html', @@ -21,12 +25,15 @@ export class InstantiationTemplatesModalComponent extends DialogComponent, private _route: ActivatedRoute) { super(dialogService); this.templateModalComponentService = _templateModalComponentService; @@ -37,7 +44,11 @@ export class InstantiationTemplatesModalComponent extends DialogComponent { - this._serviceInfoService.getServicesJobInfo(true, params['serviceModelId']).subscribe((jobs) => { + + const getServiceJobInfoRoute = this._serviceInfoService.getServicesJobInfo(true, params['serviceModelId']); + const getUserIdRoute = this._aaiService.getUserId(); + + forkJoin([getServiceJobInfoRoute, getUserIdRoute]).subscribe(([jobs]) => { this.originalTableData = this._templateModalComponentService.convertResponseToUI(jobs); this.filterTableData = this.originalTableData; }); @@ -48,6 +59,14 @@ export class InstantiationTemplatesModalComponent extends DialogComponent { + this.filterByUserId = value; + const userId: string = this._store.getState().service['userId']; + if(!_.isNil(userId)){ + this.filterTableData = this.filterByUserId ? this._templateModalComponentService.filterByUserId(userId, this.originalTableData) : this.originalTableData; + } + }; + closeModal(): void { this.dialogService.removeDialog(this); } -- cgit 1.2.3-korg