fixed building app
This commit is contained in:
parent
f7481b24cb
commit
172ddb7001
30 changed files with 55 additions and 96 deletions
|
|
@ -1,8 +1,7 @@
|
||||||
import {
|
import {
|
||||||
AuthenticationResult,
|
AuthenticationResult,
|
||||||
EventType,
|
EventType,
|
||||||
PublicClientApplication,
|
PublicClientApplication
|
||||||
InteractionStatus
|
|
||||||
} from "@azure/msal-browser";
|
} from "@azure/msal-browser";
|
||||||
import { msalConfig } from "./authConfig";
|
import { msalConfig } from "./authConfig";
|
||||||
import { MsalProvider } from "@azure/msal-react";
|
import { MsalProvider } from "@azure/msal-react";
|
||||||
|
|
@ -15,7 +14,7 @@ import {
|
||||||
export const AuthProvider = ({ children }: AuthProviderProps) => {
|
export const AuthProvider = ({ children }: AuthProviderProps) => {
|
||||||
const [msalInstance, setMsalInstance] = useState<PublicClientApplication | null>(null);
|
const [msalInstance, setMsalInstance] = useState<PublicClientApplication | null>(null);
|
||||||
const [isInitialized, setIsInitialized] = useState(false);
|
const [isInitialized, setIsInitialized] = useState(false);
|
||||||
const [loginAttempted, setLoginAttempted] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const msalApp = new PublicClientApplication(msalConfig);
|
const msalApp = new PublicClientApplication(msalConfig);
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React from 'react';
|
|
||||||
import { Popup, EditForm } from '../Popup';
|
import { Popup, EditForm } from '../Popup';
|
||||||
import styles from './ConnectionEditModal.module.css';
|
import styles from './ConnectionEditModal.module.css';
|
||||||
import { ConnectionEditModalProps } from './connectionsInterfaces';
|
import { ConnectionEditModalProps } from './connectionsInterfaces';
|
||||||
|
|
@ -11,7 +11,7 @@ export function ConnectionEditModal({
|
||||||
onSave,
|
onSave,
|
||||||
onCancel
|
onCancel
|
||||||
}: ConnectionEditModalProps) {
|
}: ConnectionEditModalProps) {
|
||||||
const { t, isLoading } = useLanguage();
|
const { t } = useLanguage();
|
||||||
|
|
||||||
if (!connection) {
|
if (!connection) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React from 'react';
|
|
||||||
import styles from './ConnectionsErrorDisplay.module.css';
|
import styles from './ConnectionsErrorDisplay.module.css';
|
||||||
import { ConnectionsErrorDisplayProps } from './connectionsInterfaces';
|
import { ConnectionsErrorDisplayProps } from './connectionsInterfaces';
|
||||||
import { useLanguage } from '../../contexts/LanguageContext';
|
import { useLanguage } from '../../contexts/LanguageContext';
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,13 @@
|
||||||
import { ColumnConfig } from '../FormGenerator';
|
import { ColumnConfig } from '../FormGenerator';
|
||||||
import { EditFieldConfig } from '../Popup';
|
import { EditFieldConfig } from '../Popup';
|
||||||
|
|
||||||
// Re-export connection-related interfaces from hooks
|
|
||||||
export type { Connection, CreateConnectionData } from '../../hooks/useConnections';
|
|
||||||
|
|
||||||
// Import React for component types
|
// Import React for component types
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
|
// Re-export connection-related interfaces from hooks
|
||||||
|
export type { Connection, CreateConnectionData } from '../../hooks/useConnections';
|
||||||
|
import type { Connection } from '../../hooks/useConnections';
|
||||||
|
|
||||||
// Component Props Interfaces
|
// Component Props Interfaces
|
||||||
export interface ConnectionsTableProps {
|
export interface ConnectionsTableProps {
|
||||||
connections: Connection[];
|
connections: Connection[];
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||||
import { IoIosLink, IoIosTrash } from 'react-icons/io';
|
import { IoIosLink, IoIosTrash } from 'react-icons/io';
|
||||||
import { MdModeEdit } from 'react-icons/md';
|
import { MdModeEdit } from 'react-icons/md';
|
||||||
import { GoUnlink } from 'react-icons/go';
|
import { GoUnlink } from 'react-icons/go';
|
||||||
import React from 'react';
|
|
||||||
|
|
||||||
import { useConnections, useOAuthConnect, useDisconnect } from '../../hooks/useConnections';
|
import { useConnections, useOAuthConnect, useDisconnect } from '../../hooks/useConnections';
|
||||||
import { useLanguage } from '../../contexts/LanguageContext';
|
import { useLanguage } from '../../contexts/LanguageContext';
|
||||||
|
|
@ -24,8 +24,6 @@ export function useConnectionsLogic(): ConnectionsLogicReturn {
|
||||||
fetchConnections,
|
fetchConnections,
|
||||||
createConnection,
|
createConnection,
|
||||||
updateConnection,
|
updateConnection,
|
||||||
connectService,
|
|
||||||
disconnectService,
|
|
||||||
deleteConnection,
|
deleteConnection,
|
||||||
isLoading,
|
isLoading,
|
||||||
error
|
error
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import MessageList from "./DashboardChatAreaMessageList";
|
import MessageList from "./DashboardChatAreaMessageList";
|
||||||
import FilePreview from "./DashboardChatAreaFilePreview";
|
|
||||||
import InputArea from "./DashboardChatAreaInput";
|
import InputArea from "./DashboardChatAreaInput";
|
||||||
import ConnectedFiles from "./DashboardChatAreaConnectedFiles";
|
import ConnectedFiles from "./DashboardChatAreaConnectedFiles";
|
||||||
import { DashboardChatAreaProps } from "./dashboardChatAreaTypes";
|
import { DashboardChatAreaProps } from "./dashboardChatAreaTypes";
|
||||||
|
|
@ -17,9 +17,8 @@ const DashboardChatArea: React.FC<DashboardChatAreaProps> = ({
|
||||||
<div className={styles.chat_grid}>
|
<div className={styles.chat_grid}>
|
||||||
{/* Top Left: Message List */}
|
{/* Top Left: Message List */}
|
||||||
<div className={`${styles.quadrant} ${styles.messages_quadrant}`}>
|
<div className={`${styles.quadrant} ${styles.messages_quadrant}`}>
|
||||||
<MessageList
|
<MessageList
|
||||||
workflowState={workflowState}
|
workflowState={workflowState}
|
||||||
onFilePreview={setSelectedFile}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useFileDownload } from '../../../hooks/useWorkflows';
|
|
||||||
import { ConnectedFilesProps } from './dashboardChatAreaTypes';
|
import { ConnectedFilesProps } from './dashboardChatAreaTypes';
|
||||||
import styles from './DashboardChatAreaStyles/DashboardChatConnectedFiles.module.css';
|
import styles from './DashboardChatAreaStyles/DashboardChatConnectedFiles.module.css';
|
||||||
import { IoIosAttach } from 'react-icons/io';
|
import { IoIosAttach } from 'react-icons/io';
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ const InputArea: React.FC<InputAreaProps> = ({
|
||||||
if (files.length > 0) {
|
if (files.length > 0) {
|
||||||
// Convert File objects to AttachedFile format
|
// Convert File objects to AttachedFile format
|
||||||
const attachedFiles: AttachedFile[] = files.map((file, index) => ({
|
const attachedFiles: AttachedFile[] = files.map((file, index) => ({
|
||||||
id: Date.now() + index, // Simple ID generation
|
id: (Date.now() + index).toString(), // Simple ID generation
|
||||||
name: file.name,
|
name: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
type: file.type,
|
type: file.type,
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState } from "react";
|
import React from "react";
|
||||||
import { WorkflowLog } from "./dashboardChatAreaTypes";
|
import { WorkflowLog } from "./dashboardChatAreaTypes";
|
||||||
import messageStyles from './DashboardChatAreaStyles/DashboardChatMessages.module.css';
|
import messageStyles from './DashboardChatAreaStyles/DashboardChatMessages.module.css';
|
||||||
|
|
||||||
|
|
@ -8,7 +8,7 @@ interface LogItemProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
const LogItem: React.FC<LogItemProps> = ({ log }) => {
|
const LogItem: React.FC<LogItemProps> = ({ log }) => {
|
||||||
const [showDetails, setShowDetails] = useState(false);
|
|
||||||
|
|
||||||
// Format timestamp with robust parsing (same logic as MessageList)
|
// Format timestamp with robust parsing (same logic as MessageList)
|
||||||
const formatTimestamp = (timestamp: any) => {
|
const formatTimestamp = (timestamp: any) => {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,12 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useFileDownload } from "../../../hooks/useWorkflows";
|
|
||||||
import { Message, Document } from "./dashboardChatAreaTypes";
|
import { Message, Document } from "./dashboardChatAreaTypes";
|
||||||
import messageStyles from './DashboardChatAreaStyles/DashboardChatMessages.module.css';
|
import messageStyles from './DashboardChatAreaStyles/DashboardChatMessages.module.css';
|
||||||
import { FaDownload, FaEye } from "react-icons/fa";
|
|
||||||
|
|
||||||
|
|
||||||
interface MessageItemProps {
|
interface MessageItemProps {
|
||||||
message: Message;
|
message: Message;
|
||||||
index: number;
|
index: number;
|
||||||
onFilePreview?: (file: any) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const formatFileSize = (bytes?: number) => {
|
const formatFileSize = (bytes?: number) => {
|
||||||
|
|
@ -19,40 +17,16 @@ const formatFileSize = (bytes?: number) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
const MessageItem: React.FC<MessageItemProps> = ({ message, onFilePreview }) => {
|
const MessageItem: React.FC<MessageItemProps> = ({ message }) => {
|
||||||
const { downloadFile, isDownloading } = useFileDownload();
|
|
||||||
|
|
||||||
const handleDocumentClick = (doc: Document) => {
|
const handleDocumentClick = (doc: Document) => {
|
||||||
const link = doc.downloadUrl || doc.url;
|
const link = doc.downloadUrl || doc.url;
|
||||||
if (link) window.open(link, '_blank');
|
if (link) window.open(link, '_blank');
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePreview = (doc: Document, e: React.MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
const fileId = doc.fileId || parseInt(doc.id || '0');
|
|
||||||
if (!fileId || isNaN(fileId)) return;
|
|
||||||
|
|
||||||
if (onFilePreview) {
|
|
||||||
onFilePreview({
|
|
||||||
id: fileId.toString(),
|
|
||||||
name: doc.name,
|
|
||||||
mimeType: doc.type || 'application/octet-stream',
|
|
||||||
size: doc.size,
|
|
||||||
fileId
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleDownload = async (doc: Document, e: React.MouseEvent) => {
|
|
||||||
e.stopPropagation();
|
|
||||||
const fileId = doc.fileId || parseInt(doc.id || '0');
|
|
||||||
if (!fileId) return;
|
|
||||||
|
|
||||||
const fileName = doc.ext ? `${doc.name}.${doc.ext}` : doc.name;
|
|
||||||
await downloadFile(fileId, fileName);
|
|
||||||
};
|
|
||||||
|
|
||||||
const hasDocuments = message.documents?.length > 0;
|
const hasDocuments = message.documents && message.documents.length > 0;
|
||||||
|
|
||||||
const formatTimestamp = (ts?: string) => {
|
const formatTimestamp = (ts?: string) => {
|
||||||
if (!ts) return '';
|
if (!ts) return '';
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ import messageStyles from './DashboardChatAreaStyles/DashboardChatMessages.modul
|
||||||
import { IoIosArrowDown, IoIosChatbubbles } from 'react-icons/io';
|
import { IoIosArrowDown, IoIosChatbubbles } from 'react-icons/io';
|
||||||
import { useLanguage } from '../../../contexts/LanguageContext';
|
import { useLanguage } from '../../../contexts/LanguageContext';
|
||||||
|
|
||||||
const MessageList: React.FC<MessageListProps> = ({ workflowState, onFilePreview }) => {
|
const MessageList: React.FC<MessageListProps> = ({ workflowState }) => {
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
const { request } = useApiRequest();
|
const { request } = useApiRequest();
|
||||||
const [messages, setMessages] = React.useState<any[]>([]);
|
const [messages, setMessages] = React.useState<any[]>([]);
|
||||||
|
|
@ -140,7 +140,6 @@ const MessageList: React.FC<MessageListProps> = ({ workflowState, onFilePreview
|
||||||
key={`message-${item.item.id}`}
|
key={`message-${item.item.id}`}
|
||||||
message={item.item}
|
message={item.item}
|
||||||
index={index}
|
index={index}
|
||||||
onFilePreview={onFilePreview}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
} else if (item.type === 'log') {
|
} else if (item.type === 'log') {
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,8 @@
|
||||||
import React, { useState, useRef, useEffect } from 'react';
|
import React, { useState, useRef } from 'react';
|
||||||
import { useUserFiles, UserFile } from '../../../hooks/useFiles';
|
import { useUserFiles, UserFile } from '../../../hooks/useFiles';
|
||||||
import DateienAll from '../../../Dateien/DateienAll';
|
|
||||||
import DateienShared from '../../../Dateien/DateienShared';
|
|
||||||
import DateienCreated from '../../../Dateien/DateienCreated';
|
|
||||||
import DateienUploads from '../../../Dateien/DateienUploads';
|
|
||||||
|
|
||||||
interface AttachedFile {
|
interface AttachedFile {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
size: number;
|
size: number;
|
||||||
type: string;
|
type: string;
|
||||||
|
|
@ -67,7 +63,7 @@ const FileAttachmentPopup: React.FC<FileAttachmentPopupProps> = ({
|
||||||
// Create file objects with data for preview
|
// Create file objects with data for preview
|
||||||
const uploadedFiles: AttachedFile[] = files.map((file, index) => {
|
const uploadedFiles: AttachedFile[] = files.map((file, index) => {
|
||||||
const fileObj: AttachedFile = {
|
const fileObj: AttachedFile = {
|
||||||
id: Date.now() + index,
|
id: (Date.now() + index).toString(),
|
||||||
name: file.name,
|
name: file.name,
|
||||||
size: file.size,
|
size: file.size,
|
||||||
type: file.type,
|
type: file.type,
|
||||||
|
|
@ -107,9 +103,7 @@ const FileAttachmentPopup: React.FC<FileAttachmentPopupProps> = ({
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const isFileSelected = (fileId: number) => {
|
|
||||||
return selectedFiles.some(f => f.id === fileId);
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleConfirm = () => {
|
const handleConfirm = () => {
|
||||||
onFilesSelected(selectedFiles);
|
onFilesSelected(selectedFiles);
|
||||||
|
|
@ -153,7 +147,7 @@ const FileAttachmentPopup: React.FC<FileAttachmentPopupProps> = ({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const isFileSelected = (fileId: number) => {
|
const isFileSelected = (fileId: string) => {
|
||||||
return selectedFiles.some(f => f.id === fileId);
|
return selectedFiles.some(f => f.id === fileId);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ export interface WorkflowMessage {
|
||||||
sequenceNr: number;
|
sequenceNr: number;
|
||||||
publishedAt: string;
|
publishedAt: string;
|
||||||
timestamp?: string; // For backward compatibility
|
timestamp?: string; // For backward compatibility
|
||||||
fileIds?: number[]; // For backward compatibility
|
fileIds?: string[]; // For backward compatibility
|
||||||
stats?: WorkflowMessageStats;
|
stats?: WorkflowMessageStats;
|
||||||
success: boolean;
|
success: boolean;
|
||||||
actionId?: string;
|
actionId?: string;
|
||||||
|
|
@ -136,8 +136,8 @@ export interface WorkflowState {
|
||||||
|
|
||||||
export interface WorkflowActions {
|
export interface WorkflowActions {
|
||||||
loadWorkflow: (workflowId: string) => void;
|
loadWorkflow: (workflowId: string) => void;
|
||||||
startNewWorkflow: (prompt: string, fileIds?: number[]) => Promise<string | null>;
|
startNewWorkflow: (prompt: string, fileIds?: string[]) => Promise<string | null>;
|
||||||
continueWorkflow: (prompt: string, fileIds?: number[]) => Promise<boolean>;
|
continueWorkflow: (prompt: string, fileIds?: string[]) => Promise<boolean>;
|
||||||
stopWorkflow: () => Promise<boolean>;
|
stopWorkflow: () => Promise<boolean>;
|
||||||
clearWorkflow: () => void;
|
clearWorkflow: () => void;
|
||||||
selectPrompt: (prompt: Prompt | null) => void;
|
selectPrompt: (prompt: Prompt | null) => void;
|
||||||
|
|
@ -145,7 +145,7 @@ export interface WorkflowActions {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface FileInfo {
|
export interface FileInfo {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
mimeType: string;
|
mimeType: string;
|
||||||
size?: number;
|
size?: number;
|
||||||
|
|
@ -184,7 +184,7 @@ export interface InputAreaProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AttachedFile {
|
export interface AttachedFile {
|
||||||
id: number;
|
id: string;
|
||||||
name: string;
|
name: string;
|
||||||
size: number;
|
size: number;
|
||||||
type: string;
|
type: string;
|
||||||
|
|
@ -196,12 +196,11 @@ export interface ConnectedFilesProps {
|
||||||
onFileSelect?: (file: FileInfo) => void;
|
onFileSelect?: (file: FileInfo) => void;
|
||||||
selectedFile?: FileInfo | null;
|
selectedFile?: FileInfo | null;
|
||||||
attachedFiles?: AttachedFile[];
|
attachedFiles?: AttachedFile[];
|
||||||
onRemoveFile?: (fileId: number) => void;
|
onRemoveFile?: (fileId: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface MessageListProps {
|
export interface MessageListProps {
|
||||||
workflowState: WorkflowState;
|
workflowState: WorkflowState;
|
||||||
onFilePreview?: (file: any) => void;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Progress bar interfaces
|
// Progress bar interfaces
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ export function useWorkflowManager(initialWorkflowId?: string | null): [Workflow
|
||||||
const currentWorkflow = workflowStatus || workflow;
|
const currentWorkflow = workflowStatus || workflow;
|
||||||
|
|
||||||
// Helper to create optimistic user message
|
// Helper to create optimistic user message
|
||||||
const createOptimisticMessage = useCallback((prompt: string, fileIds: number[] = []) => {
|
const createOptimisticMessage = useCallback((prompt: string, fileIds: string[] = []) => {
|
||||||
const timestamp = new Date().toISOString();
|
const timestamp = new Date().toISOString();
|
||||||
return {
|
return {
|
||||||
id: `temp-${Date.now()}`,
|
id: `temp-${Date.now()}`,
|
||||||
|
|
@ -83,7 +83,7 @@ export function useWorkflowManager(initialWorkflowId?: string | null): [Workflow
|
||||||
setCurrentWorkflowId(workflowId);
|
setCurrentWorkflowId(workflowId);
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const startNewWorkflow = useCallback(async (prompt: string, fileIds: number[] = []): Promise<string | null> => {
|
const startNewWorkflow = useCallback(async (prompt: string, fileIds: string[] = []): Promise<string | null> => {
|
||||||
// Add optimistic message immediately
|
// Add optimistic message immediately
|
||||||
const optimisticMessage = createOptimisticMessage(prompt, fileIds);
|
const optimisticMessage = createOptimisticMessage(prompt, fileIds);
|
||||||
setPendingMessages(prev => [...prev, optimisticMessage]);
|
setPendingMessages(prev => [...prev, optimisticMessage]);
|
||||||
|
|
@ -119,7 +119,7 @@ export function useWorkflowManager(initialWorkflowId?: string | null): [Workflow
|
||||||
return null;
|
return null;
|
||||||
}, [startWorkflow, refetchMessages, createOptimisticMessage]);
|
}, [startWorkflow, refetchMessages, createOptimisticMessage]);
|
||||||
|
|
||||||
const continueWorkflow = useCallback(async (prompt: string, fileIds: number[] = []): Promise<boolean> => {
|
const continueWorkflow = useCallback(async (prompt: string, fileIds: string[] = []): Promise<boolean> => {
|
||||||
if (!currentWorkflowId) return false;
|
if (!currentWorkflowId) return false;
|
||||||
|
|
||||||
// Add optimistic message immediately
|
// Add optimistic message immediately
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import React, { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
|
|
||||||
import { useOrgUsers, User } from '../../hooks/useUsers';
|
import { useOrgUsers } from '../../hooks/useUsers';
|
||||||
import { useLanguage } from '../../contexts/LanguageContext';
|
import { useLanguage } from '../../contexts/LanguageContext';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
|
@ -10,7 +10,7 @@ import type {
|
||||||
} from './mitgliederTypes';
|
} from './mitgliederTypes';
|
||||||
|
|
||||||
export function useMitgliederLogic(): MitgliederLogicReturn {
|
export function useMitgliederLogic(): MitgliederLogicReturn {
|
||||||
const { users, loading, error, refetch, deleteUser } = useOrgUsers();
|
const { users, loading, error, refetch } = useOrgUsers();
|
||||||
const { t } = useLanguage();
|
const { t } = useLanguage();
|
||||||
|
|
||||||
// Configure columns for the users table
|
// Configure columns for the users table
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,7 @@ const PageManager: React.FC<PageManagerProps> = ({ loadingComponent: LoadingComp
|
||||||
<div className={styles.pageManager}>
|
<div className={styles.pageManager}>
|
||||||
{Array.from(pageInstances.values()).map((instance) => {
|
{Array.from(pageInstances.values()).map((instance) => {
|
||||||
const isVisible = instance.isActive;
|
const isVisible = instance.isActive;
|
||||||
const shouldAnimate = !instance.shouldPreserve; // Only animate non-preserved pages
|
|
||||||
|
|
||||||
if (instance.shouldPreserve) {
|
if (instance.shouldPreserve) {
|
||||||
// Preserved pages: Always mounted, just show/hide with animations
|
// Preserved pages: Always mounted, just show/hide with animations
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import { lazy } from 'react';
|
||||||
import { MdOutlineWorkOutline } from 'react-icons/md';
|
import { MdOutlineWorkOutline } from 'react-icons/md';
|
||||||
import { LuWorkflow, LuTicket } from "react-icons/lu";
|
import { LuWorkflow, LuTicket } from "react-icons/lu";
|
||||||
import { GoGear } from "react-icons/go";
|
import { GoGear } from "react-icons/go";
|
||||||
import { FaPlug, FaRegFileAlt, FaShare } from "react-icons/fa";
|
import { FaPlug, FaRegFileAlt } from "react-icons/fa";
|
||||||
import { LuMessageSquareText } from "react-icons/lu";
|
import { LuMessageSquareText } from "react-icons/lu";
|
||||||
|
|
||||||
// Lazy load components for better performance
|
// Lazy load components for better performance
|
||||||
|
|
@ -15,7 +15,7 @@ const TeamBereich = lazy(() => import('../../pages/Home/TeamBereich'));
|
||||||
const Connections = lazy(() => import('../../pages/Home/Connections'));
|
const Connections = lazy(() => import('../../pages/Home/Connections'));
|
||||||
const Workflows = lazy(() => import('../../pages/Home/Workflows'));
|
const Workflows = lazy(() => import('../../pages/Home/Workflows'));
|
||||||
const Einstellungen = lazy(() => import('../../pages/Home/Einstellungen'));
|
const Einstellungen = lazy(() => import('../../pages/Home/Einstellungen'));
|
||||||
const TestSharepoint = lazy(() => import('../../pages/Home/TestSharepoint'));
|
|
||||||
const Prompts = lazy(() => import('../../pages/Home/Prompts'));
|
const Prompts = lazy(() => import('../../pages/Home/Prompts'));
|
||||||
|
|
||||||
// Page configuration with caching and lifecycle settings
|
// Page configuration with caching and lifecycle settings
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import styles from './EditForm.module.css';
|
import styles from './EditForm.module.css';
|
||||||
|
|
||||||
// Field configuration interface (moved from EditPopup)
|
// Field configuration interface (moved from EditPopup)
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React from 'react';
|
|
||||||
import styles from './ViewForm.module.css';
|
import styles from './ViewForm.module.css';
|
||||||
import { EditFieldConfig } from './EditForm';
|
import { EditFieldConfig } from './EditForm';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect, useMemo } from 'react';
|
import { useState, useMemo } from 'react';
|
||||||
import { IoIosTrash, IoIosCopy } from 'react-icons/io';
|
import { IoIosTrash, IoIosCopy } from 'react-icons/io';
|
||||||
import { MdModeEdit } from 'react-icons/md';
|
import { MdModeEdit } from 'react-icons/md';
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { IoIosArrowDown } from "react-icons/io";
|
import { IoIosArrowDown } from "react-icons/io";
|
||||||
import { motion, AnimatePresence } from "framer-motion";
|
|
||||||
|
|
||||||
import styles from './SidebarStyles/SidebarItem.module.css';
|
import styles from './SidebarStyles/SidebarItem.module.css';
|
||||||
import SidebarSubmenu from "./SidebarSubmenu";
|
import SidebarSubmenu from "./SidebarSubmenu";
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import axios from 'axios';
|
|
||||||
import { useMsal } from '@azure/msal-react';
|
import { useMsal } from '@azure/msal-react';
|
||||||
import api from '../api';
|
import api from '../api';
|
||||||
import { useApiRequest } from './useApi';
|
import { useApiRequest } from './useApi';
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { useState, useEffect } from 'react';
|
import { useState } from 'react';
|
||||||
import { useApiRequest } from './useApi';
|
import { useApiRequest } from './useApi';
|
||||||
|
|
||||||
// Connection interfaces based on backend UserConnection model
|
// Connection interfaces based on backend UserConnection model
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ export function usePrompts() {
|
||||||
export function usePromptOperations() {
|
export function usePromptOperations() {
|
||||||
const [deletingPrompts, setDeletingPrompts] = useState<Set<string>>(new Set());
|
const [deletingPrompts, setDeletingPrompts] = useState<Set<string>>(new Set());
|
||||||
const [creatingPrompt, setCreatingPrompt] = useState(false);
|
const [creatingPrompt, setCreatingPrompt] = useState(false);
|
||||||
const { request, error: apiError, isLoading } = useApiRequest();
|
const { request, isLoading } = useApiRequest();
|
||||||
const [deleteError, setDeleteError] = useState<string | null>(null);
|
const [deleteError, setDeleteError] = useState<string | null>(null);
|
||||||
const [createError, setCreateError] = useState<string | null>(null);
|
const [createError, setCreateError] = useState<string | null>(null);
|
||||||
const [updateError, setUpdateError] = useState<string | null>(null);
|
const [updateError, setUpdateError] = useState<string | null>(null);
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ export type { Workflow, WorkflowMessage, WorkflowStats, WorkflowDocument, Workfl
|
||||||
|
|
||||||
export interface StartWorkflowRequest {
|
export interface StartWorkflowRequest {
|
||||||
prompt: string;
|
prompt: string;
|
||||||
listFileId: number[];
|
listFileId: string[];
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface StartWorkflowResponse {
|
export interface StartWorkflowResponse {
|
||||||
|
|
|
||||||
|
|
@ -340,10 +340,7 @@ export default {
|
||||||
'files.type.audio': 'Audio',
|
'files.type.audio': 'Audio',
|
||||||
'files.type.file': 'Fichier',
|
'files.type.file': 'Fichier',
|
||||||
|
|
||||||
// File Sources
|
|
||||||
'files.source.uploaded': 'Téléchargé',
|
|
||||||
'files.source.created': 'Créé par IA',
|
|
||||||
'files.source.shared': 'Partagé',
|
|
||||||
|
|
||||||
// File Actions
|
// File Actions
|
||||||
'files.action.download': 'Télécharger',
|
'files.action.download': 'Télécharger',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import styles from './HomeStyles/Einstellungen.module.css';
|
import styles from './HomeStyles/Einstellungen.module.css';
|
||||||
import sharedStyles from '../../components/PageManager/pages.module.css';
|
import sharedStyles from '../../components/PageManager/pages.module.css';
|
||||||
import { useLanguage, Language } from '../../contexts/LanguageContext';
|
import { useLanguage, Language } from '../../contexts/LanguageContext';
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useLocation } from 'react-router-dom';
|
|
||||||
|
|
||||||
import styles from './HomeStyles/Home.module.css'
|
import styles from './HomeStyles/Home.module.css'
|
||||||
|
|
||||||
import Sidebar from '../../components/Sidebar';
|
import Sidebar from '../../components/Sidebar';
|
||||||
import PageManager from '../../components/PageManager';
|
import PageManager from '../../components/PageManager';
|
||||||
|
|
||||||
import { AnimatePresence, motion } from "framer-motion";
|
|
||||||
|
|
||||||
function Home () {
|
function Home () {
|
||||||
useEffect(()=> {
|
useEffect(()=> {
|
||||||
document.title = "PowerOn";
|
document.title = "PowerOn";
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const location = useLocation();
|
|
||||||
|
|
||||||
// Loading component
|
// Loading component
|
||||||
const LoadingComponent = () => (
|
const LoadingComponent = () => (
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import { FaMicrosoft } from 'react-icons/fa';
|
|
||||||
import styles from './Register.module.css';
|
import styles from './Register.module.css';
|
||||||
import { useRegister, useMsalRegister, useUsernameAvailability } from '../hooks/useAuthentication';
|
import { useRegister, useMsalRegister, useUsernameAvailability } from '../hooks/useAuthentication';
|
||||||
|
|
||||||
|
|
@ -15,7 +15,7 @@ interface RegisterFormData {
|
||||||
function Register() {
|
function Register() {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { register, error: registerError, isLoading } = useRegister();
|
const { register, error: registerError, isLoading } = useRegister();
|
||||||
const { registerWithMsal, error: msalError, isLoading: msalLoading } = useMsalRegister();
|
const { error: msalError } = useMsalRegister();
|
||||||
const { checkAvailability, isChecking, error: availabilityError } = useUsernameAvailability();
|
const { checkAvailability, isChecking, error: availabilityError } = useUsernameAvailability();
|
||||||
const [formData, setFormData] = useState<RegisterFormData>({
|
const [formData, setFormData] = useState<RegisterFormData>({
|
||||||
username: '',
|
username: '',
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
import { httpsConfig } from './server.ts';
|
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue