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
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type * as SCHEMA from "@ctrlplane/db/schema";
import type { NodeProps } from "reactflow";
import { IconPlant } from "@tabler/icons-react";
import { Handle, Position } from "reactflow";
Expand All @@ -12,7 +11,6 @@ import { VersionSelectorCheck } from "../checks/VersionSelector";

type EnvironmentNodeProps = NodeProps<{
workspaceId: string;
policy?: SCHEMA.EnvironmentPolicy;
versionId: string;
versionTag: string;
deploymentId: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,10 @@ export const EnvironmentTabs: React.FC = () => {
const overviewUrl = environmentUrls.overview();
const deploymentsUrl = environmentUrls.deployments();
const resourcesUrl = environmentUrls.resources();
const policiesUrl = environmentUrls.policies();
const settingsUrl = environmentUrls.settings();

const pathname = usePathname();
const getInitialTab = () => {
if (pathname === policiesUrl) return "policies";
if (pathname === resourcesUrl) return "resources";
if (pathname === deploymentsUrl) return "deployments";
if (pathname === baseUrl) return "overview";
Expand All @@ -44,7 +42,6 @@ export const EnvironmentTabs: React.FC = () => {
if (value === "overview") router.push(overviewUrl);
if (value === "deployments") router.push(deploymentsUrl);
if (value === "resources") router.push(resourcesUrl);
if (value === "policies") router.push(policiesUrl);
if (value === "settings") router.push(settingsUrl);
setActiveTab(value);
};
Expand All @@ -55,7 +52,6 @@ export const EnvironmentTabs: React.FC = () => {
<TabsTrigger value="overview">Overview</TabsTrigger>
<TabsTrigger value="deployments">Deployments</TabsTrigger>
<TabsTrigger value="resources">Resources</TabsTrigger>
<TabsTrigger value="policies">Policies</TabsTrigger>
<TabsTrigger value="settings">Settings</TabsTrigger>
</TabsList>
</Tabs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
IconChartBar,
IconClipboardCopy,
IconExternalLink,
IconLock,
IconRefresh,
IconSettings,
IconTrash,
Expand Down Expand Up @@ -96,14 +95,6 @@ export const EnvironmentDropdown: React.FC<EnvironmentDropdownProps> = ({
Settings
</DropdownMenuItem>

<DropdownMenuItem
className="flex cursor-pointer items-center gap-2"
onClick={() => router.push(environmentUrls.policies())}
>
<IconLock className="h-4 w-4" />
Policies
</DropdownMenuItem>

<DropdownMenuItem
className="flex cursor-pointer items-center gap-2"
onClick={() => router.push(environmentUrls.variables())}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const GET = request()
const { environmentId } = await params;
const environment = await ctx.db.query.environment.findFirst({
where: eq(schema.environment.id, environmentId),
with: { policy: true, metadata: true },
with: { metadata: true },
});
if (environment == null)
return NextResponse.json(
Expand Down
9 changes: 0 additions & 9 deletions apps/webservice/src/app/api/v1/environments/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,6 @@ export const openapi: Swagger.SwaggerV3 = {
type: "object",
additionalProperties: true,
},
policyId: {
type: "string",
},
releaseChannels: {
type: "array",
items: {
type: "string",
},
},
metadata: {
type: "object",
additionalProperties: { type: "string" },
Expand Down
1 change: 0 additions & 1 deletion apps/webservice/src/app/urls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ const environment = (params: EnvironmentParams) => {
return {
baseUrl: () => buildUrl(...base),
deployments: () => buildUrl(...base, "deployments"),
policies: () => buildUrl(...base, "policies"),
resources: () => buildUrl(...base, "resources"),
variables: () => buildUrl(...base, "variables"),
settings: () => buildUrl(...base, "settings"),
Expand Down
85 changes: 0 additions & 85 deletions packages/api/src/router/environment-approval.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,15 @@ export const getDeploymentStats = async (
].filter(isPresent),
};

const row = await db
const version = await db
.select()
.from(SCHEMA.deploymentVersion)
.leftJoin(
SCHEMA.environmentPolicyApproval,
and(
eq(
SCHEMA.environmentPolicyApproval.deploymentVersionId,
SCHEMA.deploymentVersion.id,
),
eq(SCHEMA.environmentPolicyApproval.policyId, environment.policyId),
),
)
.leftJoin(
SCHEMA.user,
eq(SCHEMA.environmentPolicyApproval.userId, SCHEMA.user.id),
)
.where(and(eq(SCHEMA.deploymentVersion.deploymentId, deployment.id)))
.orderBy(desc(SCHEMA.deploymentVersion.createdAt))
.limit(1)
.then(takeFirstOrNull);

if (row == null) return null;

const { deployment_version: version, user } = row;
if (version == null) return null;

const resources = await db
.select()
Expand Down Expand Up @@ -157,7 +141,7 @@ export const getDeploymentStats = async (
status,
resourceCount,
duration,
deployedBy: user?.name ?? null,
deployedBy: null,
successRate,
deployedAt: version.createdAt,
};
Expand Down
Loading
Loading