Skip to content

Commit

Permalink
fix: issues with bookmarks selection and deletion (#5921)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde authored and ericpgreen2 committed Oct 16, 2024
1 parent 8c2bdbf commit d553424
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 7 additions & 3 deletions web-admin/src/features/bookmarks/Bookmarks.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
let showDialog = false;
let bookmark: BookmarkEntry | null = null;
$: bookmarkApplier = createBookmarkApplier($runtime?.instanceId, exploreName);
$: bookmarkApplier = createBookmarkApplier(
$runtime?.instanceId,
metricsViewName,
exploreName,
);
$: exploreStore = useExploreStore(exploreName);
$: projectId = useProjectId($page.params.organization, $page.params.project);
Expand Down Expand Up @@ -71,8 +75,8 @@
return queryClient.refetchQueries(
getAdminServiceListBookmarksQueryKey({
projectId: $projectId.data ?? "",
resourceKind: ResourceKind.MetricsView,
resourceName: metricsViewName,
resourceKind: ResourceKind.Explore,
resourceName: exploreName,
}),
);
}
Expand Down
8 changes: 6 additions & 2 deletions web-admin/src/features/bookmarks/applyBookmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ import { useExploreValidSpec } from "@rilldata/web-common/features/explores/sele
import { createQueryServiceMetricsViewSchema } from "@rilldata/web-common/runtime-client";
import { get } from "svelte/store";

export function createBookmarkApplier(instanceId: string, exploreName: string) {
export function createBookmarkApplier(
instanceId: string,
metricsViewName: string,
exploreName: string,
) {
const validExploreSpec = useExploreValidSpec(instanceId, exploreName);
const metricsSchema = createQueryServiceMetricsViewSchema(
instanceId,
exploreName,
metricsViewName,
);

return (bookmark: V1Bookmark) => {
Expand Down

1 comment on commit d553424

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

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

Please sign in to comment.