diff --git a/cli/pkg/local/server.go b/cli/pkg/local/server.go
index 8b3e8d9b3cd..500f555b13d 100644
--- a/cli/pkg/local/server.go
+++ b/cli/pkg/local/server.go
@@ -600,8 +600,6 @@ func (s *Server) RedeployProject(ctx context.Context, r *connect.Request[localv1
if err != nil {
return nil, err
}
- } else {
- // TODO: should we push change to github for redeploy on github connected project?
}
// TODO : Add other update project fields
diff --git a/web-common/src/features/dashboards/workspace/DeployDashboardCTA.svelte b/web-common/src/features/dashboards/workspace/DeployDashboardCTA.svelte
index e8e2c695b42..4a2e4008d34 100644
--- a/web-common/src/features/dashboards/workspace/DeployDashboardCTA.svelte
+++ b/web-common/src/features/dashboards/workspace/DeployDashboardCTA.svelte
@@ -11,13 +11,10 @@
import DeployIcon from "@rilldata/web-common/components/icons/DeployIcon.svelte";
import Tooltip from "@rilldata/web-common/components/tooltip/Tooltip.svelte";
import TooltipContent from "@rilldata/web-common/components/tooltip/TooltipContent.svelte";
- import { createDeployer } from "@rilldata/web-common/features/project/deploy";
- import { waitUntil } from "@rilldata/web-common/lib/waitUtils";
+ import { ProjectDeployer } from "@rilldata/web-common/features/project/deploy";
import { behaviourEvent } from "@rilldata/web-common/metrics/initMetrics";
- import {
- createLocalServiceDeployValidation,
- createLocalServiceRedeploy,
- } from "@rilldata/web-common/runtime-client/local-service";
+ import { createLocalServiceDeployValidation } from "@rilldata/web-common/runtime-client/local-service";
+ import { get } from "svelte/store";
import { Button } from "../../../components/button";
export let type: "primary" | "secondary" = "primary";
@@ -28,41 +25,37 @@
},
});
$: isDeployed = !!$deployValidation.data?.deployedProjectId;
+ const deployer = new ProjectDeployer();
+ const deployerStatus = deployer.getStatus();
+ const deploying = deployer.deploying;
let open = false;
function onShowDeploy() {
- if (isDeployed) {
- return onDeploy();
+ if (deployer.isDeployed) {
+ return deployer.deploy();
}
open = true;
void behaviourEvent?.fireDeployIntentEvent();
}
- let deploying = false;
- const deploy = createDeployer();
- const redeploy = createLocalServiceRedeploy();
- $: isLoading = $deploy.isLoading || $redeploy.isLoading;
-
async function onDeploy() {
- deploying = true;
-
- await waitUntil(() => !$deployValidation.isLoading);
- if (!(await $deploy.mutateAsync($deployValidation.data!))) return;
-
- deploying = false;
+ if (!(await deployer.validate())) return;
+ await deployer.deploy();
open = false;
}
function handleVisibilityChange() {
- if (document.visibilityState !== "visible" || !deploying) return;
- void onDeploy();
+ if (document.visibilityState !== "visible" || !get(deploying)) return;
+ void deployer.validate();
}
+
+ $: console.log($deployerStatus);
-