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]); }, [request]);
const duplicateTemplate = useCallback(async (templateId: string) => { 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; return response;
}, [request]); }, [request]);

View file

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

View file

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

View file

@ -53,7 +53,7 @@ export const AutomationTemplatesPage: React.FC = () => {
const columns = useMemo(() => [ const columns = useMemo(() => [
{ key: 'label', label: 'Label', type: 'string' as const, sortable: true, searchable: true, width: 200 }, { 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: '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> 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> : <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) { if (error) {
return ( return (
<div className={styles.adminPage}> <div className={styles.adminPage}>
@ -211,8 +200,7 @@ export const AutomationTemplatesPage: React.FC = () => {
selectable={false} selectable={false}
actionButtons={[ actionButtons={[
{ {
type: 'custom' as const, type: 'copy' as const,
icon: <FaCopy />,
title: 'Duplizieren', title: 'Duplizieren',
onAction: handleDuplicate, onAction: handleDuplicate,
}, },

View file

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