Skip to content

Commit

Permalink
feat:cbi created in keystatic
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChrisFabian committed Jan 2, 2025
1 parent f28dfbd commit d02a85e
Show file tree
Hide file tree
Showing 14 changed files with 120 additions and 343 deletions.
192 changes: 0 additions & 192 deletions keystatic.config.tsx

This file was deleted.

2 changes: 0 additions & 2 deletions src/pages/posts/[major].astro
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ export const getStaticPaths = () => {
<Layout title=`Ingeniería ${majorData[0].label}`>
<!-- container -->
<SubjectSelect majorData={majorData} client:load />


</Layout>
38 changes: 38 additions & 0 deletions src/utils/CBIDataHandler.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import { fields } from "@keystatic/core";
import { materiasCBI } from "./data/dataCBI";
import { semesterOptionsCBI } from "./data/dataSemester";

export const cbiDataHandler = fields.conditional(
fields.select({
label: "Semestre",
description: "Select the semester",
options: semesterOptionsCBI,
defaultValue: "1",
}),
{
1: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCBI[1],
defaultValue: "F1",
}),
2: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCBI[2],
defaultValue: "F2",
}),
3: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCBI[3],
defaultValue: "DT1",
}),
4: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCBI[4],
defaultValue: "DT2",
}),
},
);
33 changes: 5 additions & 28 deletions src/utils/civilDataHandler.ts
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
import { fields } from "@keystatic/core";
import { materiasCivil } from "./data/dataCivil";
import { semesterOptions } from "./data/dataSemester";
import { semesterOptionsCE } from "./data/dataSemester";

export const civilDataHanlder = fields.conditional(
export const civilDataHandler = fields.conditional(
fields.select({
label: "Semestre",
description: "Select the semester",
options: semesterOptions,
defaultValue: "1",
options: semesterOptionsCE,
defaultValue: "5",
}),
{
1: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCivil[1],
defaultValue: "F1",
}),
2: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCivil[2],
defaultValue: "F2",
}),
3: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCivil[3],
defaultValue: "DT1",
}),
4: fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiasCivil[4],
defaultValue: "DT2",
}),

5: fields.select({
label: "Subject",
description: "Enter the subject of the post",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/cpaDataHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ export const cpaDataHandler = fields.select({
label: "Subject",
description: "Enter the subject of the post",
options: materiaCPA,
defaultValue: "Algebra",
defaultValue: "Ab",
});
43 changes: 43 additions & 0 deletions src/utils/data/dataCBI.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const materiaCBI1er = [
{ label: "Álgebra", value: "AL" },
{ label: "Análisis Matemático 1", value: "A1" },
{ label: "Física 1", value: "F1" },
{ label: "Geometría", value: "GE" },
{ label: "Inglés", value: "IN" },
{ label: "Química 1", value: "Q1" },
];

const materiaCBI2do = [
{ label: "Álgebra Lineal", value: "AN" },
{ label: "Análisis Matemático 2", value: "A2" },
{ label: "Física 2", value: "F2" },
{ label: "Análisis Vectorial", value: "AV" },
{ label: "Computación 1", value: "C1" },
{ label: "Química 2", value: "Q2" },
];

const materiaCBI3ero = [
{ label: "Diseño Técnico I", value: "DT1" },
{ label: "Análisis Matemático III", value: "A3" },
{ label: "Física III", value: "F3" },
{ label: "Mecánica Racional I", value: "MR1" },
{ label: "Probabilidades y Estadística", value: "PE" },
{ label: "Computación II", value: "C2" },
{ label: "Diseño Asistido por Computadora I", value: "DAC1" },
];

const materiaCBI4to = [
{ label: "Diseño Técnico II", value: "DT2" },
{ label: "Cálculo Numérico", value: "CN" },
{ label: "Mecánica Racional II", value: "MR2" },
{ label: "Mecánica de los Materiales I", value: "MM1" },
{ label: "Tecnología de los Materiales", value: "TM" },
{ label: "Diseño Asistido por Computadora II", value: "DAC2" },
{ label: "Construcciones", value: "CON" },
];
export const materiasCBI = {
1: materiaCBI1er,
2: materiaCBI2do,
3: materiaCBI3ero,
4: materiaCBI4to,
}
41 changes: 0 additions & 41 deletions src/utils/data/dataCivil.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
const materiaCivil1er = [
{ label: "Álgebra", value: "AL" },
{ label: "Análisis Matemático 1", value: "A1" },
{ label: "Física 1", value: "F1" },
{ label: "Geometría", value: "GE" },
{ label: "Inglés", value: "IN" },
{ label: "Química 1", value: "Q1" },
];

const materiaCivil2do = [
{ label: "Álgebra Lineal", value: "AN" },
{ label: "Análisis Matemático 2", value: "A2" },
{ label: "Física 2", value: "F2" },
{ label: "Análisis Vectorial", value: "AV" },
{ label: "Computación 1", value: "C1" },
{ label: "Química 2", value: "Q2" },
];

const materiaCivil3ero = [
{ label: "Diseño Técnico I", value: "DT1" },
{ label: "Análisis Matemático III", value: "A3" },
{ label: "Física III", value: "F3" },
{ label: "Mecánica Racional I", value: "MR1" },
{ label: "Probabilidades y Estadística", value: "PE" },
{ label: "Computación II", value: "C2" },
{ label: "Diseño Asistido por Computadora I", value: "DAC1" },
];

const materiaCivil4to = [
{ label: "Diseño Técnico II", value: "DT2" },
{ label: "Cálculo Numérico", value: "CN" },
{ label: "Mecánica Racional II", value: "MR2" },
{ label: "Mecánica de los Materiales I", value: "MM1" },
{ label: "Tecnología de los Materiales", value: "TM" },
{ label: "Diseño Asistido por Computadora II", value: "DAC2" },
{ label: "Construcciones", value: "CON" },
];

const materiaCivil5to = [
{ label: "Electrotecnia e Instalaciones Eléctricas", value: "EIE" },
Expand Down Expand Up @@ -90,10 +53,6 @@ const materiaCivilDec = [
];

export const materiasCivil = {
1: materiaCivil1er,
2: materiaCivil2do,
3: materiaCivil3ero,
4: materiaCivil4to,
5: materiaCivil5to,
6: materiaCivil6to,
7: materiaCivil7mo,
Expand Down
Loading

0 comments on commit d02a85e

Please sign in to comment.