]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: use http://docs.ceph.com/en/${release}/ for the domain of the docs 38061/head
authorKefu Chai <kchai@redhat.com>
Fri, 13 Nov 2020 10:32:18 +0000 (18:32 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 20 Nov 2020 02:31:07 +0000 (10:31 +0800)
* use the URL of RTD, where the locale is encoded in it.
* s/http/https/
* add test accordingly

Fixes: https://tracker.ceph.com/issues/48012
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.ts

index 5694998ace4e98d885dc610b9222f7b10444e112..7c3bf24dd5d96b5874635e495eacce2fa5ed6b15 100644 (file)
@@ -22,7 +22,13 @@ describe('DocService', () => {
 
   it('should return full URL', () => {
     expect(service.urlGenerator('iscsi', 'foo')).toBe(
-      'http://docs.ceph.com/docs/foo/mgr/dashboard/#enabling-iscsi-management'
+      'https://docs.ceph.com/en/foo/mgr/dashboard/#enabling-iscsi-management'
+    );
+  });
+
+  it('should return latest version URL for master', () => {
+    expect(service.urlGenerator('orch', 'master')).toBe(
+      'https://docs.ceph.com/en/latest/mgr/orchestrator'
     );
   });
 
@@ -60,7 +66,7 @@ describe('DocService', () => {
 
       nextSummary('foo');
       expect(result).toEqual(
-        'http://docs.ceph.com/docs/foo/mgr/dashboard/#enabling-prometheus-alerting'
+        'https://docs.ceph.com/en/foo/mgr/dashboard/#enabling-prometheus-alerting'
       );
       expect(i).toBe(1);
       expect(subscriber.closed).toBe(true);
index 09181f12b3c75c80619421c24139e5a131ed6e73..4cbb4cf185b38ae5347e3b2c315ca63819171578 100644 (file)
@@ -24,7 +24,8 @@ export class DocService {
   }
 
   urlGenerator(section: string, release = 'master'): string {
-    const domain = `http://docs.ceph.com/docs/${release}/`;
+    const docVersion = release === 'master' ? 'latest' : release;
+    const domain = `https://docs.ceph.com/en/${docVersion}/`;
     const domainCeph = `https://ceph.io/`;
 
     const sections = {