]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fixed documentation link on RGW page 24612/head
authorTina Kallio <tina.kallio@gmail.com>
Mon, 15 Oct 2018 18:32:42 +0000 (20:32 +0200)
committerTina Kallio <tina.kallio@gmail.com>
Thu, 18 Oct 2018 17:33:31 +0000 (19:33 +0200)
Fixes: https://tracker.ceph.com/issues/24548
Signed-off-by: Tina Kallio <tina.kallio@gmail.com>
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.html
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-501/rgw-501.component.ts

index 471bf738b7096f30376c88606f000cc5b464eba6..81181c4401e917e3273645a80af51d5f50a2346f 100644 (file)
@@ -1,6 +1,6 @@
 <cd-info-panel>
   {{ message }}
   <ng-container i18n>
-    Please consult the <a href="http://docs.ceph.com/docs/mimic/mgr/dashboard/#enabling-the-object-gateway-management-frontend" target="_blank">documentation</a> on how to configure and enable the Object Gateway management functionality.
+    Please consult the <a href="{{docsUrl}}" target="_blank">documentation</a> on how to configure and enable the Object Gateway management functionality.
   </ng-container>
 </cd-info-panel>
index 382d66f25647fe2e00c27335ee45c9741579cc45..75941b9e30bd259ff62cb291386d0849a1ceecad 100644 (file)
@@ -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(() => {
index 77bea30a6be1e6f7f35f7f96664bbbfd0b9003c9..666ada886bc1c4a44c5c2681ec0466d0bf3a89ab 100644 (file)
@@ -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;
     });