diff --git a/datahub-web-react/src/CustomThemeProvider.tsx b/datahub-web-react/src/CustomThemeProvider.tsx index fc0b091b7723fe..4b547030aca41d 100644 --- a/datahub-web-react/src/CustomThemeProvider.tsx +++ b/datahub-web-react/src/CustomThemeProvider.tsx @@ -1,7 +1,6 @@ import React, { useState } from 'react'; import { ThemeProvider } from 'styled-components'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; import { useCustomThemeId } from '@app/useSetAppTheme'; import themes from '@conf/theme/themes'; import { Theme } from '@conf/theme/types'; @@ -12,12 +11,9 @@ interface Props { } const CustomThemeProvider = ({ children }: Props) => { - // Note: AppConfigContext not provided yet, so both of these calls rely on the DEFAULT_APP_CONFIG - const isThemeV2 = useIsThemeV2(); const customThemeId = useCustomThemeId(); - // Note: If custom theme id is a json file, it will only be loaded later in useSetAppTheme - const defaultTheme = isThemeV2 ? themes.themeV2 : themes.themeV1; + const defaultTheme = themes.themeV2; const customTheme = customThemeId ? themes[customThemeId] : null; const [theme, setTheme] = useState(customTheme ?? defaultTheme); diff --git a/datahub-web-react/src/app/ProtectedRoutes.tsx b/datahub-web-react/src/app/ProtectedRoutes.tsx index 3cadb9c1d3e4b1..e69cd36f51021b 100644 --- a/datahub-web-react/src/app/ProtectedRoutes.tsx +++ b/datahub-web-react/src/app/ProtectedRoutes.tsx @@ -6,7 +6,6 @@ import styled from 'styled-components'; import DataHubTitle from '@app/DataHubTitle'; import EmbedRoutes from '@app/EmbedRoutes'; import { SearchRoutes } from '@app/SearchRoutes'; -import { HomePage } from '@app/home/HomePage'; import { HomePage as HomePageV2 } from '@app/homeV2/HomePage'; import { IntroduceYourself } from '@app/homeV2/introduce/IntroduceYourself'; import { useSetUserPersona } from '@app/homeV2/persona/useUserPersona'; @@ -14,7 +13,7 @@ import { HomePage as HomePageV3 } from '@app/homeV3/HomePage'; import { useShowHomePageRedesign } from '@app/homeV3/context/hooks/useShowHomePageRedesign'; import { useSetUserTitle } from '@app/identity/user/useUserTitle'; import { OnboardingContextProvider } from '@app/onboarding/OnboardingContextProvider'; -import { useIsThemeV2, useSetThemeIsV2 } from '@app/useIsThemeV2'; +import { useSetThemeIsV2 } from '@app/useIsThemeV2'; import { useSetAppTheme } from '@app/useSetAppTheme'; import { useSetNavBarRedesignEnabled } from '@app/useShowNavBarRedesign'; import { NEW_ROUTE_MAP, PageRoutes } from '@conf/Global'; @@ -34,16 +33,9 @@ export const ProtectedRoutes = (): JSX.Element => { useSetUserTitle(); useSetNavBarRedesignEnabled(); - const isThemeV2 = useIsThemeV2(); const showHomepageRedesign = useShowHomePageRedesign(); + const FinalHomePage = showHomepageRedesign ? HomePageV3 : HomePageV2; - let FinalHomePage; - - if (isThemeV2) { - FinalHomePage = showHomepageRedesign ? HomePageV3 : HomePageV2; - } else { - FinalHomePage = HomePage; - } const location = useLocation(); const history = useHistory(); @@ -57,7 +49,7 @@ export const ProtectedRoutes = (): JSX.Element => { return ( - + } /> } /> diff --git a/datahub-web-react/src/app/SearchRoutes.tsx b/datahub-web-react/src/app/SearchRoutes.tsx index dbb741782a5f93..8fc2e9c27518e7 100644 --- a/datahub-web-react/src/app/SearchRoutes.tsx +++ b/datahub-web-react/src/app/SearchRoutes.tsx @@ -6,22 +6,14 @@ import { ManageApplications } from '@app/applications/ManageApplications'; import { BrowseResultsPage } from '@app/browse/BrowseResultsPage'; import { BusinessAttributes } from '@app/businessAttribute/BusinessAttributes'; import { useUserContext } from '@app/context/useUserContext'; -import DomainRoutes from '@app/domain/DomainRoutes'; -import { ManageDomainsPage } from '@app/domain/ManageDomainsPage'; import DomainRoutesV2 from '@app/domainV2/DomainRoutes'; import { ManageDomainsPage as ManageDomainsPageV2 } from '@app/domainV2/ManageDomainsPage'; -import { EntityPage } from '@app/entity/EntityPage'; import { EntityPage as EntityPageV2 } from '@app/entityV2/EntityPage'; -import GlossaryRoutes from '@app/glossary/GlossaryRoutes'; import GlossaryRoutesV2 from '@app/glossaryV2/GlossaryRoutes'; import StructuredProperties from '@app/govern/structuredProperties/StructuredProperties'; -import { ManageIngestionPage } from '@app/ingest/ManageIngestionPage'; import { ManageIngestionPage as ManageIngestionPageV2 } from '@app/ingestV2/ManageIngestionPage'; -import { SearchPage } from '@app/search/SearchPage'; -import { SearchablePage } from '@app/search/SearchablePage'; import { SearchPage as SearchPageV2 } from '@app/searchV2/SearchPage'; import { SearchablePage as SearchablePageV2 } from '@app/searchV2/SearchablePage'; -import { SettingsPage } from '@app/settings/SettingsPage'; import { SettingsPage as SettingsPageV2 } from '@app/settingsV2/SettingsPage'; import { NoPageFound } from '@app/shared/NoPageFound'; import { ManageTags } from '@app/tags/ManageTags'; @@ -32,7 +24,6 @@ import { useIsNestedDomainsEnabled, } from '@app/useAppConfig'; import { useEntityRegistry } from '@app/useEntityRegistry'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; import { PageRoutes } from '@conf/Global'; /** @@ -46,8 +37,6 @@ export const SearchRoutes = (): JSX.Element => { ? entityRegistry.getEntitiesForSearchRoutes() : entityRegistry.getNonGlossaryEntities(); const { config, loaded } = useAppConfig(); - const isThemeV2 = useIsThemeV2(); - const FinalSearchablePage = isThemeV2 ? SearchablePageV2 : SearchablePage; const businessAttributesFlag = useBusinessAttributesFlag(); const appConfigContextLoaded = useIsAppConfigContextLoaded(); @@ -64,25 +53,16 @@ export const SearchRoutes = (): JSX.Element => { const showAnalytics = (config?.analyticsConfig?.enabled && me && me?.platformPrivileges?.viewAnalytics) || false; return ( - + {entities.map((entity) => ( - isThemeV2 ? ( - - ) : ( - - ) - } + render={() => } /> ))} - (isThemeV2 ? : )} - /> + } /> } /> {showTags ? } /> : null} } /> @@ -97,27 +77,13 @@ export const SearchRoutes = (): JSX.Element => { /> } /> } /> - {isNestedDomainsEnabled && ( - (isThemeV2 ? : )} - /> - )} - {!isNestedDomainsEnabled && ( - (isThemeV2 ? : )} - /> - )} + {isNestedDomainsEnabled && } />} + {!isNestedDomainsEnabled && } />} - {!showIngestV2 && } />} {showIngestV2 && } />} - (isThemeV2 ? : )} /> - (isThemeV2 ? : )} - /> + } /> + } /> {showStructuredProperties && ( } /> )} @@ -135,6 +101,6 @@ export const SearchRoutes = (): JSX.Element => { /> {me.loaded && loaded && } - + ); }; diff --git a/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx b/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx index ccd17a69051452..21cf0a40fa66bf 100644 --- a/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx +++ b/datahub-web-react/src/app/analyticsDashboard/components/AnalyticsPage.tsx @@ -9,15 +9,14 @@ import { useUserContext } from '@app/context/useUserContext'; import { ANTD_GRAY } from '@app/entity/shared/constants'; import filterSearchQuery from '@app/search/utils/filterSearchQuery'; import { Message } from '@app/shared/Message'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; import { useShowNavBarRedesign } from '@src/app/useShowNavBarRedesign'; import { useGetAnalyticsChartsQuery, useGetMetadataAnalyticsChartsQuery } from '@graphql/analytics.generated'; import { useListDomainsQuery } from '@graphql/domain.generated'; import { useGetHighlightsQuery } from '@graphql/highlights.generated'; -const PageContainer = styled.div<{ isV2: boolean; $isShowNavBarRedesign?: boolean }>` - background-color: ${(props) => (props.isV2 ? '#fff' : 'inherit')}; +const PageContainer = styled.div<{ $isShowNavBarRedesign?: boolean }>` + background-color: #fff; ${(props) => props.$isShowNavBarRedesign && ` @@ -29,12 +28,12 @@ const PageContainer = styled.div<{ isV2: boolean; $isShowNavBarRedesign?: boolea ${(props) => !props.$isShowNavBarRedesign && ` - margin-right: ${props.isV2 ? '24px' : '0'}; - margin-bottom: ${props.isV2 ? '24px' : '0'}; + margin-right: 24px; + margin-bottom: 24px; `} border-radius: ${(props) => { - if (props.isV2 && props.$isShowNavBarRedesign) return props.theme.styles['border-radius-navbar-redesign']; - return props.isV2 ? '8px' : '0'; + if (props.$isShowNavBarRedesign) return props.theme.styles['border-radius-navbar-redesign']; + return '8px'; }}; `; @@ -75,7 +74,6 @@ const StyledSearchBar = styled(Input)` `; export const AnalyticsPage = () => { - const isV2 = useIsThemeV2(); const isShowNavBarRedesign = useShowNavBarRedesign(); const me = useUserContext(); const canManageDomains = me?.platformPrivileges?.createDomains; @@ -118,7 +116,7 @@ export const AnalyticsPage = () => { const isLoading = highlightLoading || chartLoading || domainLoading || metadataAnalyticsLoading; return ( - + {isLoading && } {highlightError && ( diff --git a/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx b/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx index 3cdbdf298eef6b..24fd4ce825c862 100644 --- a/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx +++ b/datahub-web-react/src/app/entity/shared/entityForm/FormByEntity.tsx @@ -9,7 +9,6 @@ import { useEntityFormContext } from '@app/entity/shared/entityForm/EntityFormCo import Form from '@app/entity/shared/entityForm/Form'; import ProgressBar from '@app/entity/shared/entityForm/ProgressBar'; import { useEntityRegistry } from '@app/useEntityRegistry'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; const ContentWrapper = styled.div` background-color: ${ANTD_GRAY_V2[1]}; @@ -36,15 +35,9 @@ export default function FormByEntity({ formUrn }: Props) { const { entityType } = useEntityContext(); const entityRegistry = useEntityRegistry(); const sidebarSections = entityRegistry.getSidebarSections(selectedEntity?.type || entityType); - const isV2 = useIsThemeV2(); - // Used for v2 - removes repeated entity header (we use EntityInfo in this component) - // SidebarEntityHeader is always the first index in sidebarSections, so remove it here - // TODO (OBS-677): remove this logic once we get form info into V2 sidebar const cleanedSidebarSections = sidebarSections.slice(1); - - // Conditional sections based on theme version - const sections = isV2 ? cleanedSidebarSections : sidebarSections; + const sections = cleanedSidebarSections; return ( ` +const AddButton = styled.div<{ isV1Drawer?: boolean }>` border-radius: 200px; - background-color: ${(props) => - props.isThemeV2 ? props.theme.styles['primary-color'] : REDESIGN_COLORS.LINK_HOVER_BLUE}; + background-color: ${(props) => props.theme.styles['primary-color']}; width: ${(props) => (props.isV1Drawer ? '24px' : '32px')}; height: ${(props) => (props.isV1Drawer ? '24px' : '32px')}; display: flex; @@ -82,7 +79,6 @@ interface Props { const AddPropertyButton = ({ fieldUrn, refetch, fieldProperties, isV1Drawer }: Props) => { const [searchQuery, setSearchQuery] = useState(''); const { entityData, entityType } = useEntityData(); - const isThemeV2 = useIsThemeV2(); const me = useUserContext(); const entityRegistry = useEntityRegistry(); const [isEditModalVisible, setIsEditModalVisible] = useState(false); @@ -194,7 +190,7 @@ const AddPropertyButton = ({ fieldUrn, refetch, fieldProperties, isV1Drawer }: P )} > - + diff --git a/datahub-web-react/src/app/onboarding/OnboardingTour.tsx b/datahub-web-react/src/app/onboarding/OnboardingTour.tsx index 6726daeb0e9984..4f756c52fb0ec6 100644 --- a/datahub-web-react/src/app/onboarding/OnboardingTour.tsx +++ b/datahub-web-react/src/app/onboarding/OnboardingTour.tsx @@ -8,7 +8,6 @@ import { REDESIGN_COLORS } from '@app/entityV2/shared/constants'; import OnboardingContext from '@app/onboarding/OnboardingContext'; import useShouldSkipOnboardingTour from '@app/onboarding/useShouldSkipOnboardingTour'; import { convertStepId, getConditionalStepIdsToAdd, getStepsToRender } from '@app/onboarding/utils'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; import { EducationStepsContext } from '@providers/EducationStepsContext'; import { useBatchUpdateStepStatesMutation } from '@graphql/step.generated'; @@ -21,10 +20,9 @@ type Props = { export const OnboardingTour = ({ stepIds }: Props) => { const { educationSteps, setEducationSteps, educationStepIdsAllowlist } = useContext(EducationStepsContext); const userUrn = useUserContext()?.user?.urn; - const isThemeV2 = useIsThemeV2(); const { isTourOpen, tourReshow, setTourReshow, setIsTourOpen } = useContext(OnboardingContext); const location = useLocation(); - const accentColor = isThemeV2 ? REDESIGN_COLORS.BACKGROUND_PURPLE : '#5cb7b7'; + const accentColor = REDESIGN_COLORS.BACKGROUND_PURPLE; useEffect(() => { function handleKeyDown(e) { diff --git a/datahub-web-react/src/app/settingsV2/Preferences.tsx b/datahub-web-react/src/app/settingsV2/Preferences.tsx index dc434075e837cf..69902efc1e5736 100644 --- a/datahub-web-react/src/app/settingsV2/Preferences.tsx +++ b/datahub-web-react/src/app/settingsV2/Preferences.tsx @@ -3,14 +3,10 @@ import { message } from 'antd'; import React from 'react'; import styled from 'styled-components'; -import analytics, { EventType } from '@app/analytics'; import { useUserContext } from '@app/context/useUserContext'; import { useAppConfig } from '@app/useAppConfig'; -import { useIsThemeV2, useIsThemeV2EnabledForUser, useIsThemeV2Toggleable } from '@app/useIsThemeV2'; import { useUpdateApplicationsSettingsMutation } from '@graphql/app.generated'; -import { useUpdateUserSettingMutation } from '@graphql/me.generated'; -import { UserSetting } from '@types'; const Page = styled.div` width: 100%; @@ -70,22 +66,13 @@ const DescriptionText = styled.div` `; export const Preferences = () => { - // Current User Urn - const { user, refetchUser } = useUserContext(); - const isThemeV2 = useIsThemeV2(); - const [isThemeV2Toggleable] = useIsThemeV2Toggleable(); - const [isThemeV2EnabledForUser] = useIsThemeV2EnabledForUser(); const userContext = useUserContext(); const appConfig = useAppConfig(); - const showSimplifiedHomepage = !!user?.settings?.appearance?.showSimplifiedHomepage; - const applicationsEnabled = appConfig.config?.visualConfig?.application?.showApplicationInNavigation ?? false; - const [updateUserSettingMutation] = useUpdateUserSettingMutation(); const [updateApplicationsSettingsMutation] = useUpdateApplicationsSettingsMutation(); - const showSimplifiedHomepageSetting = !isThemeV2; const canManageApplicationAppearance = userContext?.platformPrivileges?.manageFeatures; return ( @@ -96,77 +83,6 @@ export const Preferences = () => { - {showSimplifiedHomepageSetting && ( - - - - Show simplified homepage - - Limits entity browse cards on homepage to Domains, Charts, Datasets, Dashboards and - Glossary Terms - - - { - await updateUserSettingMutation({ - variables: { - input: { - name: UserSetting.ShowSimplifiedHomepage, - value: !showSimplifiedHomepage, - }, - }, - }); - analytics.event({ - type: showSimplifiedHomepage - ? EventType.ShowStandardHomepageEvent - : EventType.ShowSimplifiedHomepageEvent, - }); - message.success({ content: 'Setting updated!', duration: 2 }); - refetchUser?.(); - }} - /> - - - )} - {isThemeV2Toggleable && ( - <> - - - - Try New User Experience - - Enable an early preview of the new DataHub UX - a complete makeover for your app - with a sleek new design and advanced features. - - - { - await updateUserSettingMutation({ - variables: { - input: { - name: UserSetting.ShowThemeV2, - value: !isThemeV2EnabledForUser, - }, - }, - }); - // clicking this button toggles, so event is whatever is opposite to what isThemeV2EnabledForUser currently is - analytics.event({ - type: isThemeV2EnabledForUser - ? EventType.RevertV2ThemeEvent - : EventType.ShowV2ThemeEvent, - }); - message.success({ content: 'Setting updated!', duration: 2 }); - refetchUser?.(); - }} - /> - - - - )} {canManageApplicationAppearance && ( @@ -195,7 +111,7 @@ export const Preferences = () => { )} - {!showSimplifiedHomepageSetting && !isThemeV2Toggleable && !canManageApplicationAppearance && ( + {!canManageApplicationAppearance && (
No appearance settings found.
)} diff --git a/datahub-web-react/src/app/settingsV2/SettingsPage.tsx b/datahub-web-react/src/app/settingsV2/SettingsPage.tsx index d45ec45ef82905..81808d6d342ca1 100644 --- a/datahub-web-react/src/app/settingsV2/SettingsPage.tsx +++ b/datahub-web-react/src/app/settingsV2/SettingsPage.tsx @@ -20,7 +20,6 @@ import NavBarMenu from '@app/homeV2/layout/navBarRedesign/NavBarMenu'; import { NavBarMenuItemTypes, NavBarMenuItems } from '@app/homeV2/layout/navBarRedesign/types'; import { DEFAULT_PATH, PATHS } from '@app/settingsV2/settingsPaths'; import { useAppConfig } from '@app/useAppConfig'; -import { useIsThemeV2 } from '@app/useIsThemeV2'; import { useShowNavBarRedesign } from '@app/useShowNavBarRedesign'; import { Button, colors } from '@src/alchemy-components'; @@ -86,7 +85,6 @@ export const SettingsPage = () => { const history = useHistory(); const subscriptionsEnabled = false; const me = useUserContext(); - const isThemeV2 = useIsThemeV2(); const isShowNavBarRedesign = useShowNavBarRedesign(); const { config } = useAppConfig(); @@ -246,7 +244,7 @@ export const SettingsPage = () => { Settings Manage your settings - {isThemeV2 && !isShowNavBarRedesign && ( + {!isShowNavBarRedesign && (