refactor(gitops): make workflow detach EE-only [BE-13220] (#3195)

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Chaim Lev-Ari
2026-07-19 10:04:19 +03:00
committed by GitHub
parent 7f6fe01a68
commit 61e742a66a
4 changed files with 10 additions and 70 deletions
@@ -31,7 +31,7 @@ export function RadioGroup<T extends string | number = string>({
key={option.value}
className={
itemClassName ??
'col-sm-3 col-lg-2 control-label cursor-pointer !p-0 text-left font-normal'
'control-label cursor-pointer !p-0 text-left font-normal'
}
>
<input
@@ -56,12 +56,10 @@ function validateGit(): SchemaOf<FormValues['git']> {
tlsSkipVerify: bool(),
polling: object({
enabled: bool().required().default(false),
interval: string()
.default('')
.when('enabled', {
is: true,
then: intervalValidation(),
}),
interval: string().default('').when('enabled', {
is: true,
then: intervalValidation(),
}),
}),
connectionOk: bool()
.oneOf([true], 'The connection test must succeed before continuing.')
@@ -20,10 +20,12 @@ import { ItemView } from './ItemView';
const useCurrentStateAndParams = vi.fn(() => ({
params: { workflowId: 1 },
}));
const go = vi.fn();
vi.mock('@uirouter/react', async (importOriginal: () => Promise<object>) => ({
...(await importOriginal()),
useCurrentStateAndParams: () => useCurrentStateAndParams(),
useRouter: () => ({ stateService: { go } }),
}));
// Avoid ui-router relative/unregistered state resolution in tests, same as WidgetTabs.test.tsx
@@ -79,6 +81,7 @@ describe('ItemView', () => {
});
function renderComponent(workflow: Workflow = mockWorkflowHealthy) {
go.mockClear();
useCurrentStateAndParams.mockReturnValue({
params: { workflowId: workflow.id },
});
@@ -1,20 +1,13 @@
import { GitCommit, PenBoxIcon, PauseIcon, RefreshCwIcon } from 'lucide-react';
import _ from 'lodash';
import { GitCommit } from 'lucide-react';
import { Icon } from '@@/Icon';
import { ResourceDetailHeader } from '@@/ResourceDetailHeader/ResourceDetailHeader';
import { HeaderStats } from '@@/ResourceDetailHeader/HeaderStats';
import { ResourceStatBlock } from '@@/ResourceDetailHeader/ResourceStatBlock';
import { ActionBarShell } from '@@/ResourceDetailHeader/ActionBarShell';
import { Button } from '@@/buttons';
import { DeleteButton } from '@@/buttons/DeleteButton';
import { TooltipWithChildren } from '@@/Tip/TooltipWithChildren';
import { Workflow } from '../types';
import { StatusBadge } from '../../components/StatusBadge';
import { computeTargetRollup, effectiveWorkflowStatus } from '../status';
const COMING_SOON_MESSAGE = 'Coming soon';
import { effectiveWorkflowStatus, computeTargetRollup } from '../status';
interface Props {
workflow: Workflow;
@@ -44,60 +37,6 @@ export function WorkflowResourceHeader({ workflow }: Props) {
</ResourceStatBlock>
</HeaderStats>
}
actionBar={
<ActionBarShell>
<div className="flex items-center gap-2">
<TooltipWithChildren message={COMING_SOON_MESSAGE}>
<span>
<Button
icon={PenBoxIcon}
color="light"
disabled
data-cy="workflow-edit-button"
>
Edit
</Button>
</span>
</TooltipWithChildren>
<TooltipWithChildren message={COMING_SOON_MESSAGE}>
<span>
<Button
icon={RefreshCwIcon}
color="light"
disabled
data-cy="workflow-sync-button"
>
Force sync
</Button>
</span>
</TooltipWithChildren>
<TooltipWithChildren message={COMING_SOON_MESSAGE}>
<span>
<Button
icon={PauseIcon}
color="light"
disabled
data-cy="workflow-pause-button"
>
Pause
</Button>
</span>
</TooltipWithChildren>
</div>
<div className="ml-auto">
<TooltipWithChildren message={COMING_SOON_MESSAGE}>
<span>
<DeleteButton
confirmMessage="Are you sure you want to delete this workflow?"
onConfirmed={_.noop}
data-cy="workflow-delete-button"
disabled
/>
</span>
</TooltipWithChildren>
</div>
</ActionBarShell>
}
/>
);
}