Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
philipperolet committed Dec 11, 2024
1 parent 6332852 commit 8780176
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions front/components/poke/plugins/RunPluginDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ export function RunPluginDialog({
manifest={manifest}
onSubmit={onSubmit}
/>
{manifest.warning && (
<PokeAlert variant="destructive">
<PokeAlertTitle>Warning</PokeAlertTitle>
<PokeAlertDescription>{manifest.warning}</PokeAlertDescription>
</PokeAlert>
)}
</>
)}
</PokeDialogContent>
Expand Down
4 changes: 3 additions & 1 deletion front/lib/api/poke/plugins/global/batch_downgrade.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { Err, Ok } from "@dust-tt/types";
import { Op } from "sequelize";

import { createPlugin } from "@app/lib/api/poke/types";
import { Workspace } from "@app/lib/models/workspace";
import { Op } from "sequelize";
import { internalSubscribeWorkspaceToFreeNoPlan } from "@app/lib/plans/subscription";
import { launchScheduleWorkspaceScrubWorkflow } from "@app/temporal/scrub_workspace/client";

export const batchDowngradePlugin = createPlugin(
{
id: "batch-downgrade",
name: "Batch Downgrade Workspaces",
warning:
"Downgrading workspaces will block access, make sure all workspaces from your list should really be downgraded.",
description:
"Downgrade a list of workspaces to NO_PLAN, used to block access to fraudulent users",
resourceTypes: ["global"],
Expand Down
4 changes: 2 additions & 2 deletions front/lib/api/poke/plugins/global/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * from "./create_workspace";
export * from "./batch_downgrade";
export * from "./batch_downgrade";
export * from "./create_workspace";
1 change: 1 addition & 0 deletions types/src/front/lib/poke/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export interface PluginManifest<T extends PluginArgs> {
id: string;
name: string;
resourceTypes: string[];
warning?: string;
}

export interface PluginWorkspaceResource {
Expand Down

0 comments on commit 8780176

Please sign in to comment.