Skip to content

Commit

Permalink
Merge branch 'master' into gabe--advSearchFixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe-lyons committed Oct 25, 2022
2 parents ae2fb5d + 18df38e commit 1878275
Show file tree
Hide file tree
Showing 85 changed files with 2,388 additions and 967 deletions.
2 changes: 1 addition & 1 deletion datahub-frontend/app/auth/sso/oidc/OidcConfigs.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class OidcConfigs extends SsoConfigs {
/**
* Default values
*/
private static final String DEFAULT_OIDC_USERNAME_CLAIM = "preferred_username";
private static final String DEFAULT_OIDC_USERNAME_CLAIM = "email";
private static final String DEFAULT_OIDC_USERNAME_CLAIM_REGEX = "(.*)";
private static final String DEFAULT_OIDC_SCOPE = "openid profile email"; // Often "group" must be included for groups.
private static final String DEFAULT_OIDC_CLIENT_NAME = "oidc";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public SsoCallbackController(
@Nonnull AuthServiceClient authClient) {
_ssoManager = ssoManager;
setDefaultUrl("/"); // By default, redirects to Home Page on log in.
setSaveInSession(false);
setCallbackLogic(new SsoCallbackLogic(ssoManager, systemAuthentication, entityClient, authClient));
}

Expand Down
2 changes: 1 addition & 1 deletion datahub-frontend/run/frontend.env
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ METADATA_SERVICE_AUTH_ENABLED=true
DATAHUB_AKKA_MAX_HEADER_COUNT=64

# Change to override max header value length defaults
DATAHUB_AKKA_MAX_HEADER_VALUE_LENGTH=8k
DATAHUB_AKKA_MAX_HEADER_VALUE_LENGTH=8k
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class GlossaryTermType implements SearchableEntityType<GlossaryTerm, Stri
OWNERSHIP_ASPECT_NAME,
STATUS_ASPECT_NAME,
BROWSE_PATHS_ASPECT_NAME,
DOMAINS_ASPECT_NAME,
DEPRECATION_ASPECT_NAME
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@
import com.linkedin.datahub.graphql.types.common.mappers.InstitutionalMemoryMapper;
import com.linkedin.datahub.graphql.types.common.mappers.OwnershipMapper;
import com.linkedin.datahub.graphql.types.common.mappers.util.MappingHelper;
import com.linkedin.datahub.graphql.types.domain.DomainAssociationMapper;
import com.linkedin.datahub.graphql.types.glossary.GlossaryTermUtils;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;
import com.linkedin.entity.EntityResponse;
import com.linkedin.entity.EnvelopedAspectMap;
import com.linkedin.glossary.GlossaryTermInfo;
import com.linkedin.metadata.key.GlossaryTermKey;
import com.linkedin.domain.Domains;
import javax.annotation.Nonnull;

import static com.linkedin.metadata.Constants.*;
Expand Down Expand Up @@ -54,6 +56,7 @@ public GlossaryTerm apply(@Nonnull final EntityResponse entityResponse) {
glossaryTerm.setProperties(GlossaryTermPropertiesMapper.map(new GlossaryTermInfo(dataMap), entityUrn)));
mappingHelper.mapToResult(OWNERSHIP_ASPECT_NAME, (glossaryTerm, dataMap) ->
glossaryTerm.setOwnership(OwnershipMapper.map(new Ownership(dataMap), entityUrn)));
mappingHelper.mapToResult(DOMAINS_ASPECT_NAME, this::mapDomains);
mappingHelper.mapToResult(DEPRECATION_ASPECT_NAME, (glossaryTerm, dataMap) ->
glossaryTerm.setDeprecation(DeprecationMapper.map(new Deprecation(dataMap))));
mappingHelper.mapToResult(INSTITUTIONAL_MEMORY_ASPECT_NAME, (dataset, dataMap) ->
Expand All @@ -74,4 +77,9 @@ private void mapGlossaryTermKey(@Nonnull GlossaryTerm glossaryTerm, @Nonnull Dat
glossaryTerm.setName(GlossaryTermUtils.getGlossaryTermName(glossaryTermKey.getName()));
glossaryTerm.setHierarchicalName(glossaryTermKey.getName());
}

private void mapDomains(@Nonnull GlossaryTerm glossaryTerm, @Nonnull DataMap dataMap) {
final Domains domains = new Domains(dataMap);
glossaryTerm.setDomain(DomainAssociationMapper.map(domains, glossaryTerm.getUrn()));
}
}
5 changes: 5 additions & 0 deletions datahub-graphql-core/src/main/resources/entity.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -1447,6 +1447,11 @@ type GlossaryTerm implements Entity {
"""
ownership: Ownership

"""
The Domain associated with the glossary term
"""
domain: DomainAssociation

"""
References to internal resources related to the Glossary Term
"""
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"react": "^17.0.0",
"react-color": "^2.19.3",
"react-dom": "^17.0.0",
"react-helmet": "^6.1.0",
"react-highlighter": "^0.4.3",
"react-icons": "4.3.1",
"react-js-cron": "^2.1.0",
Expand Down
4 changes: 4 additions & 0 deletions datahub-web-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { BrowserRouter as Router } from 'react-router-dom';
import { ApolloClient, ApolloProvider, createHttpLink, InMemoryCache, ServerError } from '@apollo/client';
import { onError } from '@apollo/client/link/error';
import { ThemeProvider } from 'styled-components';
import { Helmet } from 'react-helmet';
import './App.less';
import { Routes } from './app/Routes';
import EntityRegistry from './app/entity/EntityRegistry';
Expand Down Expand Up @@ -107,6 +108,9 @@ const App: React.VFC = () => {
return (
<ThemeProvider theme={dynamicThemeConfig}>
<Router>
<Helmet>
<title>{dynamicThemeConfig.content.title}</title>
</Helmet>
<EntityRegistryContext.Provider value={entityRegistry}>
<ApolloProvider client={client}>
<Routes />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const ChartPreview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Chart, urn)}
name={name || ''}
urn={urn}
description={description || ''}
type="Chart"
typeIcon={entityRegistry.getIcon(EntityType.Chart, 14, IconStyleType.ACCENT)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Container, urn)}
name={name || ''}
urn={urn}
platform={platformName}
platformInstanceId={platformInstanceId}
description={description || ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export const DashboardPreview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Dashboard, urn)}
name={name || ''}
urn={urn}
description={description || ''}
type={capitalizeFirstLetterOnly(subtype) || 'Dashboard'}
typeIcon={entityRegistry.getIcon(EntityType.Dashboard, 14, IconStyleType.ACCENT)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.DataFlow, urn)}
name={name}
urn={urn}
description={description || ''}
platformInstanceId={platformInstanceId}
type="Data Pipeline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.DataJob, urn)}
name={name}
urn={urn}
description={description || ''}
type="Data Task"
typeIcon={entityRegistry.getIcon(EntityType.DataJob, 14, IconStyleType.ACCENT)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Dataset, urn)}
name={name || ''}
urn={urn}
description={description || ''}
type={capitalizeFirstLetterOnly(subtype) || 'Dataset'}
logoUrl={platformLogo || ''}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Domain, urn)}
name={name || ''}
urn={urn}
description={description || ''}
type="Domain"
typeIcon={entityRegistry.getIcon(EntityType.Domain, 14, IconStyleType.ACCENT)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.GlossaryNode, urn)}
name={name || ''}
urn={urn}
description={description || ''}
owners={owners}
logoComponent={<FolderOutlined style={{ fontSize: '20px' }} />}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { SidebarAboutSection } from '../shared/containers/profile/sidebar/Sideba
import GlossaryEntitiesPath from '../../glossary/GlossaryEntitiesPath';
import { EntityMenuItems } from '../shared/EntityDropdown/EntityDropdown';
import { EntityActionItem } from '../shared/entity/EntityActions';
import { SidebarDomainSection } from '../shared/containers/profile/sidebar/Domain/SidebarDomainSection';

/**
* Definition of the DataHub Dataset entity.
Expand Down Expand Up @@ -112,6 +113,12 @@ export class GlossaryTermEntity implements Entity<GlossaryTerm> {
{
component: SidebarOwnerSection,
},
{
component: SidebarDomainSection,
properties: {
hideOwnerType: true,
},
},
]}
getOverrideProperties={this.getOverridePropertiesFromEntity}
customNavBar={<GlossaryEntitiesPath />}
Expand Down Expand Up @@ -139,6 +146,7 @@ export class GlossaryTermEntity implements Entity<GlossaryTerm> {
name={this.displayName(data)}
description={data?.properties?.description || ''}
owners={data?.ownership?.owners}
domain={data.domain?.domain}
/>
);
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { BookOutlined } from '@ant-design/icons';
import { Deprecation, EntityType, Owner, ParentNodesResult } from '../../../../types.generated';
import { Deprecation, Domain, EntityType, Owner, ParentNodesResult } from '../../../../types.generated';
import DefaultPreviewCard from '../../../preview/DefaultPreviewCard';
import { useEntityRegistry } from '../../../useEntityRegistry';
import { IconStyleType, PreviewType } from '../../Entity';
Expand All @@ -13,6 +13,7 @@ export const Preview = ({
deprecation,
parentNodes,
previewType,
domain,
}: {
urn: string;
name: string;
Expand All @@ -21,20 +22,23 @@ export const Preview = ({
deprecation?: Deprecation | null;
parentNodes?: ParentNodesResult | null;
previewType: PreviewType;
domain?: Domain | undefined;
}): JSX.Element => {
const entityRegistry = useEntityRegistry();
return (
<DefaultPreviewCard
previewType={previewType}
url={entityRegistry.getEntityUrl(EntityType.GlossaryTerm, urn)}
name={name || ''}
urn={urn}
description={description || ''}
owners={owners}
logoComponent={<BookOutlined style={{ fontSize: '20px' }} />}
type="Glossary Term"
typeIcon={entityRegistry.getIcon(EntityType.GlossaryTerm, 14, IconStyleType.ACCENT)}
deprecation={deprecation}
parentNodes={parentNodes}
domain={domain}
/>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Mlfeature, urn)}
name={name}
urn={urn}
platformInstanceId={platformInstanceId}
description={description || ''}
platform={capitalizeFirstLetterOnly(platform?.properties?.displayName) || featureNamespace}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.MlfeatureTable, urn)}
name={name}
urn={urn}
description={description || ''}
type={entityRegistry.getEntityName(EntityType.MlfeatureTable)}
typeIcon={entityRegistry.getIcon(EntityType.MlfeatureTable, 14, IconStyleType.ACCENT)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export const Preview = ({ model }: { model: MlModel }): JSX.Element => {
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.Mlmodel, model.urn)}
name={model.name || ''}
urn={model.urn}
description={model.description || ''}
platformInstanceId={model.dataPlatformInstance?.instanceId}
type={entityRegistry.getEntityName(EntityType.Mlmodel)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const Preview = ({ group }: { group: MlModelGroup }): JSX.Element => {
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.MlmodelGroup, group.urn)}
name={group?.name || ''}
urn={group.urn}
platformInstanceId={group.dataPlatformInstance?.instanceId}
description={group?.description || ''}
type="MLModel Group"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Preview = ({
<DefaultPreviewCard
url={entityRegistry.getEntityUrl(EntityType.MlprimaryKey, urn)}
name={name}
urn={urn}
description={description || ''}
platform={capitalizeFirstLetterOnly(platform?.properties?.displayName) || featureNamespace}
logoUrl={platform?.properties?.logoUrl || ''}
Expand Down
61 changes: 61 additions & 0 deletions datahub-web-react/src/app/entity/shared/ExternalUrlButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import { ArrowRightOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import React from 'react';
import styled from 'styled-components/macro';
import { EntityType } from '../../../types.generated';
import analytics, { EventType, EntityActionType } from '../../analytics';

const GITHUB_LINK = 'github.com';
const GITHUB = 'GitHub';

const ExternalUrlWrapper = styled.span`
font-size: 12px;
`;

const StyledButton = styled(Button)`
> :hover {
text-decoration: underline;
}
&&& {
padding-bottom: 0px;
}
padding-left: 12px;
padding-right: 12px;
`;

interface Props {
externalUrl: string;
platformName?: string;
entityUrn: string;
entityType?: string;
}

export default function ExternalUrlButton({ externalUrl, platformName, entityType, entityUrn }: Props) {
function sendAnalytics() {
analytics.event({
type: EventType.EntityActionEvent,
actionType: EntityActionType.ClickExternalUrl,
entityType: entityType as EntityType,
entityUrn,
});
}

let displayedName = platformName;
if (externalUrl.toLocaleLowerCase().includes(GITHUB_LINK)) {
displayedName = GITHUB;
}

return (
<ExternalUrlWrapper>
<StyledButton
type="link"
href={externalUrl}
target="_blank"
rel="noreferrer noopener"
onClick={sendAnalytics}
>
View in {displayedName} <ArrowRightOutlined style={{ fontSize: 12 }} />
</StyledButton>
</ExternalUrlWrapper>
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { BrowserWrapper, MAX_BROWSER_WIDTH, MIN_BROWSWER_WIDTH } from '../../../
import { combineEntityDataWithSiblings, useIsSeparateSiblingsMode } from '../../siblingUtils';
import { EntityActionItem } from '../../entity/EntityActions';
import { ErrorSection } from '../../../../shared/error/ErrorSection';
import { EntityHead } from '../../../../shared/EntityHead';

type Props<T, U> = {
urn: string;
Expand Down Expand Up @@ -297,6 +298,7 @@ export const EntityProfile = <T, U>({
}}
>
<>
<EntityHead />
{customNavBar}
{showBrowseBar && !customNavBar && <EntityProfileNavBar urn={urn} entityType={entityType} />}
{entityData?.status?.removed === true && (
Expand Down
Loading

0 comments on commit 1878275

Please sign in to comment.