Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 84d7b7e847 | |||
| a0a77648ca | |||
| 6cb35e82fe | |||
| b43cf6f036 | |||
| b573d20aab | |||
| 38284dabb6 | |||
| 74c6624317 | |||
| 51078a68fc | |||
| a4b2a870f3 | |||
| c74e19d732 | |||
| 8e74ca50be | |||
| 5798881446 | |||
| f57e4d94f8 | |||
| d543ba04ba | |||
| 4c5ef84443 | |||
| 5b0b2e1890 | |||
| c950249d15 | |||
| 41433b4859 | |||
| 3c4d9ec02a | |||
| 8d86ccea01 | |||
| 011f572ef3 | |||
| 74588fbd5d |
@@ -0,0 +1 @@
|
|||||||
|
VITE_PB_URL=
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { describe, it, expect } from 'vitest';
|
||||||
|
|
||||||
|
describe('AEGIS Initial Test', () => {
|
||||||
|
it('devrait valider que 1 + 1 font 2', () => {
|
||||||
|
expect(1 + 1).toBe(2);
|
||||||
|
});
|
||||||
|
});
|
||||||
+17
-15
@@ -7,35 +7,37 @@
|
|||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "tsc -b && vite build",
|
"build": "tsc -b && vite build",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"preview": "vite preview"
|
"preview": "vite preview",
|
||||||
|
"test": "vitest"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@tailwindcss/vite": "^4.3.3",
|
"@tailwindcss/vite": "^4.3.3",
|
||||||
"@zitadel/react-auth": "^1.2.1",
|
"@zitadel/react-auth": "^1.2.1",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"lucide-react": "^1.27.0",
|
"lucide-react": "^1.28.0",
|
||||||
"oidc-client-ts": "^3.5.0",
|
"oidc-client-ts": "^3.5.0",
|
||||||
"otpauth": "^9.5.1",
|
"otpauth": "^9.5.1",
|
||||||
"pocketbase": "^0.27.0",
|
"pocketbase": "^0.27.1",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "^4.2.0",
|
||||||
"react": "^19.2.7",
|
"react": "^19.2.8",
|
||||||
"react-dom": "^19.2.7",
|
"react-dom": "^19.2.8",
|
||||||
"react-router-dom": "^7.18.1",
|
"react-router-dom": "^7.18.2",
|
||||||
"tailwind-merge": "^3.6.0",
|
"tailwind-merge": "^3.6.0",
|
||||||
"tailwindcss": "^4.3.3"
|
"tailwindcss": "^4.3.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@eslint/js": "^10.0.1",
|
"@eslint/js": "^10.0.1",
|
||||||
"@types/node": "^24.13.2",
|
"@types/node": "^24.13.3",
|
||||||
"@types/react": "^19.2.17",
|
"@types/react": "^19.2.18",
|
||||||
"@types/react-dom": "^19.2.3",
|
"@types/react-dom": "^19.2.4",
|
||||||
"@vitejs/plugin-react": "^6.0.3",
|
"@vitejs/plugin-react": "^6.0.5",
|
||||||
"eslint": "^10.6.0",
|
"eslint": "^10.8.0",
|
||||||
"eslint-plugin-react-hooks": "^7.1.1",
|
"eslint-plugin-react-hooks": "^7.1.1",
|
||||||
"eslint-plugin-react-refresh": "^0.5.3",
|
"eslint-plugin-react-refresh": "^0.5.3",
|
||||||
"globals": "^17.7.0",
|
"globals": "^17.9.0",
|
||||||
"typescript": "~6.0.2",
|
"typescript": "~6.0.3",
|
||||||
"typescript-eslint": "^8.62.0",
|
"typescript-eslint": "^8.65.0",
|
||||||
"vite": "^8.1.1"
|
"vite": "^8.2.0",
|
||||||
|
"vitest": "^4.1.10"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Generated
+461
-227
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,3 @@
|
|||||||
|
overrides:
|
||||||
|
react-router: "^6.30.4"
|
||||||
|
react-router-dom: "^6.30.4"
|
||||||
@@ -5,6 +5,8 @@ import { Button } from '@/components/ui/Button';
|
|||||||
import { Input } from '@/components/ui/Input';
|
import { Input } from '@/components/ui/Input';
|
||||||
import { Select } from '@/components/ui/Select';
|
import { Select } from '@/components/ui/Select';
|
||||||
import { Textarea } from '@/components/ui/Textarea';
|
import { Textarea } from '@/components/ui/Textarea';
|
||||||
|
import type { TicketCategory } from '@/types/Category';
|
||||||
|
import type { ButtonVariantStyle } from '@/styles/VariantStyle';
|
||||||
|
|
||||||
interface NewTicketWidgetProps {
|
interface NewTicketWidgetProps {
|
||||||
onCancel: () => void;
|
onCancel: () => void;
|
||||||
@@ -15,13 +17,13 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
|||||||
const { createTicket, isSubmitting, error } = useCreateTicket();
|
const { createTicket, isSubmitting, error } = useCreateTicket();
|
||||||
|
|
||||||
// États locaux isolés dans le widget
|
// États locaux isolés dans le widget
|
||||||
const [category, setCategory] = useState<'Incident Critique' | 'Évolution' | 'Administratif'>('Incident Critique');
|
const [category, setCategory] = useState<TicketCategory>('Incident Critique');
|
||||||
const [ci, setCi] = useState('general');
|
const [ci, setCi] = useState('general');
|
||||||
const [subject, setSubject] = useState('');
|
const [subject, setSubject] = useState('');
|
||||||
const [affectedAsset, setAffectedAsset] = useState('');
|
const [affectedAsset, setAffectedAsset] = useState('');
|
||||||
const [incidentTime, setIncidentTime] = useState('');
|
const [incidentTime, setIncidentTime] = useState('');
|
||||||
const [description, setDescription] = useState('');
|
const [description, setDescription] = useState('');
|
||||||
const [buttonVariant, setButtonVariant]=useState('primary');
|
const [buttonVariant, setButtonVariant]=useState<ButtonVariantStyle>('primary');
|
||||||
|
|
||||||
const handleSubmit = async (e: React.FormEvent) => {
|
const handleSubmit = async (e: React.FormEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
@@ -62,7 +64,7 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
|||||||
<Select
|
<Select
|
||||||
label="Type de demande"
|
label="Type de demande"
|
||||||
value={category}
|
value={category}
|
||||||
onChange={(e) => {setCategory(e.target.value as any); setButtonVariant(e.target.value==="Incident Critique"?"danger":"primary")}}
|
onChange={(e) => {setCategory(e.target.value as TicketCategory); setButtonVariant(e.target.value==="Incident Critique"?"danger":"primary")}}
|
||||||
options={[
|
options={[
|
||||||
{ value: 'Incident Critique', label: 'Incident Critique (Panne, Dégradation)' },
|
{ value: 'Incident Critique', label: 'Incident Critique (Panne, Dégradation)' },
|
||||||
{ value: 'Évolution', label: 'Évolution (Ajout de ressources, Modification)' },
|
{ value: 'Évolution', label: 'Évolution (Ajout de ressources, Modification)' },
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export const TicketChatWidget: React.FC<TicketChatWidgetProps> = ({
|
|||||||
try {
|
try {
|
||||||
await onSendMessage(newMessage);
|
await onSendMessage(newMessage);
|
||||||
setNewMessage(''); // Vide l'input uniquement si l'envoi réussit
|
setNewMessage(''); // Vide l'input uniquement si l'envoi réussit
|
||||||
} catch (err) {
|
} catch {
|
||||||
alert("Erreur lors de l'envoi.");
|
alert("Erreur lors de l'envoi.");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ export const useDocuments = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||||
fetchDocuments();
|
fetchDocuments();
|
||||||
}, [fetchDocuments]);
|
}, [fetchDocuments]);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const useInfrastructureNodes = () => {
|
|||||||
sort: 'created',
|
sort: 'created',
|
||||||
});
|
});
|
||||||
setNodes(records);
|
setNodes(records);
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError("Impossible de charger l'infrastructure.");
|
setError("Impossible de charger l'infrastructure.");
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
|||||||
try {
|
try {
|
||||||
const authData = await pb.collection('aegis_users').authWithOAuth2({ provider: 'oidc' });
|
const authData = await pb.collection('aegis_users').authWithOAuth2({ provider: 'oidc' });
|
||||||
if (authData) onLoginSuccess();
|
if (authData) onLoginSuccess();
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error(err);
|
|
||||||
setError("Échec de la connexion via GISE Identity.");
|
setError("Échec de la connexion via GISE Identity.");
|
||||||
pb.authStore.clear();
|
pb.authStore.clear();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -64,7 +63,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
|||||||
} else {
|
} else {
|
||||||
onLoginSuccess();
|
onLoginSuccess();
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError("Identifiants incorrects ou accès révoqué.");
|
setError("Identifiants incorrects ou accès révoqué.");
|
||||||
pb.authStore.clear();
|
pb.authStore.clear();
|
||||||
} finally {
|
} finally {
|
||||||
@@ -98,7 +97,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
|||||||
} else {
|
} else {
|
||||||
setError("Code de sécurité invalide ou expiré.");
|
setError("Code de sécurité invalide ou expiré.");
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch {
|
||||||
setError("Erreur critique lors de la vérification.");
|
setError("Erreur critique lors de la vérification.");
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ export const useTicketDetail = (ticketId?: string) => {
|
|||||||
}, [ticketId]);
|
}, [ticketId]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||||
fetchTicketData();
|
fetchTicketData();
|
||||||
}, [fetchTicketData]);
|
}, [fetchTicketData]);
|
||||||
|
|
||||||
@@ -51,9 +52,8 @@ export const useTicketDetail = (ticketId?: string) => {
|
|||||||
content: content.trim(),
|
content: content.trim(),
|
||||||
});
|
});
|
||||||
await fetchTicketData(); // On recharge les messages après l'envoi
|
await fetchTicketData(); // On recharge les messages après l'envoi
|
||||||
} catch (err) {
|
} catch (error) {
|
||||||
console.error("Erreur lors de l'envoi du message :", err);
|
throw new Error("Impossible de charger le ticket", { cause: error });
|
||||||
throw new Error("Impossible d'envoyer le message.");
|
|
||||||
} finally {
|
} finally {
|
||||||
setIsSending(false);
|
setIsSending(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ export const useTickets = () => {
|
|||||||
sort: '-created', // Du plus récent au plus ancien
|
sort: '-created', // Du plus récent au plus ancien
|
||||||
});
|
});
|
||||||
setTickets(records);
|
setTickets(records);
|
||||||
} catch (err) {
|
} catch {
|
||||||
console.error("Erreur lors de la récupération des tickets :", err);
|
|
||||||
setError("Impossible de charger l'historique de vos requêtes.");
|
setError("Impossible de charger l'historique de vos requêtes.");
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
@@ -24,6 +23,7 @@ export const useTickets = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||||
fetchTickets();
|
fetchTickets();
|
||||||
}, [fetchTickets]);
|
}, [fetchTickets]);
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import { useEvolutionRequest } from '@/hooks/useEvolutionRequest';
|
|||||||
|
|
||||||
import { BackButton } from '@/components/ui/BackButton';
|
import { BackButton } from '@/components/ui/BackButton';
|
||||||
import { EmptyState } from '@/components/ui/EmptyState';
|
import { EmptyState } from '@/components/ui/EmptyState';
|
||||||
import { Button } from '@/components/ui/Button';
|
|
||||||
|
|
||||||
// Nos nouveaux composants
|
// Nos nouveaux composants
|
||||||
import { EvolutionOptionCard } from '@/components/widgets/EvolutionOptionCard';
|
import { EvolutionOptionCard } from '@/components/widgets/EvolutionOptionCard';
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export type ButtonVariantStyle = "primary" | "danger" | "secondary" | "success" | "outline" | "ghost";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
export type TicketCategory = "Incident Critique" | "Évolution" | "Administratif";
|
||||||
Reference in New Issue
Block a user