From 94ed0ba28bf0bffef7f36d61749335451991114d Mon Sep 17 00:00:00 2001 From: Tykayn Date: Mon, 11 Aug 2025 10:42:43 +0200 Subject: [PATCH] CSC: add initial state for redux --- sae-csc/scripts/link-sae-lib.sh | 5 +-- sae-csc/src/app/redux/initialState.ts | 38 +++++++++++++++++++++ sae-csc/src/app/redux/reducers/index.ts | 44 +++++++++++++++++++++++-- sae-csc/src/styles.scss | 3 +- 4 files changed, 83 insertions(+), 7 deletions(-) diff --git a/sae-csc/scripts/link-sae-lib.sh b/sae-csc/scripts/link-sae-lib.sh index 3d930b1..8ce7d34 100755 --- a/sae-csc/scripts/link-sae-lib.sh +++ b/sae-csc/scripts/link-sae-lib.sh @@ -24,15 +24,16 @@ if [ ! -f "package.json" ]; then exit 1 fi -# Créer un lien npm echo "Création d'un lien npm pour sae-lib..." npm link -# Revenir au dossier de l'application cd ../../../sae-csc # Utiliser le lien dans l'application echo "Utilisation du lien dans l'application sae-csc..." npm link sae-lib +cd ../sae-airwatch +npm link sae-lib + echo "Lien créé avec succès. sae-lib est maintenant disponible comme un module npm." diff --git a/sae-csc/src/app/redux/initialState.ts b/sae-csc/src/app/redux/initialState.ts index 9b020c3..bbbf50d 100644 --- a/sae-csc/src/app/redux/initialState.ts +++ b/sae-csc/src/app/redux/initialState.ts @@ -6,6 +6,44 @@ export const initialState: StateInterface = { app: { backendAPIRoot: "", demoMode: true, + fromText: "", + toText: "", + filters: { + engineType: { + availableList: {}, + selectedList: {} + }, + findings: { + availableList: {}, + selectedList: {} + }, + ata: { + availableList: {}, + selectedList: {} + }, + partNumber: { + availableList: {}, + selectedList: {} + }, + technicalManual: { + availableList: {}, + selectedList: {} + }, + onOffWing: { + availableList: {}, + selectedList: {} + } + }, + similarCases: {}, + searchInput: "", + enableAiSuggestion: false, + technicalManuals: [], + admin: { + pendingUsers: {}, + users: {}, + currentUser: {}, + statistics: {} + } }, currentLang: "fr_FR", currentTheme: "light", diff --git a/sae-csc/src/app/redux/reducers/index.ts b/sae-csc/src/app/redux/reducers/index.ts index afa4f2e..f82c7cc 100644 --- a/sae-csc/src/app/redux/reducers/index.ts +++ b/sae-csc/src/app/redux/reducers/index.ts @@ -62,9 +62,27 @@ export interface SwitchToNextLanguageAction { type: ActionTypes.SWITCH_TO_NEXT_LANGUAGE; } -type Theme = 'light' | 'dark'; -type Lang = 'fr_FR' | 'en_US'; +export type Theme = 'light' | 'dark'; +export type Lang = 'fr_FR' | 'en_US'; +export type SelectFilterType = { + availableList: object; + selectedList: object; +} + +export type technicalManualType = { + title: string; + information: string; + originalQuestion: string; + answerSent: string; + caseSummary: string; + enginePart: object; + findings: object; + date: object; + chronoId: string; + teamInCharge: string; + partNumber: string; +} export type AppActions = | UpdateUserAction | UpdateAppAction @@ -79,8 +97,28 @@ export interface StateInterface { id: string; }; app: { - demoMode:boolean; + demoMode: boolean; backendAPIRoot: string; + fromText: string, + toText: string, + filters: { + engineType: SelectFilterType, + findings: SelectFilterType, + ata: SelectFilterType, + partNumber: SelectFilterType, + technicalManual: SelectFilterType, + onOffWing: SelectFilterType, + } + similarCases: object; + searchInput: string; + enableAiSuggestion: boolean; + technicalManuals: Array; + admin: { + pendingUsers: object; + users: object; + currentUser: object; + statistics: object; + } }; themesList: Array; currentTheme: Theme; diff --git a/sae-csc/src/styles.scss b/sae-csc/src/styles.scss index 422db61..11ddb74 100644 --- a/sae-csc/src/styles.scss +++ b/sae-csc/src/styles.scss @@ -3,8 +3,7 @@ @use "sass:color"; @use "app/styles/app.scss"; // lib SAE Aero styles -//@use 'sae-lib/src/styles/index.scss'; -@use '../../my-workspace/projects/sae-lib/src/styles/index.scss'; +@use 'sae-lib/src/styles/index.scss'; /* Fichier de styles global pour l'application */ // Importer les styles principaux