From 6a52c50c39084a7ce3116cdbce4eb0cdde0eb2bf Mon Sep 17 00:00:00 2001 From: jayacryl <159848059+jayacryl@users.noreply.github.com> Date: Thu, 31 Oct 2024 18:42:45 -0400 Subject: [PATCH] feat(web-react) improved title logic --- 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) {