CSC: add initial state for redux

This commit is contained in:
Tykayn 2025-08-11 10:42:43 +02:00 committed by tykayn
parent 14cdf17ec3
commit 94ed0ba28b
4 changed files with 83 additions and 7 deletions

View file

@ -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."

View file

@ -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",

View file

@ -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
@ -81,6 +99,26 @@ export interface StateInterface {
app: {
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<technicalManualType>;
admin: {
pendingUsers: object;
users: object;
currentUser: object;
statistics: object;
}
};
themesList: Array<Theme>;
currentTheme: Theme;

View file

@ -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