-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't show the "Source imported successfully" modal when unpacking ex…
…ample projects (#6260) * Don't show the "Source imported successfully" modal when unpacking example projects * Review
- Loading branch information
1 parent
1d52dc8
commit c7761a4
Showing
3 changed files
with
30 additions
and
5 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { | ||
getRuntimeServiceListResourcesQueryKey, | ||
runtimeServiceListResources, | ||
type V1Resource, | ||
} from "@rilldata/web-common/runtime-client"; | ||
import { queryClient } from "../../lib/svelte-query/globalQueryClient"; | ||
|
||
export async function isLeafResource(resource: V1Resource, instanceId: string) { | ||
const allResources = await queryClient.fetchQuery({ | ||
queryKey: getRuntimeServiceListResourcesQueryKey(instanceId, undefined), | ||
queryFn: () => runtimeServiceListResources(instanceId, undefined), | ||
}); | ||
|
||
if (!allResources || !allResources.resources) return false; | ||
|
||
const hasDownstreamResource = allResources.resources.some((r: V1Resource) => | ||
r.meta?.refs?.some((ref) => ref.name === resource.meta?.name?.name), | ||
); | ||
|
||
return !hasDownstreamResource; | ||
} |
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
c7761a4
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.
🎉 Published on https://ui.rilldata.io as production
🚀 Deployed on https://675bb8e56c1b9b7ea412e856--rill-ui-stage.netlify.app
c7761a4
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.
🎉 Published on https://ui.rilldata.com as production
🚀 Deployed on https://675bc81759e03483c5320e46--rill-ui.netlify.app