From 4d319fb19181dc5c9c5ed52a4aa3d2e555a4234c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= Date: Sun, 5 Jan 2025 15:24:16 +0100 Subject: [PATCH 1/9] suppression popup qui provoquait des bugs --- src/views/login/pronote/PronoteWebview.tsx | 36 ---------------------- 1 file changed, 36 deletions(-) diff --git a/src/views/login/pronote/PronoteWebview.tsx b/src/views/login/pronote/PronoteWebview.tsx index 41408d9e9..699c58eac 100644 --- a/src/views/login/pronote/PronoteWebview.tsx +++ b/src/views/login/pronote/PronoteWebview.tsx @@ -380,42 +380,6 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { webViewRef.current?.injectJavaScript(INJECT_PRONOTE_JSON); } else { setLoading(false); - if (url.includes("pronote/mobile.eleve.html")) { - if (!url.includes("identifiant")) { - if (Platform.OS === "ios") { - Alert.alert( - "Attention", - "Désolé, seuls les comptes élèves sont compatibles pour le moment.", - [ - { - text: "OK", - onPress: () => navigation.goBack(), - }, - ] - ); - } else { - showAlert({ - title: "Attention", - message: - "Désolé, seuls les comptes élèves sont compatibles pour le moment.", - actions: [ - { - title: "OK", - onPress: () => navigation.goBack(), - backgroundColor: theme.colors.card, - }, - ], - }); - } - } else { - webViewRef.current?.injectJavaScript( - INJECT_PRONOTE_INITIAL_LOGIN_HOOK - ); - webViewRef.current?.injectJavaScript( - INJECT_PRONOTE_CURRENT_LOGIN_STATE - ); - } - } if (url.split("?")[0].includes("mobile.eleve.html") == false) { setShowWebView(true); From f7e501483a1a74ed19244c60cb01d4c80aa10278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= Date: Sun, 5 Jan 2025 15:31:34 +0100 Subject: [PATCH 2/9] =?UTF-8?q?avertissement=20directement=20lors=20de=20l?= =?UTF-8?q?a=20s=C3=A9lection=20d'un=20service?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/ServiceSelector.tsx | 32 ++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/views/login/ServiceSelector.tsx b/src/views/login/ServiceSelector.tsx index 9fa1f9854..e1c611668 100644 --- a/src/views/login/ServiceSelector.tsx +++ b/src/views/login/ServiceSelector.tsx @@ -13,11 +13,12 @@ import { useAlert } from "@/providers/AlertProvider"; import { Audio } from "expo-av"; import { useTheme } from "@react-navigation/native"; import GetV6Data from "@/utils/login/GetV6Data"; -import { Check, School, Undo2 } from "lucide-react-native"; +import { Check, Info, LockIcon, School, Undo2 } from "lucide-react-native"; import Constants from "expo-constants"; import { LinearGradient } from "expo-linear-gradient"; import { sr } from "date-fns/locale"; import { sub } from "date-fns"; +import { NativeText } from "@/components/Global/NativeComponents"; const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { const theme = useTheme(); @@ -205,6 +206,35 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { + + + + Seuls les comptes élèves sont supportés pour le moment. Se connecter + avec un autre type de compte ne fonctionnera pas et + provoquera des bugs. + + Date: Sun, 5 Jan 2025 15:50:03 +0100 Subject: [PATCH 3/9] =?UTF-8?q?refactor(ServiceSelector):=20suppression=20?= =?UTF-8?q?de=20l'alerte=20non=20support=C3=A9e=20et=20nettoyage=20des=20i?= =?UTF-8?q?mports=20inutilis=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/ServiceSelector.tsx | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/src/views/login/ServiceSelector.tsx b/src/views/login/ServiceSelector.tsx index e1c611668..c94092174 100644 --- a/src/views/login/ServiceSelector.tsx +++ b/src/views/login/ServiceSelector.tsx @@ -1,5 +1,5 @@ import React, { memo, useEffect, useState } from "react"; -import { Image, View, StyleSheet, Text } from "react-native"; +import { Image, View, StyleSheet } from "react-native"; import { SafeAreaView } from "react-native-safe-area-context"; import Reanimated, { LinearTransition, FlipInXDown } from "react-native-reanimated"; @@ -9,15 +9,11 @@ import PapillonShineBubble from "@/components/FirstInstallation/PapillonShineBub import DuoListPressable from "@/components/FirstInstallation/DuoListPressable"; import ButtonCta from "@/components/FirstInstallation/ButtonCta"; import MaskStars from "@/components/FirstInstallation/MaskStars"; -import { useAlert } from "@/providers/AlertProvider"; import { Audio } from "expo-av"; import { useTheme } from "@react-navigation/native"; import GetV6Data from "@/utils/login/GetV6Data"; -import { Check, Info, LockIcon, School, Undo2 } from "lucide-react-native"; -import Constants from "expo-constants"; +import { Info, School } from "lucide-react-native"; import { LinearGradient } from "expo-linear-gradient"; -import { sr } from "date-fns/locale"; -import { sub } from "date-fns"; import { NativeText } from "@/components/Global/NativeComponents"; const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { @@ -25,8 +21,6 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { const { colors } = theme; const [sound, setSound] = useState(null); - const { showAlert } = useAlert(); - type Services = "pronote" | "ed" | "skolengo"; const [service, setService] = useState(null); @@ -89,13 +83,6 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { }, ]; - const UnsupportedAlert = () => { - showAlert({ - title: "Service non supporté", - message: "Désolé, ce service n'est pas encore supporté. Veuillez réessayer dans une prochaine version." - }); - }; - useEffect(() => { const loadSound = async () => { const { sound } = await Audio.Sound.createAsync( @@ -186,7 +173,12 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { padding: 3, }} > - {React.cloneElement(srv.icon, { size: 26, strokeWidth: 2.5, color: srv.name === service ? colors.primary : colors.text })} + {React.cloneElement(srv.icon, { + size: 26, + strokeWidth: 2.5, + color: + srv.name === service ? colors.primary : colors.text, + })} : Date: Sun, 5 Jan 2025 15:59:47 +0100 Subject: [PATCH 4/9] oups --- src/views/login/pronote/PronoteWebview.tsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/views/login/pronote/PronoteWebview.tsx b/src/views/login/pronote/PronoteWebview.tsx index 699c58eac..999e95200 100644 --- a/src/views/login/pronote/PronoteWebview.tsx +++ b/src/views/login/pronote/PronoteWebview.tsx @@ -380,6 +380,14 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { webViewRef.current?.injectJavaScript(INJECT_PRONOTE_JSON); } else { setLoading(false); + if (url.includes("pronote/mobile.eleve.html") && url.includes("identifiant")) { + webViewRef.current?.injectJavaScript( + INJECT_PRONOTE_INITIAL_LOGIN_HOOK + ); + webViewRef.current?.injectJavaScript( + INJECT_PRONOTE_CURRENT_LOGIN_STATE + ); + } if (url.split("?")[0].includes("mobile.eleve.html") == false) { setShowWebView(true); From e7dc7e1076196421057cd493a63da565fb94049a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= Date: Sun, 5 Jan 2025 16:04:34 +0100 Subject: [PATCH 5/9] =?UTF-8?q?refactor(PronoteWebview):=20suppression=20d?= =?UTF-8?q?es=20alertes=20inutilis=C3=A9es=20et=20nettoyage=20du=20code=20?= =?UTF-8?q?et=20indentation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/login/pronote/PronoteWebview.tsx | 36 +++++++++------------- 1 file changed, 14 insertions(+), 22 deletions(-) diff --git a/src/views/login/pronote/PronoteWebview.tsx b/src/views/login/pronote/PronoteWebview.tsx index 999e95200..f3e83c724 100644 --- a/src/views/login/pronote/PronoteWebview.tsx +++ b/src/views/login/pronote/PronoteWebview.tsx @@ -5,7 +5,6 @@ import { Dimensions, KeyboardAvoidingView, Platform, - Alert, } from "react-native"; import { WebView } from "react-native-webview"; @@ -33,19 +32,13 @@ import defaultPersonalization from "@/services/pronote/default-personalization"; import extract_pronote_name from "@/utils/format/extract_pronote_name"; import PapillonSpinner from "@/components/Global/PapillonSpinner"; import { animPapillon } from "@/utils/ui/animations"; -import { useAlert } from "@/providers/AlertProvider"; const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { const theme = useTheme(); - const { showAlert } = useAlert(); - const [, setLoading] = useState(true); - const [, setLoadProgress] = useState(0); const [showWebView, setShowWebView] = useState(false); const [loggingIn, setLoggingIn] = useState(false); - const [, setCurrentURL] = useState(""); - const [deviceUUID] = useState(uuid()); const [sound, setSound] = useState(null); const [sound2, setSound2] = useState(null); @@ -268,17 +261,11 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { ]} source={{ uri: infoMobileURL }} setSupportMultipleWindows={false} - onLoadProgress={({ nativeEvent }) => { - setLoadProgress(nativeEvent.progress); - }} onError={(e) => { console.error("Pronote webview error", e); }} onLoadStart={(e) => { const { url } = e.nativeEvent; - setCurrentURL(url); - - setLoading(true); if (url.includes("mobile.eleve.html")) { setLoginStep("En attente de votre établissement"); @@ -306,14 +293,18 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { kind: pronote.AccountKind.STUDENT, username: message.data.login, token: message.data.mdp, - deviceUUID - } - ).catch((error) => { - if (error instanceof pronote.SecurityError && !error.handle.shouldCustomPassword && !error.handle.shouldCustomDoubleAuth) { + deviceUUID, + }) + .catch((error) => { + if ( + error instanceof pronote.SecurityError && + !error.handle.shouldCustomPassword && + !error.handle.shouldCustomDoubleAuth + ) { navigation.navigate("Pronote2FA_Auth", { session, error, - accountID: deviceUUID + accountID: deviceUUID, }); } else { throw error; @@ -345,12 +336,11 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { authentication: { ...refresh, deviceUUID }, personalization: await defaultPersonalization(session), - identity: {} + identity: {}, }; pronote.startPresenceInterval(session); createStoredAccount(account); - setLoading(false); switchTo(account); // We need to wait a tick to make sure the account is set before navigating. @@ -379,8 +369,10 @@ const PronoteWebview: Screen<"PronoteWebview"> = ({ route, navigation }) => { ) { webViewRef.current?.injectJavaScript(INJECT_PRONOTE_JSON); } else { - setLoading(false); - if (url.includes("pronote/mobile.eleve.html") && url.includes("identifiant")) { + if ( + url.includes("pronote/mobile.eleve.html") && + url.includes("identifiant") + ) { webViewRef.current?.injectJavaScript( INJECT_PRONOTE_INITIAL_LOGIN_HOOK ); From 650321c8e603e8da7a35a6425565ca3c2231cb2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= <164187100+Kgeek33@users.noreply.github.com> Date: Sun, 5 Jan 2025 16:24:41 +0100 Subject: [PATCH 6/9] Add "buildNumber" + code version to 7702 in ios and android --- app.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.json b/app.json index e2a4104fb..4d763cb51 100644 --- a/app.json +++ b/app.json @@ -15,6 +15,7 @@ }, "assetBundlePatterns": ["**/*"], "ios": { + "buildNumber": "7502", "supportsTablet": true, "appStoreUrl": "https://apps.apple.com/us/app/papillon-lappli-scolaire/id6477761165", "bundleIdentifier": "xyz.getpapillon.ios", @@ -41,7 +42,7 @@ } }, "android": { - "versionCode": 7701, + "versionCode": 7702, "playStoreUrl": "https://play.google.com/store/apps/details?id=xyz.getpapillon.app", "adaptiveIcon": { "foregroundImage": "./assets/launch/adaptive-icon-foreground.png", From a97c694276b138475992c0f2f957224d38e93e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= <164187100+Kgeek33@users.noreply.github.com> Date: Sun, 5 Jan 2025 18:44:02 +0100 Subject: [PATCH 7/9] Suppression du gras --- src/views/login/ServiceSelector.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/views/login/ServiceSelector.tsx b/src/views/login/ServiceSelector.tsx index c94092174..b1abce968 100644 --- a/src/views/login/ServiceSelector.tsx +++ b/src/views/login/ServiceSelector.tsx @@ -219,7 +219,6 @@ const ServiceSelector: Screen<"ServiceSelector"> = ({ navigation }) => { opacity: 0.5, fontSize: 13, lineHeight: 16, - fontFamily: "bold", }} > Seuls les comptes élèves sont supportés pour le moment. Se connecter From 4127be677daa0c2e20b67de6fe0f9a7210e2d53f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= <164187100+Kgeek33@users.noreply.github.com> Date: Sun, 5 Jan 2025 18:44:41 +0100 Subject: [PATCH 8/9] Revert des modifs sur `app.json` --- app.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app.json b/app.json index 4d763cb51..e2a4104fb 100644 --- a/app.json +++ b/app.json @@ -15,7 +15,6 @@ }, "assetBundlePatterns": ["**/*"], "ios": { - "buildNumber": "7502", "supportsTablet": true, "appStoreUrl": "https://apps.apple.com/us/app/papillon-lappli-scolaire/id6477761165", "bundleIdentifier": "xyz.getpapillon.ios", @@ -42,7 +41,7 @@ } }, "android": { - "versionCode": 7702, + "versionCode": 7701, "playStoreUrl": "https://play.google.com/store/apps/details?id=xyz.getpapillon.app", "adaptiveIcon": { "foregroundImage": "./assets/launch/adaptive-icon-foreground.png", From e435e831456b14f416f009b2a35c5f990059cabb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=F0=9D=95=82=F0=9D=95=AA=F0=9D=95=9D=F0=9D=95=9A?= =?UTF-8?q?=F0=9D=95=92=F0=9D=95=9F?= Date: Wed, 8 Jan 2025 19:50:06 +0100 Subject: [PATCH 9/9] fix(ts) errors --- src/components/Global/AnimatedNumber.tsx | 2 +- src/views/welcome/DevMenu.tsx | 25 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/components/Global/AnimatedNumber.tsx b/src/components/Global/AnimatedNumber.tsx index f6aff6614..d2a7edc9f 100644 --- a/src/components/Global/AnimatedNumber.tsx +++ b/src/components/Global/AnimatedNumber.tsx @@ -50,7 +50,7 @@ const AnimatedNumber: React.FC = ({ }, contentContainerStyle]} layout={animPapillon(LinearTransition)} > - {value.toString().split("").map((n, i) => ( + {value.toString().split("").map((n: string, i: number) => ( = ({ navigation }) => { navigation.navigate("NoteReaction")} + onPress={() => navigation.navigate("GradeReaction", { + grade: { + id: "mmmhm", + subjectName: "Éval TS", + description: "Note de test", + timestamp: 1735996215000, + average: { + value: 0.2 + }, + coefficient: 40, + min: { + value: 0 + }, + max: { + value: 20 + }, + student: { + value: 0 + }, + outOf: { + value: 20 + } + } + })} > NoteReaction