Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'development'
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-luchack committed May 16, 2023
2 parents c8c6b39 + c3dff31 commit f87b658
Show file tree
Hide file tree
Showing 15 changed files with 486 additions and 658 deletions.
19 changes: 19 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Security Policy

## Supported Versions

Use this section to tell people about which versions of your project are
currently being supported with security updates.

| Version | Supported |
| ------- | ------------------ |
| 5.6.x | :white_check_mark: |
| < 5.6.x | :x: |

## Reporting a Vulnerability

Use this section to tell people how to report a vulnerability.

Tell them where to go, how often they can expect to get an update on a
reported vulnerability, what to expect if the vulnerability is accepted or
declined, etc.
1 change: 1 addition & 0 deletions android/app/capacitor.build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dependencies {
implementation project(':hugotomazi-capacitor-navigation-bar')
implementation project(':transistorsoft-capacitor-background-fetch')
implementation project(':capacitor-android-shortcuts')
implementation project(':capacitor-calendar')
implementation project(':capacitor-notification-badge')
implementation project(':capacitor-plugin-safe-area')

Expand Down
3 changes: 3 additions & 0 deletions android/capacitor.settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ project(':transistorsoft-capacitor-background-fetch').projectDir = new File('../
include ':capacitor-android-shortcuts'
project(':capacitor-android-shortcuts').projectDir = new File('../node_modules/capacitor-android-shortcuts/android')

include ':capacitor-calendar'
project(':capacitor-calendar').projectDir = new File('../node_modules/capacitor-calendar/android')

include ':capacitor-notification-badge'
project(':capacitor-notification-badge').projectDir = new File('../node_modules/capacitor-notification-badge/android')

Expand Down
90 changes: 36 additions & 54 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default defineComponent({
},
setup() {
// defines the tabs shown in the menu
// GLOBAL - Accueil
const appPages = [
{
title: 'Accueil',
Expand All @@ -104,13 +105,15 @@ export default defineComponent({
disabled: false
}
];
// SKOLENGO
if (localStorage.getItem("loginService") === "skolengo") {
appPages.push({
title: 'Emploi du temps',
url: '/timetable',
icon: "calendar_month",
disabled: false,
},
title: 'Emploi du temps',
url: '/timetable',
icon: "calendar_month",
disabled: false,
},
{
title: 'Travail à faire',
url: '/homework',
Expand All @@ -122,21 +125,17 @@ export default defineComponent({
url: '/news',
icon: "newspaper",
disabled: false,
},
{
title: 'Paramètres',
url: '/settings',
icon: "settings",
disabled: false
})
}
// PRONOTE
if (localStorage.getItem("loginService") === "pronote") {
appPages.push({
title: 'Emploi du temps',
url: '/timetable',
icon: "calendar_month",
disabled: false,
},
title: 'Emploi du temps',
url: '/timetable',
icon: "calendar_month",
disabled: false,
},
{
title: 'Travail à faire',
url: '/homework',
Expand All @@ -148,14 +147,17 @@ export default defineComponent({
url: '/grades',
icon: "insights",
disabled: false,
},
{
})
if (localStorage.getItem('viescolaireEnabled') == 'true') {
appPages.push({
title: 'Vie scolaire',
url: '/schoollife',
icon: "gavel",
disabled: false,
},
{
})
}
appPages.push({
title: 'Actualités',
url: '/news',
icon: "newspaper",
Expand All @@ -166,19 +168,10 @@ export default defineComponent({
url: '/conversations',
icon: "forum",
disabled: false,
},
{
title: 'Paramètres',
url: '/settings',
icon: "settings",
disabled: false
})
}
// hides some tabs when they are not anabled
if (localStorage.getItem('viescolaireEnabled') !== 'true') {
// remove school life tab
appPages.splice(4, 1);
}
// ECOLEDIRECTE
if (localStorage.getItem("loginService") === "ecoledirecte") {
let usercache = localStorage.getItem("UserCache");
if (usercache != null) {
Expand Down Expand Up @@ -258,15 +251,18 @@ export default defineComponent({
break;
}
})
appPages.push({
title: 'Paramètres',
url: '/settings',
icon: "settings",
disabled: false
})
}
}
// GLOBAL - Paramètres
appPages.push({
title: 'Paramètres',
url: '/settings',
icon: "settings",
disabled: false
})
const route = useRoute();
return {
Expand Down Expand Up @@ -467,15 +463,6 @@ export default defineComponent({
setTimeout(() => {
menu?.toggle();
}, 100);
if (url == "/home") {
StatusBar.setStyle({ style: Style.Dark })
this.changeStatusTimeout = false;
setTimeout(() => {
this.changeStatusTimeout = true;
}, 520);
}
},
async askNotifPerms() {
await LocalNotifications.requestPermissions();
Expand Down Expand Up @@ -514,12 +501,7 @@ export default defineComponent({
}
else {
if (this.changeStatusTimeout) {
// get current page from URL
const currentUrl = window.location.pathname;
if (currentUrl !== "/home") {
StatusBar.setStyle({ style: Style.Default })
}
StatusBar.setStyle({ style: Style.Default })
}
setTimeout(() => {
Expand All @@ -532,7 +514,7 @@ export default defineComponent({
async displayDevMsg() {
const alert = await alertController.create({
header: 'Version de développement',
message: 'Papillon fonctionne actuellement en mode développement. <br/><br/> Certaines fonctionnalités ne sont pas encore terminées et risquent de ne pas fonctionner correctement.',
message: 'Papillon fonctionne actuellement en mode développement. Certaines fonctionnalités ne sont pas encore terminées et risquent de ne pas fonctionner correctement.',
mode: 'md',
buttons: ['Je comprends']
});
Expand Down Expand Up @@ -732,7 +714,7 @@ export default defineComponent({
<template>
<ion-app>
<div id="debug_banner" v-if="appCanal == 'dev'" @click="displayDevMsg">
DEVBUILD
Devbuild
</div>

<ion-split-pane content-id="main-content">
Expand Down
2 changes: 0 additions & 2 deletions src/functions/fetch/GetGrades.js
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,6 @@ function groupEDSubjects(subjectData, markArray) {
let excluded = false;
console.log("GROUP ED SUBJECTS")
console.log(subjectData)
if (localStorage.getItem('groupSubjects') != 'true') {
subject = markArray.find(subject => subject.id == subjectData.id);
Expand Down Expand Up @@ -715,7 +714,6 @@ function constructEDGrades(grades) {
let averagesCalculate = [moment(period.ensembleMatieres.dateCalcul).format("DD/MM/YYYY"), period.ensembleMatieres.dateCalcul.split(' ')[1] ]//moment(period.ensembleMatieres.dateCalcul).format("HH:MM")]
/*
markArray.forEach(subject => {
console.log(subject.class)
studentAverage += subject.average;
classAverage += subject.class.average;
classMin += subject.class.min;
Expand Down
10 changes: 2 additions & 8 deletions src/functions/fetch/GetHomeworks.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,7 @@ function getEDHomework(dateFrom, dateTo, forceReload) {

let homework = response2.data.data;
all_homeworks[date] = homework.matieres;
console.log(`[${date}] ${JSON.stringify(homework.matieres)}`)


resolve(all_homeworks)
})
})
Expand Down Expand Up @@ -393,13 +392,11 @@ function constructEDHomework(hw) {

//2023-03-17
hw[date].forEach((homework) => {
console.log("le homework : " + JSON.stringify(homework))
// get homework
let hws = homework;
//foreach documents
console.log("a faire : " + JSON.stringify(hws.aFaire))
if(!hws.aFaire) {
console.warn("Skip construct of " + JSON.stringify(homework) + " because doesn't contain any \"aFaire\" var")
console.warn("Skip construct of homework because doesn't contain any \"aFaire\" var")
return;
}
hws.aFaire.documents.forEach((file) => {
Expand All @@ -415,7 +412,6 @@ function constructEDHomework(hw) {
});
//homework description
hws.aFaire.contenu = atob(hws.aFaire.contenu)
console.log("contenu du travail : " + hws.aFaire.contenu)
let homeworkDescription = hws.aFaire.contenu;
/*
Traitement des balises HTML (<strong>, <u>)
Expand Down Expand Up @@ -502,8 +498,6 @@ async function tickCustomHomework(id) {

// tick pronote homework
async function tickPronoteHomework(data) {
console.log(data)

let homeworkID = data[0];
let dateSet = data[1];

Expand Down
33 changes: 0 additions & 33 deletions src/functions/fetch/GetUserData.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,39 +256,6 @@ async function getEDUser(force) {
return constructEDUser(user);
}
// download avatar
/*let url = `https://cors.api.getpapillon.xyz/` + avatar;
axios.get(url, { responseType: 'blob' })
.then((response) => {
// get blob
let blob = response.data;
// create reader
let reader = new FileReader();
reader.readAsDataURL(blob);
// read blob
reader.onloadend = async function () {
// get base64
let base64 = reader.result;
// save in cache
let avatarURL = `${base64}`;
// get average color
fac.getColorAsync(avatarURL)
.then(color => {
localStorage.setItem('averageColor', JSON.stringify(color));
document.dispatchEvent(new CustomEvent('averageColorUpdated'));
})
.catch(e => {
console.log(e);
});
// save in cache
localStorage.setItem('avatarCache', avatarURL);
}
});*/
//FETCH PERIODS
await getEDPeriods().then(periods => {
user.periods = periods;
Expand Down
1 change: 1 addition & 0 deletions src/theme/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,7 @@ ion-fab .mdls {

font-size: 11px;
font-weight: 600;
text-transform: uppercase;

box-shadow: 1px 1px 5px #00000055;
}
Expand Down
15 changes: 1 addition & 14 deletions src/views/homepage/HomepageSetup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,28 +21,15 @@
};
},
methods: {
invertStatus() {
inner = !inner;
if(inner) {
StatusBar.setStyle({ style: Style.Default })
}
else {
StatusBar.setStyle({ style: Style.Dark })
}
},
navWillChange() {
setTimeout(() => {
this.invertStatus();
}, 120);
return false;
},
navDidChange() {
return false;
}
},
mounted() {
StatusBar.setStyle({ style: Style.Dark })
return false;
}
};
</script>
Expand Down
Loading

0 comments on commit f87b658

Please sign in to comment.