Skip to content

Commit

Permalink
wip: matricula init
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Nov 17, 2024
1 parent 0d170dc commit 728afe6
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
import { ref, onMounted, computed, watch } from 'vue';
import _ from 'lodash';
import draggable from 'vuedraggable';
import { NextAPI } from '../services/NextAPI';
import { NextAPI } from '../services/next';
import matriculaUtils from '../utils/Matricula';
import { convertDisciplina } from '../utils/convertUfabcDisciplina';
import { findSeasonKey, findIdeais } from '../utils/season';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewSubject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ import Highcharts3D from 'highcharts/highcharts-3d';
import Highcharts from 'highcharts';
import _ from 'lodash';
import { NextAPI } from '../services/NextAPI';
import { NextAPI } from '../services/next';
import SubjectTeachersList from './SubjectTeachersList.vue';
Highcharts3D(Highcharts);
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReviewTeacher.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ import Highcharts from 'highcharts';
import { ref, computed, watch, onMounted } from 'vue'
import _ from 'lodash';
import { NextAPI } from '../services/NextAPI';
import { NextAPI } from '../services/next';
import Utils from '../utils/extensionUtils';
import matriculaUtils from '../utils/Matricula';
Expand Down
17 changes: 17 additions & 0 deletions src/entrypoints/matricula.content/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { storage } from "wxt/storage";
import { scrapeMenu } from "@/scripts/sig/homepage";
import { errorToast, processingToast, successToast } from "@/utils/toasts";
import "toastify-js/src/toastify.css";
import '@/assets/tailwind.css'


export default defineContentScript({
main() {
errorToast.showToast()
processingToast.showToast()
successToast.showToast()
console.log('joabe')
},
runAt: "document_end",
matches: ["https://ufabc-matricula-snapshot.vercel.app"],
})
4 changes: 3 additions & 1 deletion src/entrypoints/sig.content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { storage } from "wxt/storage";
import { scrapeMenu } from "@/scripts/sig/homepage";
import { successToast } from "@/utils/toasts";
import "toastify-js/src/toastify.css";
import '@/assets/tailwind.css'

export default defineContentScript({
async main() {
Expand All @@ -21,7 +22,8 @@ export default defineContentScript({
const student = await scrapeMenu($trs);
console.log(student)
// storage.setItem("sync:student", student);
successToast.showToast();
// storage.setItem('session:studied', student?.graduation.components)
successToast.showToast();
}

// scrape student past classes to retrieve the credits
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/sig/homepage.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { fetchGrades, getUFStudent } from "@/services/UFSig";
import { fetchGrades, getUFStudent } from "@/services/uf-sig";
import { normalizeDiacritics } from "@/utils/removeDiacritics";
import { useChangeCase } from "@vueuse/integrations/useChangeCase";
import {
Expand Down
87 changes: 0 additions & 87 deletions src/utils/nextToasts.js

This file was deleted.

40 changes: 40 additions & 0 deletions src/utils/toasts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import toast from "toastify-js";

// Utils.injectStyle('styles/portal.css');


export const successToast = toast({
text: `
<div class='toast-loading-text' style='width: 250px'>
Expand All @@ -16,3 +19,40 @@ export const successToast = toast({
background: '#E74C3C;',
},
})

export const processingToast = toast({
text: `
<div class='toast-loading-text' style='width: 250px'>
<img src="/logo-white.svg" width="120" style="margin-bottom: 8px" />
<p style="padding-bottom: 8px;">Atualizando suas informações...</p>\n\n
<b>NÃO SAIA DESSA PÁGINA,</b>
<p>apenas aguarde, no máx. 5 min 🙏</p>
</div>`,
duration: -1,
close: false,
gravity: 'bottom',
position: 'right',
className: 'toast-loading',
escapeMarkup: false,
avatar: '/loading.svg',
style: {
background: 'linear-gradient(to right, #2E7EED, rgba(46, 126, 237, 0.5));',
},
});

export const errorToast = toast({
text: `
<div style="width: 228px; display: flex; align-items: end; margin-right: 12px;">
<img style="margin-right: 16px;" width="32" height="32" src="/error.svg" />
Não foi possível salvar seus dados, recarregue a página e aguarde.
</div>`,
duration: -1,
close: true,
gravity: 'bottom',
position: 'right',
className: 'toast-error-container',
escapeMarkup: false,
style: {
background: '#E74C3C;',
},
});

0 comments on commit 728afe6

Please sign in to comment.