From: Kefu Chai Date: Fri, 13 Nov 2020 10:32:18 +0000 (+0800) Subject: mgr/dashboard: use http://docs.ceph.com/en/${release}/ for the domain of the docs X-Git-Tag: v16.1.0~534^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a74f8de1c3bc3d53dc2c9a2a264698249d0d2d13;p=ceph.git mgr/dashboard: use http://docs.ceph.com/en/${release}/ for the domain of the docs * 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 Signed-off-by: Kefu Chai --- diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.spec.ts index 5694998ace4..7c3bf24dd5d 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.spec.ts @@ -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); diff --git a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.ts b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.ts index 09181f12b3c..4cbb4cf185b 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/shared/services/doc.service.ts @@ -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 = {