Skip to content

Commit

Permalink
fix: small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Joabesv committed Feb 5, 2024
1 parent 21d7b68 commit ddbbb09
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 59 deletions.
58 changes: 30 additions & 28 deletions app/scripts/matricula/App.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
<template>
<template>
<div class="ufabc-row filters">
<div class="mr-3 ufabc-row ufabc-align-center">
<img :src="getUrl('/images/icon-128.png')" style="width: 32px; height: 32px;" />
</div>
<div class="mr-5">
<div class="title-filter">Câmpus</div>
<div>
<el-checkbox
v-for='filter in campusFilters'
@change="applyFilter(filter)"
<el-checkbox
v-for='(filter, index) in campusFilters'
:key="index"
@change="applyFilter(filter)"
v-model="filter.val">
{{ filter.name }}
</el-checkbox>
Expand All @@ -18,9 +19,10 @@
<div class="mr-5">
<div class="title-filter">Turno</div>
<div>
<el-checkbox
v-for='filter in shiftFilters'
@change="applyFilter(filter)"
<el-checkbox
v-for='(filter, index) in shiftFilters'
:key="index"
@change="applyFilter(filter)"
v-model="filter.val">
{{ filter.name }}
</el-checkbox>
Expand All @@ -30,17 +32,17 @@
<div class="pr-5">
<div class="title-filter">Filtros</div>
<div>
<el-switch
<el-switch
class="mr-3 ufabc-element-switch"
active-text="Disciplinas escolhidas"
v-model="selected"
active-text="Disciplinas escolhidas"
v-model="selected"
@change="changeSelected()"
></el-switch>

<el-switch
<el-switch
class="mr-3 ufabc-element-switch"
active-text="Disciplinas cursadas"
v-model="cursadas"
active-text="Disciplinas cursadas"
v-model="cursadas"
@change="changeCursadas()"
></el-switch>

Expand All @@ -57,22 +59,22 @@
Atualizar dados agora
</a>
</div>
<el-button
<el-button
v-if="showWarning"
slot="reference"
type="danger"
icon="el-icon-warning"
type="danger"
icon="el-icon-warning"
class="ml-3"
circle
></el-button>
</el-popover>



<!-- <el-switch
<!-- <el-switch
class="mr-3 ufabc-element-switch"
active-text="Professores"
v-model="teachers"
active-text="Professores"
v-model="teachers"
@change="changeTeachers()"
></el-switch> -->
</div>
Expand All @@ -84,7 +86,7 @@
import MatriculaHelper from '../helpers/matricula'
import Utils from '../helpers/utils'
import Mustache from 'mustache'
// await MatriculaHelper.getTotalMatriculas()
// await MatriculaHelper.getTotalMatriculas()
export default {
name: 'App',
Expand Down Expand Up @@ -213,16 +215,16 @@
})
// chrome.runtime.sendMessage(Utils.EXTENSION_ID, {
// method: 'storage',
// key:
// method: 'storage',
// key:
// }, function(item) {
// if (item == null) {
// self.$notify({
// message: 'Não temos as diciplinas que você cursou, acesse o Portal do Aluno'
// })
// return
// }
// })
},
changeTeachers() {
Expand All @@ -242,7 +244,7 @@
if (item == null) {
item = await MatriculaHelper.getProfessors()
}
const disciplinaMap = new Map([...item.map(d => [d.disciplina_id.toString(), d])])
const htmlPop = await Utils.fetchChromeUrl('pages/matricula/fragments/professorPopover.html')
const corteHtml = await Utils.fetchChromeUrl('pages/matricula/corte.html')
Expand All @@ -252,7 +254,7 @@
var subjectEl = $(this).find('td:nth-child(3) > span')
var corteEl = $(this).find('td:nth-child(5)')
var disciplinaId = el.parent().attr('value')
const disciplinaInfo = disciplinaMap.get(disciplinaId)
if(!disciplinaInfo) return
Expand All @@ -275,7 +277,7 @@
* {
font-family: Ubuntu;
}
.filters {
.filters {
position: sticky;
top: 0px;
background: #fff;
Expand All @@ -288,11 +290,11 @@
}
.title-filter {
font-size: 14px;
font-size: 14px;
margin-bottom: 2px;
color: rgba(0,0,0,0.9);
}
.warning-advice > a {
color: rgb(0, 0, 238);
}
</style>
</style>
41 changes: 30 additions & 11 deletions app/scripts/portal/portal.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,24 @@ const errorSVG = require('./error.svg')
const logoWhite = require('./logo-white.svg')

const toast = new Toastify({
text: "<div class='toast-loading-text' style='width: 250px'><img src=" + logoWhite + " 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>",
text: `
<div class='toast-loading-text' style='width: 250px'>
<img src=${logoWhite} 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',
position: "right",
className: "toast-loading",
escapeMarkup: false,
avatar: loading,
style: {
background: 'linear-gradient(to right, #2E7EED, rgba(46, 126, 237, 0.5));'
background: "linear-gradient(to right, #2E7EED, rgba(46, 126, 237, 0.5));",
},
})
});

if (isIndexPortalAluno()) {
const anchor = document.createElement('div')
Expand Down Expand Up @@ -148,16 +155,21 @@ async function getFichaAluno(fichaAlunoUrl, nomeDoCurso, anoDaGrade) {
} catch(err) {
console.log(err)
Toastify({
text: "<div style='width: 228px; display: flex; align-items: end; margin-right: 12px;'><img style='margin-right: 16px;' width='32' height='32' src='" + errorSVG + "' /> Não foi possível salvar seus dados, recarregue a página e aguarde.</div>",
text:
`
<div style="width: 228px; display: flex; align-items: end; margin-right: 12px;">
<img style="margin-right: 16px;" width="32" height="32" src="${errorSVG}" />
Não foi possível salvar seus dados, recarregue a página e aguarde.
</div>`,
duration: -1,
close: true,
gravity: "top",
position: 'right',
className: 'toast-error-container',
position: "right",
className: "toast-error-container",
style: {
background: '#E74C3C;'
background: "#E74C3C;",
},
}).showToast()
}).showToast();
}
}

Expand Down Expand Up @@ -185,7 +197,14 @@ async function saveToLocalStorage(curso) {
user = _.uniqBy(user, 'curso')

await Utils.storage.setItem(storageUser, user)
toastr.success('Suas informações foram salvas! Disciplinas do curso do ' + curso.curso + ' para o usuário ' + getEmailAluno() + '.', { timeout: 100000})

toastr.success(
`Suas informações foram salvas! Disciplinas do curso do ${curso.curso}
para o usuário ${getEmailAluno()}.,
`,
{ timeout: 100000 }
);

}


Expand Down
22 changes: 2 additions & 20 deletions tasks/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,17 @@ gulp.task("styles:css", function () {
.pipe(gulpif(args.watch, livereload()));
});

gulp.task("styles:less", function () {
return gulp
.src("app/styles/*.less")
.pipe(gulpif(args.sourcemaps, sourcemaps.init()))
.pipe(
less({ paths: ["./app"] }).on("error", function (error) {
gutil.log(
gutil.colors.red("Error (" + error.plugin + "): " + error.message),
);
this.emit("end");
}),
)
.pipe(gulpif(args.production, cleanCSS()))
.pipe(gulpif(args.sourcemaps, sourcemaps.write()))
.pipe(gulp.dest(`dist/${args.vendor}/styles`))
.pipe(gulpif(args.watch, livereload()));
});

gulp.task("styles:sass", function () {
return gulp
.src("app/styles/*.scss")
.pipe(gulpif(args.sourcemaps, sourcemaps.init()))
.pipe(
sass({ includePaths: ["./app"] }).on("error", function (error) {
gutil.log(
gutil.colors.red("Error (" + error.plugin + "): " + error.message),
gutil.colors.red("Error (" + error.plugin + "): " + error.message)
);
this.emit("end");
}),
})
)
.pipe(gulpif(args.production, cleanCSS()))
.pipe(gulpif(args.sourcemaps, sourcemaps.write()))
Expand Down

0 comments on commit ddbbb09

Please sign in to comment.