Skip to content

Commit

Permalink
Adjust github url edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
AdityaHegde committed Jul 17, 2024
1 parent c57aa21 commit ec24980
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<script lang="ts">
import { createAdminServiceUpdateProject } from "@rilldata/web-admin/client";
import {
createAdminServiceGetProject,
createAdminServiceUpdateProject,
getAdminServiceGetGithubUserStatusQueryKey,
} from "@rilldata/web-admin/client";
import { GithubRepoUpdater } from "@rilldata/web-admin/features/projects/github/GithubRepoUpdater";
import {
AlertDialog,
Expand All @@ -15,6 +19,9 @@
import Select from "@rilldata/web-common/components/forms/Select.svelte";
import Spinner from "@rilldata/web-common/features/entity-management/Spinner.svelte";
import { EntityStatus } from "@rilldata/web-common/features/entity-management/types";
import { eventBus } from "@rilldata/web-common/lib/event-bus/event-bus";
import { queryClient } from "@rilldata/web-common/lib/svelte-query/globalQueryClient";
import { invalidateRuntimeQueries } from "@rilldata/web-common/runtime-client/invalidation";
import type { AxiosError } from "axios";
export let open = false;
Expand All @@ -25,6 +32,7 @@
const githubRepoUpdater = new GithubRepoUpdater();
const githubRepos = githubRepoUpdater.userRepos;
const status = githubRepoUpdater.status;
const projectQuery = createAdminServiceGetProject(organization, project);
$: repoSelections =
$githubRepos.data?.repos?.map((r) => ({
Expand All @@ -41,6 +49,17 @@
githubUrl,
},
});
eventBus.emit("notification", {
message: `Set github repo to ${githubUrl}`,
type: "success",
});
void queryClient.refetchQueries(
getAdminServiceGetGithubUserStatusQueryKey(),
);
void invalidateRuntimeQueries(
queryClient,
$projectQuery.data.prodDeployment.runtimeInstanceId,
);
open = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@
>Github</span
>
<div class="flex items-start gap-x-1">
<div class="py-0.5">
<div class="py-0.5 mt-1">
<Github className="w-4 h-4" />
</div>
<div class="flex flex-col">
{#if isGithubConnected}
<div class="flex flex-row items-center">
<div class="flex flex-row gap-x-1 items-center">
<a
href={$proj.data?.project?.githubUrl}
class="text-gray-800 text-[12px] font-semibold font-mono leading-5 truncate"
Expand Down

0 comments on commit ec24980

Please sign in to comment.