deploy fix

This commit is contained in:
ValueOn AG 2026-02-12 00:39:51 +01:00
parent 9312e76737
commit 573a77be0b
5 changed files with 10 additions and 22 deletions

View file

@ -541,7 +541,7 @@ export function useAutomationTemplates() {
}, [request]);
const duplicateTemplate = useCallback(async (templateId: string) => {
const response = await request('POST', `/api/automation-templates/${templateId}/duplicate`);
const response = await request({ url: `/api/automation-templates/${templateId}/duplicate`, method: 'post' });
return response;
}, [request]);

View file

@ -54,6 +54,7 @@ export interface Role {
description?: string | { [key: string]: string };
mandateId?: string;
featureInstanceId?: string;
featureCode?: string;
isSystemRole?: boolean;
}

View file

@ -83,7 +83,7 @@ export const AdminAutomationEventsPage: React.FC = () => {
const _handleDelete = useCallback(async (eventId: string) => {
try {
setError(null);
const event = events.find(e => e.eventId === eventId);
const _event = events.find(e => e.eventId === eventId);
const encodedId = encodeURIComponent(eventId);
await api.post(`/api/admin/automation-events/${encodedId}/remove`);
setEvents(prev => prev.filter(e => e.eventId !== eventId));

View file

@ -53,7 +53,7 @@ export const AutomationTemplatesPage: React.FC = () => {
const columns = useMemo(() => [
{ key: 'label', label: 'Label', type: 'string' as const, sortable: true, searchable: true, width: 200 },
{ key: 'overview', label: 'Beschreibung', type: 'string' as const, width: 300 },
{ key: 'isSystem', label: 'Typ', type: 'custom' as const, width: 100, render: (value: boolean) =>
{ key: 'isSystem', label: 'Typ', type: 'boolean' as const, width: 100, formatter: (value: any) =>
value ? <span style={{ display: 'inline-flex', alignItems: 'center', gap: 4, fontSize: '0.75rem', padding: '0.125rem 0.5rem', borderRadius: 10, background: 'var(--info-color, #3182ce)', color: '#fff' }}><FaLock style={{ fontSize: '0.625rem' }} /> System</span>
: <span style={{ fontSize: '0.75rem', padding: '0.125rem 0.5rem', borderRadius: 10, background: 'var(--success-color, #38a169)', color: '#fff' }}>Instanz</span>
},
@ -124,17 +124,6 @@ export const AutomationTemplatesPage: React.FC = () => {
}
};
// Check if template is editable (system templates only by SysAdmin)
const _canEditTemplate = (template: AutomationTemplate) => {
if ((template as any).isSystem) return isSysAdmin;
return canUpdate;
};
const _canDeleteTemplate = (template: AutomationTemplate) => {
if ((template as any).isSystem) return isSysAdmin;
return canDelete;
};
if (error) {
return (
<div className={styles.adminPage}>
@ -211,8 +200,7 @@ export const AutomationTemplatesPage: React.FC = () => {
selectable={false}
actionButtons={[
{
type: 'custom' as const,
icon: <FaCopy />,
type: 'copy' as const,
title: 'Duplizieren',
onAction: handleDuplicate,
},

View file

@ -247,7 +247,7 @@ export const AutomationsPage: React.FC = () => {
// Handle duplicate automation
const handleDuplicate = async (automation: Automation) => {
try {
await request('POST', `/api/automations/${automation.id}/duplicate`);
await request({ url: `/api/automations/${automation.id}/duplicate`, method: 'post' });
showSuccess('Automatisierung dupliziert');
await refetch();
} catch (err: any) {
@ -341,7 +341,7 @@ export const AutomationsPage: React.FC = () => {
url: `/api/workflows/${workflowId}/logs`,
method: 'get',
params: lastLogIdRef.current ? { afterId: lastLogIdRef.current } : {},
headers: contextHeaders,
additionalConfig: { headers: contextHeaders },
});
const logs: WorkflowLog[] = response?.items || response || [];
@ -364,7 +364,7 @@ export const AutomationsPage: React.FC = () => {
const statusResponse = await request({
url: `/api/workflows/${workflowId}`,
method: 'get',
headers: contextHeaders,
additionalConfig: { headers: contextHeaders },
});
const workflowStatus = statusResponse?.status;
@ -462,7 +462,7 @@ export const AutomationsPage: React.FC = () => {
await request({
url: `/api/workflows/${executionModal.workflowId}/stop`,
method: 'post',
headers: stopHeaders,
additionalConfig: { headers: stopHeaders },
});
setExecutionModal(prev => ({
@ -628,8 +628,7 @@ export const AutomationsPage: React.FC = () => {
selectable={false}
actionButtons={[
...(canCreate ? [{
type: 'custom' as const,
icon: <FaCopy />,
type: 'copy' as const,
title: 'Duplizieren',
onAction: handleDuplicate,
}] : []),