Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions web-common/src/components/alert-dialog/alert-dialog-content.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script lang="ts">
import { cn, flyAndScale } from "@rilldata/web-common/lib/shadcn";
import { AlertDialog as AlertDialogPrimitive } from "bits-ui";
import Cross2 from "svelte-radix/Cross2.svelte";
import * as AlertDialog from "web-common/src/components/alert-dialog/index.js";
import { cn, flyAndScale } from "@rilldata/web-common/lib/shadcn";

type $$Props = AlertDialogPrimitive.ContentProps;

let className: $$Props["class"] = undefined;
export let transition: $$Props["transition"] = flyAndScale;
export let transitionConfig: $$Props["transitionConfig"] = undefined;
export let noCancel = false;
export { className as class };
</script>

Expand All @@ -17,11 +19,19 @@
{transition}
{transitionConfig}
class={cn(
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-300 bg-surface p-6 shadow-lg sm:rounded-lg md:w-full",
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-slate-300 bg-surface p-6 shadow-lg sm:rounded-lg md:w-full",
className,
)}
{...$$restProps}
>
<slot />
{#if !noCancel}
<AlertDialogPrimitive.Cancel
class="absolute right-4 top-4 rounded-md opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground"
>
<Cross2 class="h-4 w-4" />
<span class="sr-only">Close</span>
</AlertDialogPrimitive.Cancel>
{/if}
</AlertDialogPrimitive.Content>
</AlertDialog.Portal>
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ export class WatchResourcesClient {
// If it's a new source, show the "Source imported successfully" modal
const isNewSource =
res.name.kind === ResourceKind.Source &&
res.resource.meta.specVersion === "1" &&
res.resource.meta.specVersion === "1" && // First file version
res.resource.meta.stateVersion === "2" && // First ingest is complete
(await isLeafResource(res.resource, this.instanceId)); // Protects against existing projects reconciling anew
if (isNewSource) {
const filePath = res.resource?.meta?.filePaths?.[0] as string;
Expand Down