From 601a42988f4c5ad7a1f068c009ed8147d390ef71 Mon Sep 17 00:00:00 2001 From: Tina Kallio Date: Mon, 15 Oct 2018 20:32:42 +0200 Subject: [PATCH] mgr/dashboard: Fixed documentation link on RGW page Fixes: https://tracker.ceph.com/issues/24548 Signed-off-by: Tina Kallio --- .../ceph/rgw/rgw-501/rgw-501.component.html | 2 +- .../rgw/rgw-501/rgw-501.component.spec.ts | 3 ++- .../app/ceph/rgw/rgw-501/rgw-501.component.ts | 24 ++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html index 471bf738b709..81181c4401e9 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html @@ -1,6 +1,6 @@ {{ message }} - Please consult the documentation on how to configure and enable the Object Gateway management functionality. + Please consult the documentation on how to configure and enable the Object Gateway management functionality. diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts index 382d66f25647..75941b9e30bd 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts @@ -1,3 +1,4 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; import { ComponentFixture, TestBed } from '@angular/core/testing'; import { RouterTestingModule } from '@angular/router/testing'; @@ -11,7 +12,7 @@ describe('Rgw501Component', () => { configureTestBed({ declarations: [Rgw501Component], - imports: [RouterTestingModule, SharedModule] + imports: [HttpClientTestingModule, RouterTestingModule, SharedModule] }); beforeEach(() => { diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts index 77bea30a6be1..666ada886bc1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts @@ -1,18 +1,40 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; +import { CephReleaseNamePipe } from '../../../shared/pipes/ceph-release-name.pipe'; +import { SummaryService } from '../../../shared/services/summary.service'; + @Component({ selector: 'cd-rgw-501', templateUrl: './rgw-501.component.html', styleUrls: ['./rgw-501.component.scss'] }) export class Rgw501Component implements OnInit, OnDestroy { + docsUrl: string; message = 'The Object Gateway service is not configured.'; routeParamsSubscribe: any; - constructor(private route: ActivatedRoute) {} + constructor( + private route: ActivatedRoute, + private summaryService: SummaryService, + private cephReleaseNamePipe: CephReleaseNamePipe + ) {} ngOnInit() { + const subs = this.summaryService.subscribe((summary: any) => { + if (!summary) { + return; + } + + const releaseName = this.cephReleaseNamePipe.transform(summary.version); + this.docsUrl = `http://docs.ceph.com/docs/${releaseName}/mgr/dashboard/ + #enabling-the-object-gateway-management-frontend`; + + setTimeout(() => { + subs.unsubscribe(); + }, 0); + }); + this.routeParamsSubscribe = this.route.params.subscribe((params: { message: string }) => { this.message = params.message; }); -- 2.47.3