Cleanup #43375

mgr/dashboard: replace doc URL literals in TS code with

Added by Ernesto Puerta about 1 year ago. Updated 6 months ago.

Target version:
% Done:


Affected Versions:
Pull request ID:


This comes from the need to update upstream doc URLs to downstream ones. Being these literals scattered across the front-end code makes them harder to find/update/fix them.

The immediate fix would be to move these strings to a shared constants file (e.g.: shared/constants/app.constants like DocUrls static class), but given upstream URLs use Javascript template literals for pointing to the proper release (e.g.: `${releaseName}/mgr/dashboard/`), that doesn't work when the interpolated variable does not exists (now that variable is calculated live from back-end provided version). IMHO this could be easily fixed by using explicit version name in the same constant file (we cannot avoid the need of manually hardcoding the mapping between ceph versions and release names at least once).

As a result of this refactor, dashboard components (DashboardHelp, RGW, NFS, iSCSI, Grafana) would only need to point to a valid Ceph-Dashboard docs anchor ("#enabling-the-object-gateway-management-frontend", "#configuring-nfs-ganesha-in-the-dashboard", "#enabling-iscsi-management", ...).

PG Calculator link should also be extracted.

Additionally, it could be interesting to explore how to better link, integrate (and maintain) dashboard with Ceph documentation (by connecting dashboard components to Ceph docs structure, and provide help with context-sensitive or index-based searches). AFAIK most tools to integrate this into web applications are proprietary ones.

Related issues

Related to mgr - Cleanup #36565: mgr/dashboard: Extract documentation link to a component Resolved


#1 Updated by Lenz Grimmer 10 months ago

  • Tags set to low-hanging-fruit, refactoring
  • Tags deleted (low-hanging-fruit)

#2 Updated by Tiago Melo 10 months ago

  • Related to Cleanup #36565: mgr/dashboard: Extract documentation link to a component added

#3 Updated by Ernesto Puerta 8 months ago

  • Description updated (diff)

#4 Updated by Tiago Melo 6 months ago

  • Status changed from New to In Progress
  • Assignee set to Tiago Melo

#5 Updated by Tiago Melo 6 months ago

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 36396

#6 Updated by Tiago Melo 6 months ago

I added some base code for this in
ATM you only have to modify 'doc.service.ts' downstream and you get new URLs for all doc links.

If we don't want to change existing files downstream, we could also read the value os Sections and base URL from a vendor file or from env file.

#7 Updated by Lenz Grimmer 6 months ago

  • Status changed from Fix Under Review to Resolved
  • Target version set to v16.0.0

Also available in: Atom PDF