From a559c7ee5f5d8f66dca3154621b7a42c881d5281 Mon Sep 17 00:00:00 2001 From: Jay <159848059+jayacryl@users.noreply.github.com> Date: Fri, 8 Nov 2024 15:42:03 -0500 Subject: [PATCH] feat(web-react) improved webpage title generation logic (#11773) --- datahub-web-react/src/app/search/SearchablePage.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/datahub-web-react/src/app/search/SearchablePage.tsx b/datahub-web-react/src/app/search/SearchablePage.tsx index 8a2b0b35ec31f..8e347671079b9 100644 --- a/datahub-web-react/src/app/search/SearchablePage.tsx +++ b/datahub-web-react/src/app/search/SearchablePage.tsx @@ -78,7 +78,11 @@ export const SearchablePage = ({ onSearch, onAutoComplete, children }: Props) => const formattedPath = location.pathname .split('/') .filter((word) => word !== '') - .map((word) => word.charAt(0).toUpperCase() + word.slice(1)) + .map((rawWord) => { + // ie. personal-notifications -> Personal Notifications + const words = rawWord.split('-'); + return words.map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(' '); + }) .join(' | '); if (formattedPath) {