Remove Console.Log
continuous-integration/drone/push Build is passing Details

pull/24/head^2
Louison PARANT 1 year ago
parent 4cbc138fb8
commit 3dee4a4dd4

@ -31,7 +31,6 @@ export default function FiltersSelection(props) {
const subscriptionAddProfile = eventEmitter.addListener('profileAdded', async () => { const subscriptionAddProfile = eventEmitter.addListener('profileAdded', async () => {
fetchProfiles() fetchProfiles()
console.log("Technique de Shinobi Anti-CodeSmell", selectedDiets)
subscriptionAddProfile.remove() subscriptionAddProfile.remove()
eventEmitter.removeAllListeners('profileAdded') eventEmitter.removeAllListeners('profileAdded')
eventEmitter.removeAllListeners('updateDietsAllergies') eventEmitter.removeAllListeners('updateDietsAllergies')
@ -67,7 +66,7 @@ export default function FiltersSelection(props) {
fetchProfiles() fetchProfiles()
eventEmitter.emit("selectedProfilesUpdated") eventEmitter.emit("selectedProfilesUpdated")
} catch (error) { } catch (error) {
console.error('Error occured when updating active profiles:', error); console.error('Error occured when updating active profiles:', error, selectedDiets);
} }
}; };
@ -75,7 +74,6 @@ export default function FiltersSelection(props) {
updateDiets() updateDiets()
updateAllergies() updateAllergies()
eventEmitter.emit("updateDietsAllergies") eventEmitter.emit("updateDietsAllergies")
console.log("Filters Selection: ---------------------------------------------------")
subscriptionUpdateProfiles.remove(); subscriptionUpdateProfiles.remove();
eventEmitter.removeAllListeners('profileAdded') eventEmitter.removeAllListeners('profileAdded')
eventEmitter.removeAllListeners('updateDietsAllergies') eventEmitter.removeAllListeners('updateDietsAllergies')

@ -30,7 +30,7 @@ export default function HomePage({ navigation, props }) {
const existingAvailableIngredient = await AsyncStorage.getItem('ingredient'); const existingAvailableIngredient = await AsyncStorage.getItem('ingredient');
return JSON.parse(existingAvailableIngredient) || []; return JSON.parse(existingAvailableIngredient) || [];
} catch (error) { } catch (error) {
console.log(error); console.error(error);
return []; return [];
} }
} }
@ -247,7 +247,7 @@ export default function HomePage({ navigation, props }) {
<Text style={styles.nbSelected}>{nbActiveProfiles()} selected</Text> <Text style={styles.nbSelected}>{nbActiveProfiles()} selected</Text>
</View> </View>
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>
<ProfileSelection listProfile={profiles} disableSelection={true} changeStatusWaiting={(val) => console.log("Ignorer", val)}/> <ProfileSelection listProfile={profiles} disableSelection={true} changeStatusWaiting={(val) => val += 1}/>
<View style={{marginTop: "4%"}}/> <View style={{marginTop: "4%"}}/>
<ValidateButton title="Change Active Filters" image="update.png" colour={colors.buttonDetail} backColour={colors.buttonBackground} todo={() => navigation.navigate('FiltersSelection')}/> <ValidateButton title="Change Active Filters" image="update.png" colour={colors.buttonDetail} backColour={colors.buttonBackground} todo={() => navigation.navigate('FiltersSelection')}/>
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>

@ -37,7 +37,7 @@ export default function IngredientSelection(props) {
setResponse(filtered); setResponse(filtered);
} }
} catch (error) { } catch (error) {
console.log(error); console.error(error);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
@ -52,7 +52,7 @@ const loadIngredients = async () => {
try { try {
setResponse(await ingredientService.getAllIngredient()); setResponse(await ingredientService.getAllIngredient());
} catch (error) { } catch (error) {
console.log(error); console.error(error);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }
@ -95,7 +95,7 @@ const loadIngredients = async () => {
const existingAvailableIngredient = await AsyncStorage.getItem('ingredient'); const existingAvailableIngredient = await AsyncStorage.getItem('ingredient');
return JSON.parse(existingAvailableIngredient) || []; return JSON.parse(existingAvailableIngredient) || [];
} catch (error) { } catch (error) {
console.log(error); console.error(error);
return []; return [];
} }
} }
@ -125,7 +125,7 @@ const fetchAvailableIngredient = async () => {
} }
} }
catch(error){ catch(error){
console.log("Error occured during the addition of Ingredient:", error) console.error("Error occured during the addition of Ingredient:", error)
} }
}; };
@ -139,7 +139,7 @@ const fetchAvailableIngredient = async () => {
ChangeAvailableSize(true) ChangeAvailableSize(true)
} }
catch (error){ catch (error){
console.log("Error occured during the suppression of Ingredient:", error) console.error("Error occured during the suppression of Ingredient:", error)
} }
}; };
@ -187,7 +187,7 @@ const fetchAvailableIngredient = async () => {
const ingredientsByLetter = await ingredientService.getIngredientByLetter(letter); const ingredientsByLetter = await ingredientService.getIngredientByLetter(letter);
setResponse(ingredientsByLetter); setResponse(ingredientsByLetter);
} catch (error) { } catch (error) {
console.log(error); console.error(error);
} finally { } finally {
setIsLoading(false); setIsLoading(false);
} }

@ -21,10 +21,9 @@ export default function ModifyProfile(props) {
const profiles = JSON.parse(existingProfiles) || []; const profiles = JSON.parse(existingProfiles) || [];
const matchedProfile = profiles.find(profile => profile.name === profileName); const matchedProfile = profiles.find(profile => profile.name === profileName);
console.log("Le profil choisit : " + matchedProfile);
return matchedProfile || null; return matchedProfile || null;
} catch (error) { } catch (error) {
console.log("Erreur lors de la récupération du profil :", error); console.error("Erreur lors de la récupération du profil :", error);
return null; return null;
} }
}; };
@ -45,7 +44,7 @@ useEffect(() => {
<View style={{marginTop: "6%"}}/> <View style={{marginTop: "6%"}}/>
<ProfileModification name={profile.name} avatar={profile.avatar} diets={profile.diets} allergies={profile.allergies}></ProfileModification> <ProfileModification name={profile.name} avatar={profile.avatar} diets={profile.diets} allergies={profile.allergies}></ProfileModification>
<View style={{marginTop: "3%"}}/> <View style={{marginTop: "3%"}}/>
<ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={() => (console.log("Profile Modified"))}></ValidateButton> <ValidateButton title="Update Profile" image="update.png" colour={colors.buttonMain} backColour={colors.cardBackground} todo={() => console.log("")}></ValidateButton>
<View style={{marginTop: "20%"}}/> <View style={{marginTop: "20%"}}/>
</LinearGradient> </LinearGradient>
</ScrollView> </ScrollView>

@ -102,7 +102,6 @@ export default function RecipeDetails({ route }) {
return categories[0]; return categories[0];
} }
console.log("LA LISTE DES CATEGORY : " + categories)
let bestMatch = { category: '', similarity: 0 }; let bestMatch = { category: '', similarity: 0 };
for (const [name, categoriesList] of Object.entries(categoryMappings)) { for (const [name, categoriesList] of Object.entries(categoryMappings)) {
@ -119,20 +118,15 @@ export default function RecipeDetails({ route }) {
function getImageForRecipe(recipeName: string) { function getImageForRecipe(recipeName: string) {
const categories = []; const categories = [];
console.log("NAAAAAME : " + recipeName)
for (const [category, words] of Object.entries(imagesDictionary)) { for (const [category, words] of Object.entries(imagesDictionary)) {
const matchedWords = words.filter((word) => recipeName.toLowerCase().includes(word)); const matchedWords = words.filter((word) => recipeName.toLowerCase().includes(word));
console.log("Matched Word : " + matchedWords)
if (matchedWords.length > 0) { if (matchedWords.length > 0) {
categories.push(category); categories.push(category);
console.log(category)
} }
} }
console.log("ON ENTRE DANS LA 2EME FONCTION");
const categoryName = getCategoryFromList(categories); const categoryName = getCategoryFromList(categories);
console.log("CategoryName à la fin : " + categoryName);
switch (categoryName) { switch (categoryName) {
case 'meat': case 'meat':
@ -179,10 +173,9 @@ export default function RecipeDetails({ route }) {
const loadRecipe = async () => { const loadRecipe = async () => {
try { try {
const recipe = await recipesService.getRecipeById(recipeId); const recipe = await recipesService.getRecipeById(recipeId);
console.log("Recipe.name: "+recipe.name)
setResponse(recipe); setResponse(recipe);
} catch (error) { } catch (error) {
console.log(error); console.error(error);
} finally{ } finally{
setIsLoading(false) setIsLoading(false)
} }

@ -99,7 +99,7 @@ export default function RecipeSuggestion({ route, navigation }) {
} }
} catch (error) { } catch (error) {
console.log(error) console.error(error)
} }
}; };

Loading…
Cancel
Save