Compare commits
26 Commits
80dc61b938
..
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e33a19d41 | |||
| 641f634dfa | |||
| 689c5105fe | |||
| 38284dabb6 | |||
| 74c6624317 | |||
| dffa4c5a77 | |||
| c040b9e62d | |||
| 51078a68fc | |||
| a4b2a870f3 | |||
| c74e19d732 | |||
| 39bf84cd0e | |||
| b989b6e8e8 | |||
| 8e74ca50be | |||
| 5798881446 | |||
| f57e4d94f8 | |||
| d543ba04ba | |||
| 4c5ef84443 | |||
| 5b0b2e1890 | |||
| c950249d15 | |||
| 41433b4859 | |||
| 3c4d9ec02a | |||
| 8d86ccea01 | |||
| 011f572ef3 | |||
| 74588fbd5d | |||
| def5c304e3 | |||
| 25ddc59f98 |
@@ -0,0 +1 @@
|
||||
VITE_PB_URL=
|
||||
@@ -0,0 +1,88 @@
|
||||
name: Déploiement AEGIS Portal
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- dev
|
||||
- test
|
||||
- acc
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: "true"
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||
|
||||
steps:
|
||||
- name: Patch DNS local pour Gitea Runner
|
||||
run: sudo echo "10.10.40.31 git.bunker.lan" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Configuration de Git pour SSL
|
||||
run: git config --global http.sslVerify false
|
||||
|
||||
- name: Récupération du code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configuration de Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Activation de pnpm
|
||||
run: corepack enable pnpm
|
||||
|
||||
- name: Installation des dépendances
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Compilation de la Build
|
||||
env:
|
||||
VITE_APP_ENV: ${{ github.ref_name }}
|
||||
VITE_PB_URL: ${{ secrets.PB_URL }}
|
||||
run: pnpm run build
|
||||
|
||||
- name: Installation de lftp
|
||||
run: sudo apt-get update && sudo apt-get install -y lftp
|
||||
|
||||
- name: Routage et Déploiement FTP
|
||||
env: # 1. On charge tous les secrets de manière sécurisée
|
||||
SERVER: ${{ secrets.FTP_SERVER }}
|
||||
DEV_U: ${{ secrets.DEV_FTP_USER }}
|
||||
DEV_P: ${{ secrets.DEV_FTP_PASSWORD }}
|
||||
TEST_U: ${{ secrets.TEST_FTP_USER }}
|
||||
TEST_P: ${{ secrets.TEST_FTP_PASSWORD }}
|
||||
ACC_U: ${{ secrets.ACC_FTP_USER }}
|
||||
ACC_P: ${{ secrets.ACC_FTP_PASSWORD }}
|
||||
PROD_U: ${{ secrets.PROD_FTP_USER }}
|
||||
PROD_P: ${{ secrets.PROD_FTP_PASSWORD }}
|
||||
BRANCH: ${{ github.ref_name }}
|
||||
run: |
|
||||
# 2. On attribue les bons identifiants selon la branche
|
||||
if [ "$BRANCH" == "master" ]; then
|
||||
TARGET_USER=$PROD_U; TARGET_PASS=$PROD_P;
|
||||
elif [ "$BRANCH" == "acc" ]; then
|
||||
TARGET_USER=$ACC_U; TARGET_PASS=$ACC_P;
|
||||
elif [ "$BRANCH" == "test" ]; then
|
||||
TARGET_USER=$TEST_U; TARGET_PASS=$TEST_P;
|
||||
else
|
||||
TARGET_USER=$DEV_U; TARGET_PASS=$DEV_P;
|
||||
fi
|
||||
|
||||
echo "Déploiement de la branche [$BRANCH]"
|
||||
|
||||
# 3. Exécution du script FTP
|
||||
cat << EOF > script.lftp
|
||||
set ftp:passive-mode true
|
||||
set ftp:ssl-allow no
|
||||
set ssl:verify-certificate no
|
||||
set net:timeout 5
|
||||
set net:max-retries 2
|
||||
set dns:fatal-timeout 2
|
||||
open -u "${TARGET_USER}","${TARGET_PASS}" "${SERVER}"
|
||||
cd home/${TARGET_USER}
|
||||
mirror -R --delete --verbose dist/ ./
|
||||
quit
|
||||
EOF
|
||||
|
||||
lftp -f script.lftp
|
||||
@@ -1,61 +0,0 @@
|
||||
name: Deploy Aegis Portal
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master # Branche principale confirmée
|
||||
|
||||
jobs:
|
||||
build-and-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# 1. On désactive la vérification SSL pour tout le conteneur du job (Node.js et Git)
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: "true"
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||
|
||||
steps:
|
||||
- name: Patch DNS local pour Gitea Runner
|
||||
run: sudo echo "10.10.40.31 git.bunker.lan" | sudo tee -a /etc/hosts
|
||||
|
||||
# 2. On force l'exécutable Git interne à ignorer la vérification de l'autorité locale
|
||||
- name: Configuration de Git pour SSL
|
||||
run: git config --global http.sslVerify false
|
||||
|
||||
- name: Récupération du code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configuration de Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Installation des dépendances (React/Vite)
|
||||
run: npm ci
|
||||
|
||||
- name: Compilation de la Build (Aegis)
|
||||
run: npm run build
|
||||
|
||||
- name: Installation de lftp
|
||||
run: sudo apt-get update && sudo apt-get install -y lftp
|
||||
|
||||
- name: Déploiement FTP (10.10.40.12)
|
||||
env:
|
||||
FTP_USER: ${{ secrets.FTP_USER }} # Le compte FTP enfermé dans aegis.gise.be
|
||||
FTP_PASSWORD: ${{ secrets.FTP_PASSWORD }}
|
||||
FTP_SERVER: ${{ secrets.FTP_SERVER }} # Doit contenir : 10.10.40.12
|
||||
run: |
|
||||
cat << EOF > script.lftp
|
||||
set ftp:passive-mode true
|
||||
set ftp:ssl-allow no
|
||||
set ssl:verify-certificate no
|
||||
set net:timeout 5
|
||||
set net:max-retries 2
|
||||
set dns:fatal-timeout 2
|
||||
open -u "${FTP_USER}","${FTP_PASSWORD}" "${FTP_SERVER}"
|
||||
cd home/${FTP_USER}
|
||||
mirror -R --delete --verbose dist/ ./
|
||||
quit
|
||||
EOF
|
||||
|
||||
lftp -f script.lftp
|
||||
@@ -0,0 +1,40 @@
|
||||
name: Sécurité - Architecture Git-Flow
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
- test
|
||||
- acc
|
||||
- master
|
||||
|
||||
jobs:
|
||||
validate-flow:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Vérification du flux de promotion
|
||||
run: |
|
||||
TARGET_BRANCH="${{ github.base_ref }}"
|
||||
SOURCE_BRANCH="${{ github.head_ref }}"
|
||||
|
||||
echo "Tentative de promotion : $SOURCE_BRANCH ➔ $TARGET_BRANCH"
|
||||
|
||||
# Règle 1 : Vers TEST (Doit venir de DEV)
|
||||
if [ "$TARGET_BRANCH" == "test" ] && [ "$SOURCE_BRANCH" != "dev" ]; then
|
||||
echo "ERREUR : L'environnement TEST ne peut recevoir que du code de DEV."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Règle 2 : Vers ACC (Doit venir de TEST)
|
||||
if [ "$TARGET_BRANCH" == "acc" ] && [ "$SOURCE_BRANCH" != "test" ]; then
|
||||
echo "ERREUR : L'environnement d'ACCEPTATION ne peut recevoir que du code de TEST."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Règle 3 : Vers PROD (Doit venir de ACC)
|
||||
if [ "$TARGET_BRANCH" == "master" ] && [ "$SOURCE_BRANCH" != "acc" ]; then
|
||||
echo "ERREUR : La PRODUCTION ne peut recevoir que du code validé en ACCEPTATION (acc)."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Flux réglementaire respecté ! Promotion autorisée."
|
||||
@@ -0,0 +1,59 @@
|
||||
name: Contrôle Qualité & Sécurité (QA)
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- dev
|
||||
- test
|
||||
- acc
|
||||
- master
|
||||
|
||||
jobs:
|
||||
quality-gate:
|
||||
name: qa-s-check
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
env:
|
||||
GIT_SSL_NO_VERIFY: "true"
|
||||
NODE_TLS_REJECT_UNAUTHORIZED: "0"
|
||||
|
||||
steps:
|
||||
- name: Patch DNS local pour Gitea Runner
|
||||
run: sudo echo "10.10.40.31 git.bunker.lan" | sudo tee -a /etc/hosts
|
||||
|
||||
- name: Configuration de Git pour SSL
|
||||
run: git config --global http.sslVerify false
|
||||
|
||||
- name: Récupération du code source
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configuration de Node.js (v22)
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 22
|
||||
|
||||
- name: Activation de pnpm
|
||||
run: corepack enable pnpm
|
||||
|
||||
- name: Installation des dépendances
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
# Étape 1 : ESLint (Syntaxe et conventions)
|
||||
- name: Analyse Linter (ESLint)
|
||||
run: pnpm run lint
|
||||
|
||||
# Étape 2 : Verification stricte des types TypeScript (sans émettre de fichiers)
|
||||
- name: Verification des Types TypeScript
|
||||
run: pnpm exec tsc --noEmit
|
||||
|
||||
# Étape 3 : Exécution des tests unitaires
|
||||
- name: Tests Unitaires (Vitest)
|
||||
run: pnpm run test -- --run
|
||||
|
||||
# Étape 4 : Audit des vulnérabilités npm (Niveau High/Critical)
|
||||
- name: Audit de Sécurité des Dépendances
|
||||
run: pnpm audit --audit-level=high
|
||||
|
||||
# Étape 5 : Validation de la compilation ViteJS
|
||||
- name: Validation du Build de Production
|
||||
run: pnpm run build
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
+18
-16
@@ -7,35 +7,37 @@
|
||||
"dev": "vite",
|
||||
"build": "tsc -b && vite build",
|
||||
"lint": "eslint .",
|
||||
"preview": "vite preview"
|
||||
"preview": "vite preview",
|
||||
"test": "vitest"
|
||||
},
|
||||
"dependencies": {
|
||||
"@tailwindcss/vite": "^4.3.3",
|
||||
"@zitadel/react-auth": "^1.2.1",
|
||||
"clsx": "^2.1.1",
|
||||
"lucide-react": "^1.27.0",
|
||||
"lucide-react": "^1.28.0",
|
||||
"oidc-client-ts": "^3.5.0",
|
||||
"otpauth": "^9.5.1",
|
||||
"pocketbase": "^0.27.0",
|
||||
"pocketbase": "^0.27.1",
|
||||
"qrcode.react": "^4.2.0",
|
||||
"react": "^19.2.7",
|
||||
"react-dom": "^19.2.7",
|
||||
"react-router-dom": "^7.18.1",
|
||||
"react": "^19.2.8",
|
||||
"react-dom": "^19.2.8",
|
||||
"react-router-dom": "^7.18.2",
|
||||
"tailwind-merge": "^3.6.0",
|
||||
"tailwindcss": "^4.3.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/node": "^24.13.2",
|
||||
"@types/react": "^19.2.17",
|
||||
"@types/react-dom": "^19.2.3",
|
||||
"@vitejs/plugin-react": "^6.0.3",
|
||||
"eslint": "^10.6.0",
|
||||
"@types/node": "^24.13.3",
|
||||
"@types/react": "^19.2.18",
|
||||
"@types/react-dom": "^19.2.4",
|
||||
"@vitejs/plugin-react": "^6.0.5",
|
||||
"eslint": "^10.8.0",
|
||||
"eslint-plugin-react-hooks": "^7.1.1",
|
||||
"eslint-plugin-react-refresh": "^0.5.3",
|
||||
"globals": "^17.7.0",
|
||||
"typescript": "~6.0.2",
|
||||
"typescript-eslint": "^8.62.0",
|
||||
"vite": "^8.1.1"
|
||||
"globals": "^17.9.0",
|
||||
"typescript": "~6.0.3",
|
||||
"typescript-eslint": "^8.65.0",
|
||||
"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"
|
||||
@@ -1,4 +1,6 @@
|
||||
import { Card, CardContent } from '@/components/ui/Card';
|
||||
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||
import { Check } from 'lucide-react';
|
||||
import Badge from '@ui/Badge';
|
||||
|
||||
interface BackupWidgetProps {
|
||||
onClick?: () => void;
|
||||
@@ -6,27 +8,22 @@ interface BackupWidgetProps {
|
||||
|
||||
export default function BackupWidget({ onClick }: BackupWidgetProps) {
|
||||
return (
|
||||
<Card
|
||||
<Card
|
||||
onClick={onClick}
|
||||
className="cursor-pointer hover:border-blue-300 hover:shadow-md transition-all group"
|
||||
className="cursor-pointer transition-all duration-300 ease-in-out"
|
||||
>
|
||||
<CardHeader>
|
||||
<h2 className="text-lg font-semibold">Sauvegardes</h2>
|
||||
<Badge className="max-w-fit min-w-fit" name="PRA Immuable">
|
||||
</Badge>
|
||||
</CardHeader>
|
||||
<CardContent className="p-6">
|
||||
<div className="flex items-center justify-between mb-4">
|
||||
<h2 className="text-lg font-semibold text-slate-900 group-hover:text-blue-900 transition-colors">Sauvegardes</h2>
|
||||
<span className="bg-slate-100 text-slate-600 text-xs px-2 py-1 rounded font-medium border border-slate-200">
|
||||
PRA Immuable
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<div className="bg-slate-50 rounded-lg p-4 border border-slate-100 mb-4 group-hover:bg-blue-50/50 transition-colors">
|
||||
<Card variant='digged' className="bg-slate-50 rounded-lg p-4 border border-slate-100 mb-4">
|
||||
<p className="text-sm text-slate-500 mb-1">Dernier snapshot système</p>
|
||||
<p className="text-slate-900 font-medium">Aujourd'hui à 03:00 AM</p>
|
||||
</div>
|
||||
|
||||
</Card>
|
||||
<div className="flex items-center text-emerald-600 text-sm font-medium">
|
||||
<svg className="w-5 h-5 mr-2" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" d="M5 13l4 4L19 7" />
|
||||
</svg>
|
||||
<Check></Check>
|
||||
Intégrité validée avec succès
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
@@ -5,7 +5,8 @@ import { Button } from '@/components/ui/Button';
|
||||
import { Input } from '@/components/ui/Input';
|
||||
import { Select } from '@/components/ui/Select';
|
||||
import { Textarea } from '@/components/ui/Textarea';
|
||||
import { cn } from '@/utils/utils';
|
||||
import type { TicketCategory } from '@/types/Category';
|
||||
import type { ButtonVariantStyle } from '@/styles/VariantStyle';
|
||||
|
||||
interface NewTicketWidgetProps {
|
||||
onCancel: () => void;
|
||||
@@ -16,12 +17,13 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
const { createTicket, isSubmitting, error } = useCreateTicket();
|
||||
|
||||
// É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 [subject, setSubject] = useState('');
|
||||
const [affectedAsset, setAffectedAsset] = useState('');
|
||||
const [incidentTime, setIncidentTime] = useState('');
|
||||
const [description, setDescription] = useState('');
|
||||
const [buttonVariant, setButtonVariant]=useState<ButtonVariantStyle>('primary');
|
||||
|
||||
const handleSubmit = async (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
@@ -39,7 +41,7 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="bg-slate-50 border-b border-slate-100">
|
||||
<CardHeader>
|
||||
<h1 className="text-xl font-bold text-slate-900 tracking-tight">Ouvrir un nouveau ticket</h1>
|
||||
<p className="text-sm text-slate-500 mt-0.5">Qualification de votre requête ITSM</p>
|
||||
</CardHeader>
|
||||
@@ -62,7 +64,7 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
<Select
|
||||
label="Type de demande"
|
||||
value={category}
|
||||
onChange={(e) => setCategory(e.target.value as any)}
|
||||
onChange={(e) => {setCategory(e.target.value as TicketCategory); setButtonVariant(e.target.value==="Incident Critique"?"danger":"primary")}}
|
||||
options={[
|
||||
{ value: 'Incident Critique', label: 'Incident Critique (Panne, Dégradation)' },
|
||||
{ value: 'Évolution', label: 'Évolution (Ajout de ressources, Modification)' },
|
||||
@@ -143,11 +145,7 @@ export const NewTicketWidget: React.FC<NewTicketWidgetProps> = ({ onCancel, onSu
|
||||
<Button
|
||||
type="submit"
|
||||
isLoading={isSubmitting}
|
||||
className={cn(
|
||||
category === 'Incident Critique'
|
||||
? "bg-red-600 hover:bg-red-700 focus:ring-red-600"
|
||||
: ""
|
||||
)}
|
||||
variant={buttonVariant}
|
||||
>
|
||||
Soumettre le ticket
|
||||
</Button>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Card, CardContent } from '@/components/ui/Card';
|
||||
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||
|
||||
interface SecurityWidgetProps {
|
||||
onClick?: () => void;
|
||||
@@ -6,18 +6,18 @@ interface SecurityWidgetProps {
|
||||
|
||||
export default function SecurityWidget({ onClick }: SecurityWidgetProps) {
|
||||
return (
|
||||
<Card
|
||||
<Card
|
||||
onClick={onClick}
|
||||
className="cursor-pointer hover:border-blue-300 hover:shadow-md transition-all group"
|
||||
className="cursor-pointer hover:border-blue-300 transition-all duration-300 ease-in-out"
|
||||
>
|
||||
<CardHeader>
|
||||
<h2 className="text-lg font-semibold transition-colors">Posture de Sécurité</h2>
|
||||
</CardHeader>
|
||||
<CardContent className="p-6">
|
||||
<h2 className="text-lg font-semibold text-slate-900 mb-4 group-hover:text-blue-900 transition-colors">Posture de Sécurité</h2>
|
||||
|
||||
<div className="flex items-baseline space-x-2 mb-4">
|
||||
<span className="text-3xl font-bold text-slate-900">1,432</span>
|
||||
<span className="text-sm text-slate-500">menaces bloquées (30j)</span>
|
||||
</div>
|
||||
|
||||
<div className="space-y-3">
|
||||
<div className="flex justify-between items-center text-sm">
|
||||
<span className="text-slate-600">Bouclier Cloudflare WAF</span>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useState } from 'react';
|
||||
import type { TicketMessage } from '@/types/Message';
|
||||
import { Card } from '@/components/ui/Card';
|
||||
import { Card, CardContent, CardHeader } from '@/components/ui/Card';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
import { Input } from '@/components/ui/Input';
|
||||
import { EmptyState } from '@/components/ui/EmptyState';
|
||||
@@ -28,19 +28,19 @@ export const TicketChatWidget: React.FC<TicketChatWidgetProps> = ({
|
||||
try {
|
||||
await onSendMessage(newMessage);
|
||||
setNewMessage(''); // Vide l'input uniquement si l'envoi réussit
|
||||
} catch (err) {
|
||||
} catch {
|
||||
alert("Erreur lors de l'envoi.");
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Card className="flex flex-col h-[500px] overflow-hidden shadow-sm">
|
||||
<div className="p-4 border-b border-slate-100 bg-slate-50">
|
||||
<h2 className="text-sm font-semibold text-slate-800">Échanges chiffrés avec l'ingénierie</h2>
|
||||
</div>
|
||||
<Card className="h-125">
|
||||
<CardHeader>
|
||||
<h2 className="text-sm font-semibold text-slate-800">Échanges chiffrés</h2>
|
||||
</CardHeader>
|
||||
|
||||
{/* Zone des messages */}
|
||||
<div className="flex-1 overflow-y-auto p-6 space-y-6 scrollbar-hide bg-white">
|
||||
<CardContent className="flex-1 overflow-y-auto p-6 space-y-6">
|
||||
{messages.length === 0 ? (
|
||||
<EmptyState message="Aucun message pour l'instant. Démarrez la conversation ci-dessous." />
|
||||
) : (
|
||||
@@ -48,10 +48,10 @@ export const TicketChatWidget: React.FC<TicketChatWidgetProps> = ({
|
||||
<MessageBubble key={msg.id} message={msg} currentUserId={currentUserId} />
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
{/* Zone de saisie avec notre composant UI */}
|
||||
<form onSubmit={handleSubmit} className="p-4 border-t border-slate-100 bg-slate-50 flex items-start space-x-3">
|
||||
<form onSubmit={handleSubmit} className="p-4 flex items-start space-x-3">
|
||||
<div className="flex-1">
|
||||
<Input
|
||||
value={newMessage}
|
||||
|
||||
@@ -10,7 +10,7 @@ interface TicketInfoWidgetProps {
|
||||
export const TicketInfoWidget: React.FC<TicketInfoWidgetProps> = ({ ticket }) => {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="bg-slate-50 border-b border-slate-100 flex flex-col sm:flex-row sm:items-start justify-between gap-4">
|
||||
<CardHeader>
|
||||
<div className="space-y-2">
|
||||
<div className="flex items-center space-x-3">
|
||||
<span className="text-xs font-bold uppercase tracking-wider px-2.5 py-1 bg-slate-200 text-slate-700 rounded-md">
|
||||
@@ -24,10 +24,10 @@ export const TicketInfoWidget: React.FC<TicketInfoWidgetProps> = ({ ticket }) =>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<StatusBadge status={ticket.status} className="shrink-0" />
|
||||
<StatusBadge status={ticket.status} className="shrink-0 max-w-fit" />
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="p-6 bg-white">
|
||||
<CardContent>
|
||||
<p className="text-xs font-semibold text-slate-400 mb-2 uppercase tracking-wide">
|
||||
Description du besoin :
|
||||
</p>
|
||||
|
||||
@@ -24,6 +24,7 @@ export const useDocuments = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
fetchDocuments();
|
||||
}, [fetchDocuments]);
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ export const useInfrastructureNodes = () => {
|
||||
sort: 'created',
|
||||
});
|
||||
setNodes(records);
|
||||
} catch (err) {
|
||||
} catch {
|
||||
setError("Impossible de charger l'infrastructure.");
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
@@ -23,8 +23,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
||||
try {
|
||||
const authData = await pb.collection('aegis_users').authWithOAuth2({ provider: 'oidc' });
|
||||
if (authData) onLoginSuccess();
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
} catch {
|
||||
setError("Échec de la connexion via GISE Identity.");
|
||||
pb.authStore.clear();
|
||||
} finally {
|
||||
@@ -64,7 +63,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
||||
} else {
|
||||
onLoginSuccess();
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
setError("Identifiants incorrects ou accès révoqué.");
|
||||
pb.authStore.clear();
|
||||
} finally {
|
||||
@@ -98,7 +97,7 @@ export const useLoginFlow = (onLoginSuccess: () => void) => {
|
||||
} else {
|
||||
setError("Code de sécurité invalide ou expiré.");
|
||||
}
|
||||
} catch (err) {
|
||||
} catch {
|
||||
setError("Erreur critique lors de la vérification.");
|
||||
} finally {
|
||||
setIsLoading(false);
|
||||
|
||||
@@ -15,7 +15,7 @@ export const useTicketDetail = (ticketId?: string) => {
|
||||
const fetchTicketData = useCallback(async () => {
|
||||
if (!ticketId) return;
|
||||
setError(null);
|
||||
|
||||
|
||||
try {
|
||||
// 1. Récupération du ticket
|
||||
const ticketData = await pb.collection('aegis_tickets').getOne<Ticket>(ticketId);
|
||||
@@ -37,12 +37,13 @@ export const useTicketDetail = (ticketId?: string) => {
|
||||
}, [ticketId]);
|
||||
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
fetchTicketData();
|
||||
}, [fetchTicketData]);
|
||||
|
||||
const sendMessage = async (content: string) => {
|
||||
if (!content.trim() || !currentUser || !ticketId) return;
|
||||
|
||||
|
||||
setIsSending(true);
|
||||
try {
|
||||
await pb.collection('aegis_ticket_messages').create({
|
||||
@@ -51,9 +52,8 @@ export const useTicketDetail = (ticketId?: string) => {
|
||||
content: content.trim(),
|
||||
});
|
||||
await fetchTicketData(); // On recharge les messages après l'envoi
|
||||
} catch (err) {
|
||||
console.error("Erreur lors de l'envoi du message :", err);
|
||||
throw new Error("Impossible d'envoyer le message.");
|
||||
} catch (error) {
|
||||
throw new Error("Impossible de charger le ticket", { cause: error });
|
||||
} finally {
|
||||
setIsSending(false);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ export const useTickets = () => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect
|
||||
fetchTickets();
|
||||
}, [fetchTickets]);
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import { useEvolutionRequest } from '@/hooks/useEvolutionRequest';
|
||||
|
||||
import { BackButton } from '@/components/ui/BackButton';
|
||||
import { EmptyState } from '@/components/ui/EmptyState';
|
||||
import { Button } from '@/components/ui/Button';
|
||||
|
||||
// Nos nouveaux composants
|
||||
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