diff --git a/src/app/applications/application.model/application.model.ts b/src/app/applications/application.model/application.model.ts index 02719a8904..85e373535e 100644 --- a/src/app/applications/application.model/application.model.ts +++ b/src/app/applications/application.model/application.model.ts @@ -168,6 +168,10 @@ export class Application { return this.project_application_statuses?.includes(Application_States.SUBMITTED); } + public isMigrated(): boolean { + return this.migrate_to_simple_vm || this.migrated_simple_vm_resources; + } + public hasTerminatedStatus(): boolean { return this.project_application_statuses?.includes(Application_States.TERMINATED); } diff --git a/src/app/pipe-module/pipe-module.module.ts b/src/app/pipe-module/pipe-module.module.ts index fd2eff008f..37ae004611 100644 --- a/src/app/pipe-module/pipe-module.module.ts +++ b/src/app/pipe-module/pipe-module.module.ts @@ -15,6 +15,7 @@ import { IsFutureTimePipe } from './pipes/futureTime.pipe'; import { IsMigratedProjectIdPipe } from './pipes/migratedList'; import { HasStatusNotInListPipe } from './pipes/has-status-not-in-list.pipe'; import { SignificancePipe } from '../shared/shared_modules/components/maintenance-notification/significance-pipe/significance.pipe'; +import { IsMigratedProjectPipe } from './pipes/isMigratedProject'; /** * Pipemodule @@ -39,6 +40,7 @@ import { SignificancePipe } from '../shared/shared_modules/components/maintenanc IsMigratedProjectIdPipe, HasStatusNotInListPipe, SignificancePipe, + IsMigratedProjectPipe, ], exports: [ FlavorCounterPipe, @@ -59,8 +61,9 @@ import { SignificancePipe } from '../shared/shared_modules/components/maintenanc IsMigratedProjectIdPipe, HasStatusNotInListPipe, SignificancePipe, + IsMigratedProjectPipe, ], imports: [CommonModule], - providers: [IsMigratedProjectIdPipe], + providers: [], }) export class PipeModuleModule {} diff --git a/src/app/pipe-module/pipes/isMigratedProject.ts b/src/app/pipe-module/pipes/isMigratedProject.ts new file mode 100644 index 0000000000..9b5d2feae7 --- /dev/null +++ b/src/app/pipe-module/pipes/isMigratedProject.ts @@ -0,0 +1,14 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { Application } from 'app/applications/application.model/application.model'; + +/** + * Pipe which returns whether a certain project is migrated or marked for migration to SimpleVM-Platform. + */ +@Pipe({ + name: 'isMigratedProject', +}) +export class IsMigratedProjectPipe implements PipeTransform { + transform(projectApplication: Application) { + return projectApplication.isMigrated(); + } +} diff --git a/src/app/pipe-module/pipes/migratedList.ts b/src/app/pipe-module/pipes/migratedList.ts index ee19a0ec9b..ad5101081b 100644 --- a/src/app/pipe-module/pipes/migratedList.ts +++ b/src/app/pipe-module/pipes/migratedList.ts @@ -1,7 +1,7 @@ import { Pipe, PipeTransform } from '@angular/core'; /** - * Pipe which returns counter of flavors. + * Pipe which returns whether a project id belongs to a migrated project or not. */ @Pipe({ name: 'isMigratedProjectId', diff --git a/src/app/projectmanagement/overview.component.html b/src/app/projectmanagement/overview.component.html index 8846893e91..26bf300cd8 100644 --- a/src/app/projectmanagement/overview.component.html +++ b/src/app/projectmanagement/overview.component.html @@ -403,11 +403,17 @@