diff --git a/src/app/appmarket/bulkDeployment/appDeployment/appchoose/appdeployment.component.html b/src/app/appmarket/bulkDeployment/appDeployment/appchoose/appdeployment.component.html index fa13ea74f6388c78bcddf2d7a80c431c87d98bf6..511559b58cbb7d1ba3cb46137b1db7cb0d5cdf00 100644 --- a/src/app/appmarket/bulkDeployment/appDeployment/appchoose/appdeployment.component.html +++ b/src/app/appmarket/bulkDeployment/appDeployment/appchoose/appdeployment.component.html @@ -7,7 +7,7 @@ <h4>{{'BULK.APP.INFO' | translate}}</h4> </div> <div style="margin-top: 3rem;"> - <p-dropdown [options]="apps" optionLabel="name" [(ngModel)]="selectedApp"></p-dropdown> + <p-dropdown [options]="apps" optionLabel="name" [(ngModel)]="selectedApp" [filter]="true"></p-dropdown> </div> <div class="row .navbar-right" style="margin-top: 3rem; display: flex; justify-content: right"> <button class="btn btn-primary" (click)="selectApp()"> {{'BULK.LIST.CONTINUE' | translate}}</button> diff --git a/src/app/appmarket/bulkDeployment/appdeployment.service.ts b/src/app/appmarket/bulkDeployment/appdeployment.service.ts index 22094e037df4a5cac2a4b7e6e0781c4ba19be982..b4d31abc48301412da86e483e4d02a9ed5f6a56c 100644 --- a/src/app/appmarket/bulkDeployment/appdeployment.service.ts +++ b/src/app/appmarket/bulkDeployment/appdeployment.service.ts @@ -2,7 +2,7 @@ import {Injectable} from '@angular/core'; import {ApplicationBase} from '../../model/application-base'; import {HttpClient} from '@angular/common/http'; import {AppConfigService} from '../../service'; -import {BulkReplay} from '../../model/bulk-replay'; +import {BulkResponse} from '../../model/bulk-response'; import {Observable} from 'rxjs'; import {BulkDeployment} from '../../model/bulk-deployment'; @@ -17,7 +17,7 @@ export class AppdeploymentService { private selectedApp: string = undefined; private selectedAppId: string = undefined; - public result: BulkReplay[] = []; + public result: BulkResponse[] = []; public bulk: BulkDeployment; diff --git a/src/app/appmarket/bulkDeployment/bulk-app-list/bulk-app-list.component.ts b/src/app/appmarket/bulkDeployment/bulk-app-list/bulk-app-list.component.ts index c321c9caf8a45027549611abd87d36cac1d046ee..6b16e157764cb4d500d25888159456d6eb28b961 100644 --- a/src/app/appmarket/bulkDeployment/bulk-app-list/bulk-app-list.component.ts +++ b/src/app/appmarket/bulkDeployment/bulk-app-list/bulk-app-list.component.ts @@ -1,7 +1,7 @@ import {Component, OnInit, ViewChild} from '@angular/core'; import {BulkDeployment} from '../../../model/bulk-deployment'; import {AppdeploymentService} from '../appdeployment.service'; -import {BulkType} from '../../../model/bulk-replay'; +import {BulkType} from '../../../model/bulk-response'; import {ModalComponent} from '../../../shared'; @Component({ diff --git a/src/app/appmarket/bulkDeployment/bulk-domain-list/bulk-domain-list.component.ts b/src/app/appmarket/bulkDeployment/bulk-domain-list/bulk-domain-list.component.ts index 96c31b8cd2cc6faecba572bdbea48565826d7aa7..2a7b32136440ca302c00e49ddf3f16538454176d 100644 --- a/src/app/appmarket/bulkDeployment/bulk-domain-list/bulk-domain-list.component.ts +++ b/src/app/appmarket/bulkDeployment/bulk-domain-list/bulk-domain-list.component.ts @@ -1,7 +1,7 @@ import {Component, OnInit} from '@angular/core'; import {AppdeploymentService} from '../appdeployment.service'; import {BulkDeployment} from '../../../model/bulk-deployment'; -import {BulkType} from '../../../model/bulk-replay'; +import {BulkType} from '../../../model/bulk-response'; @Component({ selector: 'app-bulk-domain-list', diff --git a/src/app/appmarket/bulkDeployment/bulk-list/bulk-list.component.ts b/src/app/appmarket/bulkDeployment/bulk-list/bulk-list.component.ts index cd5e3d5f9aed274a384b154f46f046637e3dd284..9f16ab035e14e3970b2292ed14d773a62f0b7ac2 100644 --- a/src/app/appmarket/bulkDeployment/bulk-list/bulk-list.component.ts +++ b/src/app/appmarket/bulkDeployment/bulk-list/bulk-list.component.ts @@ -1,6 +1,6 @@ import {Component, Input, OnInit, QueryList, ViewChild, ViewChildren} from '@angular/core'; import {BulkDeployment} from '../../../model/bulk-deployment'; -import {BulkType} from '../../../model/bulk-replay'; +import {BulkType} from '../../../model/bulk-response'; import {SortableHeaderDirective} from '../../../service/sort-domain.directive'; import {ModalComponent} from '../../../shared'; diff --git a/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.html b/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.html index c836480e7c994b83dc75a9aae61db3a6babf3ee7..fccc7db77b72de2a284c3592881a2e40f4228e43 100644 --- a/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.html +++ b/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.html @@ -53,11 +53,11 @@ <th>{{'BULK.LIST.DETAILS' | translate}}</th> <th style="width: 5%" scope="col"></th> </tr> - <ng-template ngFor let-replay [ngForOf]="bulk.entries" let-i="index"> - <tr *ngIf="replay.type === 'DOMAIN'" class="table-row"> - <td>{{'BULK.STATE.' + replay.state | translate}}</td> - <td>{{replay.created}}</td> - <td>{{getDetails(replay)}}</td> + <ng-template ngFor let-response [ngForOf]="bulk.entries" let-i="index"> + <tr *ngIf="response.type === 'DOMAIN'" class="table-row"> + <td>{{'BULK.STATE.' + response.state | translate}}</td> + <td>{{response.created}}</td> + <td>{{getDetails(response)}}</td> <td style="width: 5%" class="text-right"> <span class="dropdown"> <a style="display: inline-block" class="dropdown-toggle " aria-expanded="false" aria-haspopup="true" @@ -65,11 +65,11 @@ <em class="fas fa-cog icon-black icon-bigger"></em> </a> <ul class="dropdown-menu pull-right-drop"> - <li *ngIf="replay.type === 'DOMAIN'"> - <a [routerLink]="['/admin/domains/view/', replay?.details['domainId']]">{{ 'BULK.LIST.MOVE_DOMAIN' | translate }}</a> + <li *ngIf="response.type === 'DOMAIN'"> + <a [routerLink]="['/admin/domains/view/', response?.details['domainId']]">{{ 'BULK.LIST.MOVE_DOMAIN' | translate }}</a> </li> - <li *ngIf="replay.type === 'USER'"> - <a [routerLink]="['/admin/users/view', replay?.details['userId']]">{{ 'BULK.LIST.MOVE_USER' | translate }}</a> + <li *ngIf="response.type === 'USER'"> + <a [routerLink]="['/admin/users/view', response?.details['userId']]">{{ 'BULK.LIST.MOVE_USER' | translate }}</a> </li> </ul> </span> @@ -201,16 +201,16 @@ <th>{{'BULK.APP.DOMAIN' | translate}}</th> <th style="width: 5%" scope="col"></th> </tr> - <ng-template ngFor let-replay [ngForOf]="bulk.entries" let-i="index"> - <tr *ngIf="replay.type === 'APPLICATION'" class="table-row"> - <td >{{'BULK.STATE.' + replay.state | translate}} <i *ngIf="replay.state == 'PROCESSING'" + <ng-template ngFor let-response [ngForOf]="bulk.entries" let-i="index"> + <tr *ngIf="response.type === 'APPLICATION'" class="table-row"> + <td >{{'BULK.STATE.' + response.state | translate}} <i *ngIf="response.state == 'PROCESSING'" class="pi pi-spin pi-spinner ml-1" style="font-size: 1.4rem"></i> - <i *ngIf="replay.state == 'FAILED'" class="pi pi-info-circle" style="font-size: 1.4rem" - pTooltip="{{replay?.details['errorMessage']}}" tooltipStyleClass="p-tooltip-width " [fitContent]="false"></i></td> - <td>{{getAppInstanceId(replay)}}</td> - <td>{{getAppInstanceName(replay)}}</td> - <td>{{getDomainCodeName(replay)}}</td> + <i *ngIf="response.state == 'FAILED'" class="pi pi-info-circle" style="font-size: 1.4rem" + pTooltip="{{response?.details['errorMessage']}}" tooltipStyleClass="p-tooltip-width " [fitContent]="false"></i></td> + <td>{{getAppInstanceId(response)}}</td> + <td>{{getAppInstanceName(response)}}</td> + <td>{{getDomainCodeName(response)}}</td> <td style="width: 5%" class="text-right"> <span class="dropdown"> <a style="display: inline-block" class="dropdown-toggle " aria-expanded="false" aria-haspopup="true" @@ -218,10 +218,10 @@ <em class="fas fa-cog icon-black icon-bigger"></em> </a> <ul class="dropdown-menu pull-right-drop"> - <li *ngIf="replay.type === 'APPLICATION' && replay?.details['appInstanceId'] !== undefined"> - <a [routerLink]="['/instances/', replay?.details['appInstanceId']]">{{ 'BULK.LIST.MOVE_APP' | translate }}</a> + <li *ngIf="response.type === 'APPLICATION' && response?.details['appInstanceId'] !== undefined"> + <a [routerLink]="['/instances/', response?.details['appInstanceId']]">{{ 'BULK.LIST.MOVE_APP' | translate }}</a> </li> - <li *ngIf="replay.type === 'APPLICATION' && replay.state !== 'COMPLETED'"> + <li *ngIf="response.type === 'APPLICATION' && response.state !== 'COMPLETED'"> <a>{{ 'BULK.APP.CHECK_STATE' | translate }}</a> </li> </ul> diff --git a/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.ts b/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.ts index 0d3025bb3e498210efd90fc8496268c484d42131..8511fb0d17ad1751f3b12f3e16e387c4e4299f7f 100644 --- a/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.ts +++ b/src/app/appmarket/bulkDeployment/bulk-view/bulk-view.component.ts @@ -2,7 +2,7 @@ import {Component, OnDestroy, OnInit} from '@angular/core'; import {BulkDeployment} from '../../../model/bulk-deployment'; import {AppdeploymentService} from '../appdeployment.service'; import {ActivatedRoute, Router} from '@angular/router'; -import {BulkReplay, BulkType} from '../../../model/bulk-replay'; +import {BulkResponse, BulkType} from '../../../model/bulk-response'; import {timer} from 'rxjs'; import {map} from 'rxjs/operators'; import {AppImagesService} from '../../../service'; @@ -51,7 +51,7 @@ export class BulkViewComponent implements OnInit, OnDestroy { }); } - public getDetails(entry: BulkReplay) { + public getDetails(entry: BulkResponse) { if (entry.type === 'USER') { return `Username: ${entry.details['userName']} email: ${entry.details['email']} userId: ${entry.details['userId']}` } else if (entry.type === 'DOMAIN') { @@ -61,15 +61,15 @@ export class BulkViewComponent implements OnInit, OnDestroy { } } - public getAppInstanceId(entry: BulkReplay) { + public getAppInstanceId(entry: BulkResponse) { return entry?.details['appInstanceId'] } - public getAppInstanceName(entry: BulkReplay) { + public getAppInstanceName(entry: BulkResponse) { return entry?.details['appInstanceName'] } - public getDomainCodeName(entry: BulkReplay) { + public getDomainCodeName(entry: BulkResponse) { return entry?.details['domainCodename'] || entry?.details['domainName'] } diff --git a/src/app/appmarket/bulkDeployment/domainDeployment/domainupload/domainupload.component.ts b/src/app/appmarket/bulkDeployment/domainDeployment/domainupload/domainupload.component.ts index c3290605228f21fd29e80e94d9f3f6ea6d90e57a..0e7d673719a9b3b24db2d56c69ef39f527ec3168 100644 --- a/src/app/appmarket/bulkDeployment/domainDeployment/domainupload/domainupload.component.ts +++ b/src/app/appmarket/bulkDeployment/domainDeployment/domainupload/domainupload.component.ts @@ -1,7 +1,8 @@ import {Component, OnInit} from '@angular/core'; import {AppdeploymentService} from '../../appdeployment.service'; import {Router} from '@angular/router'; -import {BulkType} from '../../../../model/bulk-replay'; +import {BulkType} from '../../../../model/bulk-response'; +import {DomainService} from '../../../../service'; @Component({ selector: 'app-domainupload', @@ -12,12 +13,15 @@ export class DomainuploadComponent implements OnInit { public showProgressBar = false; - public csvText = ''; + public csvText = '"domain","username","networks","domainGroups","email"\n' + + '"ExampleDomain","TestUser","","Lab1","email@domain.com"\n' + + '"ExampleDomain2","TestUser2","","Lab1","email2@domain.com"\n'; public errorMessage = ''; constructor(private readonly deployService: AppdeploymentService, - private router: Router) { } + private router: Router, + private domainService: DomainService) { } ngOnInit(): void { } @@ -29,7 +33,8 @@ export class DomainuploadComponent implements OnInit { this.deployService.uploadUserDomainFile(event.files[0]).subscribe( val => { console.warn("done") this.deployService.bulk = val; - if (val.type === BulkType.DOMAIN) { + this.domainService.setUpdateRequiredFlag(true); + if (val.type === BulkType.DOMAIN) { this.router.navigate(['admin/domains/bulks/', val.id]) } else { this.router.navigate(['admin/domains/deploy/summary']) @@ -49,7 +54,8 @@ export class DomainuploadComponent implements OnInit { this.deployService.uploadUserDomainFile(file).subscribe( val => { console.warn("done") this.deployService.bulk = val; - if (val.type === BulkType.DOMAIN) { + this.domainService.setUpdateRequiredFlag(true); + if (val.type === BulkType.DOMAIN) { this.router.navigate(['admin/domains/bulks/', val.id]) } else { this.router.navigate(['admin/domains/deploy/summary']) diff --git a/src/app/model/bulk-deployment.ts b/src/app/model/bulk-deployment.ts index c062ad021f244a627860fdda9306bf88807c7528..718e0c2bfb5e5d011ce37461a73ce0e24fbd5bce 100644 --- a/src/app/model/bulk-deployment.ts +++ b/src/app/model/bulk-deployment.ts @@ -1,11 +1,11 @@ import {User} from './user'; -import {BulkReplay, BulkType} from './bulk-replay'; +import {BulkResponse, BulkType} from './bulk-response'; export class BulkDeployment { public id: number; public creationDate: Date; public creator: User; - public entries: BulkReplay[] = []; + public entries: BulkResponse[] = []; public state: BulkDeploymentState; public type: BulkType; public details: Map<string, string>; diff --git a/src/app/model/bulk-replay.ts b/src/app/model/bulk-response.ts similarity index 91% rename from src/app/model/bulk-replay.ts rename to src/app/model/bulk-response.ts index eb4ce117fb9a4c06ebdea4721ed61e665d7c5945..d55a0c0e2e5299c34a36f30c9ddd5efe2a63cc46 100644 --- a/src/app/model/bulk-replay.ts +++ b/src/app/model/bulk-response.ts @@ -1,6 +1,6 @@ import {BulkDeploymentState} from './bulk-deployment'; -export class BulkReplay { +export class BulkResponse { public state: BulkDeploymentState; public created: boolean; public details: Map<string, string>;