Project

General

Profile

Cleanup #43375

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

Added by Ernesto Puerta 9 months ago. Updated about 2 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
dashboard/general
Target version:
% Done:

0%

Tags:
Backport:
nautilus
Reviewed:
Affected Versions:
Pull request ID:

Description

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.: `http://docs.ceph.com/docs/${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

History

#1 Updated by Lenz Grimmer 6 months ago

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

#2 Updated by Tiago Melo 6 months ago

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

#3 Updated by Ernesto Puerta 4 months ago

  • Description updated (diff)

#4 Updated by Tiago Melo about 2 months ago

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

#5 Updated by Tiago Melo about 2 months ago

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

#6 Updated by Tiago Melo about 2 months ago

I added some base code for this in https://github.com/ceph/ceph/pull/36396.
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 about 2 months ago

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

Also available in: Atom PDF