Skip to content
This repository has been archived by the owner on Aug 25, 2024. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'upstream/development' into features/dev…
Browse files Browse the repository at this point in the history
…-menu
  • Loading branch information
LeGeek01 committed Apr 18, 2024
2 parents 2665f02 + 07581dd commit 32581c9
Show file tree
Hide file tree
Showing 136 changed files with 1,863 additions and 1,377 deletions.
126 changes: 126 additions & 0 deletions .github/workflows/build-expo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
name: Build and Pubish App
on:
workflow_dispatch:
inputs:
profile:
type: choice
description: Build profile to use
options:
- development
- preview
- production
jobs:
prepare-env:
runs-on: macos-14
strategy:
matrix:
node: [20.x]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2

- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 20
cache: npm

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest

- name: 🏗 Setup EAS local builds
run: npm i -g eas-cli-local-build-plugin

- name: 📦 Install dependencies
run: npm i


build-ios:
runs-on: macos-14
needs: [prepare-env]
strategy:
matrix:
node: [20.x]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2

- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 20
cache: npm

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest

- name: 🏗 Setup EAS local builds
run: npm i -g eas-cli-local-build-plugin

- name: 📦 Install dependencies
run: npm i

- name: 👷 Build app
run: |
eas build --local \
--non-interactive \
--output=./app-build \
--platform=ios \
--profile=${{ github.event.inputs.profile }}
- name: 📱 Upload binary
uses: actions/upload-artifact@v2
with:
name: app-ios
path: app-build

build-android:
runs-on: macos-14
needs: [prepare-env]
strategy:
matrix:
node: [20.x]
steps:
- name: 🏗 Setup repo
uses: actions/checkout@v2

- name: 🏗 Setup Node
uses: actions/setup-node@v2
with:
node-version: 20
cache: npm

- name: 🏗 Setup Expo and EAS
uses: expo/expo-github-action@v7
with:
token: ${{ secrets.EXPO_TOKEN }}
expo-version: latest
eas-version: latest

- name: 🏗 Setup EAS local builds
run: npm i -g eas-cli-local-build-plugin

- name: 📦 Install dependencies
run: npm i

- name: 👷 Build app
run: |
eas build --local \
--non-interactive \
--output=./app-build \
--platform=android \
--profile=${{ github.event.inputs.profile }}
- name: 📱 Upload binary
uses: actions/upload-artifact@v2
with:
name: app-android
path: app-build
39 changes: 22 additions & 17 deletions App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,32 @@ function App() {

useEffect(() => {
const prepare = async () => {
await loadFonts();
try {
await loadFonts();

const serviceName = await AsyncStorage.getItem('service');
const serviceName = await AsyncStorage.getItem('service');

if (!serviceName) {
setLoading(false);
return;
}
if (!serviceName) {
setLoading(false);
return;
}

if (serviceName === 'pronote') {
setLoggedIn(true);
await provider.init(serviceName);
} else if (serviceName === 'skolengo') {
await provider.init(serviceName);
setLoggedIn(Boolean(provider.pronoteInstance || provider.skolengoInstance || provider.isNetworkFailing));
} else if (serviceName === 'ecoledirecte') {
await provider.init(serviceName);
setLoggedIn(true);
}
if (serviceName === 'pronote') {
setLoggedIn(true);
await provider.init(serviceName);
} else if (serviceName === 'skolengo') {
await provider.init(serviceName);
setLoggedIn(Boolean(provider.pronoteInstance || provider.skolengoInstance || provider.isNetworkFailing));
} else if (serviceName === 'ecoledirecte') {
await provider.init(serviceName);
setLoggedIn(true);
}

setLoading(false);
setLoading(false);
} catch (error) {
console.error(error);
setLoading(false);
}
};

prepare();
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ android {
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "6.6.2"
versionName "6.6.3"

buildConfigField("boolean", "REACT_NATIVE_UNSTABLE_USE_RUNTIME_SCHEDULER_ALWAYS", (findProperty("reactNative.unstable_useRuntimeSchedulerAlways") ?: true).toString())
}
Expand Down
12 changes: 6 additions & 6 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,6 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity-alias android:name="xyz.getpapillon.app.MainActivitylightgreen" android:enabled="false" android:exported="true" android:icon="@mipmap/lightgreen" android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity-alias android:name="xyz.getpapillon.app.MainActivitybacktoschool" android:enabled="false" android:exported="true" android:icon="@mipmap/backtoschool" android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
Expand Down Expand Up @@ -181,5 +175,11 @@
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity-alias android:name="xyz.getpapillon.app.MainActivitymascotte" android:enabled="false" android:exported="true" android:icon="@mipmap/mascotte" android:targetActivity=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity-alias>
</application>
</manifest>
Binary file modified android/app/src/main/res/mipmap-hdpi/barbie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/mipmap-hdpi/lightgreen.png
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-hdpi/macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/mipmap-hdpi/mascotte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/oldios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/pride.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/relief.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/retro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-hdpi/verscinq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/barbie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/beta.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/gradient.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed android/app/src/main/res/mipmap-mdpi/lightgreen.png
Binary file not shown.
Binary file modified android/app/src/main/res/mipmap-mdpi/macos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added android/app/src/main/res/mipmap-mdpi/mascotte.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/oldios.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/pride.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/relief.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/retro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/verscinq.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/barbie.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/beta.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/gradient.png
Binary file removed android/app/src/main/res/mipmap-xhdpi/lightgreen.png
Diff not rendered.
Binary file modified android/app/src/main/res/mipmap-xhdpi/macos.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/oldios.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/pride.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/purple.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/relief.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/retro.png
Binary file modified android/app/src/main/res/mipmap-xhdpi/verscinq.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/barbie.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/beta.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/gradient.png
Diff not rendered.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/macos.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/oldios.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/pride.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/purple.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/relief.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/retro.png
Binary file modified android/app/src/main/res/mipmap-xxhdpi/verscinq.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/barbie.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/beta.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/gradient.png
Diff not rendered.
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/macos.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/oldios.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/pride.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/purple.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/relief.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/retro.png
Binary file modified android/app/src/main/res/mipmap-xxxhdpi/verscinq.png
8 changes: 4 additions & 4 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,6 @@
"image": "./assets/customicons/sparkles.png",
"prerendered": true
},
"lightgreen": {
"image": "./assets/customicons/lightgreen.png",
"prerendered": true
},
"backtoschool": {
"image": "./assets/customicons/backtoschool.png",
"prerendered": true
Expand All @@ -223,6 +219,10 @@
"verscinq": {
"image": "./assets/customicons/verscinq.png",
"prerendered": true
},
"mascotte": {
"image": "./assets/customicons/mascotte.png",
"prerendered": true
}
}
]
Expand Down
Binary file added assets/customicons/apple-touch-icon.png
Binary file added assets/customicons/mascotte.png
Binary file removed assets/customicons/monochrome.png
Diff not rendered.
5 changes: 3 additions & 2 deletions components/NativeList.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React from 'react';
import { View, StyleSheet } from 'react-native';
import { List } from 'react-native-paper';
import GetUIColors from '../utils/GetUIColors';
import mapChildrenWithKeys from '../utils/mapChildrenWithKeys';
import type { ViewStyle } from 'react-native';


interface Props {
children: React.ReactNode
Expand All @@ -11,6 +12,7 @@ interface Props {
style?: ViewStyle
containerStyle?: ViewStyle
plain?: boolean
inset?: boolean // only for iOS (NativeList.ios.tsx)
}

const NativeList: React.FC<Props> = React.memo(({
Expand All @@ -21,7 +23,6 @@ const NativeList: React.FC<Props> = React.memo(({
containerStyle,
plain,
}) => {
const UIColors = GetUIColors(null, plain ? 'ios' : null);
const childrenWithKeys = mapChildrenWithKeys(children);

return (
Expand Down
21 changes: 20 additions & 1 deletion fetch/background/Grades.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,30 @@ const sendGradesToSharedGroup = async (grades: PapillonGrades) => {
for (const grade of grades.grades) {
const color = getSavedCourseColor(grade.subject.name, '#29947a');

const significantTypeValue = {
'-1|ERROR': -1,
'0|GRADE': 0,
'1|ABSENT': 1,
'2|EXEMPTED': 2,
'3|NOT_GRADED': 3,
'4|UNFIT': 4,
'5|UNRETURNED': 5,
'6|ABSENT_ZERO': 6,
'7|UNRETURNED_ZERO': 7,
'8|CONGRATULATIONS': 8,
};

sharedLessons.push({
subject: formatCoursName(grade.subject.name),
emoji: getClosestGradeEmoji(grade.subject.name),
description: grade.description ? grade.description : '',
color: color,
date: new Date(grade.date).getTime(),
grade: {
value: grade.grade.value,
value: {
significant: grade.grade.value.significant,
value: grade.grade.value.value || Number(significantTypeValue[grade.grade.value.value as keyof typeof significantTypeValue]),
},
out_of: grade.grade.out_of,
average: grade.grade.average,
max: grade.grade.max,
Expand All @@ -69,6 +85,9 @@ const sendGradesToSharedGroup = async (grades: PapillonGrades) => {
// store grades in shared group
await SharedGroupPreferences.setItem('getGradesF', JSON.stringify(sharedLessons), APP_GROUP_IDENTIFIER);
console.info('[background fetch] Stored grades in shared group (getGradesF)');
for (let lesson of sharedLessons) {
console.log(lesson.grade.value.value, lesson.grade.value.significant, lesson.subject, lesson.date);
}
} catch (error) {
console.error('[background fetch] Error while storing grades in shared group', error);
}
Expand Down
2 changes: 1 addition & 1 deletion interface/AlertBottomSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ const AlertBottomSheet = ({ visible = true, emphasize = false, title, subtitle,
styles.modal,
Platform.OS === 'android' && styles.androidModal,
{
backgroundColor: UIColors.background, marginBottom: insets.bottom,
backgroundColor: UIColors.background, marginBottom: insets.bottom + (insets.bottom < 12 ? 12 : 0),
borderColor: UIColors.borderLight,
borderWidth: UIColors.dark ? 0.5 : 0,
opacity: opacity,
Expand Down
6 changes: 3 additions & 3 deletions interface/CheckAnimated.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import GetUIColors from '../utils/GetUIColors';

import { Check } from 'lucide-react-native';
import * as Haptics from 'expo-haptics';
import { set } from 'sync-storage';

const CheckAnimated = ({ checked, pressed = () => {}, loading, backgroundColor }) => {
const CheckAnimated = ({ checked, pressed = () => {}, loading, backgroundColor, style }) => {
const UIColors = GetUIColors();
const [check, setCheck] = useState(checked);
const [initialState, setInitialState] = useState(false);
Expand Down Expand Up @@ -106,7 +105,8 @@ const CheckAnimated = ({ checked, pressed = () => {}, loading, backgroundColor }
return (
<TouchableOpacity
style={[
styles.container
styles.container,
style,
]}
onPress={handlePress}
>
Expand Down
Loading

0 comments on commit 32581c9

Please sign in to comment.