Files
claude code agent 003a90c235 feat(ce): collapse BE edition gating in Docker/Kubernetes/Edge views
Remove always-false isBE branches, BE-only teaser controls and the
now-dead imports across the Docker, Kubernetes and Edge-stack React
views. CE behaviour is preserved; only the Business Edition branches,
teasers and BE-only (non-functional) controls are removed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 06:33:03 +03:00

88 lines
2.2 KiB
TypeScript

import { Pod } from 'kubernetes-types/core/v1';
import { Stack } from '@/react/common/stacks/types';
import { EnvironmentId } from '@/react/portainer/environments/types';
import { isGitConfigDiverged } from '@/react/portainer/gitops/utils';
import { AddButton } from '@@/buttons';
import { useAppStackFile } from '../../queries/useAppStackFile';
import { Application } from '../../types';
import { applicationIsKind } from '../../utils';
import { EditButtons } from './EditButtons';
import { RedeployApplicationButton } from './RedeployApplicationButton';
import { RollbackApplicationButton } from './RollbackApplicationButton';
export function ButtonsLine({
stack,
environmentId,
externalApp,
appStackId,
appStackKind,
app,
name,
namespace,
}: {
stack?: Stack;
externalApp: boolean;
environmentId: EnvironmentId;
appStackId?: number;
appStackKind?: string;
namespace: string;
app?: Application;
name: string;
}) {
const appStackFileQuery = useAppStackFile(
{
id: stack?.Id ?? appStackId,
kind: appStackKind,
},
{
enabled:
!!stack &&
(!stack.GitConfig ||
!isGitConfigDiverged(stack.GitConfig, stack.CurrentDeploymentInfo)),
}
);
const appStackFileContent = appStackFileQuery.data;
return (
<div className="flex flex-wrap gap-2">
<EditButtons
isEdge={appStackKind === 'edge'}
stackId={stack?.Id ?? appStackId}
externalApp={externalApp}
stack={stack}
/>
{!applicationIsKind<Pod>('Pod', app) && (
<RedeployApplicationButton
environmentId={environmentId}
namespace={namespace}
appName={name}
app={app}
/>
)}
{!externalApp && (
<RollbackApplicationButton
environmentId={environmentId}
namespace={namespace}
appName={name}
app={app}
/>
)}
{appStackFileContent && (
<AddButton
to="kubernetes.templates.custom.new"
data-cy="k8sAppDetail-createCustomTemplateButton"
params={{
fileContent: appStackFileContent,
}}
>
Create template from application
</AddButton>
)}
</div>
);
}