From 3cc27a5598b358601e6b290b79ced6ad31fe4560 Mon Sep 17 00:00:00 2001 From: Hunter Richardson Date: Sun, 23 Jun 2024 15:40:42 -0500 Subject: [PATCH] Correct frontend errors --- src/facies/inflectere.vue | 66 ++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/src/facies/inflectere.vue b/src/facies/inflectere.vue index 44634be..e7f1179 100644 --- a/src/facies/inflectere.vue +++ b/src/facies/inflectere.vue @@ -4,7 +4,7 @@ defineProps<{ eventus: { - referendum: Faciendum, + referendum: Faciendum | null, categoria: string } }>(); @@ -15,11 +15,11 @@ filter: (verbum: Hoc, colamen: string) => boolean }[]; - const agendum: Faciendum = eventus?.referendum; + const agendum: Faciendum = eventus.referendum; // eslint-disable-next-line @typescript-eslint/no-unused-vars const tabula: Tabula | null = agendum?.putetur() ?? null; - const categoria: string = eventus?.categoria ?? ''; + const categoria: string = eventus.categoria ?? ''; const anglica: boolean = Cocutor.se.ipse().edatur('lingua') === 'anglica'; // eslint-disable-next-line @typescript-eslint/no-unused-vars @@ -70,14 +70,10 @@ import { genera, gradi, anglicum } from '../miscella/enumerationes'; import type { Referendum } from '../praebeunda/interfecta' - // eslint-disable-next-line @typescript-eslint/no-unused-vars const verbum: ModelRef = defineModel('verbum'); - // eslint-disable-next-line @typescript-eslint/no-unused-vars const HorizontalScroll = require('vue-horizontal-scroll'); - // eslint-disable-next-line @typescript-eslint/no-unused-vars const seligenda: string[] = []; - // eslint-disable-next-line @typescript-eslint/no-unused-vars const selecta: string[] = []; type Et = { @@ -113,7 +109,7 @@ figura: figura, seligenda: seligenda, selecta: selecta, - haec: tabula?.tabulentur() ?? [], + haec: (tabula?.tabulentur() ?? []) as Hoc[], verbum: verbum.value, onerans: true, columnae: columnae, @@ -136,59 +132,57 @@ if (this.figura === 'numeramenAgendum' && agendum instanceof Agenda.NumeramenAgendum && numeramen instanceof Numeramen) { - const referendum: Referendum = (agendum as Agenda.NumeramenAgendum).referatur(numeramen.referendum); + const referendum: Referendum | null = await (agendum as Agenda.NumeramenAgendum).referatur(numeramen.referendum); if (referendum instanceof Numerus) { this.verbum = referendum as Numerus; } else if (referendum instanceof Agenda.NomenAgendum) { - this.eventus = { - referendum: referendum as Agenda.NomenAgendum, - categoria: 'nomen' - }; + this.eventus.referendum = referendum as Agenda.NomenAgendum; + this.eventus.categoria = 'nomen'; } else if (referendum instanceof Agenda.AdiectivumAgendum) { - this.eventus = { - referendum: referendum as Agenda.AdiectivumAgendum, - categoria: 'adiectivum' - }; + this.eventus.referendum = referendum as Agenda.AdiectivumAgendum; + this.eventus.categoria = 'adiectivum'; } else if (referendum instanceof Agenda.Incomparabile) { - this.eventus = { - referendum: referendum as Agenda.Incomparabile, - categoria: 'adiectivum' - }; + this.eventus.referendum = referendum as Agenda.Incomparabile; + this.eventus.categoria = 'adiectivum'; } } }, selige (hoc: Hoc): void { this.verbum = hoc; - }, refer (eventus: { + }, async refer (eventus: { categoria: string, referendum?: string, gradus?: string, genus?: string; - }): void { - let referendum: Referendum | null = null; + }): Promise { switch (this.figura) { case 'actusAgendus': if (agendum instanceof Agenda.ActusAgendus) { switch (eventus.referendum) { case 'frequentativus': - referendum = (agendum as Agenda.ActusAgendus).frequentativus(); + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = (agendum as Agenda.ActusAgendus).frequentativus(); break; case 'nomen': - referendum = (agendum as Agenda.ActusAgendus).nomen(); + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = await (agendum as Agenda.ActusAgendus).nomen(); break; case 'actor': - referendum = (agendum as Agenda.ActusAgendus).actor(eventus.genus ?? ''); + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = (agendum as Agenda.ActusAgendus).actor(eventus.genus ?? ''); break; } } break; case 'nomenActum': if (agendum instanceof Agenda.NomenActum) { - referendum = (agendum as Agenda.NomenActum).actus(); + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = await (agendum as Agenda.NomenActum).actus(); } break; case 'adiectivumAgendum': if (agendum instanceof Agenda.AdiectivumAgendum) { - referendum = (agendum as Agenda.AdiectivumAgendum).probetur({ + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = await (agendum as Agenda.AdiectivumAgendum).probetur({ gradus: eventus.gradus ?? '', genus: eventus.genus ?? '' }); @@ -196,17 +190,11 @@ break; case 'incomparabile': if (agendum instanceof Agenda.Incomparabile) { - referendum = (agendum as Agenda.Incomparabile).probetur(eventus.genus ?? ''); + this.eventus.categoria = eventus.categoria; + this.eventus.referendum = (agendum as Agenda.Incomparabile).probetur(eventus.genus ?? ''); } break; } - - if (referendum) { - this.eventus = { - referendum: referendum, - categoria: eventus.categoria - }; - } } }, async mounted (): Promise { this.haec = await this.omnes(); @@ -238,7 +226,7 @@ -