From 783954bed249f77fd123264ab3a83c6a62b8574b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Avelino?= Date: Tue, 11 Jun 2019 12:30:10 -0300 Subject: [PATCH] org/space quota: reusing styling and minor changes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: VĂ­tor Avelino --- .../cloud-foundry/cloud-foundry.routing.ts | 2 +- .../quota-definition-base.component.scss | 24 ++++ .../quota-definition-base.component.ts | 95 +++++++++++++ .../quota-definition.component.html | 20 +-- .../quota-definition.component.scss | 25 ---- .../quota-definition.component.ts | 89 +++++------- .../cloud-foundry-organization.service.ts | 5 +- .../services/cloud-foundry-space.service.ts | 10 +- .../space-quota-definition.component.html | 84 +++++------- .../space-quota-definition.component.scss | 3 - .../space-quota-definition.component.ts | 127 +++++------------- .../cloud-foundry-space-base.component.ts | 14 +- .../card-cf-org-user-details.component.html | 2 +- .../card-cf-space-details.component.html | 4 +- 14 files changed, 247 insertions(+), 257 deletions(-) create mode 100644 src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.scss create mode 100644 src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.ts diff --git a/src/frontend/packages/core/src/features/cloud-foundry/cloud-foundry.routing.ts b/src/frontend/packages/core/src/features/cloud-foundry/cloud-foundry.routing.ts index cd26d17164..472dd16d90 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/cloud-foundry.routing.ts +++ b/src/frontend/packages/core/src/features/cloud-foundry/cloud-foundry.routing.ts @@ -75,8 +75,8 @@ import { CloudFoundryStacksComponent } from './tabs/cloud-foundry-stacks/cloud-f import { CloudFoundrySummaryTabComponent } from './tabs/cloud-foundry-summary-tab/cloud-foundry-summary-tab.component'; import { CloudFoundryUsersComponent } from './tabs/cloud-foundry-users/cloud-foundry-users.component'; import { InviteUsersComponent } from './users/invite-users/invite-users.component'; -import { RemoveUserComponent } from './users/remove-user/remove-user.component'; import { UsersRolesComponent } from './users/manage-users/manage-users.component'; +import { RemoveUserComponent } from './users/remove-user/remove-user.component'; /* tslint:enable:max-line-length */ diff --git a/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.scss b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.scss new file mode 100644 index 0000000000..777f33b959 --- /dev/null +++ b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.scss @@ -0,0 +1,24 @@ +.quota-definition-base { + &__name-sub-text { + font-size: 14px; + opacity: .6; + } + &__title { + margin: 10px 0; + } + &__name { + margin: 0; + } + &__section-header { + margin: 10px 0; + opacity: .6; + } + &__basic-services { + display: flex; + margin: 8px 0; + } + &__basic-services-label { + margin-right: 10px; + opacity: .6; + } +} diff --git a/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.ts b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.ts new file mode 100644 index 0000000000..28f85e4c76 --- /dev/null +++ b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition-base/quota-definition-base.component.ts @@ -0,0 +1,95 @@ +import { ActivatedRoute } from '@angular/router'; +import { Store } from '@ngrx/store'; +import { combineLatest, Observable, of, Subscription } from 'rxjs'; +import { first, map } from 'rxjs/operators'; + +import { GetOrganization } from '../../../../../store/src/actions/organization.actions'; +import { GetSpace } from '../../../../../store/src/actions/space.actions'; +import { AppState } from '../../../../../store/src/app-state'; +import { entityFactory, organizationSchemaKey, spaceSchemaKey } from '../../../../../store/src/helpers/entity-factory'; +import { endpointEntitiesSelector } from '../../../../../store/src/selectors/endpoint.selectors'; +import { APIResource } from '../../../../../store/src/types/api.types'; +import { EndpointModel } from '../../../../../store/src/types/endpoint.types'; +import { IOrganization, IQuotaDefinition, ISpace } from '../../../core/cf-api.types'; +import { EntityServiceFactory } from '../../../core/entity-service-factory.service'; +import { IHeaderBreadcrumb } from '../../../shared/components/page-header/page-header.types'; +import { ActiveRouteCfOrgSpace } from '../cf-page.types'; + +export class QuotaDefinitionBaseComponent { + breadcrumbs$: Observable; + quotaDefinition$: Observable>; + org$: Observable>; + space$: Observable>; + cfGuid: string; + orgGuid: string; + spaceGuid: string; + quotaGuid: string; + detailsLoading$: Observable; + orgSubscriber: Subscription; + + constructor( + protected entityServiceFactory: EntityServiceFactory, + protected store: Store, + protected activeRouteCfOrgSpace: ActiveRouteCfOrgSpace, + protected activatedRoute: ActivatedRoute, + ) { + this.cfGuid = activeRouteCfOrgSpace.cfGuid; + this.orgGuid = activeRouteCfOrgSpace.orgGuid || activatedRoute.snapshot.queryParams.orgGuid; + this.spaceGuid = activeRouteCfOrgSpace.spaceGuid || activatedRoute.snapshot.queryParams.spaceGuid; + this.quotaGuid = activatedRoute.snapshot.params.quotaId || activatedRoute.snapshot.queryParams.quotaGuid; + this.setupOrgObservable(); + this.setupSpaceObservable(); + this.setupBreadcrumbs(); + } + + setupOrgObservable() { + if (this.orgGuid) { + this.org$ = this.entityServiceFactory.create>( + organizationSchemaKey, + entityFactory(organizationSchemaKey), + this.orgGuid, + new GetOrganization(this.orgGuid, this.cfGuid), + true + ).waitForEntity$.pipe( + map(data => data.entity), + ); + } + } + + setupSpaceObservable() { + if (this.spaceGuid) { + this.space$ = this.entityServiceFactory.create>( + spaceSchemaKey, + entityFactory(spaceSchemaKey), + this.spaceGuid, + new GetSpace(this.spaceGuid, this.cfGuid), + true + ).waitForEntity$.pipe( + map(data => data.entity), + ); + } + } + + private setupBreadcrumbs() { + const endpoints$ = this.store.select(endpointEntitiesSelector); + const org$ = this.org$ ? this.org$ : of(null); + const space$ = this.space$ ? this.space$ : of(null); + this.breadcrumbs$ = combineLatest(endpoints$, org$, space$).pipe( + map(([endpoints, org, space]) => this.getBreadcrumbs(endpoints[this.cfGuid], org, space)), + first() + ); + } + + protected setupQuotaDefinitionObservable() { + throw new Error('Method not implemented.'); + } + + protected getBreadcrumbs( + endpoint: EndpointModel, + org: APIResource, + space: APIResource + ) { + throw new Error('Method not implemented.'); + return null; + } +} diff --git a/src/frontend/packages/core/src/features/cloud-foundry/quota-definition/quota-definition.component.html b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition/quota-definition.component.html index aca711b2c9..eca680fa15 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/quota-definition/quota-definition.component.html +++ b/src/frontend/packages/core/src/features/cloud-foundry/quota-definition/quota-definition.component.html @@ -2,19 +2,19 @@

{{ (quotaDefinition$ | async)?.entity?.name }}

-
+
-
name
-

{{ quotaDefinition.entity.name }}

-
-
Non Basic Services Allowed:
+
Name
+

{{ quotaDefinition.entity.name }}

+
+
Non Basic Services Allowed:
-

Quota Limits

-

Memory

+

Quota Limits

+

Memory

Memory -

Application

+

Application

Application -

Service

+

Service

Service -

Routes & Domains

+

Routes & Domains

; quotaDefinition$: Observable>; org$: Observable>; + space$: Observable>; cfGuid: string; orgGuid: string; spaceGuid: string; @@ -47,33 +37,15 @@ export class QuotaDefinitionComponent { orgSubscriber: Subscription; constructor( - private activeRouteCfOrgSpace: ActiveRouteCfOrgSpace, - private entityServiceFactory: EntityServiceFactory, - private store: Store, + protected entityServiceFactory: EntityServiceFactory, + protected store: Store, + activeRouteCfOrgSpace: ActiveRouteCfOrgSpace, activatedRoute: ActivatedRoute, ) { - this.cfGuid = activeRouteCfOrgSpace.cfGuid; - this.orgGuid = activeRouteCfOrgSpace.orgGuid || activatedRoute.snapshot.queryParams.orgGuid; - this.quotaGuid = activatedRoute.snapshot.params.quotaId; - this.setupOrgObservable(); - this.setupBreadcrumbs(); + super(entityServiceFactory, store, activeRouteCfOrgSpace, activatedRoute); this.setupQuotaDefinitionObservable(); } - setupOrgObservable() { - if (this.orgGuid) { - this.org$ = this.entityServiceFactory.create>( - organizationSchemaKey, - entityFactory(organizationSchemaKey), - this.orgGuid, - new GetOrganization(this.orgGuid, this.cfGuid), - true - ).waitForEntity$.pipe( - map(data => data.entity), - ); - } - } - setupQuotaDefinitionObservable() { const quotaGuid$ = this.quotaGuid ? of(this.quotaGuid) : this.org$.pipe(map(org => org.entity.quota_definition_guid)); const entityInfo$ = quotaGuid$.pipe( @@ -83,9 +55,9 @@ export class QuotaDefinitionComponent { entityFactory(quotaDefinitionSchemaKey), quotaGuid, new GetQuotaDefinition(quotaGuid, this.cfGuid), - ).entityObs$ - ) + ).entityObs$) ); + this.quotaDefinition$ = entityInfo$.pipe( filter(definition => !!definition && !!definition.entity), map(definition => definition.entity) @@ -96,20 +68,12 @@ export class QuotaDefinitionComponent { ); } - private setupBreadcrumbs() { - const endpoints$ = this.store.select(endpointEntitiesSelector); - const org$ = this.org$ ? this.org$ : of(null); - this.breadcrumbs$ = combineLatest(endpoints$, org$).pipe( - map(([endpoints, org]) => this.getBreadcrumbs(endpoints[this.cfGuid], org)), - first() - ); - } - - private getBreadcrumbs( + protected getBreadcrumbs( endpoint: EndpointModel, - org: APIResource + org: APIResource, + space: APIResource ) { - const baseCFUrl = `/cloud-foundry/${this.activeRouteCfOrgSpace.cfGuid}`; + const baseCFUrl = `/cloud-foundry/${this.cfGuid}`; const breadcrumbs: IHeaderBreadcrumb[] = [{ breadcrumbs: [ @@ -127,6 +91,19 @@ export class QuotaDefinitionComponent { { value: org.entity.name, routerLink: `${baseOrgUrl}/summary` }, ] }); + + if (space) { + const baseSpaceUrl = `${baseCFUrl}/organizations/${org.metadata.guid}/spaces/${space.metadata.guid}`; + + breadcrumbs.push({ + key: 'space', + breadcrumbs: [ + { value: endpoint.name, routerLink: `${baseCFUrl}/organizations` }, + { value: org.entity.name, routerLink: `${baseOrgUrl}/spaces` }, + { value: space.entity.name, routerLink: `${baseSpaceUrl}/summary` }, + ] + }); + } } return breadcrumbs; diff --git a/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-organization.service.ts b/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-organization.service.ts index 6ab652185d..71392e3ab5 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-organization.service.ts +++ b/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-organization.service.ts @@ -184,8 +184,9 @@ export class CloudFoundryOrganizationService { return quotaDefinition && [ '/cloud-foundry', this.cfGuid, - 'quota-definitions', - quotaDefinition.metadata.guid + 'organizations', + this.orgGuid, + 'quota' ]; })); } diff --git a/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-space.service.ts b/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-space.service.ts index 7c272f4b2f..6c893509df 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-space.service.ts +++ b/src/frontend/packages/core/src/features/cloud-foundry/services/cloud-foundry-space.service.ts @@ -162,8 +162,9 @@ export class CloudFoundrySpaceService { return [ '/cloud-foundry', this.cfGuid, - 'quota-definitions', - quota.guid + 'organizations', + this.orgGuid, + 'quota', ]; } @@ -172,8 +173,9 @@ export class CloudFoundrySpaceService { this.cfGuid, 'organizations', this.orgGuid, - 'space-quota-definitions', - quota.guid + 'space', + this.spaceGuid, + 'space-quota' ]; } ) diff --git a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.html b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.html index 0ae3f3a5c1..ebe3e942ea 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.html +++ b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.html @@ -1,93 +1,73 @@ -

{{ (spaceQuotaDefinition$ | async)?.entity?.name }}

+

{{ (quotaDefinition$ | async)?.entity?.name }}

-
+
+
Name
+

{{ quotaDefinition.entity.name }}

+
+
Non Basic Services Allowed:
+ + +
+

Quota Limits

+

Memory

-

Space

-
-
- - - - + - - - - - -

Applications

+ +
+

Application

- - - - - + - + +

Service

-

Services

-
-
- - - - + - + - - - - - - - - -

Routes

-
+

Routes

- + - + -
-
+
\ No newline at end of file diff --git a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.scss b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.scss index dbaeeca5c3..e69de29bb2 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.scss +++ b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.scss @@ -1,3 +0,0 @@ -h4 { - margin: 0; -} \ No newline at end of file diff --git a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.ts b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.ts index 1684825c26..ffed979e1f 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.ts +++ b/src/frontend/packages/core/src/features/cloud-foundry/space-quota-definition/space-quota-definition.component.ts @@ -1,43 +1,30 @@ -import { Component, OnDestroy } from '@angular/core'; +import { Component } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Store } from '@ngrx/store'; -import { combineLatest, Observable, of, Subscription } from 'rxjs'; -import { filter, first, map, startWith } from 'rxjs/operators'; +import { Observable, of, Subscription } from 'rxjs'; +import { filter, first, map, switchMap } from 'rxjs/operators'; -import { GetOrganization } from '../../../../../store/src/actions/organization.actions'; import { GetSpaceQuotaDefinition } from '../../../../../store/src/actions/quota-definitions.actions'; -import { GetSpace } from '../../../../../store/src/actions/space.actions'; import { AppState } from '../../../../../store/src/app-state'; -import { - entityFactory, - organizationSchemaKey, - spaceQuotaSchemaKey, - spaceSchemaKey, -} from '../../../../../store/src/helpers/entity-factory'; -import { endpointEntitiesSelector } from '../../../../../store/src/selectors/endpoint.selectors'; +import { entityFactory, spaceQuotaSchemaKey } from '../../../../../store/src/helpers/entity-factory'; import { APIResource } from '../../../../../store/src/types/api.types'; import { EndpointModel } from '../../../../../store/src/types/endpoint.types'; import { IOrganization, IQuotaDefinition, ISpace } from '../../../core/cf-api.types'; import { EntityServiceFactory } from '../../../core/entity-service-factory.service'; import { IHeaderBreadcrumb } from '../../../shared/components/page-header/page-header.types'; -import { CfUserService } from '../../../shared/data-services/cf-user.service'; import { ActiveRouteCfOrgSpace } from '../cf-page.types'; import { getActiveRouteCfOrgSpaceProvider } from '../cf.helpers'; -import { CloudFoundryEndpointService } from '../services/cloud-foundry-endpoint.service'; -import { CloudFoundryOrganizationService } from '../services/cloud-foundry-organization.service'; +import { QuotaDefinitionBaseComponent } from '../quota-definition-base/quota-definition-base.component'; @Component({ selector: 'app-space-quota-definition', - styleUrls: ['./space-quota-definition.component.scss'], + styleUrls: ['../quota-definition-base/quota-definition-base.component.scss', './space-quota-definition.component.scss'], templateUrl: './space-quota-definition.component.html', providers: [ - getActiveRouteCfOrgSpaceProvider, - CfUserService, - CloudFoundryEndpointService, - CloudFoundryOrganizationService + getActiveRouteCfOrgSpaceProvider ] }) -export class SpaceQuotaDefinitionComponent implements OnDestroy { +export class SpaceQuotaDefinitionComponent extends QuotaDefinitionBaseComponent { breadcrumbs$: Observable; spaceQuotaDefinition$: Observable>; cfGuid: string; @@ -48,96 +35,52 @@ export class SpaceQuotaDefinitionComponent implements OnDestroy { spaceSubscriber: Subscription; constructor( - private activeRouteCfOrgSpace: ActiveRouteCfOrgSpace, - private entityServiceFactory: EntityServiceFactory, - private store: Store, + protected entityServiceFactory: EntityServiceFactory, + protected store: Store, + activeRouteCfOrgSpace: ActiveRouteCfOrgSpace, activatedRoute: ActivatedRoute, ) { - this.cfGuid = activeRouteCfOrgSpace.cfGuid; - this.orgGuid = activeRouteCfOrgSpace.orgGuid; - this.spaceGuid = activeRouteCfOrgSpace.spaceGuid || activatedRoute.snapshot.queryParams.spaceGuid; - this.quotaGuid = activatedRoute.snapshot.params.quotaId; - - this.buildBreadcrumbs(); - this.fetchQuotaDefinition(); - } - - ngOnDestroy(): void { - if (this.spaceSubscriber) { - this.spaceSubscriber.unsubscribe(); - } - } - - fetchOrg() { - return this.entityServiceFactory.create>( - organizationSchemaKey, - entityFactory(organizationSchemaKey), - this.orgGuid, - new GetOrganization(this.orgGuid, this.cfGuid), - true - ).waitForEntity$.pipe( - map(data => data.entity), - ); + super(entityServiceFactory, store, activeRouteCfOrgSpace, activatedRoute); + this.setupQuotaDefinitionObservable(); } - fetchSpace() { - return this.entityServiceFactory.create>( - spaceSchemaKey, - entityFactory(spaceSchemaKey), - this.spaceGuid, - new GetSpace(this.spaceGuid, this.cfGuid), - true - ).waitForEntity$.pipe( - map(data => data.entity), - ); - } - - fetchQuotaDefinition() { - const quotaSpace = { entity: { space_quota_definition_guid: this.quotaGuid } }; - const obs$: Observable = this.quotaGuid ? of(quotaSpace) : this.fetchSpace(); - this.spaceSubscriber = obs$.subscribe((space) => { - this.spaceQuotaDefinition$ = this.entityServiceFactory.create>( + setupQuotaDefinitionObservable() { + const quotaGuid$ = this.quotaGuid ? of(this.quotaGuid) : this.space$.pipe(map(space => space.entity.space_quota_definition_guid)); + const entityInfo$ = quotaGuid$.pipe( + first(), + switchMap(quotaGuid => this.entityServiceFactory.create>( spaceQuotaSchemaKey, entityFactory(spaceQuotaSchemaKey), - space.entity.space_quota_definition_guid, - new GetSpaceQuotaDefinition(space.entity.space_quota_definition_guid, this.cfGuid), - ).waitForEntity$.pipe( - map(data => data.entity), - ); - this.detailsLoading$ = this.spaceQuotaDefinition$.pipe( - filter(data => !!data.entity), - map(() => false), - startWith(true) - ); - }); - } + quotaGuid, + new GetSpaceQuotaDefinition(quotaGuid, this.cfGuid), + ).entityObs$) + ); - private buildBreadcrumbs() { - const endpoints$ = this.store.select(endpointEntitiesSelector); - const org$ = this.fetchOrg(); - this.breadcrumbs$ = combineLatest(endpoints$, org$).pipe( - map(([endpoints, org]) => { - return this.getBreadcrumbs( - endpoints[this.cfGuid], - org - ); - }), - first() + this.quotaDefinition$ = entityInfo$.pipe( + filter(definition => !!definition && !!definition.entity), + map(definition => definition.entity) + ); + this.detailsLoading$ = entityInfo$.pipe( + filter(definition => !!definition), + map(definition => definition.entityRequestInfo.fetching) ); } - private getBreadcrumbs( + protected getBreadcrumbs( endpoint: EndpointModel, org: APIResource, + space: APIResource ) { - const baseCFUrl = `/cloud-foundry/${this.activeRouteCfOrgSpace.cfGuid}`; + const baseCFUrl = `/cloud-foundry/${this.cfGuid}`; const baseOrgUrl = `${baseCFUrl}/organizations/${org.metadata.guid}`; + const baseSpaceUrl = `${baseOrgUrl}/spaces/${space.metadata.guid}`; const breadcrumbs: IHeaderBreadcrumb[] = [ { breadcrumbs: [ { value: endpoint.name, routerLink: `${baseCFUrl}/organizations` }, - { value: org.entity.name, routerLink: `${baseOrgUrl}/space-quota-definitions` }, + { value: org.entity.name, routerLink: `${baseOrgUrl}/spaces` }, + { value: space.entity.name, routerLink: `${baseSpaceUrl}/summary` }, ], }, ]; diff --git a/src/frontend/packages/core/src/features/cloud-foundry/tabs/cloud-foundry-organizations/cloud-foundry-organization-spaces/cloud-foundry-space-base/cloud-foundry-space-base.component.ts b/src/frontend/packages/core/src/features/cloud-foundry/tabs/cloud-foundry-organizations/cloud-foundry-organization-spaces/cloud-foundry-space-base/cloud-foundry-space-base.component.ts index 9fa92400bc..ba95939bb4 100644 --- a/src/frontend/packages/core/src/features/cloud-foundry/tabs/cloud-foundry-organizations/cloud-foundry-organization-spaces/cloud-foundry-space-base/cloud-foundry-space-base.component.ts +++ b/src/frontend/packages/core/src/features/cloud-foundry/tabs/cloud-foundry-organizations/cloud-foundry-organization-spaces/cloud-foundry-space-base/cloud-foundry-space-base.component.ts @@ -1,6 +1,6 @@ import { Component, OnDestroy } from '@angular/core'; import { Store } from '@ngrx/store'; -import { combineLatest, Observable, Subscription } from 'rxjs'; +import { combineLatest, Observable, of, Subscription } from 'rxjs'; import { first, map, tap } from 'rxjs/operators'; import { RouterNav } from '../../../../../../../../store/src/actions/router.actions'; @@ -88,6 +88,7 @@ export class CloudFoundrySpaceBaseComponent implements OnDestroy { public schema = entityFactory(spaceSchemaKey); private deleteRedirectSub: Subscription; + private quotaLinkSub: Subscription; public extensionActions: StratosActionMetadata[] = getActionsFromExtensions(StratosActionType.CloudFoundryOrg); @@ -134,16 +135,11 @@ export class CloudFoundrySpaceBaseComponent implements OnDestroy { private setupLinks() { this.quotaLinkSub = this.cfSpaceService.space$.pipe( tap((space) => { - let link = 'space-quota'; - - if (!space.entity.entity.space_quota_definition) { - link = 'quota'; - } - this.tabLinks.push({ - link, + link: 'space-quota', label: 'Quota', - matIcon: 'data_usage' + matIcon: 'data_usage', + hidden: of(!space.entity.entity.space_quota_definition) }); this.tabLinks = this.tabLinks.concat(getTabsFromExtensions(StratosTabType.CloudFoundrySpace)); }), diff --git a/src/frontend/packages/core/src/shared/components/cards/card-cf-org-user-details/card-cf-org-user-details.component.html b/src/frontend/packages/core/src/shared/components/cards/card-cf-org-user-details/card-cf-org-user-details.component.html index ad49653594..70380240fc 100644 --- a/src/frontend/packages/core/src/shared/components/cards/card-cf-org-user-details/card-cf-org-user-details.component.html +++ b/src/frontend/packages/core/src/shared/components/cards/card-cf-org-user-details/card-cf-org-user-details.component.html @@ -10,7 +10,7 @@ {{ (cfOrgService.userOrgRole$ | async) }} - + {{ (cfOrgService.quotaDefinition$ | async)?.name }} diff --git a/src/frontend/packages/core/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.html b/src/frontend/packages/core/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.html index 14fa57933a..3cd1a6a8e7 100644 --- a/src/frontend/packages/core/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.html +++ b/src/frontend/packages/core/src/shared/components/cards/card-cf-space-details/card-cf-space-details.component.html @@ -12,14 +12,14 @@ - + {{ spaceQuotaDefinition.name }} None assigned (showing - organization's {{ quotaDefinition.name }}) + organization's {{ quotaDefinition.name }})