Skip to content

Commit

Permalink
Merge branch 'datahub-project:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
hsheth2 authored Sep 18, 2024
2 parents 0affbb9 + cc6cbe2 commit 2263859
Show file tree
Hide file tree
Showing 18 changed files with 174 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ private void configureQueryResolvers(final RuntimeWiring.Builder builder) {
.dataFetcher("assertion", getResolver(assertionType))
.dataFetcher("form", getResolver(formType))
.dataFetcher("view", getResolver(dataHubViewType))
.dataFetcher("structuredProperty", getResolver(structuredPropertyType))
.dataFetcher("listPolicies", new ListPoliciesResolver(this.entityClient))
.dataFetcher("getGrantedPrivileges", new GetGrantedPrivilegesResolver())
.dataFetcher("listUsers", new ListUsersResolver(this.entityClient))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ public CompletableFuture<StructuredPropertyEntity> get(final DataFetchingEnviron
builder.setCardinality(
PropertyCardinality.valueOf(input.getCardinality().toString()));
}
builder.setCreated(context.getOperationContext().getAuditStamp());
builder.setLastModified(context.getOperationContext().getAuditStamp());

MetadataChangeProposal mcp = builder.build();
_entityClient.ingestProposal(context.getOperationContext(), mcp, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ public CompletableFuture<StructuredPropertyEntity> get(final DataFetchingEnviron
if (input.getNewEntityTypes() != null) {
input.getNewEntityTypes().forEach(builder::addEntityType);
}
builder.setLastModified(context.getOperationContext().getAuditStamp());

MetadataChangeProposal mcp = builder.build();
_entityClient.ingestProposal(context.getOperationContext(), mcp, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@
import static com.linkedin.datahub.graphql.util.SearchInsightsUtil.*;
import static com.linkedin.metadata.utils.SearchUtil.*;

import com.linkedin.common.AuditStamp;
import com.linkedin.common.UrnArray;
import com.linkedin.common.urn.Urn;
import com.linkedin.data.template.StringMap;
import com.linkedin.datahub.graphql.QueryContext;
import com.linkedin.datahub.graphql.generated.AggregationMetadata;
import com.linkedin.datahub.graphql.generated.CorpUser;
import com.linkedin.datahub.graphql.generated.EntityPath;
import com.linkedin.datahub.graphql.generated.ExtraProperty;
import com.linkedin.datahub.graphql.generated.FacetMetadata;
import com.linkedin.datahub.graphql.generated.MatchedField;
import com.linkedin.datahub.graphql.generated.ResolvedAuditStamp;
import com.linkedin.datahub.graphql.generated.SearchResult;
import com.linkedin.datahub.graphql.generated.SearchSuggestion;
import com.linkedin.datahub.graphql.types.common.mappers.UrnToEntityMapper;
Expand Down Expand Up @@ -132,4 +135,13 @@ public static EntityPath mapPath(@Nullable final QueryContext context, UrnArray
path.stream().map(p -> UrnToEntityMapper.map(context, p)).collect(Collectors.toList()));
return entityPath;
}

public static ResolvedAuditStamp createResolvedAuditStamp(AuditStamp auditStamp) {
final ResolvedAuditStamp resolvedAuditStamp = new ResolvedAuditStamp();
final CorpUser emptyCreatedUser = new CorpUser();
emptyCreatedUser.setUrn(auditStamp.getActor().toString());
resolvedAuditStamp.setActor(emptyCreatedUser);
resolvedAuditStamp.setTime(auditStamp.getTime());
return resolvedAuditStamp;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.linkedin.datahub.graphql.generated.StructuredPropertyEntity;
import com.linkedin.datahub.graphql.generated.TypeQualifier;
import com.linkedin.datahub.graphql.types.common.mappers.util.MappingHelper;
import com.linkedin.datahub.graphql.types.mappers.MapperUtils;
import com.linkedin.datahub.graphql.types.mappers.ModelMapper;
import com.linkedin.entity.EntityResponse;
import com.linkedin.entity.EnvelopedAspectMap;
Expand Down Expand Up @@ -74,6 +75,13 @@ private void mapStructuredPropertyDefinition(
if (gmsDefinition.hasTypeQualifier()) {
definition.setTypeQualifier(mapTypeQualifier(gmsDefinition.getTypeQualifier()));
}
if (gmsDefinition.getCreated() != null) {
definition.setCreated(MapperUtils.createResolvedAuditStamp(gmsDefinition.getCreated()));
}
if (gmsDefinition.getLastModified() != null) {
definition.setLastModified(
MapperUtils.createResolvedAuditStamp(gmsDefinition.getLastModified()));
}
definition.setEntityTypes(
gmsDefinition.getEntityTypes().stream()
.map(this::createEntityTypeEntity)
Expand Down
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 @@ -84,6 +84,11 @@ type Query {
"""
role(urn: String!): Role

"""
Fetch a Structured Property by primary key (urn)
"""
structuredProperty(urn: String!): StructuredPropertyEntity

"""
Fetch a ERModelRelationship by primary key (urn)
"""
Expand Down
10 changes: 10 additions & 0 deletions datahub-graphql-core/src/main/resources/properties.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,16 @@ type StructuredPropertyDefinition {
Whether or not this structured property is immutable
"""
immutable: Boolean!

"""
Audit stamp for when this structured property was created
"""
created: ResolvedAuditStamp

"""
Audit stamp for when this structured property was last modified
"""
lastModified: ResolvedAuditStamp
}

"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,14 @@
font-family: "Manrope";

div {
width: 70%;
width: 80%;
margin: auto;
font-size: 2rem;
line-height: normal;
font-weight: 400;
}
p {
width: 60%;
width: 80%;
margin: auto;
font-size: 1.1rem;
line-height: 1.5rem;
Expand Down
3 changes: 1 addition & 2 deletions docs-website/src/pages/_components/Community/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,7 @@ const Community = () => {
</div>
</div>
<p>
Q&A.&emsp;Office Hours.&emsp; Monthly Town Hall.&emsp; Job
Postings.
Q&A.&nbsp;&nbsp;Office Hours.&nbsp;&nbsp;Think Tanks.&nbsp;&nbsp;Job Postings.
</p>
<a href="/slack">Join Slack</a>
</div>
Expand Down
3 changes: 2 additions & 1 deletion docs-website/src/pages/_components/Hero/hero.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
margin-left: 4px;
height: 1.8rem;
padding-left: 2px;
padding-right: 8px;
padding-right: 6px;
font-family: 'Manrope';
font-style: normal;
font-weight: 400;
Expand Down Expand Up @@ -213,6 +213,7 @@
font-size: .8rem;
height: 1.2rem;
padding-left: 0px;
padding-right: 4px;
}
}
.hero__cta {
Expand Down
9 changes: 5 additions & 4 deletions docs-website/src/pages/_components/Hero/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import { animate, motion, useMotionValue, useTransform } from "framer-motion";

const SOLUTION_TEXTS = ["AI Governance", "Data Discovery", "AI Collaboration", "Data Governance", "Data Democratization", "Data Observability"];

const Hero = ({}) => {
const Hero = ({ onOpenTourModal }) => {
// const { colorMode } = useColorMode();
const textIndex = useMotionValue(0);
const baseText = useTransform(textIndex, (latest) => SOLUTION_TEXTS[latest] || "");
Expand Down Expand Up @@ -71,12 +71,13 @@ const Hero = ({}) => {
<Link className="cta__primary" to="/cloud">
Book a Demo
</Link>
<Link
<a
className="cta__secondary"
to="https://www.acryldata.io/tour"
// to="https://www.acryldata.io/tour"
onClick={onOpenTourModal}
>
Product Tour
</Link>
</a>
</div>
<Link className="hero__footer_cta" to="/docs">
Get started with Core →
Expand Down
7 changes: 5 additions & 2 deletions docs-website/src/pages/_components/Trial/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import styles from "./trial.module.scss";
import useBaseUrl from "@docusaurus/useBaseUrl";
import Link from "@docusaurus/Link";

const Trial = () => {
const Trial = ({onOpenTourModal}) => {
return (
<div className={styles.container}>
<div className={styles.trial}>
Expand All @@ -15,7 +15,10 @@ const Trial = () => {
</p>
<div className={styles.btn_div}>
<Link to="/cloud">Book a Demo</Link>
<Link to="https://www.acryldata.io/tour">Product Tour</Link>
<a
// to="https://www.acryldata.io/tour"
onClick={onOpenTourModal}
>Product Tour</a>
</div>
<Link className={styles.start_arrow} to="/docs">Get started with Core →</Link>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs-website/src/pages/_components/Trial/trial.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
flex-direction: column;
width: 90vw;
min-width: 0;
margin: 2rem auto;
margin: 4rem auto;
}
.trial {
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion docs-website/src/pages/cloud/UnifiedTabs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ const TabbedComponent = () => {
{activeTab === index && (
<div className={clsx(styles.imageContainer, styles.mobileImageContainer)}>
<div className={clsx(styles.tabImage)}>
<video src={tabs[activeTab].image} controls={false} autoPlay muted loop />
<video playsInline src={tabs[activeTab].image} controls={false} autoPlay muted loop />
</div>
</div>
)}
Expand Down
22 changes: 19 additions & 3 deletions docs-website/src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React, { useState } from "react";
import Layout from "@theme/Layout";
import Link from "@docusaurus/Link";
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
Expand All @@ -17,6 +17,7 @@ import Community from "./_components/Community";
import SocialMedia from "./_components/SocialMedia";
import CaseStudy from "./_components/CaseStudy";
import Trial from "./_components/Trial";
import CloseButton from "@ant-design/icons/CloseCircleFilled";

const companyIndexes = require("../../adoptionStoriesIndexes.json");
const companies = companyIndexes.companies;
Expand All @@ -33,12 +34,27 @@ function Home() {
window.location.replace("/docs");
}

const [isTourModalVisible, setIsTourModalVisible] = useState(false);
const onOpenTourModal = () => {
setIsTourModalVisible(true);
};
const onCloseTourModal = () => {
setIsTourModalVisible(false);
};
return !siteConfig.customFields.isSaas ? (
<Layout
title={siteConfig.tagline}
description="DataHub is a data discovery application built on an extensible data catalog that helps you tame the complexity of diverse data ecosystems."
>
<Hero />
{isTourModalVisible ? (
<div className="tourModal">
<div className="closeButtonWrapper" onClick={onCloseTourModal}>
<CloseButton />
</div>
<iframe src="https://www.acryldata.io/tour" />
</div>
) : null}
<Hero onOpenTourModal={onOpenTourModal} />
<div className="comapny__logos">
<div className="text">
Trusted by industry leaders&nbsp;
Expand Down Expand Up @@ -73,7 +89,7 @@ function Home() {
<Community />
<SocialMedia />
<CaseStudy />
<Trial />
<Trial onOpenTourModal={onOpenTourModal} />
{/* <Section>
<div className="container">
<div className="row row--centered">
Expand Down
47 changes: 47 additions & 0 deletions docs-website/src/styles/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,53 @@ div[class^="announcementBar"] {
}
}
}

@keyframes openModal {
0% {
opacity: 0;
scale: .8;
}
100% {
opacity: 1;
scale: 1;
}
}

.tourModal {
position: fixed;
top: 0; left: 0;
height: 100%;
width: 100%;
background-color: #000000CC;
z-index: 1000;
display: flex;
justify-content: center;
align-items: center;

animation: openModal .3s ease-out;

iframe {
border-radius: 24px;
overflow: hidden;
width: 98%;
height: 98%;
}
.closeButtonWrapper {
position: absolute;
top: 24px;
right: 24px;
z-index: 100;
cursor: pointer;

span {
font-size: 36px;
path {
color: #CCC;
}
}
}
}

@media only screen and (max-width: 800px) {
.comapny__logos {
flex-direction: column;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.ObjectNode;
import com.linkedin.common.AuditStamp;
import com.linkedin.data.template.StringArrayMap;
import com.linkedin.metadata.aspect.patch.PatchOperationType;
import com.linkedin.structured.PropertyCardinality;
Expand All @@ -29,6 +30,10 @@ public class StructuredPropertyDefinitionPatchBuilder
public static final String ENTITY_TYPES_FIELD = "entityTypes";
public static final String DESCRIPTION_FIELD = "description";
public static final String IMMUTABLE_FIELD = "immutable";
private static final String LAST_MODIFIED_KEY = "lastModified";
private static final String CREATED_KEY = "created";
private static final String TIME_KEY = "time";
private static final String ACTOR_KEY = "actor";

// can only be used when creating a new structured property
public StructuredPropertyDefinitionPatchBuilder setQualifiedName(@Nonnull String name) {
Expand Down Expand Up @@ -134,6 +139,30 @@ public StructuredPropertyDefinitionPatchBuilder setImmutable(boolean immutable)
return this;
}

public StructuredPropertyDefinitionPatchBuilder setLastModified(
@Nonnull AuditStamp lastModified) {
ObjectNode lastModifiedValue = instance.objectNode();
lastModifiedValue.put(TIME_KEY, lastModified.getTime());
lastModifiedValue.put(ACTOR_KEY, lastModified.getActor().toString());

pathValues.add(
ImmutableTriple.of(
PatchOperationType.ADD.getValue(), "/" + LAST_MODIFIED_KEY, lastModifiedValue));

return this;
}

public StructuredPropertyDefinitionPatchBuilder setCreated(@Nonnull AuditStamp created) {
ObjectNode createdValue = instance.objectNode();
createdValue.put(TIME_KEY, created.getTime());
createdValue.put(ACTOR_KEY, created.getActor().toString());

pathValues.add(
ImmutableTriple.of(PatchOperationType.ADD.getValue(), "/" + CREATED_KEY, createdValue));

return this;
}

@Override
protected String getAspectName() {
return STRUCTURED_PROPERTY_DEFINITION_ASPECT_NAME;
Expand Down
Loading

0 comments on commit 2263859

Please sign in to comment.