-
Notifications
You must be signed in to change notification settings - Fork 125
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
b853554
commit 326ab38
Showing
4 changed files
with
31 additions
and
6 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
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
326ab38
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.in as production
🚀 Deployed on https://675bb88e8944e57ab8790226--rill-ui-dev.netlify.app