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

View file

@ -563,12 +563,6 @@ export const AccessRulesEditor: React.FC<AccessRulesEditorProps> = ({
fetchObjects(undefined, featureCode, mandateId);
}, [fetchObjects, featureCode, mandateId]);
// Get objects for current tab
const currentContextObjects = useMemo(() => {
if (activeTab === 'JSON') return [];
return catalogObjects[activeTab] || [];
}, [catalogObjects, activeTab]);
// Track changes
useEffect(() => {
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.
*/
const calculateNewLevel = (
currentLevel: AccessLevel | null | undefined,
_currentLevel: AccessLevel | null | undefined,
targetLevel: 'm' | 'g' | 'a',
checked: boolean
): AccessLevel => {

View file

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

View file

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

View file

@ -71,11 +71,6 @@ export const VoiceLanguageSelect: React.FC<VoiceLanguageSelectProps> = ({
className = '',
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>) => {
onChange(e.target.value);
};

View file

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

View file

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

View file

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

View file

@ -6,21 +6,12 @@
*/
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 { FormGeneratorForm } from '../../components/FormGenerator/FormGeneratorForm';
import { FaSync, FaPlug, FaGoogle, FaMicrosoft, FaLink, FaRedo } from 'react-icons/fa';
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 = () => {
// Use the consolidated hook
const {
@ -85,7 +76,20 @@ export const ConnectionsPage: React.FC = () => {
if (!editingConnection) return;
// Note: updateConnection is handled through the hook
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);
refetch();
} catch (error) {

View file

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

View file

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

View file

@ -36,7 +36,6 @@ export const TrusteePositionsView: React.FC = () => {
handleCreate,
handleUpdate,
deletingItems,
creatingItem,
} = useTrusteePositionOperations();
// 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 { useToast } from '../../contexts/ToastContext';
import { useVoiceLanguage, VoiceLanguageSelect, Messages } from '../../components/UiComponents';
import type { Message } from '../../components/UiComponents/Messages/MessagesTypes';
import api from '../../api';
import styles from './PlaygroundPage.module.css';
@ -79,7 +80,6 @@ export const PlaygroundPage: React.FC = () => {
// Voice recording state
const [isRecording, setIsRecording] = useState(false);
const [mediaRecorder, setMediaRecorder] = useState<MediaRecorder | null>(null);
const [audioChunks, setAudioChunks] = useState<Blob[]>([]);
// Voice language selection (defaults to user profile language)
const { voiceLanguage, setVoiceLanguage } = useVoiceLanguage();
@ -231,7 +231,6 @@ export const PlaygroundPage: React.FC = () => {
recorder.start();
setMediaRecorder(recorder);
setAudioChunks([]);
setIsRecording(true);
} catch (error: any) {
console.error('Error starting recording:', error);
@ -330,7 +329,7 @@ export const PlaygroundPage: React.FC = () => {
return (
<Messages
messages={messages}
messages={messages as any as Message[]}
variant="chat"
showDocuments={true}
showMetadata={false}

View file

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