Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusbrg committed Sep 20, 2024
1 parent b0594c2 commit 3885f1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
10 changes: 7 additions & 3 deletions src/components/Modal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,14 @@ const defaultSortHeaders = computed(() => {
})
const transformed = computed(() => {
if (!kicks.value || kicks.value.length === 0) {
return [];
}
return kicks.value.map((kick) => {
return Object.assign(kick, {
reserva: kick.reserva ? 'Sim' : 'Não',
ik: kick.ik.toFixed(3),
ik: kick.ik && kick.ik.toFixed(3) || kick.ik,
});
});
});
Expand Down Expand Up @@ -213,7 +217,7 @@ function setupComponents() {
nextApi
.get(`/entities/components/${componentId}/kicks?studentId=${studentId}`)
.then((res) => {
kicks.value = res;
kicks.value = res.data;
resort();
loading.value = false;
})
Expand All @@ -237,7 +241,7 @@ function resort() {
oldComponentObject.turno === 'diurno' ? 'asc' : 'desc';
}
kicks.value = _.orderBy(kicks, sortOrder, sortRef);
kicks.value = _.orderBy(kicks.value, sortOrder, sortRef);
}
function removedFilter(filter) {
Expand Down
20 changes: 10 additions & 10 deletions src/pages/matricula/fragments/professorPopover.html
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<div>
{{# component.teoria }}
<div class="col-md-12 isTeacherReview ufabc-extension-prof ufabc-well ufabc-transparent" style="margin-top: 6px;"> Teoria: <a class="ReviewTeacher Help" data="{{ component.teoria._id }}" teacherName="{{ component.teoria.name }}" style="cursor: pointer;">{{ component.teoria.name }}</a>
</div>
{{/ component.teoria }}

{{# component.pratica }}
<div class="col-md-12 isTeacherReview ufabc-extension-prof ufabc-well ufabc-transparent" style="margin-top: 6px;"> Prática: <a class="ReviewTeacher Help" data="{{ component.pratica._id }}" teacherName="{{ component.pratica.name }}" style="cursor: pointer;">{{ component.pratica.name }}</a>
</div>
{{/ component.pratica }}
</div>
{{# component.teoria }}
<div class="col-md-12 isTeacherReview ufabc-extension-prof ufabc-well ufabc-transparent" style="margin-top: 6px;"> Teoria: <a class="ReviewTeacher Help" data="{{ component.teoriaId }}" teacherName="{{ component.teoria }}" style="cursor: pointer;">{{ component.teoria }}</a>
</div>
{{/ component.teoria }}
{{# component.pratica }}
<div class="col-md-12 isTeacherReview ufabc-extension-prof ufabc-well ufabc-transparent" style="margin-top: 6px;"> Prática: <a class="ReviewTeacher Help" data="{{ component.praticaId }}" teacherName="{{ component.pratica }}" style="cursor: pointer;">{{ component.pratica }}</a>
</div>
{{/ component.pratica }}
</div>
4 changes: 2 additions & 2 deletions src/utils/Matricula.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ function Matricula() {
const searchString = 'todasMatriculas';
let studentId = null;

for (const script of scripts) {
for (const script of Array.from(scripts)) {
const content = script.textContent || script.innerHTML;
if (content.includes(searchString)) {
const regex = /matriculas\[(\d+)\]/;
const match = content.match(regex);

if (match && match[1]) {
studentId = Number.parseInt(match[1], 10);
return; // Interrompe o loop quando o ID é encontrado
break; // Interrompe o loop quando o ID é encontrado
}
}
}
Expand Down

0 comments on commit 3885f1c

Please sign in to comment.