-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ui/java) Update domains to be nested #8841
Merged
chriscollins3456
merged 143 commits into
datahub-project:master
from
chriscollins3456:cc--nested-domains-public
Sep 18, 2023
Merged
Changes from 137 commits
Commits
Show all changes
143 commits
Select commit
Hold shift + click to select a range
6447d3a
Add feature flag for Nested Domains work
chriscollins3456 2be1631
feat(nested-domains): parentDomain model change
0372cde
Add feature flag for Nested Domains work (#1672)
chriscollins3456 6079f1c
feat(nested-domains): parentDomain model change (#1674)
joshuaeilers 9814f02
set up skeleton for new manage domains page
chriscollins3456 a179c68
get sidebar and header of page together
chriscollins3456 90cdea8
show root domains
chriscollins3456 0e1fbdf
display domains sidebar on domain profile page
chriscollins3456 c45803c
update styling
chriscollins3456 339a947
fix routing situation when flag is off
chriscollins3456 0893ee4
feat(nested-domains): parentDomain in listDomains resolver
3c552e2
add parentDomain input to create domain resolver
4decf3e
back out a gql field
56644fc
add todos
2c84014
get test to pass
3548a4e
feat(nested-domains): parentDomain in listDomains/create resolvers (#…
joshuaeilers cd1a627
PR edits
chriscollins3456 00d9c3e
chore(nested-domains): list and create tests
efcc8cb
Add new Domains home page behind feature flag (#1678)
chriscollins3456 0fa4c3f
feat(nested-domains): support children relationship query
0fbc505
chore(nested-domains): list and create tests (#1683)
joshuaeilers 8a551c3
feat(nested-domains): support children relationship query (#1684)
joshuaeilers 2eb31ab
feat(nested-domains): validate domain names
8da12db
improve validation
d851e87
plug in more usage of static const
d4b4e95
remove todo
297f26e
add DomainNavigator and allow exploration of domains
chriscollins3456 4638ada
set entity data and show styled selected domain in sidebar
chriscollins3456 2a94f29
remove a filter mock we don't need
554bf70
feat(nested-domains): validate domain names (#1685)
joshuaeilers d111394
feat(nested-domains): validate name is unique per level
fb0595c
feat(nested-domains): validate name is unique per level (#1686)
joshuaeilers 9c8b342
hide toggle if no domain children
chriscollins3456 4dfe084
Do not allow deleting a domain with child domains
a8d8c15
feat(nested-domains): ParentDomainsResolver
814227e
back out parentDomains from list resolver for now
eacccb0
s/thenThrow/assertThrow
87a0808
feat(ui) Creeate and display Domains Navigator (#1689)
chriscollins3456 d98cf77
more generic graphql resolver
b54da1d
first pass
eboneil 1e28dc4
clean up a bit
eboneil d2d5584
feat(domains): Do not allow deleting a domain with child domains (#1690)
iprentic 687d860
feat(nested-domains): ParentDomainsResolver (#1691)
joshuaeilers 0cba2c4
remove console.log
9fe4e83
Update Domain search result card to include more info
chriscollins3456 3b4a779
merge in nested-domains-feature-branch and resolve conflict
chriscollins3456 8d0d13f
get the rest
eboneil ca726d2
clean up
eboneil 87eb38d
PR comment
eboneil a0804b6
before testing subdomains
eboneil ed842a1
tweak
eboneil f270ae7
Auto open domain navigator to current domain
chriscollins3456 72f266b
feat(nested-domains) consistent domain logos (#1698)
eboneil 9d1b78e
fix(nested-domains): better error handling on name collisions
beedf64
fix(nested-domains): better error handling on name collisions (#1705)
joshuaeilers 291c77e
add parent node field in modal and set things up
chriscollins3456 1a46978
allow selecting of parents in modals and update parent cache
chriscollins3456 4d79622
implement parentDomainsToUpdate after creating a domain
chriscollins3456 465a875
final pieces for create domain
chriscollins3456 0581fde
update useEffect
chriscollins3456 ba43023
Allow creating nested domains from the FE (#1694)
chriscollins3456 e1ca302
Handle deleting a domain and update sidebar
chriscollins3456 b0c4da4
Merge branch 'nested-domains-feature-branch' into cc--domain-search-card
chriscollins3456 3f7cc30
Update Domain search result card to include more info (#1697)
chriscollins3456 5d84bea
Handle deleting a domain and update sidebar (#1708)
joshuaeilers 8be73d6
fix(nested-domains): unbreak gql file
e087183
add search to sidebar
eboneil 9f38b2a
fix(nested-domains): unbreak gql file (#1709)
chriscollins3456 9f18dc9
Merge branch 'nested-domains-feature-branch' into manage_domains_sear…
eboneil 7f71bb2
add search bar
eboneil 7bb7075
clean up
eboneil 5b4e16d
feat(nested-domains) Disable delete if domain has subdomains (#1700)
eboneil 1d93263
feat(nested-domains): authorization by parent domain
f9007f7
Add debounce
eboneil 3c0742b
Display parent domain path in various places for domains
chriscollins3456 e21a94c
chore(nested-domains): test for parent domain auth
f73018b
rm logs
16b573d
fix bug in ParentEntities
chriscollins3456 035e03a
Fix typo in nested domains context
chriscollins3456 614afe1
feat(nested-domains): authorization by parent domain (#1713)
joshuaeilers ac47b6b
tests for parent domain auth (#1720)
joshuaeilers acfa15a
feat(nested-domains) Manage domains search (#1711)
eboneil d70dae6
Update domains section on homepage
chriscollins3456 c585d7b
chore(nested-domains): more auth tests
b4af40d
feat(nested-domains): adjust copy on policy builder
fdaf0b8
Fix typo in nested domains context (#1721)
chriscollins3456 1c5a7fc
merge in nested-domains-feature-branch, resolve conflicts
chriscollins3456 5102174
Auto open domain navigator to current domain (#1701)
chriscollins3456 6aac656
Display parent domain path in various places for domains (#1719)
chriscollins3456 3d64d33
fix weird filter logic
chriscollins3456 3f7342e
Update domains section on homepage (#1722)
chriscollins3456 34ce378
update caching function
chriscollins3456 fad75de
chore(nested-domains): more auth tests (#1724)
joshuaeilers 5102e46
adjust copy some more
6aaf767
more copy
9f6af1b
adjust
bb54f72
adjust copy on policy builder (#1725)
joshuaeilers 1c4b064
use navigator when selecting a domain
chriscollins3456 90d7be2
feat(nested-domains): move domain resolver
a04f9a4
use navigator in polict builder
chriscollins3456 6bb4e6b
test updates
cc1dd38
Reuse domain navigator for selecting domains in remaining places (#1731)
chriscollins3456 c8bf2a8
move domain resolver (#1732)
joshuaeilers aaa745a
fix(nested-domains): do not overlap button icon
3c04bfd
remove an unused graphql definition that wasn't compiling
cdd1bc8
feat(nested-domains): move parent
af7712d
fix(nested-domains): do not overlap button icon (#1733)
joshuaeilers 41bfaae
wip
862274e
Merge remote-tracking branch 'private/nested-domains-feature-branch' …
dff1fe7
big wip
aa2dd03
fix(nested-domains): prevent parent cycles
bf4a676
cmt
60cf7f4
fix(nested-domains): Hide child when moving
06ba5e8
sort domains by display name
3d4b064
code review feedback
1e5cfb6
feat(nested-domains): move parent (#1734)
joshuaeilers 5d5261c
prevent parent domain cycles in auth / resolver (#1738)
joshuaeilers 7ce14da
fix(nested-domains): Hide child when moving (#1739)
joshuaeilers b101f41
sort domains by name (#1741)
joshuaeilers e2345d9
feat(nested-domains): domain autocomplete improvements
7502f94
nested domain analytics
1ac8a76
feat(nested-domains): domain autocomplete improvements (#1742)
joshuaeilers b8aa3e6
remove log
396b6ac
Merge branch 'nested-domains-feature-branch' into je--nested-domain-a…
joshuaeilers 27ddd91
remove "your domains" header
7439bfe
styling feedback
048cdc7
better clear handling
f4330e2
tidy up
99fe0b5
nested domain analytics (#1743)
joshuaeilers 4b3ddda
Create domain modal ui tweaks (#1744)
joshuaeilers af9310e
feature flag wire up
a8575d1
use domains context in v1
e0be65d
fix move link condition
550ab19
feature flag wire up (#1749)
joshuaeilers 8728358
fix(nested-domains): show parent path in modals
fe7160f
fix(nested-domains): show parent path in modals (#1769)
joshuaeilers 162ffe9
merge in master, resolve conflicts
chriscollins3456 96917fb
remove unneeded stuff
chriscollins3456 948eb2c
remove slf4j from test
chriscollins3456 d13eddc
format tests
chriscollins3456 89f23e3
fix broken test
chriscollins3456 b9d4a2e
fix cypress tests
chriscollins3456 86cfb06
fix cypress tests (finally)
chriscollins3456 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
...re/src/main/java/com/linkedin/datahub/graphql/resolvers/domain/ParentDomainsResolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.linkedin.datahub.graphql.resolvers.domain; | ||
|
||
import com.linkedin.common.urn.Urn; | ||
import com.linkedin.common.urn.UrnUtils; | ||
import com.linkedin.datahub.graphql.QueryContext; | ||
import com.linkedin.datahub.graphql.generated.Entity; | ||
import com.linkedin.datahub.graphql.generated.ParentDomainsResult; | ||
import com.linkedin.datahub.graphql.resolvers.mutate.util.DomainUtils; | ||
import com.linkedin.entity.client.EntityClient; | ||
import graphql.schema.DataFetcher; | ||
import graphql.schema.DataFetchingEnvironment; | ||
|
||
import java.util.ArrayList; | ||
import java.util.HashSet; | ||
import java.util.List; | ||
import java.util.Set; | ||
import java.util.concurrent.CompletableFuture; | ||
|
||
import static com.linkedin.metadata.Constants.DOMAIN_ENTITY_NAME; | ||
|
||
public class ParentDomainsResolver implements DataFetcher<CompletableFuture<ParentDomainsResult>> { | ||
|
||
private final EntityClient _entityClient; | ||
|
||
public ParentDomainsResolver(final EntityClient entityClient) { | ||
_entityClient = entityClient; | ||
} | ||
|
||
@Override | ||
public CompletableFuture<ParentDomainsResult> get(DataFetchingEnvironment environment) { | ||
final QueryContext context = environment.getContext(); | ||
final Urn urn = UrnUtils.getUrn(((Entity) environment.getSource()).getUrn()); | ||
final List<Entity> parentDomains = new ArrayList<>(); | ||
final Set<String> visitedParentUrns = new HashSet<>(); | ||
|
||
if (!DOMAIN_ENTITY_NAME.equals(urn.getEntityType())) { | ||
throw new IllegalArgumentException(String.format("Failed to resolve parents for entity type %s", urn)); | ||
} | ||
|
||
return CompletableFuture.supplyAsync(() -> { | ||
try { | ||
Entity parentDomain = DomainUtils.getParentDomain(urn, context, _entityClient); | ||
|
||
while (parentDomain != null && !visitedParentUrns.contains(parentDomain.getUrn())) { | ||
parentDomains.add(parentDomain); | ||
visitedParentUrns.add(parentDomain.getUrn()); | ||
parentDomain = DomainUtils.getParentDomain(Urn.createFromString(parentDomain.getUrn()), context, _entityClient); | ||
} | ||
|
||
final ParentDomainsResult result = new ParentDomainsResult(); | ||
result.setCount(parentDomains.size()); | ||
result.setDomains(parentDomains); | ||
return result; | ||
} catch (Exception e) { | ||
throw new RuntimeException(String.format("Failed to load parent domains for entity %s", urn), e); | ||
} | ||
}); | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to do this todo, I'll push a PR to remove it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually since it's on your branch, can you update it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you bet