Skip to content

Commit

Permalink
feat(ui) Show Acryl information with button and banner behind flag (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscollins3456 authored Jun 29, 2023
1 parent 08d4e90 commit c051ea0
Show file tree
Hide file tree
Showing 12 changed files with 104 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ public class FeatureFlags {
private boolean showSearchFiltersV2 = false;
private boolean showBrowseV2 = false;
private PreProcessHooks preProcessHooks;
private boolean showAcrylInfo = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public CompletableFuture<AppConfig> get(final DataFetchingEnvironment environmen
.setShowSearchFiltersV2(_featureFlags.isShowSearchFiltersV2())
.setReadOnlyModeEnabled(_featureFlags.isReadOnlyModeEnabled())
.setShowBrowseV2(_featureFlags.isShowBrowseV2())
.setShowAcrylInfo(_featureFlags.isShowAcrylInfo())
.build();

appConfig.setFeatureFlags(featureFlagsConfig);
Expand Down
5 changes: 5 additions & 0 deletions datahub-graphql-core/src/main/resources/app.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,11 @@ type FeatureFlagsConfig {
Whether browse V2 sidebar should be shown
"""
showBrowseV2: Boolean!

"""
Whether we should show CTAs in the UI related to moving to Managed DataHub by Acryl.
"""
showAcrylInfo: Boolean!
}

"""
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { Button } from 'antd';
import React from 'react';
import styled from 'styled-components';

const StyledButton = styled(Button)`
padding: 8px;
font-size: 14px;
margin-left: 18px;
`;

export default function DemoButton() {
return (
<StyledButton
type="primary"
href="https://www.acryldata.io/datahub-sign-up"
target="_blank"
rel="noopener noreferrer"
>
Schedule a Demo
</StyledButton>
);
}
56 changes: 56 additions & 0 deletions datahub-web-react/src/app/home/AcrylDemoBanner.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import Link from 'antd/lib/typography/Link';
import React from 'react';
import styled from 'styled-components';
import AcrylLogo from '../../images/acryl-light-mark.svg';

const BannerWrapper = styled.div`
padding: 12px;
display: flex;
align-items: center;
justify-content: center;
color: #262626;
background-color: #e6f4ff;
width: 100%;
margin-bottom: 24px;
`;

const Logo = styled.img`
margin-right: 12px;
height: 40px;
width: 40px;
`;

const TextWrapper = styled.div`
font-size: 14px;
`;

const Title = styled.div`
font-weight: 700;
`;

const StyledLink = styled(Link)`
color: #1890ff;
font-weight: 700;
`;

export default function AcrylDemoBanner() {
return (
<BannerWrapper>
<Logo src={AcrylLogo} />
<TextWrapper>
<Title>Schedule a Demo of Managed Datahub</Title>
<span>
DataHub is already the industries #1 Open Source Data Catalog.{' '}
<StyledLink
href="https://www.acryldata.io/datahub-sign-up"
target="_blank"
rel="noopener noreferrer"
>
Schedule a demo
</StyledLink>{' '}
of Acryl DataHub to see the advanced features that take it to the next level!
</span>
</TextWrapper>
</BannerWrapper>
);
}
7 changes: 6 additions & 1 deletion datahub-web-react/src/app/home/HomePageHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import { EntityType, FacetFilterInput } from '../../types.generated';
import analytics, { EventType } from '../analytics';
import { HeaderLinks } from '../shared/admin/HeaderLinks';
import { ANTD_GRAY } from '../entity/shared/constants';
import { useAppConfig } from '../useAppConfig';
import { useAppConfig, useIsShowAcrylInfoEnabled } from '../useAppConfig';
import { DEFAULT_APP_CONFIG } from '../../appConfigContext';
import { HOME_PAGE_SEARCH_BAR_ID } from '../onboarding/config/HomePageOnboardingConfig';
import { useQuickFiltersContext } from '../../providers/QuickFiltersContext';
import { getAutoCompleteInputFromQuickFilter } from '../search/utils/filterUtils';
import { useUserContext } from '../context/useUserContext';
import AcrylDemoBanner from './AcrylDemoBanner';
import DemoButton from '../entity/shared/components/styled/DemoButton';

const Background = styled.div`
width: 100%;
Expand Down Expand Up @@ -147,6 +149,7 @@ export const HomePageHeader = () => {
const appConfig = useAppConfig();
const [newSuggestionData, setNewSuggestionData] = useState<GetAutoCompleteMultipleResultsQuery | undefined>();
const { selectedQuickFilter } = useQuickFiltersContext();
const showAcrylInfo = useIsShowAcrylInfoEnabled();
const { user } = userContext;
const viewUrn = userContext.localState?.selectedViewUrn;

Expand Down Expand Up @@ -243,9 +246,11 @@ export const HomePageHeader = () => {
pictureLink={user?.editableProperties?.pictureLink || ''}
name={(user && entityRegistry.getDisplayName(EntityType.CorpUser, user)) || undefined}
/>
{showAcrylInfo && <DemoButton />}
</NavGroup>
</Row>
<HeaderContainer>
{showAcrylInfo && <AcrylDemoBanner />}
<Image
src={
appConfig.config !== DEFAULT_APP_CONFIG
Expand Down
5 changes: 4 additions & 1 deletion datahub-web-react/src/app/search/SearchHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import { AutoCompleteResultForEntity, EntityType } from '../../types.generated';
import EntityRegistry from '../entity/EntityRegistry';
import { ANTD_GRAY } from '../entity/shared/constants';
import { HeaderLinks } from '../shared/admin/HeaderLinks';
import { useAppConfig } from '../useAppConfig';
import { useAppConfig, useIsShowAcrylInfoEnabled } from '../useAppConfig';
import { DEFAULT_APP_CONFIG } from '../../appConfigContext';
import { ViewSelect } from '../entity/view/select/ViewSelect';
import DemoButton from '../entity/shared/components/styled/DemoButton';

const { Header } = Layout;

Expand Down Expand Up @@ -82,6 +83,7 @@ export const SearchHeader = ({
}: Props) => {
const [isSearchBarFocused, setIsSearchBarFocused] = useState(false);
const themeConfig = useTheme();
const showAcrylInfo = useIsShowAcrylInfoEnabled();
const appConfig = useAppConfig();
const viewsEnabled = appConfig.config?.viewsConfig?.enabled;

Expand Down Expand Up @@ -118,6 +120,7 @@ export const SearchHeader = ({
)}
<HeaderLinks areLinksHidden={isSearchBarFocused} />
<ManageAccount urn={authenticatedUserUrn} pictureLink={authenticatedUserPictureLink || ''} />
{showAcrylInfo && <DemoButton />}
</NavGroup>
</Header>
);
Expand Down
5 changes: 5 additions & 0 deletions datahub-web-react/src/app/useAppConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,8 @@ import { AppConfigContext } from '../appConfigContext';
export function useAppConfig() {
return useContext(AppConfigContext);
}

export function useIsShowAcrylInfoEnabled() {
const appConfig = useAppConfig();
return appConfig.config.featureFlags.showAcrylInfo;
}
1 change: 1 addition & 0 deletions datahub-web-react/src/appConfigContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const DEFAULT_APP_CONFIG = {
readOnlyModeEnabled: false,
showSearchFiltersV2: true,
showBrowseV2: true,
showAcrylInfo: false,
},
};

Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/graphql/app.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ query appConfig {
readOnlyModeEnabled
showSearchFiltersV2
showBrowseV2
showAcrylInfo
}
}
}
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/images/acryl-light-mark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ featureFlags:
showBrowseV2: ${SHOW_BROWSE_V2:true} # Enables showing the browse v2 sidebar experience.
preProcessHooks:
uiEnabled: ${PRE_PROCESS_HOOKS_UI_ENABLED:true} # Circumvents Kafka for processing index updates for UI changes sourced from GraphQL to avoid processing delays
showAcrylInfo: ${SHOW_ACRYL_INFO:false} # Show different CTAs within DataHub around moving to Managed DataHub. Set to true for the demo site.

entityChangeEvents:
enabled: ${ENABLE_ENTITY_CHANGE_EVENTS_HOOK:true}
Expand Down

0 comments on commit c051ea0

Please sign in to comment.