build errors

This commit is contained in:
Ida Dittrich 2026-01-29 10:14:33 +01:00
parent 386b710c53
commit 9b10f73d09
15 changed files with 40 additions and 45 deletions

View file

@ -85,7 +85,7 @@ const MOCK_RESPONSE: FeaturesMyResponse = {
mandateId: 'mand-soha', mandateId: 'mand-soha',
mandateName: 'Soha Treuhand', mandateName: 'Soha Treuhand',
instanceLabel: 'PamoCreate AG', instanceLabel: 'PamoCreate AG',
userRole: 'admin', userRoles: ['admin'],
permissions: MOCK_PERMISSIONS, permissions: MOCK_PERMISSIONS,
}, },
{ {
@ -94,7 +94,7 @@ const MOCK_RESPONSE: FeaturesMyResponse = {
mandateId: 'mand-soha', mandateId: 'mand-soha',
mandateName: 'Soha Treuhand', mandateName: 'Soha Treuhand',
instanceLabel: 'ValueOn AG', instanceLabel: 'ValueOn AG',
userRole: 'customer', userRoles: ['customer'],
permissions: MOCK_CUSTOMER_PERMISSIONS, permissions: MOCK_CUSTOMER_PERMISSIONS,
}, },
], ],
@ -110,7 +110,7 @@ const MOCK_RESPONSE: FeaturesMyResponse = {
mandateId: 'mand-soha', mandateId: 'mand-soha',
mandateName: 'Soha Treuhand', mandateName: 'Soha Treuhand',
instanceLabel: 'Beratung Dynamic', instanceLabel: 'Beratung Dynamic',
userRole: 'user', userRoles: ['user'],
permissions: MOCK_WORKFLOW_PERMISSIONS, permissions: MOCK_WORKFLOW_PERMISSIONS,
}, },
], ],
@ -133,7 +133,7 @@ const MOCK_RESPONSE: FeaturesMyResponse = {
mandateId: 'mand-swiss', mandateId: 'mand-swiss',
mandateName: 'SwissTreu', mandateName: 'SwissTreu',
instanceLabel: 'Firma X', instanceLabel: 'Firma X',
userRole: 'customer', userRoles: ['customer'],
permissions: MOCK_CUSTOMER_PERMISSIONS, permissions: MOCK_CUSTOMER_PERMISSIONS,
}, },
], ],

View file

@ -563,12 +563,6 @@ export const AccessRulesEditor: React.FC<AccessRulesEditorProps> = ({
fetchObjects(undefined, featureCode, mandateId); fetchObjects(undefined, featureCode, mandateId);
}, [fetchObjects, featureCode, mandateId]); }, [fetchObjects, featureCode, mandateId]);
// Get objects for current tab
const currentContextObjects = useMemo(() => {
if (activeTab === 'JSON') return [];
return catalogObjects[activeTab] || [];
}, [catalogObjects, activeTab]);
// Track changes // Track changes
useEffect(() => { useEffect(() => {
setHasChanges(JSON.stringify(rules) !== JSON.stringify(originalRules)); setHasChanges(JSON.stringify(rules) !== JSON.stringify(originalRules));

View file

@ -40,7 +40,7 @@ const hasLevel = (level: AccessLevel | null | undefined, minLevel: 'm' | 'g' | '
* Calculate the new access level when a checkbox is toggled. * Calculate the new access level when a checkbox is toggled.
*/ */
const calculateNewLevel = ( const calculateNewLevel = (
currentLevel: AccessLevel | null | undefined, _currentLevel: AccessLevel | null | undefined,
targetLevel: 'm' | 'g' | 'a', targetLevel: 'm' | 'g' | 'a',
checked: boolean checked: boolean
): AccessLevel => { ): AccessLevel => {

View file

@ -4,7 +4,6 @@ import Button from '../Button';
import { Popup } from '../../Popup'; import { Popup } from '../../Popup';
import { FormGeneratorForm, AttributeDefinition } from '../../../FormGenerator/FormGeneratorForm'; import { FormGeneratorForm, AttributeDefinition } from '../../../FormGenerator/FormGeneratorForm';
import { useLanguage } from '../../../../providers/language/LanguageContext'; import { useLanguage } from '../../../../providers/language/LanguageContext';
import styles from './CreateButton.module.css';
const CreateButton: React.FC<CreateButtonProps> = ({ const CreateButton: React.FC<CreateButtonProps> = ({
onCreate, onCreate,
@ -29,14 +28,14 @@ const CreateButton: React.FC<CreateButtonProps> = ({
// Convert CreateButtonFieldConfig to AttributeDefinition format // Convert CreateButtonFieldConfig to AttributeDefinition format
const attributes: AttributeDefinition[] = useMemo(() => { const attributes: AttributeDefinition[] = useMemo(() => {
return fieldsToUse.map(field => { return fields.map(field => {
// Convert options to AttributeOption[] format // Convert options to AttributeOption[] format
let options: AttributeDefinition['options'] = undefined; let options: AttributeDefinition['options'] = undefined;
if (field.options) { if (field.options) {
// If options is an array of strings, convert to AttributeOption format // If options is an array of strings, convert to AttributeOption format
if (Array.isArray(field.options)) { if (Array.isArray(field.options)) {
options = field.options.map(opt => { options = field.options.map((opt: any) => {
if (typeof opt === 'string') { if (typeof opt === 'string') {
return { value: opt, label: opt }; return { value: opt, label: opt };
} }
@ -90,7 +89,7 @@ const CreateButton: React.FC<CreateButtonProps> = ({
// Initialize form data with default values // Initialize form data with default values
const initialFormData = useMemo(() => { const initialFormData = useMemo(() => {
const data: any = {}; const data: any = {};
fieldsToUse.forEach(field => { fields.forEach(field => {
if (field.type === 'multiselect') { if (field.type === 'multiselect') {
// Multiselect fields should default to empty array // Multiselect fields should default to empty array
data[field.key] = field.defaultValue || []; data[field.key] = field.defaultValue || [];

View file

@ -14,9 +14,11 @@ export interface LogMessageProps {
onFileDelete?: (file: WorkflowFile) => Promise<void>; onFileDelete?: (file: WorkflowFile) => Promise<void>;
onFileRemove?: (file: WorkflowFile) => Promise<void>; onFileRemove?: (file: WorkflowFile) => Promise<void>;
onFileView?: (file: WorkflowFile) => Promise<void>; onFileView?: (file: WorkflowFile) => Promise<void>;
onFileDownload?: (file: WorkflowFile) => Promise<void>;
deletingFiles?: Set<string>; deletingFiles?: Set<string>;
previewingFiles?: Set<string>; previewingFiles?: Set<string>;
removingFiles?: Set<string>; removingFiles?: Set<string>;
downloadingFiles?: Set<string>;
workflowId?: string; workflowId?: string;
} }
@ -32,9 +34,11 @@ export const LogMessage: React.FC<LogMessageProps> = ({
onFileDelete, onFileDelete,
onFileRemove, onFileRemove,
onFileView, onFileView,
onFileDownload,
deletingFiles, deletingFiles,
previewingFiles, previewingFiles,
removingFiles, removingFiles,
downloadingFiles,
workflowId workflowId
}) => { }) => {
return ( return (
@ -78,9 +82,11 @@ export const LogMessage: React.FC<LogMessageProps> = ({
onFileDelete={onFileDelete} onFileDelete={onFileDelete}
onFileRemove={onFileRemove} onFileRemove={onFileRemove}
onFileView={onFileView} onFileView={onFileView}
onFileDownload={onFileDownload}
deletingFiles={deletingFiles} deletingFiles={deletingFiles}
previewingFiles={previewingFiles} previewingFiles={previewingFiles}
removingFiles={removingFiles} removingFiles={removingFiles}
downloadingFiles={downloadingFiles}
workflowId={workflowId} workflowId={workflowId}
/> />
)} )}

View file

@ -71,11 +71,6 @@ export const VoiceLanguageSelect: React.FC<VoiceLanguageSelectProps> = ({
className = '', className = '',
title = 'Sprache für Spracherkennung', title = 'Sprache für Spracherkennung',
}) => { }) => {
const { currentLanguage } = useLanguage();
// Get the currently selected language option
const selectedOption = voiceLanguages.find(lang => lang.code === value);
const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => { const handleChange = (e: React.ChangeEvent<HTMLSelectElement>) => {
onChange(e.target.value); onChange(e.target.value);
}; };

View file

@ -8,7 +8,7 @@ interface FileContextType {
refetch: () => Promise<void>; refetch: () => Promise<void>;
handleFileUpload: (file: File, workflowId?: string) => Promise<{ success: boolean; fileData?: any; error?: string }>; handleFileUpload: (file: File, workflowId?: string) => Promise<{ success: boolean; fileData?: any; error?: string }>;
handleFileDelete: (fileId: string, onOptimisticDelete?: () => void) => Promise<boolean>; handleFileDelete: (fileId: string, onOptimisticDelete?: () => void) => Promise<boolean>;
handleFilePreview: (fileId: string, fileName: string, mimeType?: string) => Promise<{ success: boolean; previewUrl?: string | null; blob?: Blob; isJsonContent?: boolean; decodedContent?: string; error?: string }>; handleFilePreview: (fileId: string, fileName: string, mimeType?: string) => Promise<{ success: boolean; previewUrl?: string | null; blob?: Blob | null; isJsonContent?: boolean; decodedContent?: any; isTextContent?: boolean; error?: string }>;
handleFileDownload: (fileId: string, fileName: string) => Promise<void>; handleFileDownload: (fileId: string, fileName: string) => Promise<void>;
uploadingFile: boolean; uploadingFile: boolean;
deletingFiles: Set<string>; deletingFiles: Set<string>;
@ -83,8 +83,11 @@ export function FileProvider({ children }: { children: React.ReactNode }) {
refetch, refetch,
handleFileUpload, handleFileUpload,
handleFileDelete, handleFileDelete,
handleFilePreview, handleFilePreview: handleFilePreview as FileContextType['handleFilePreview'],
handleFileDownload, handleFileDownload: async (fileId: string, fileName: string) => {
await handleFileDownload(fileId, fileName);
// Return void (ignore boolean return value)
},
uploadingFile, uploadingFile,
deletingFiles, deletingFiles,
previewingFiles, previewingFiles,

View file

@ -279,7 +279,7 @@ export function useWorkflowLifecycle() {
statsItems.forEach(statItem => { statsItems.forEach(statItem => {
const statData = statItem.item || statItem; const statData = statItem.item || statItem;
const statId = statData?.id || statItem.id; const statId = statData?.id || (statItem as any).id;
// Skip if already processed // Skip if already processed
if (statId && processedStatIdsRef.current.has(statId)) { if (statId && processedStatIdsRef.current.has(statId)) {

View file

@ -32,7 +32,7 @@ interface UseResizablePanelsReturn {
/** Reset to default width */ /** Reset to default width */
resetToDefault: () => void; resetToDefault: () => void;
/** Container ref to attach to the parent container */ /** Container ref to attach to the parent container */
containerRef: React.RefObject<HTMLDivElement>; containerRef: React.RefObject<HTMLDivElement | null>;
} }
export function useResizablePanels({ export function useResizablePanels({

View file

@ -6,21 +6,12 @@
*/ */
import React, { useState, useMemo, useEffect } from 'react'; import React, { useState, useMemo, useEffect } from 'react';
import { useConnections } from '../../hooks/useConnections'; import { useConnections, type Connection } from '../../hooks/useConnections';
import { FormGeneratorTable } from '../../components/FormGenerator/FormGeneratorTable'; import { FormGeneratorTable } from '../../components/FormGenerator/FormGeneratorTable';
import { FormGeneratorForm } from '../../components/FormGenerator/FormGeneratorForm'; import { FormGeneratorForm } from '../../components/FormGenerator/FormGeneratorForm';
import { FaSync, FaPlug, FaGoogle, FaMicrosoft, FaLink, FaRedo } from 'react-icons/fa'; import { FaSync, FaPlug, FaGoogle, FaMicrosoft, FaLink, FaRedo } from 'react-icons/fa';
import styles from '../admin/Admin.module.css'; import styles from '../admin/Admin.module.css';
interface Connection {
id: string;
name?: string;
email?: string;
authority: 'google' | 'msft' | string;
status: 'active' | 'inactive' | string;
[key: string]: any;
}
export const ConnectionsPage: React.FC = () => { export const ConnectionsPage: React.FC = () => {
// Use the consolidated hook // Use the consolidated hook
const { const {
@ -85,7 +76,20 @@ export const ConnectionsPage: React.FC = () => {
if (!editingConnection) return; if (!editingConnection) return;
// Note: updateConnection is handled through the hook // Note: updateConnection is handled through the hook
try { try {
await handleInlineUpdate(editingConnection.id, data, editingConnection); // Ensure authority is properly typed - filter and validate authority value
const updateData: Partial<import('../../api/connectionApi').Connection> = { ...data };
// Validate and set authority if present
if (data.authority) {
if (data.authority === 'local' || data.authority === 'google' || data.authority === 'msft') {
updateData.authority = data.authority;
} else {
// Remove invalid authority value
delete (updateData as any).authority;
}
}
await handleInlineUpdate(editingConnection.id, updateData, editingConnection);
setEditingConnection(null); setEditingConnection(null);
refetch(); refetch();
} catch (error) { } catch (error) {

View file

@ -40,7 +40,6 @@ export const PromptsPage: React.FC = () => {
handlePromptDelete, handlePromptDelete,
handleInlineUpdate, handleInlineUpdate,
deletingPrompts, deletingPrompts,
creatingPrompt,
} = usePromptOperations(); } = usePromptOperations();
const [showCreateModal, setShowCreateModal] = useState(false); const [showCreateModal, setShowCreateModal] = useState(false);

View file

@ -34,7 +34,6 @@ export const TrusteePositionDocumentsView: React.FC = () => {
handleCreate, handleCreate,
handleUpdate, handleUpdate,
deletingItems, deletingItems,
creatingItem,
} = useTrusteePositionDocumentOperations(); } = useTrusteePositionDocumentOperations();
// Modal state // Modal state
@ -213,6 +212,7 @@ export const TrusteePositionDocumentsView: React.FC = () => {
...(canUpdate ? [{ ...(canUpdate ? [{
type: 'edit' as const, type: 'edit' as const,
title: 'Verknüpfung bearbeiten', title: 'Verknüpfung bearbeiten',
onAction: handleEditClick,
// Row-level permissions handled automatically by FormGeneratorTable // Row-level permissions handled automatically by FormGeneratorTable
}] : []), }] : []),
...(canDelete ? [{ ...(canDelete ? [{
@ -222,8 +222,6 @@ export const TrusteePositionDocumentsView: React.FC = () => {
// Row-level permissions handled automatically by FormGeneratorTable // Row-level permissions handled automatically by FormGeneratorTable
}] : []), }] : []),
]} ]}
attributes={formAttributes}
onEdit={handleEditClick}
onDelete={handleDeleteLink} onDelete={handleDeleteLink}
hookData={{ hookData={{
refetch, refetch,

View file

@ -36,7 +36,6 @@ export const TrusteePositionsView: React.FC = () => {
handleCreate, handleCreate,
handleUpdate, handleUpdate,
deletingItems, deletingItems,
creatingItem,
} = useTrusteePositionOperations(); } = useTrusteePositionOperations();
// Modal state // Modal state

View file

@ -14,6 +14,7 @@ import { usePrompts } from '../../hooks/usePrompts';
import { FaComment, FaTasks, FaPaperPlane, FaStop, FaFile, FaPlus, FaMicrophone, FaSquare, FaFileAlt } from 'react-icons/fa'; import { FaComment, FaTasks, FaPaperPlane, FaStop, FaFile, FaPlus, FaMicrophone, FaSquare, FaFileAlt } from 'react-icons/fa';
import { useToast } from '../../contexts/ToastContext'; import { useToast } from '../../contexts/ToastContext';
import { useVoiceLanguage, VoiceLanguageSelect, Messages } from '../../components/UiComponents'; import { useVoiceLanguage, VoiceLanguageSelect, Messages } from '../../components/UiComponents';
import type { Message } from '../../components/UiComponents/Messages/MessagesTypes';
import api from '../../api'; import api from '../../api';
import styles from './PlaygroundPage.module.css'; import styles from './PlaygroundPage.module.css';
@ -79,7 +80,6 @@ export const PlaygroundPage: React.FC = () => {
// Voice recording state // Voice recording state
const [isRecording, setIsRecording] = useState(false); const [isRecording, setIsRecording] = useState(false);
const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null); const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null);
const [audioChunks, setAudioChunks] = useState<Blob[]>([]);
// Voice language selection (defaults to user profile language) // Voice language selection (defaults to user profile language)
const { voiceLanguage, setVoiceLanguage } = useVoiceLanguage(); const { voiceLanguage, setVoiceLanguage } = useVoiceLanguage();
@ -231,7 +231,6 @@ export const PlaygroundPage: React.FC = () => {
recorder.start(); recorder.start();
setMediaRecorder(recorder); setMediaRecorder(recorder);
setAudioChunks([]);
setIsRecording(true); setIsRecording(true);
} catch (error: any) { } catch (error: any) {
console.error('Error starting recording:', error); console.error('Error starting recording:', error);
@ -330,7 +329,7 @@ export const PlaygroundPage: React.FC = () => {
return ( return (
<Messages <Messages
messages={messages} messages={messages as any as Message[]}
variant="chat" variant="chat"
showDocuments={true} showDocuments={true}
showMetadata={false} showMetadata={false}

View file

@ -44,7 +44,6 @@ export const WorkflowsPage: React.FC = () => {
handleWorkflowUpdate, handleWorkflowUpdate,
handleInlineUpdate, handleInlineUpdate,
deletingWorkflows, deletingWorkflows,
editingWorkflows,
} = useWorkflowOperations(); } = useWorkflowOperations();
const [editingWorkflow, setEditingWorkflow] = useState<Workflow | null>(null); const [editingWorkflow, setEditingWorkflow] = useState<Workflow | null>(null);