Skip to content
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(editor-3001): dependency tree #27183

Merged
merged 6 commits into from
Dec 31, 2024
Merged

Conversation

EDsCODE
Copy link
Member

@EDsCODE EDsCODE commented Dec 30, 2024

Problem

  • hard to understand views

Changes

  • add dependency tree for seeing view dependencies
Screenshot 2024-12-30 at 2 33 50 PM

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Does this work well for both Cloud and self-hosted?

How did you test this code?

Copy link
Contributor

github-actions bot commented Dec 30, 2024

Size Change: -28 B (0%)

Total Size: 1.11 MB

ℹ️ View Unchanged
Filename Size Change
frontend/dist/toolbar.js 1.11 MB -28 B (0%)

compressed-size-action

@EDsCODE EDsCODE requested a review from Gilbert09 December 30, 2024 20:39
@EDsCODE EDsCODE marked this pull request as ready for review December 30, 2024 20:39
Comment on lines +54 to +72
const traverseAncestors = async (viewId: DataWarehouseSavedQuery['id'], level: number): Promise<void> => {
if (!nodes[viewId]?.savedQueryId) {
return
}

const result = await api.dataWarehouseSavedQueries.ancestors(viewId, level)
for (const ancestor of result.ancestors) {
nodes[ancestor] = {
nodeId: ancestor,
name:
values.viewsMapById[ancestor]?.name ||
values.dataWarehouseTablesMapById[ancestor]?.name ||
ancestor,
savedQueryId: values.viewsMapById[ancestor]?.id,
leaf: [...(nodes[ancestor]?.leaf || []), viewId],
}
await traverseAncestors(ancestor, 1)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I imagine this could create a lot of API requests if we have a large number of dependents on a node/view - maybe something to rethink in the future

@EDsCODE EDsCODE merged commit fba4288 into master Dec 31, 2024
103 checks passed
@EDsCODE EDsCODE deleted the editor-3001-dependency-tree branch December 31, 2024 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants