Skip to content

Commit

Permalink
Merge pull request PapillonApp#296 from imyanice/main
Browse files Browse the repository at this point in the history
ed: various fixes & enhancements part 2
  • Loading branch information
tryon-dev authored Oct 28, 2024
2 parents 561217d + c606bf5 commit 17a75a8
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
"restore-app-icon": "cp -a ./AppIcon.appiconset.backup/. ios/Papillon/Images.xcassets/AppIcon.appiconset/"
},
"dependencies": {
"@babel/runtime": "^7.25.7",
"@birdwingo/react-native-reanimated-graph": "^1.1.3",
"@candlefinance/app-icon": "^0.4.5",
"@notifee/react-native": "^7.8.2",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-community/datetimepicker": "8.0.1",
"@react-native-community/netinfo": "11.3.1",
"@react-native-masked-view/masked-view": "0.3.1",
"@react-native/assets-registry": "^0.75.4",
"@react-navigation/bottom-tabs": "^6.6.0",
"@react-navigation/native": "^6.1.17",
"@react-navigation/native-stack": "^6.9.26",
Expand Down Expand Up @@ -65,7 +67,7 @@
"lottie-react-native": "^6.7.0",
"lucide-react-native": "^0.378.0",
"openid-client": "^5.7.0",
"pawdirecte": "^1.4.0",
"pawdirecte": "^1.5.0",
"pawnilim": "^0.2.0",
"pawnote": "^1.0.3",
"pawrd": "^0.4.0",
Expand Down
2 changes: 1 addition & 1 deletion src/router/screens/account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const screens = [
tabBarLabel: "Vie sco.",
tabBarLottie: require("@/../assets/lottie/tab_check.json"),
}),
createScreen("Messages", PlaceholderScreen, {
createScreen("Messages", Messages, {
headerTitle: "Messages",
tabBarLabel: "Messages",
tabBarLottie: require("@/../assets/lottie/tab_chat.json"),
Expand Down
8 changes: 4 additions & 4 deletions src/services/ecoledirecte/attendance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,19 +44,19 @@ const decodePunishment = (item: AttendanceItem): Punishment => {
id: item.id.toString(),
duration,
givenBy: item.teacher,
timestamp: item.date.getTime(),
timestamp: new Date(timeInterval?.start ?? item.date.getTime()).getTime(),
// TODO
duringLesson: false,
exclusion: false,
homework: {
documents: [],
text: ""
text: item.todo
},
nature: "",
reason: {
circumstances: item.reason,
circumstances: "",
documents: [],
text: []
text: [item.reason]
},
schedulable: false,
schedule: []
Expand Down
12 changes: 10 additions & 2 deletions src/services/ecoledirecte/timetable.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {EcoleDirecteAccount} from "@/stores/account/types";
import {Timetable, TimetableClass, TimetableClassStatus} from "../shared/Timetable";
import {ErrorServiceUnauthenticated} from "../shared/errors";
import ecoledirecte, {TimetableItemKind} from "pawdirecte";
import ecoledirecte, { TimetableItemKind } from "pawdirecte";

const decodeTimetableClass = (c: ecoledirecte.TimetableItem): TimetableClass => {
const base = {
Expand All @@ -10,7 +10,6 @@ const decodeTimetableClass = (c: ecoledirecte.TimetableItem): TimetableClass =>
additionalNotes: c.notes,
backgroundColor: c.color
};

switch (c.kind) {
case TimetableItemKind.COURS:
return {
Expand Down Expand Up @@ -52,6 +51,15 @@ const decodeTimetableClass = (c: ecoledirecte.TimetableItem): TimetableClass =>
room: void 0,
...base
};
case TimetableItemKind.SANCTION:
return {
type: "detention",
subject: "",
id: c.id,
title: "Sanction",
room: "PERMANENCE",
...base
};
default:
break;
}
Expand Down
10 changes: 6 additions & 4 deletions src/views/account/Home/Elements/HomeworksElement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useMemo } from "react";
import { useHomeworkStore } from "@/stores/homework";
import { toggleHomeworkState, updateHomeworkForWeekInCache } from "@/services/homework";
import HomeworkItem from "../../Homeworks/Atoms/Item";
import { Homework } from "@/services/shared/Homework";
import type { Homework } from "@/services/shared/Homework";
import {debounce} from "lodash";
import { PapillonNavigation } from "@/router/refs";
import RedirectButton from "@/components/Home/RedirectButton";
Expand All @@ -17,12 +17,14 @@ const HomeworksElement = ({ navigation, onImportance }) => {
const actualDay = useMemo(()=>new Date(), []);

const ImportanceHandler = () => {
var score = 0;
let hw = (homeworks[dateToEpochWeekNumber(actualDay)])
if (!homeworks[dateToEpochWeekNumber(actualDay)]) return;

let score = 0;
const hw = homeworks[dateToEpochWeekNumber(actualDay)]
.filter(hw => hw.due / 1000 >= Date.now() / 1000 && hw.due / 1000 <= Date.now() / 1000 + 7 * 24 * 60 * 60)
.filter(hw => !hw.done);

let date = new Date();
const date = new Date();
if (date.getHours() >= 17 && date.getHours() < 22)
score += 4;
if (hw.length > 0)
Expand Down

2 comments on commit 17a75a8

@expo
Copy link

@expo expo bot commented on 17a75a8 Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Build Trigger Failure

The build trigger failed with the following error:

GITHUB_NOT_FOUND_ERROR: Failed to read "/eas.json".

Please check your GitHub app installation settings and your Expo project's GitHub settings to make sure you've configured everything correctly.

@expo
Copy link

@expo expo bot commented on 17a75a8 Oct 28, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GitHub Build Trigger Failure

The build trigger failed with the following error:

GITHUB_NOT_FOUND_ERROR: Failed to read "/eas.json".

Please check your GitHub app installation settings and your Expo project's GitHub settings to make sure you've configured everything correctly.

Please sign in to comment.