From aa9018b3b4310d0fb1667677ab4f50193a962c2c Mon Sep 17 00:00:00 2001 From: Happy Days!!! <36199346+rosema2012@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:29:24 +0100 Subject: [PATCH 01/36] Grupo e: cambiar color de boton e igualar con el label tutor --- .../personal-info/personal-info.component.css | 77 ++++++++++++------- .../personal-info.component.html | 63 +++++++-------- 2 files changed, 82 insertions(+), 58 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css index a522ca301..383780b41 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css @@ -3,34 +3,65 @@ margin: 5px auto; background-color: #f5f0f2; border-radius: 15px; + gap: 10px; padding: 10px; display: grid; - grid-template-columns: 1fr 1fr 1fr; - gap: 10px; + grid-template-columns: 1fr 1fr 1fr 1fr; } .datosPersonales { - grid-column: 1 / -1; + grid-column: 1/3 } .foto { - grid-column: 1 / 4; - justify-self: center; - align-self: center; - margin-bottom: 0; - display: flex; - align-items: center; - justify-content: center; - margin-bottom: 30px; + margin-top: -30px; /* Ajusta el valor negativo según sea necesario */ + display: flex; + justify-content: center; /* Centra horizontalmente la imagen */ + align-items: flex-start; /* Asegura que la imagen se mantenga en la parte superior */ } +.separatorCol { + padding-top: 0; /* Elimina cualquier padding innecesario */ +} + + +.datosPrincipales2{ + height: 31%; +} .personal-data-fields { + display: grid; + grid-template-columns: 1fr 1fr; +} + +.nombre{ + display: flex; + gap:10px +} + +.apellido{ + display: flex; + gap:10px +} + +.apellido2{ display: flex; - flex-wrap: wrap; - gap: 15px; - justify-content: space-evenly; + gap:10px +} + +.dni{ + display:flex; + gap:10px; +} + +.telefono{ + display:flex; + gap:10px; +} + +.separatorCol{ + padding-top: -50%; } p { @@ -47,21 +78,11 @@ fieldset { border: solid 2px #1a3459; border-radius: 15px; } -.p_info_foto{ - font-size: 12px; - grid-column: 1 / 4; - justify-self: center; - align-self: center; - display: flex; - align-items: center; - justify-content: center; - color: #1a3459; -} -.foto_centrada{ - display: block; -} + + @media (max-width: 1024px) { .grid-container { grid-template-columns: 1fr ; } -} \ No newline at end of file +} + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html index c68eec093..74aa40208 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html @@ -8,36 +8,38 @@
{{'Personal Data' | oTranslate}} -
-
- - -
-

{{'Info_foto' | oTranslate}}

+
-
- -

{{form.getDataValue('name').value}}

-
-
- -

{{form.getDataValue('surname1').value}}

-
-
- -

{{form.getDataValue('surname2').value}}

-
-
- -

{{form.getDataValue('dni').value}}

-
-
- -

{{form.getDataValue('phone').value}}

+
+
+ +

{{form.getDataValue('name').value}}

+
+
+ +

{{form.getDataValue('surname1').value}}

+
+
+ +

{{form.getDataValue('surname2').value}}

+
+
+ +

{{form.getDataValue('dni').value}}

+
+
+ +

{{form.getDataValue('phone').value}}

+
+
+
+ + +
+

{{'Info_foto' | oTranslate}}

@@ -66,6 +68,7 @@ +
{{'FCT Information' | oTranslate}}
@@ -85,7 +88,6 @@

{{form.getDataValue('fct_end').value | date:'dd/MM/yyyy'}}

-
{{'Additional Information' | oTranslate}}
@@ -98,6 +100,7 @@
+ - + \ No newline at end of file From e1afd1113f3fc63947e073b81cdc68fad6478cc4 Mon Sep 17 00:00:00 2001 From: Happy Days!!! <36199346+rosema2012@users.noreply.github.com> Date: Tue, 10 Dec 2024 09:48:59 +0100 Subject: [PATCH 02/36] Grupo e: restructurar portal estudiantes --- .../personal-info/personal-info.component.css | 61 ++++++++++++++++++- .../personal-info.component.html | 32 +++++----- 2 files changed, 74 insertions(+), 19 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css index 383780b41..7fd976928 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css @@ -6,7 +6,7 @@ gap: 10px; padding: 10px; display: grid; - grid-template-columns: 1fr 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1.5fr 1fr; } .datosPersonales { @@ -26,7 +26,7 @@ .datosPrincipales2{ - height: 31%; + height: 26%; } @@ -60,13 +60,68 @@ gap:10px; } +.fechaCumple{ + display:flex; + gap:10px; +} + +.location{ + display:flex; + gap:10px; +} + +.employmentStatus{ + display: flex; + gap: 10px; +} + +.emailCampus{ + display:flex; + gap: 10px; +} + +.email{ + display:flex; + gap: 5px; +} + +.fctSchool{ + display:flex; + gap: 10px; +} + +.tutor{ + display:flex; + gap:10px; +} + +.fctStart{ + display: flex; + gap:10px; +} + +.fctEnd{ + display:flex; + gap:10px; +} + +.udemy{ + display:flex; + gap: 10px; +} + +.githubUser{ + display:flex; + gap:10px; +} + .separatorCol{ padding-top: -50%; } p { color: black; - margin-top: 0; + margin-top: 0px; } p:last-child{ margin-bottom: 0; diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html index 74aa40208..83d068409 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html @@ -12,23 +12,23 @@
- +

{{form.getDataValue('name').value}}

- +

{{form.getDataValue('surname1').value}}

- +

{{form.getDataValue('surname2').value}}

- +

{{form.getDataValue('dni').value}}

- +

{{form.getDataValue('phone').value}}

@@ -47,23 +47,23 @@
{{'Academic Data' | oTranslate}}
- +

{{form.getDataValue('employment_status').value}}

- +

{{form.getDataValue('birth_date').value | date:'dd/MM/yyyy'}}

- +

{{form.getDataValue('location').value}}

- +

{{form.getDataValue('campus_email').value}}

@@ -72,30 +72,30 @@
{{'FCT Information' | oTranslate}}
- +

{{form.getDataValue('fct_school').value}}

- +

{{form.getDataValue('tutor').value}}

- +

{{form.getDataValue('fct_start').value | date:'dd/MM/yyyy'}}

- +

{{form.getDataValue('fct_end').value | date:'dd/MM/yyyy'}}

{{'Additional Information' | oTranslate}}
- +

{{form.getDataValue('udemy').value ? 'Yes' : 'No'}}

- +

{{form.getDataValue('github_user').value}}

From 7e9c03b70dc7e8f8d82463fdd044bde1695cca25 Mon Sep 17 00:00:00 2001 From: Hirary <153830184+hiraryw64@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:46:37 +0100 Subject: [PATCH 03/36] =?UTF-8?q?L=C3=ADmite=20de=20campos=20en=20todo=20m?= =?UTF-8?q?enos=20en=20el=20login=20(#190)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Límite de campos en todo menos en el login * Arreglada una traducción * Ajustados los validadores (por límite de caracteres) --- .../bootcamp-details.component.html | 4 ++-- .../bootcamp-new/bootcamp-new.component.html | 2 +- .../employment-status-new.component.html | 2 +- .../student-status-new.component.html | 2 +- .../students-detail.component.html | 8 ++++---- .../students-new/students-new.component.html | 18 +++++++++--------- .../tutors-detail/tutors-detail.component.html | 12 ++++++------ .../src/main/ngx/src/assets/i18n/es.json | 3 ++- 8 files changed, 26 insertions(+), 25 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html index e497be7d8..05033d3ab 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html @@ -6,7 +6,7 @@
- +
@@ -25,7 +25,7 @@
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-new/bootcamp-new.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-new/bootcamp-new.component.html index 217e7055f..a24132a3b 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-new/bootcamp-new.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-new/bootcamp-new.component.html @@ -40,7 +40,7 @@
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/employment-status-new/employment-status-new.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/employment-status-new/employment-status-new.component.html index e2a71cecd..e44ce5353 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/employment-status-new/employment-status-new.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/employment-status-new/employment-status-new.component.html @@ -4,7 +4,7 @@
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/student-status-new/student-status-new.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/student-status-new/student-status-new.component.html index 0737ae4f0..886b5dffc 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/student-status-new/student-status-new.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/config/student-status-new/student-status-new.component.html @@ -3,7 +3,7 @@
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html index 1c16f6e92..7e20fa9ad 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html @@ -68,7 +68,7 @@
- +
@@ -87,7 +87,7 @@
+ max-length="50">
@@ -109,11 +109,11 @@
- +
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-new/students-new.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-new/students-new.component.html index 0315d3c2e..6d6c5d925 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-new/students-new.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-new/students-new.component.html @@ -14,17 +14,17 @@
-
-
-
@@ -32,7 +32,7 @@
- +
@@ -62,7 +62,7 @@
- +
@@ -80,12 +80,12 @@ Login
-
- @@ -104,11 +104,11 @@
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/tutors/tutors-detail/tutors-detail.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/tutors/tutors-detail/tutors-detail.component.html index cfefb196b..4f9ea03ca 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/tutors/tutors-detail/tutors-detail.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/tutors/tutors-detail/tutors-detail.component.html @@ -18,23 +18,23 @@

{{'Info_foto' | oTranslate}}

-
-
-
@@ -44,11 +44,11 @@
+ max-length="50">
- diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index 3d9d4be84..16a43d719 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -149,7 +149,8 @@ "SLIDE_SEARCH": "Búsqueda conjunta", "SLIDE_TT": "Activa la búsqueda para campos complejos", "LOCALE_gal": "GAL", - "BOOTCAMP_HAS_STUDENTS":"El bootcamp que quieres borrar tiene alumnos asignados", + "BOOTCAMP_HAS_STUDENTS":"El bootcamp que quieres borrar tiene alumnos o tutores asignados", + "TUTOR_HAS_BOOTCAMPS": "El tutor que quieres borrar tiene bootcamps asignados", "description":"Descripción", "notes":"Notas", "First Surname": "Primer apellido", From 85bfeb0ff930f9ca6948c0e8715a77ef6efb2141 Mon Sep 17 00:00:00 2001 From: rosema2012 Date: Tue, 10 Dec 2024 12:49:46 +0000 Subject: [PATCH 04/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 9cb07042a..3220ef364 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: devc8ea830 + version: dev7e9c03b imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From 0897ffe441c0e6ed13c5f9ee8534a06dfe2a005d Mon Sep 17 00:00:00 2001 From: Happy Days!!! <36199346+rosema2012@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:37:45 +0100 Subject: [PATCH 05/36] Grupo e: foto --- .../personal-info/personal-info.component.css | 24 +++++++++++++++---- .../personal-info.component.html | 3 +-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css index 7fd976928..8d4a0c5d6 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css @@ -6,7 +6,7 @@ gap: 10px; padding: 10px; display: grid; - grid-template-columns: 1fr 1fr 1.5fr 1fr; + grid-template-columns: 1fr 1fr 2fr 1fr; } .datosPersonales { @@ -14,12 +14,23 @@ } .foto { - margin-top: -30px; /* Ajusta el valor negativo según sea necesario */ + margin-top: -30px; /* Ajusta según sea necesario */ display: flex; - justify-content: center; /* Centra horizontalmente la imagen */ - align-items: flex-start; /* Asegura que la imagen se mantenga en la parte superior */ + justify-content: center; + align-items: flex-start; + border-radius: 50%; /* Hace que la imagen sea circular */ + transition: box-shadow 0.3s ease, transform 0.3s ease; /* Suaviza la transición */ + width: 70%; } +.foto:hover { + box-shadow: 0 0 20px 10px #1a3459; /* Crea el efecto de aura */ + transform: scale(0.9); /* Agranda ligeramente la imagen al pasar el ratón */ + background-color: #1a3459; + border-radius: 50%; +} + + .separatorCol { padding-top: 0; /* Elimina cualquier padding innecesario */ } @@ -29,6 +40,11 @@ height: 26%; } +.fraseInfo{ + color: gray; + padding-top: 20px; + font-size: 20px; +} .personal-data-fields { display: grid; diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html index 83d068409..6fdb5af91 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html @@ -36,10 +36,9 @@
+ accept-file-type="image/png,image/jpeg,image/gif,image/jpg" show-controls="No">
-

{{'Info_foto' | oTranslate}}

From 00257e6fce980b71d7959b1307a52aacd664d66f Mon Sep 17 00:00:00 2001 From: Happy Days!!! <36199346+rosema2012@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:51:33 +0100 Subject: [PATCH 06/36] Grupo e: foto --- .../src/app/main/data/personal-info/personal-info.component.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css index 8d4a0c5d6..c90dd02a0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css @@ -20,7 +20,7 @@ align-items: flex-start; border-radius: 50%; /* Hace que la imagen sea circular */ transition: box-shadow 0.3s ease, transform 0.3s ease; /* Suaviza la transición */ - width: 70%; + width: 200px; } .foto:hover { From d28f7529a7c7c3fd9b83736ccbc034ed2e05a9dc Mon Sep 17 00:00:00 2001 From: Jesus Blanco Miguez <119857344+eluiui@users.noreply.github.com> Date: Tue, 10 Dec 2024 15:01:12 +0100 Subject: [PATCH 07/36] Bfs42024 281 (#194) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * bug solucionado * Añadidos textos a los errores --------- Co-authored-by: eluiui Co-authored-by: hiraryw64 --- .../src/main/ngx/src/assets/i18n/en.json | 2 ++ .../src/main/ngx/src/assets/i18n/es.json | 2 ++ .../model/core/service/StudentService.java | 23 ++++++++++++++++++- 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json index 38c95fa57..26883d83a 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json @@ -158,6 +158,8 @@ "SLIDE_TT": "Enable search for complex fields", "LOCALE_gal": "GAL", "BOOTCAMP_HAS_STUDENTS":"The bootcamp that you want to delete has students or mentors", + "STUDENT_HAS_STATUS": "This student has at least one employment status assigned", + "STUDENT_HAS_NOTES": "This student has at least one note assigned", "description":"Description", "notes":"Notes", "First Surname": "First surname", diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index 16a43d719..8cb923560 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -146,6 +146,8 @@ "student_status": "Estado del estudiante", "CLEAR": "Limpiar", "FILTER": "Filtrar", + "STUDENT_HAS_STATUS": "El estudiante tiene al menos un estado laboral", + "STUDENT_HAS_NOTES": "El estudiante tiene al menos una nota", "SLIDE_SEARCH": "Búsqueda conjunta", "SLIDE_TT": "Activa la búsqueda para campos complejos", "LOCALE_gal": "GAL", diff --git a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java index 0adeeccab..d8d74adb0 100644 --- a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java +++ b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java @@ -32,6 +32,12 @@ public class StudentService implements IStudentService { @Autowired private StudentBootcampDao studentBootcampDao; + @Autowired + private NotesDao notesDao; + + @Autowired + private EmploymentStatusHistoryDao employmentStatusHistoryDao; + @Autowired private IUserAndRoleService userAndRoleService; @@ -251,13 +257,28 @@ public EntityResult studentDelete(Map keyMap) throws OntimizeJEE Map deletekey = new Hashtable<>(); deletekey.put(StudentBootcampDao.STUDENT_ID,keyMap.get(StudentDao.STU_ID)); EntityResult query = this.daoHelper.query(this.studentBootcampDao,deletekey,Arrays.asList(StudentBootcampDao.STUDENT_ID)); - + Map deletekey2 = new Hashtable<>(); + deletekey2.put(NotesDao.ATTR_ID_STUDENTS,keyMap.get(StudentDao.STU_ID)); + EntityResult query2 = this.daoHelper.query(this.notesDao,deletekey2,Arrays.asList(NotesDao.ATTR_ID_STUDENTS)); + Map deletekey3 = new Hashtable<>(); + deletekey3.put(EmploymentStatusHistoryDao.ATTR_STUDENT_ID,keyMap.get(StudentDao.STU_ID)); + EntityResult query3 = this.daoHelper.query(this.employmentStatusHistoryDao,deletekey3,Arrays.asList(EmploymentStatusHistoryDao.ATTR_STUDENT_ID)); if(!query.isEmpty()){ EntityResult error = new EntityResultMapImpl(); error.setCode(EntityResult.OPERATION_WRONG); error.setMessage("STUDENT_HAS_BOOTCAMPS"); return error; + } else if(!query2.isEmpty()){ + EntityResult error2 = new EntityResultMapImpl(); + error2.setCode(EntityResult.OPERATION_WRONG); + error2.setMessage("STUDENT_HAS_NOTES"); + return error2; + }else if(!query3.isEmpty()){ + EntityResult error3 = new EntityResultMapImpl(); + error3.setCode(EntityResult.OPERATION_WRONG); + error3.setMessage("STUDENT_HAS_STATUS"); + return error3; }else { return this.daoHelper.delete(this.studentDao, keyMap); } From 3d02bcc422413719bc1e3b5ca1c060eaa97e0d07 Mon Sep 17 00:00:00 2001 From: rosema2012 Date: Tue, 10 Dec 2024 14:04:01 +0000 Subject: [PATCH 08/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 3220ef364..31ad38897 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: dev7e9c03b + version: devd28f752 imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From 516c6648330ab1092f5856bb4107b8a8e1d2952f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20=C3=81lvarez=20Rodriguez?= Date: Wed, 11 Dec 2024 09:27:49 +0100 Subject: [PATCH 09/36] toggle filtro tanla estudiantes --- .../students-table/students-table.component.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index 5c46d0613..b7a6d49b7 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -34,7 +34,10 @@ - + +
+ +
@@ -49,14 +52,14 @@

{{ 'Students' | oTranslate }}

- - - - + + + From a2a7ee5b313fe43c74cbf0b2640707d032b07ba1 Mon Sep 17 00:00:00 2001 From: hiraryw64 Date: Wed, 11 Dec 2024 09:39:06 +0100 Subject: [PATCH 10/36] Colores cambiados en las fechas de inicio/fin del cronograma --- .../calendar-timestamps/calendar-timestamps.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/calendar-timestamps/calendar-timestamps/calendar-timestamps.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/calendar-timestamps/calendar-timestamps/calendar-timestamps.component.html index f729827bc..ce32e0ab2 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/calendar-timestamps/calendar-timestamps/calendar-timestamps.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/calendar-timestamps/calendar-timestamps/calendar-timestamps.component.html @@ -43,11 +43,11 @@ (click)="navigateToBootcampDetail(bootcamp.id)" matTooltipClass="my-tooltip" matTooltip="{{bootcamp.name}}, Fecha de inicio: {{bootcamp.start_date|date:'dd/MM/yyyy'}}, Fecha de fin: {{bootcamp.end_date|date:'dd/MM/yyyy'}}">
-
{{printDate(bootcamp.start_date)}}
+
{{printDate(bootcamp.start_date)}}
{{getDisplayName(bootcamp)}}
-
{{printDate(bootcamp.end_date)}}
+
{{printDate(bootcamp.end_date)}}
From b8cf23e7113836c949b3ebc9653b6efb834e5c5a Mon Sep 17 00:00:00 2001 From: hiraryw64 Date: Wed, 11 Dec 2024 08:41:46 +0000 Subject: [PATCH 11/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 31ad38897..8bc809222 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: devd28f752 + version: deva2a7ee5 imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From 992822e06261803624318beb264aa24533411f2d Mon Sep 17 00:00:00 2001 From: eluiui Date: Wed, 11 Dec 2024 10:23:13 +0100 Subject: [PATCH 12/36] consulta chula hecha y v creado --- .../students-table.component.html | 8 ++-- .../students-table.component.ts | 1 + ...e_view_students_with_bootcamps_validos.sql | 45 +++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index b7a6d49b7..e01339a19 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -34,7 +34,7 @@ - +
@@ -45,7 +45,7 @@
@@ -54,8 +54,8 @@

{{ 'Students' | oTranslate }}

diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts index a6ea284b3..be93d3426 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts @@ -76,6 +76,7 @@ export class StudentsTableComponent { if (fil.attr === 'bootcamps_id') { filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr,"|"+filterValue+"|")); } + filters.push(FilterExpressionUtils.buildExpressionMoreEqual("validos", 1)); } }); diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql new file mode 100644 index 000000000..a5f03687f --- /dev/null +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql @@ -0,0 +1,45 @@ +drop view v_students_with_bootcamps; + +create or replace view v_students_with_bootcamps as +select +st.*, +uu.*, +ss.status, +vres.employment_status, +vres.v_employment_status_id, +concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id, +bot_activ.validos +from +students st +left join usr_user uu on +st.user_id = uu.usr_id +left join employment_status es on +st.employment_status_id = es.id +left join student_status ss on +st.student_status_id = ss.id +left join v_recent_employment_status vres on +st.id = vres.student_id +left join student_bootcamp sb on +sb.student_id = st.id +left join ( +select +count(*) validos , +sb.student_id +from +student_bootcamp sb +join bootcamps b on +b.id = sb.bootcamp_id +where +b.end_date >= current_date +group by +sb.student_id +)bot_activ on +st.id = bot_activ.student_id +group by +st.id, +ss.status, +vres.employment_status, +vres.v_employment_status_id, +uu.usr_id, +bot_activ.student_id, +bot_activ.validos; \ No newline at end of file From 04525aa02bc91801907266e284497f0359c2e444 Mon Sep 17 00:00:00 2001 From: marcospaab Date: Wed, 11 Dec 2024 10:58:38 +0000 Subject: [PATCH 13/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 8bc809222..7ff5f8428 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: deva2a7ee5 + version: dev20f63de imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From e886d208b21beba06ba12828edfc4258ed76548a Mon Sep 17 00:00:00 2001 From: rosema2012 Date: Tue, 10 Dec 2024 12:49:46 +0000 Subject: [PATCH 14/36] Cambiado traductor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cambiado Media Pantalla Datos Principales Cambiado GitHub a Accesos bug solucionado Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml Bfs42024 281 (#194) * bug solucionado * Añadidos textos a los errores --------- Co-authored-by: eluiui Co-authored-by: hiraryw64 --- .../students-detail.component.css | 26 +++++++--- .../students-detail.component.html | 51 ++++++++----------- .../src/main/ngx/src/assets/i18n/en.json | 3 +- .../src/main/ngx/src/assets/i18n/es.json | 3 +- 4 files changed, 43 insertions(+), 40 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.css index 61b5c0e22..88323aa30 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.css @@ -3,7 +3,14 @@ font-family: 'Roboto', sans-serif; box-sizing: border-box; } - + +.grid-container{ +height: 93%;} +.tabPrincipales{ + height: auto; + overflow:hidden; + scrollbar-width: 0px; +} .grid-container, .table_container { width: 96%; @@ -31,6 +38,7 @@ background-color: #f5f0f2; border-radius: 15px; padding: 30px; gap: 15px; + } p { @@ -54,7 +62,7 @@ padding-right: 20px .fct-container { display: grid; -grid-template-columns: 2fr 1fr; +grid-template-columns: 2fr; grid-template-rows: auto auto; width: 96%; margin: 5px auto; @@ -205,7 +213,7 @@ grid-template-columns: 2.5fr 0.5fr; .contacto{ grid-column: 1/2; grid-row: 2/3; - height: 100%; + height: 86.5%; } .contacto fieldset{ @@ -221,6 +229,7 @@ display: grid; grid-template-columns: 1fr; gap: 20px; width: 95%; +height: auto; } .datos { grid-column: 1 / 2; @@ -261,7 +270,13 @@ grid-column: 1 / 3; grid-column: 2/3; grid-row: 1; } +.usuario{ + margin-top: 0px; +} +.contacto{ + height: 100%; +} .fct-container { display: flex; flex-wrap: wrap; @@ -275,10 +290,7 @@ grid-column: 1 / 3; gap: 20px; } -.fct_school, -.fct_tutor, -.fct_start, -.fct_end { +.fct { flex: 1 1 45%; min-width: 300px; } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html index 7e20fa9ad..6f07cb4f0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html @@ -36,17 +36,7 @@
-
-
- - -
-
-
- -
-
-
+
-
+
@@ -111,7 +112,7 @@
-
+
@@ -218,26 +219,26 @@

{{ 'Historial_Laboral' | oTranslate }}

{{"FCT Information"|oTranslate}} -
+
-
+
-
+
-
+
@@ -245,18 +246,6 @@

{{ 'Historial_Laboral' | oTranslate }}

-
- {{'OtherInformation'|oTranslate}} -
- - -
-
-
- -
-
-
@@ -284,4 +273,4 @@

{{ 'Historial_Laboral' | oTranslate }}

- \ No newline at end of file + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json index 26883d83a..ef01446b4 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json @@ -300,5 +300,6 @@ "Download" : "Download", "Save": "Save", "TUTOR_HAS_BOOTCAMPS":"The mentor has assigned bootcamps and cannot be deleted", - "nota":"Notes" + "nota":"Notes", + "Acceso":"Access" } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index 8cb923560..e430cec08 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -298,5 +298,6 @@ "DUPLICATED_USRLOGIN_NAME": "El nombre de usuario ya existe", "Download" : "Descargar", "Save": "Guardar", - "nota":"Notas" + "nota":"Notas", + "Acceso":"Accesos" } From a6b74ffd7d2479271f17c2faf9ffd9c87ff653c7 Mon Sep 17 00:00:00 2001 From: marcospaab Date: Wed, 11 Dec 2024 12:44:08 +0000 Subject: [PATCH 15/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 7ff5f8428..7070fb012 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: dev20f63de + version: devd17fe6c imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From 771ca8642366882d07966fbac48073391dd47a86 Mon Sep 17 00:00:00 2001 From: Gabriel Alonso Varela Date: Tue, 3 Dec 2024 12:29:24 +0100 Subject: [PATCH 16/36] Commercial Section --- .../api/core/service/IBootcampService.java | 2 + .../api/core/service/IStudentService.java | 3 + .../commercial/commercial-routing.module.ts | 15 ++++ .../commercial-section.component.css | 81 +++++++++++++++++++ .../commercial-section.component.html | 54 +++++++++++++ .../commercial-section.component.spec.ts | 23 ++++++ .../commercial-section.component.ts | 71 ++++++++++++++++ .../app/main/commercial/commercial.module.ts | 23 ++++++ .../app/main/commercial/commercialstatus.ts | 7 ++ .../ngx/src/app/main/main-routing.module.ts | 2 +- .../ngx/src/app/shared/app.menu.config.ts | 1 + .../src/main/ngx/src/assets/i18n/en.json | 6 +- .../src/main/ngx/src/assets/i18n/es.json | 6 +- .../model/core/dao/StudentDao.java | 2 +- .../model/core/service/BootcampService.java | 17 ++++ .../model/core/service/StudentService.java | 10 +++ .../src/main/resources/dao/BootcampDao.xml | 12 +++ .../src/main/resources/dao/StudentDao.xml | 38 +++++++++ .../migration/V30__pending_bootcamps_view.sql | 61 ++++++++++++++ 19 files changed, 430 insertions(+), 4 deletions(-) create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.spec.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial.module.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercialstatus.ts create mode 100644 cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql diff --git a/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IBootcampService.java b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IBootcampService.java index 5857cf5b8..5c61cfab4 100644 --- a/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IBootcampService.java +++ b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IBootcampService.java @@ -22,4 +22,6 @@ public interface IBootcampService { AdvancedEntityResult bootcampPaginationQuery(final Map keyMap, final List attrList, final int recordNumber, final int startIndex, final List orderBy) throws OntimizeJEERuntimeException; EntityResult bootcampDateQuery(Map keyMap, List attrList) throws OntimizeJEERuntimeException; + + EntityResult futureBootcampQuery(Map keyMap, List attrList) throws OntimizeJEERuntimeException; } diff --git a/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IStudentService.java b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IStudentService.java index f98a1785a..fff930479 100644 --- a/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IStudentService.java +++ b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/IStudentService.java @@ -19,4 +19,7 @@ public interface IStudentService { AdvancedEntityResult studentPaginationQuery(final Map keyMap, final List attrList, final int recordNumber, final int startIndex, final List orderBy) throws OntimizeJEERuntimeException; + EntityResult commercialStudentQuery(Map keysMap, List attributes) throws OntimizeJEERuntimeException; + + AdvancedEntityResult commercialStudentPaginationQuery(Map keyMap, List attrList, int recordNumber, int startIndex, List orderBy) throws OntimizeJEERuntimeException; } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts new file mode 100644 index 000000000..f1c6dc415 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts @@ -0,0 +1,15 @@ +import { NgModule } from '@angular/core'; +import { RouterModule, Routes } from '@angular/router'; +import { CommercialSectionComponent } from './commercial-section/commercial-section.component'; +import { StudentsDetailComponent } from '../students/students-detail/students-detail.component'; + +const routes: Routes = [ + { path:'', pathMatch:'full', component: CommercialSectionComponent}, +]; + + +@NgModule({ + imports: [RouterModule.forChild(routes)], + exports: [RouterModule] +}) +export class CommercialRoutingModule { } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css new file mode 100644 index 000000000..7a2f0b73a --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css @@ -0,0 +1,81 @@ +.general_table { + width: 90%; + margin: 20px auto; + background-color: #f5f0f2; + padding: 20px; + border-radius: 15px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + font-family: 'Roboto', sans-serif; + } + + .table_container { + width: 90%; + overflow-x: hidden; + margin: 0 auto; + padding: 0 10px; + } + + .table_row { + max-height: 32px; + overflow: hidden; + } + + .table_cell { + padding: 6px; + } + + .commercial-filters-form { + width: 68%; + margin: 20px auto; + background-color: #1a3459; + padding: 10px; + border-radius: 10px; + font-family: 'Roboto', sans-serif; + box-sizing: border-box; + + + } + + + .filter_style { + display: grid; + grid-template-columns: 1.5fr 1.5fr 1.5fr 1fr; + gap: 15px; + background-color: #f5f0f2; + padding: 25px 30px 3px 30px; + border-radius: 15px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + width: 93%; + margin: 5px auto; + box-sizing: border-box; + + } + + .filter_style o-text-input, + .filter_style o-combo { + min-width: 100%; + width: 70%; + } + + .label_toggle { + color: #1a3459; + font-size: 16px; + font-weight: bold; + padding: 0 10px; + } + + .slide-container { + width: 40%; + margin: auto; + background-color: #f5f0f2; + border-radius: 15px; + display: flex; + justify-content: center; + } + + /* .centered-actions { + grid-column: 1 / -1; + justify-content: center; + margin-top: 10px; + } */ + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html new file mode 100644 index 000000000..bf041c24d --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html @@ -0,0 +1,54 @@ + + +
+ + +
+ + + + + + + + +
+ + +
+
+ + + +
+ +
+

{{ 'LCONTACTEDSTUDENTS' | oTranslate }}

+ + + + + + + + + +
+
+
+
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.spec.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.spec.ts new file mode 100644 index 000000000..9ae11055d --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { CommercialSectionComponent } from './commercial-section.component'; + +describe('CommercialSectionComponent', () => { + let component: CommercialSectionComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ CommercialSectionComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(CommercialSectionComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts new file mode 100644 index 000000000..c61561cf8 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts @@ -0,0 +1,71 @@ +import { Component, ViewChild } from '@angular/core'; +import { FilterExpressionUtils, Expression, OFormComponent, OTableComponent } from 'ontimize-web-ngx'; +import { ActivatedRoute, Router } from '@angular/router'; +import commercialStatus from '../commercialstatus'; + +@Component({ + selector: 'app-commercial-section', + templateUrl: './commercial-section.component.html', + styleUrls: ['./commercial-section.component.css'] +}) +export class CommercialSectionComponent { + + + @ViewChild('tableStudents') tableComponent: OTableComponent; + form!: OFormComponent; + dataArray = commercialStatus.map(status => ({ key: status, value: status })); + detailId !: Number; + + + + constructor(private route: ActivatedRoute, private router: Router) { } + + + goToDetail(event: any) { + const studentId = event.row.id + + if (studentId) { + console.log("ID del estudiante:", studentId); + this.router.navigate([`/main/students/${studentId}`]); + } else { + console.error("No se encontró el ID del estudiante."); + } + } + + // Método para construir el filtro (sin cambios) + createFilter(values: Array<{ attr: string, value: any }>): Expression | null { + const filters: Array = values + .filter(fil => fil.value != null && fil.value.toString().trim() !== '') // Filtra valores no nulos ni vacíos + .map(fil => { + var filterValue = fil.value; + + if (!Array.isArray(filterValue)) { + filterValue = filterValue.toString().trim(); + } + + switch (fil.attr) { + case 'bootcamps_id': + return FilterExpressionUtils.buildExpressionLike(fil.attr,"|"+filterValue+"|"); + case 'student_status_id': + return FilterExpressionUtils.buildExpressionEquals(fil.attr, filterValue); + case 'status': + if (Array.isArray(filterValue)) { + return FilterExpressionUtils.buildExpressionIn(fil.attr, filterValue); + } + return FilterExpressionUtils.buildExpressionEquals(fil.attr, filterValue); + case 'id': + return FilterExpressionUtils.buildExpressionEquals(fil.attr, filterValue); + default: + return null; + } + }) + .filter((expr): expr is Expression => expr !== null); // Elimina posibles nulos del mapeo + + // Si hay filtros, combina usando AND, si no devuelve null. + return filters.length > 0 + ? filters.reduce((exp1, exp2) => + FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_AND) + ) + : null; + } +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial.module.ts new file mode 100644 index 000000000..a2fb003ce --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial.module.ts @@ -0,0 +1,23 @@ +import { NgModule } from '@angular/core'; +import { CommonModule } from '@angular/common'; + +import { CommercialRoutingModule } from './commercial-routing.module'; +import { CommercialSectionComponent } from './commercial-section/commercial-section.component'; +import { RouterOutlet } from '@angular/router'; +import { MatIconModule } from '@angular/material/icon'; +import { OntimizeWebModule } from 'ontimize-web-ngx'; + + +@NgModule({ + declarations: [ + CommercialSectionComponent + ], + imports: [ + CommonModule, + CommercialRoutingModule, + RouterOutlet, + MatIconModule, + OntimizeWebModule, + ] +}) +export class CommercialModule { } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercialstatus.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercialstatus.ts new file mode 100644 index 000000000..b87c233b9 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercialstatus.ts @@ -0,0 +1,7 @@ +const commercialStatus: string[] = [ + "Interesado", + "Inactivo", + "Inscrito" +]; + +export default commercialStatus; \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/main-routing.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/main-routing.module.ts index 85502ae68..48a0bf575 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/main-routing.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/main-routing.module.ts @@ -21,8 +21,8 @@ export const routes: Routes = [ { path: 'students', loadChildren: () => import('./students/students.module').then(m => m.StudentsModule), data: {oPermission: {permissionId: 'students-permission', restrictedPermissionsRedirect: '/main/home'}} }, { path: 'tutors', loadChildren: () => import('./tutors/tutors.module').then(m => m.TutorsModule), data: {oPermission: {permissionId: 'tutor-permission', restrictedPermissionsRedirect: '/main/home'}}}, { path: 'data', loadChildren: () => import('./data/data.module').then(m => m.DataModule), data: {oPermission: {permissionId: 'data-permission', restrictedPermissionsRedirect: '/main/home'}}}, + { path: 'commercial', loadChildren: () => import('./commercial/commercial.module').then(m => m.CommercialModule), data: {oPermission: {permissionId: 'commercial-permission', restrictedPermissionsRedirect: '/main/home'}}}, { path: 'config', loadChildren: () => import('./config/config.module').then(m => m.ConfigModule), data: {oPermission: {permissionId: 'config-permission', restrictedPermissionsRedirect: '/main/home'}}} - ] } ]; diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/shared/app.menu.config.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/shared/app.menu.config.ts index 3e332ffab..40e52463a 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/shared/app.menu.config.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/shared/app.menu.config.ts @@ -12,6 +12,7 @@ export const MENU_CONFIG: MenuRootItem[] = [ }, { id: 'students', name: 'Students', route: '/main/students', icon: 'groups' }, { id: 'tutors', name: 'Mentors', route: '/main/tutors', icon: 'work' }, + { id: 'commercialsection', name: 'Commercial Section', route:'/main/commercial', icon:'call'}, { id: 'personalinfo', name: 'Mis Datos', route:'/main/data/student', icon:'article'}, { id: 'personaltutorinfo', name: 'Mis Datos', route:'/main/data/tutor', icon:'article'}, {id: 'config', name: 'Config', route: '/main/config', icon: 'tune' }, diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json index ef01446b4..d5de75801 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json @@ -301,5 +301,9 @@ "Save": "Save", "TUTOR_HAS_BOOTCAMPS":"The mentor has assigned bootcamps and cannot be deleted", "nota":"Notes", - "Acceso":"Access" + "Acceso":"Access", + "nota":"Notes", + "LCONTACTSTATUS": "Contact status", + "LCONTACTEDSTUDENTS": "Contacted students", + "Commercial Section": "Commercial Section" } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index e430cec08..95e0009cb 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -299,5 +299,9 @@ "Download" : "Descargar", "Save": "Guardar", "nota":"Notas", - "Acceso":"Accesos" + "Acceso":"Accesos", + "nota":"Notas", + "LCONTACTSTATUS": "Estado del Contacto", + "LCONTACTEDSTUDENTS": "Estudiantes contactados", + "Commercial Section": "Sección comercial" } diff --git a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/dao/StudentDao.java b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/dao/StudentDao.java index f5c738e70..8a6ae2aa3 100644 --- a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/dao/StudentDao.java +++ b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/dao/StudentDao.java @@ -31,7 +31,7 @@ public class StudentDao extends OntimizeJdbcDaoSupport { public static final String STATUS = "status"; public static final String SPAIN_COMUNITY = "spain_comunity"; public static final String LOCATION = "location"; - public static final String USER_ID = "user_id"; + public static final String USER_ID = "user_id"; public static final String EMPLOYMENT_STATUS_ID = "employment_status_id"; public static final String STUDENT_STATUS_ID = "student_status_id"; } \ No newline at end of file diff --git a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/BootcampService.java b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/BootcampService.java index f12599818..390a7b010 100644 --- a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/BootcampService.java +++ b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/BootcampService.java @@ -158,6 +158,23 @@ public EntityResult bootcampDateQuery(Map keyMap, List a return this.daoHelper.query(this.bootcampDao, queryFilter, attrList); } + @Override + public EntityResult futureBootcampQuery(Map keyMap, List attrList) throws OntimizeJEERuntimeException { + + SQLStatementBuilder.BasicField startDateField = new SQLStatementBuilder.BasicField(BootcampDao.ATTR_START_DATE); + SQLStatementBuilder.BasicField currentDate = new SQLStatementBuilder.BasicField("CURRENT_DATE"); + + // Crear la condición para obtener los bootcamps cuyo start_date sea posterior a la fecha actual + SQLStatementBuilder.BasicExpression startDateCondition = new SQLStatementBuilder.BasicExpression( + startDateField, SQLStatementBuilder.BasicOperator.MORE_OP, currentDate); + + Map queryFilter = new HashMap<>(); + queryFilter.put(SQLStatementBuilder.ExtendedSQLConditionValuesProcessor.EXPRESSION_KEY, startDateCondition); + + // Ejecutar la consulta con la condición aplicada (en este caso usando el alias "futureBootcamps") + return this.daoHelper.query(this.bootcampDao, queryFilter, attrList, "futureBootcamps"); + } + } diff --git a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java index d8d74adb0..95343255f 100644 --- a/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java +++ b/cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentService.java @@ -317,4 +317,14 @@ private EntityResult createErrorResult(String message) { public AdvancedEntityResult studentPaginationQuery(final Map keyMap, final List attrList, final int recordNumber, final int startIndex, final List orderBy) throws OntimizeJEERuntimeException { return this.daoHelper.paginationQuery(this.studentDao, keyMap, attrList, recordNumber, startIndex, orderBy); } + + @Override + public EntityResult commercialStudentQuery(Map keysMap, List attributes) throws OntimizeJEERuntimeException { + return this.daoHelper.query(this.studentDao, keysMap, attributes, "commercialStudent"); + } + + @Override + public AdvancedEntityResult commercialStudentPaginationQuery(final Map keyMap, final List attrList, final int recordNumber, final int startIndex, final List orderBy) throws OntimizeJEERuntimeException { + return this.daoHelper.paginationQuery(this.studentDao, keyMap, attrList, recordNumber, startIndex, orderBy, "commercialStudent"); + } } diff --git a/cd2024bfs4g1-model/src/main/resources/dao/BootcampDao.xml b/cd2024bfs4g1-model/src/main/resources/dao/BootcampDao.xml index ad646fe2e..74e15d5d2 100644 --- a/cd2024bfs4g1-model/src/main/resources/dao/BootcampDao.xml +++ b/cd2024bfs4g1-model/src/main/resources/dao/BootcampDao.xml @@ -25,5 +25,17 @@ ]]> + + + + + \ No newline at end of file diff --git a/cd2024bfs4g1-model/src/main/resources/dao/StudentDao.xml b/cd2024bfs4g1-model/src/main/resources/dao/StudentDao.xml index 24e072ee6..8f52b5caa 100644 --- a/cd2024bfs4g1-model/src/main/resources/dao/StudentDao.xml +++ b/cd2024bfs4g1-model/src/main/resources/dao/StudentDao.xml @@ -25,6 +25,44 @@ ]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql new file mode 100644 index 000000000..a15f5b9a4 --- /dev/null +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql @@ -0,0 +1,61 @@ +CREATE OR REPLACE VIEW public.v_commercial_students +AS WITH estados AS ( + SELECT s_1.id AS student_id, + 'Interesado'::text AS status + FROM students s_1 + LEFT JOIN student_bootcamp sb ON s_1.id = sb.student_id + WHERE sb.bootcamp_id IS NULL + UNION + SELECT s_1.id AS student_id, + 'Inactivo'::text AS status + FROM students s_1 + JOIN student_bootcamp sb ON s_1.id = sb.student_id + JOIN bootcamps b ON sb.bootcamp_id = b.id + WHERE b.end_date IS NOT NULL AND b.end_date < CURRENT_DATE AND NOT (EXISTS ( SELECT 1 + FROM bootcamps b2 + JOIN student_bootcamp sb2 ON b2.id = sb2.bootcamp_id + WHERE sb2.student_id = s_1.id AND b2.start_date <= CURRENT_DATE AND (b2.end_date IS NULL OR b2.end_date >= CURRENT_DATE))) + UNION + SELECT s_1.id AS student_id, + 'Inscrito'::text AS status + FROM students s_1 + JOIN student_bootcamp sb ON s_1.id = sb.student_id + JOIN bootcamps b ON sb.bootcamp_id = b.id + WHERE b.start_date > CURRENT_DATE AND NOT (EXISTS ( SELECT 1 + FROM bootcamps b2 + JOIN student_bootcamp sb2 ON b2.id = sb2.bootcamp_id + WHERE sb2.student_id = s_1.id AND b2.start_date <= CURRENT_DATE AND (b2.end_date IS NULL OR b2.end_date >= CURRENT_DATE))) + ) + SELECT DISTINCT ON (s.id) s.id, + s.name, + s.surname1, + s.personal_email, + s.dni, + s.surname2, + s.birth_date, + s.phone, + s.campus_email, + s.fct_school, + s.fct_start, + s.fct_end, + s.tutor, + s.udemy, + s.github_user, + s.notes, + s.email, + s.surnames, + s.spain_comunity, + s.location, + s.employment_status_id, + s.user_id, + s.student_status_id, + estados.status + FROM students s + JOIN estados ON s.id = estados.student_id + ORDER BY s.id, ( + CASE + WHEN estados.status = 'Interesado'::text THEN 1 + WHEN estados.status = 'Inscrito'::text THEN 2 + WHEN estados.status = 'Inactivo'::text THEN 3 + ELSE NULL::integer + END); \ No newline at end of file From 25bceb233f270ae08fadc52cad3e157cb58d4919 Mon Sep 17 00:00:00 2001 From: Gabriel Alonso Varela Date: Wed, 11 Dec 2024 13:11:51 +0100 Subject: [PATCH 17/36] Commercial Section Title and v30 modifications --- .../commercial-section.component.html | 2 +- .../db/migration/V30__pending_bootcamps_view.sql | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html index bf041c24d..c1b34a6e7 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.html @@ -1,4 +1,4 @@ - +
diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql index a15f5b9a4..9fb73473a 100644 --- a/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V30__pending_bootcamps_view.sql @@ -1,3 +1,14 @@ +INSERT INTO public.troutes (id, permissionid, enabled, id_rolename) VALUES(33, 'commercial-permission', true, 1); +INSERT INTO public.troutes (id, permissionid, enabled, id_rolename) VALUES(34, 'commercial-permission', true, 2); +INSERT INTO public.troutes (id, permissionid, enabled, id_rolename) VALUES(35, 'commercial-permission', false, 3); +INSERT INTO public.troutes (id, permissionid, enabled, id_rolename) VALUES(36, 'commercial-permission', false, 4); + +INSERT INTO public.tmenu (id, attr, visible, enabled, id_rolename) VALUES('31', 'commercialsection', true, true, 1); +INSERT INTO public.tmenu (id, attr, visible, enabled, id_rolename) VALUES('32', 'commercialsection', true, true, 2); +INSERT INTO public.tmenu (id, attr, visible, enabled, id_rolename) VALUES('33', 'commercialsection', false, false, 3); +INSERT INTO public.tmenu (id, attr, visible, enabled, id_rolename) VALUES('34', 'commercialsection', false, false, 4); + + CREATE OR REPLACE VIEW public.v_commercial_students AS WITH estados AS ( SELECT s_1.id AS student_id, From ebacea4ad5b8ad2ebf86b2c734676b61a888e32e Mon Sep 17 00:00:00 2001 From: Gabriel Alonso Varela Date: Wed, 11 Dec 2024 13:49:00 +0100 Subject: [PATCH 18/36] Students detail New button deleted --- .../students/students-detail/students-detail.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html index 6f07cb4f0..630af2490 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-detail/students-detail.component.html @@ -1,4 +1,4 @@ -
Date: Wed, 11 Dec 2024 13:56:18 +0100 Subject: [PATCH 19/36] Comments Deleted --- .../src/app/main/commercial/commercial-routing.module.ts | 1 - .../commercial-section/commercial-section.component.css | 6 ------ .../commercial-section/commercial-section.component.ts | 7 +++---- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts index f1c6dc415..6f4ebc90e 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-routing.module.ts @@ -1,7 +1,6 @@ import { NgModule } from '@angular/core'; import { RouterModule, Routes } from '@angular/router'; import { CommercialSectionComponent } from './commercial-section/commercial-section.component'; -import { StudentsDetailComponent } from '../students/students-detail/students-detail.component'; const routes: Routes = [ { path:'', pathMatch:'full', component: CommercialSectionComponent}, diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css index 7a2f0b73a..c82a0b875 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css @@ -73,9 +73,3 @@ justify-content: center; } - /* .centered-actions { - grid-column: 1 / -1; - justify-content: center; - margin-top: 10px; - } */ - diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts index c61561cf8..25c5e417d 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.ts @@ -32,10 +32,10 @@ export class CommercialSectionComponent { } } - // Método para construir el filtro (sin cambios) + createFilter(values: Array<{ attr: string, value: any }>): Expression | null { const filters: Array = values - .filter(fil => fil.value != null && fil.value.toString().trim() !== '') // Filtra valores no nulos ni vacíos + .filter(fil => fil.value != null && fil.value.toString().trim() !== '') .map(fil => { var filterValue = fil.value; @@ -59,9 +59,8 @@ export class CommercialSectionComponent { return null; } }) - .filter((expr): expr is Expression => expr !== null); // Elimina posibles nulos del mapeo + .filter((expr): expr is Expression => expr !== null); - // Si hay filtros, combina usando AND, si no devuelve null. return filters.length > 0 ? filters.reduce((exp1, exp2) => FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_AND) From af7fc96204c32e01183beed2f243e1f967550134 Mon Sep 17 00:00:00 2001 From: marcospaab Date: Wed, 11 Dec 2024 12:59:39 +0000 Subject: [PATCH 20/36] Version updated Files changed: M charts/cd2024bfs4g1/values-dev.yaml --- charts/cd2024bfs4g1/values-dev.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cd2024bfs4g1/values-dev.yaml b/charts/cd2024bfs4g1/values-dev.yaml index 7070fb012..3c01c8500 100644 --- a/charts/cd2024bfs4g1/values-dev.yaml +++ b/charts/cd2024bfs4g1/values-dev.yaml @@ -6,7 +6,7 @@ image: pullPolicy: IfNotPresent ## provided as basic setup. replace as needed repository: ghcr.io/campusdual/cd2024bfs4g1 - version: devd17fe6c + version: devb3c8ba4 imagePullSecrets: - name: "github-ecr-cred" nameOverride: "" From 60597f6bb711482bdd54a973b581e120f9fd25ae Mon Sep 17 00:00:00 2001 From: eluiui Date: Wed, 11 Dec 2024 14:12:16 +0100 Subject: [PATCH 21/36] solo queda css --- .../students-table.component.html | 90 +++++++++-------- .../students-table.component.ts | 22 ++++- .../src/main/ngx/src/assets/i18n/en.json | 3 +- .../src/main/ngx/src/assets/i18n/es.json | 3 +- ...e_view_students_with_bootcamps_validos.sql | 97 +++++++++++-------- 5 files changed, 124 insertions(+), 91 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index e01339a19..0554a9e32 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -1,76 +1,82 @@ - +
-
- + service="tutors" entity="tutor" keys="id" columns="id;name;surname1;surname2" value-column="id" + query-on-init="true" visible-columns="name;surname1;surname2" translate="yes" + null-selection="true" sort="ASC"> + - - + + - + - + -
- -
+
+ + + +
-
+
+ [expression-builder]="createFilter.bind(this)">

{{ 'Students' | oTranslate }}

- - - - - - - - - - - - - - + visible-columns="usr_photo;name;surname1;surname2;dni;personal_email;phone;validos;bootcamps_id" + delete-button="false" pageable="true" show-report-on-demand-option="false" + show-charts-on-demand-option="false" (onDataLoaded)="goToDetail()"> + + + + + + + + + + + + +
- + \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts index be93d3426..a8d87253d 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts @@ -2,6 +2,7 @@ import { Component, ViewChild } from '@angular/core'; import { FilterExpressionUtils, Expression, OFormComponent, OFormLayoutManagerComponent, OTableComponent } from 'ontimize-web-ngx'; import spainComunitys from 'src/app/main/students/spaincomunitys'; import { ActivatedRoute, Router } from '@angular/router'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; @Component({ selector: 'app-students-table', @@ -22,6 +23,7 @@ export class StudentsTableComponent { constructor(private route: ActivatedRoute, private router: Router) { } ngOnInit() { + this.route.queryParams.subscribe(params => { const tab = params['tab']; const studentId = params['studentId']; @@ -60,22 +62,29 @@ export class StudentsTableComponent { } } - // Método para construir el filtro (sin cambios) + checked: boolean = true; + + toggleFinished(event: MatSlideToggleChange): void { + this.checked = event.checked; + this.tableComponent.refresh(); + } + createFilter(values: Array<{ attr: string, value: any }>): Expression { let filters: Array = []; - + const isCheck = this.checked; values.forEach(fil => { - // Convierte fil.value a una cadena, o a una cadena vacía si es null o undefined const filterValue = fil.value != null ? fil.value.toString() : ''; - if (filterValue) { // Solo agrega el filtro si filterValue no está vacío + if (filterValue) { if (fil.attr === 'id' || fil.attr === 'tutor' || fil.attr === 'udemy' || fil.attr === 'v_employment_status_id' || fil.attr === 'student_status_id' || fil.attr === 'spain_comunity') { filters.push(FilterExpressionUtils.buildExpressionEquals(fil.attr, filterValue)); } if (fil.attr === 'bootcamps_id') { - filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr,"|"+filterValue+"|")); + filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr, "|" + filterValue + "|")); } + } + if (isCheck === true) { filters.push(FilterExpressionUtils.buildExpressionMoreEqual("validos", 1)); } }); @@ -89,3 +98,6 @@ export class StudentsTableComponent { } } } + + + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json index cd1149dae..e1e5946c7 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json @@ -297,5 +297,6 @@ "DUPLICATED_USRLOGIN_NAME":"Username already exists", "Download" : "Download", "Save": "Save", - "TUTOR_HAS_BOOTCAMPS":"The mentor has assigned bootcamps and cannot be deleted" + "TUTOR_HAS_BOOTCAMPS":"The mentor has assigned bootcamps and cannot be deleted", + "ActiveStudents":"Show only active students" } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index 1231515a6..16d5d11aa 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -294,5 +294,6 @@ "date_change":"Fecha del cambio", "DUPLICATED_USRLOGIN_NAME": "El nombre de usuario ya existe", "Download" : "Descargar", - "Save": "Guardar" + "Save": "Guardar", + "ActiveStudents":"Mostrar solo estudiantes activos" } diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql index a5f03687f..7e12ba2d8 100644 --- a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql @@ -1,45 +1,58 @@ drop view v_students_with_bootcamps; create or replace view v_students_with_bootcamps as -select -st.*, -uu.*, -ss.status, -vres.employment_status, -vres.v_employment_status_id, -concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id, -bot_activ.validos -from -students st -left join usr_user uu on -st.user_id = uu.usr_id -left join employment_status es on -st.employment_status_id = es.id -left join student_status ss on -st.student_status_id = ss.id -left join v_recent_employment_status vres on -st.id = vres.student_id -left join student_bootcamp sb on -sb.student_id = st.id -left join ( -select -count(*) validos , -sb.student_id -from -student_bootcamp sb -join bootcamps b on -b.id = sb.bootcamp_id -where -b.end_date >= current_date -group by -sb.student_id -)bot_activ on -st.id = bot_activ.student_id -group by -st.id, -ss.status, -vres.employment_status, -vres.v_employment_status_id, -uu.usr_id, -bot_activ.student_id, -bot_activ.validos; \ No newline at end of file +select st.*,uu.*,ss.status,vres.employment_status,vres.v_employment_status_id,concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id,bot_activ.validos +from students st +left join usr_user uu on st.user_id = uu.usr_id +left join employment_status es on st.employment_status_id = es.id +left join student_status ss on st.student_status_id = ss.id +left join v_recent_employment_status vres on st.id = vres.student_id +left join student_bootcamp sb on sb.student_id = st.id +left join (select count(*) validos , sb.student_id + from student_bootcamp sb + join bootcamps b on b.id = sb.bootcamp_id where b.end_date >= current_date + group by sb.student_id)bot_activ on st.id = bot_activ.student_id +group by st.id, ss.status,vres.employment_status,vres.v_employment_status_id,uu.usr_id,bot_activ.student_id,bot_activ.validos +order by st.name collate "es-ES-x-icu"; + +drop view bootcamp_status; + +CREATE OR REPLACE VIEW public.bootcamp_status +AS SELECT bootcamps.id,bootcamps.name,bootcamps.start_date,bootcamps.end_date,bootcamps.description,bootcamps.notes,bootcamps.codigo,bootcamps.op, + CASE + WHEN CURRENT_DATE > bootcamps.end_date THEN 'Finished'::text + WHEN CURRENT_DATE < bootcamps.start_date THEN 'Pending'::text + ELSE 'Started'::text + END AS status + FROM bootcamps + order by name collate "es-ES-x-icu"; + +drop view pending_bootcamps; + +CREATE OR REPLACE VIEW public.pending_bootcamps + AS SELECT bootcamp_status.id,bootcamp_status.name,bootcamp_status.start_date,bootcamp_status.end_date,bootcamp_status.description,bootcamp_status.notes,bootcamp_status.codigo,bootcamp_status.op,bootcamp_status.status + FROM bootcamp_status + WHERE bootcamp_status.status = 'Pending'::text + order by name collate "es-ES-x-icu"; + +CREATE OR REPLACE VIEW public.bootcamp_status +AS SELECT bootcamps.id,bootcamps.name,bootcamps.start_date,bootcamps.end_date,bootcamps.description,bootcamps.notes,bootcamps.codigo,bootcamps.op, + CASE + WHEN CURRENT_DATE > bootcamps.end_date THEN 'Finished'::text + WHEN CURRENT_DATE < bootcamps.start_date THEN 'Pending'::text + ELSE 'Started'::text + END AS status + FROM bootcamps + order by name collate "es-ES-x-icu"; + +drop view sessions_status; + +CREATE OR REPLACE VIEW public.sessions_status +AS SELECT sessions.id,sessions.id_bootcamp,sessions.session_name,sessions.session_date,sessions.link,sessions.password, + CASE + WHEN sessions.session_date::date < CURRENT_DATE THEN 'Finished'::text + WHEN sessions.session_date::date = CURRENT_DATE THEN 'Started'::text + ELSE 'Pending'::text + END AS status + FROM sessions + order by session_name collate "es-ES-x-icu"; From c4d8741e78b45b0e50df5cdcac49d44faf379faa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20=C3=81lvarez=20Rodriguez?= Date: Wed, 11 Dec 2024 09:27:49 +0100 Subject: [PATCH 22/36] toggle filtro tanla estudiantes --- .../students-table/students-table.component.html | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index 5c46d0613..b7a6d49b7 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -34,7 +34,10 @@ - + +
+ +
@@ -49,14 +52,14 @@

{{ 'Students' | oTranslate }}

- - - - + + + From 286861b4c7cfe9b444ad0d4147bc6badada8862c Mon Sep 17 00:00:00 2001 From: eluiui Date: Wed, 11 Dec 2024 10:23:13 +0100 Subject: [PATCH 23/36] consulta chula hecha y v creado --- .../students-table.component.html | 8 ++-- .../students-table.component.ts | 1 + ...e_view_students_with_bootcamps_validos.sql | 45 +++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) create mode 100644 cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index b7a6d49b7..e01339a19 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -34,7 +34,7 @@ - +
@@ -45,7 +45,7 @@
@@ -54,8 +54,8 @@

{{ 'Students' | oTranslate }}

diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts index a6ea284b3..be93d3426 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts @@ -76,6 +76,7 @@ export class StudentsTableComponent { if (fil.attr === 'bootcamps_id') { filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr,"|"+filterValue+"|")); } + filters.push(FilterExpressionUtils.buildExpressionMoreEqual("validos", 1)); } }); diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql new file mode 100644 index 000000000..a5f03687f --- /dev/null +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql @@ -0,0 +1,45 @@ +drop view v_students_with_bootcamps; + +create or replace view v_students_with_bootcamps as +select +st.*, +uu.*, +ss.status, +vres.employment_status, +vres.v_employment_status_id, +concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id, +bot_activ.validos +from +students st +left join usr_user uu on +st.user_id = uu.usr_id +left join employment_status es on +st.employment_status_id = es.id +left join student_status ss on +st.student_status_id = ss.id +left join v_recent_employment_status vres on +st.id = vres.student_id +left join student_bootcamp sb on +sb.student_id = st.id +left join ( +select +count(*) validos , +sb.student_id +from +student_bootcamp sb +join bootcamps b on +b.id = sb.bootcamp_id +where +b.end_date >= current_date +group by +sb.student_id +)bot_activ on +st.id = bot_activ.student_id +group by +st.id, +ss.status, +vres.employment_status, +vres.v_employment_status_id, +uu.usr_id, +bot_activ.student_id, +bot_activ.validos; \ No newline at end of file From f4e9b59546e27576e04eabc959f51df57e3d1677 Mon Sep 17 00:00:00 2001 From: eluiui Date: Wed, 11 Dec 2024 14:12:16 +0100 Subject: [PATCH 24/36] solo queda css --- .../students-table.component.html | 90 +++++++++-------- .../students-table.component.ts | 22 ++++- .../src/main/ngx/src/assets/i18n/en.json | 2 +- .../src/main/ngx/src/assets/i18n/es.json | 4 +- ...e_view_students_with_bootcamps_validos.sql | 97 +++++++++++-------- 5 files changed, 123 insertions(+), 92 deletions(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index e01339a19..0554a9e32 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -1,76 +1,82 @@ - +
-
- + service="tutors" entity="tutor" keys="id" columns="id;name;surname1;surname2" value-column="id" + query-on-init="true" visible-columns="name;surname1;surname2" translate="yes" + null-selection="true" sort="ASC"> + - - + + - + - + -
- -
+
+ + + +
-
+
+ [expression-builder]="createFilter.bind(this)">

{{ 'Students' | oTranslate }}

- - - - - - - - - - - - - - + visible-columns="usr_photo;name;surname1;surname2;dni;personal_email;phone;validos;bootcamps_id" + delete-button="false" pageable="true" show-report-on-demand-option="false" + show-charts-on-demand-option="false" (onDataLoaded)="goToDetail()"> + + + + + + + + + + + + +
- + \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts index be93d3426..a8d87253d 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.ts @@ -2,6 +2,7 @@ import { Component, ViewChild } from '@angular/core'; import { FilterExpressionUtils, Expression, OFormComponent, OFormLayoutManagerComponent, OTableComponent } from 'ontimize-web-ngx'; import spainComunitys from 'src/app/main/students/spaincomunitys'; import { ActivatedRoute, Router } from '@angular/router'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; @Component({ selector: 'app-students-table', @@ -22,6 +23,7 @@ export class StudentsTableComponent { constructor(private route: ActivatedRoute, private router: Router) { } ngOnInit() { + this.route.queryParams.subscribe(params => { const tab = params['tab']; const studentId = params['studentId']; @@ -60,22 +62,29 @@ export class StudentsTableComponent { } } - // Método para construir el filtro (sin cambios) + checked: boolean = true; + + toggleFinished(event: MatSlideToggleChange): void { + this.checked = event.checked; + this.tableComponent.refresh(); + } + createFilter(values: Array<{ attr: string, value: any }>): Expression { let filters: Array = []; - + const isCheck = this.checked; values.forEach(fil => { - // Convierte fil.value a una cadena, o a una cadena vacía si es null o undefined const filterValue = fil.value != null ? fil.value.toString() : ''; - if (filterValue) { // Solo agrega el filtro si filterValue no está vacío + if (filterValue) { if (fil.attr === 'id' || fil.attr === 'tutor' || fil.attr === 'udemy' || fil.attr === 'v_employment_status_id' || fil.attr === 'student_status_id' || fil.attr === 'spain_comunity') { filters.push(FilterExpressionUtils.buildExpressionEquals(fil.attr, filterValue)); } if (fil.attr === 'bootcamps_id') { - filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr,"|"+filterValue+"|")); + filters.push(FilterExpressionUtils.buildExpressionLike(fil.attr, "|" + filterValue + "|")); } + } + if (isCheck === true) { filters.push(FilterExpressionUtils.buildExpressionMoreEqual("validos", 1)); } }); @@ -89,3 +98,6 @@ export class StudentsTableComponent { } } } + + + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json index d5de75801..3d2347c0d 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json @@ -302,8 +302,8 @@ "TUTOR_HAS_BOOTCAMPS":"The mentor has assigned bootcamps and cannot be deleted", "nota":"Notes", "Acceso":"Access", - "nota":"Notes", "LCONTACTSTATUS": "Contact status", "LCONTACTEDSTUDENTS": "Contacted students", "Commercial Section": "Commercial Section" + "ActiveStudents":"Show only active students" } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json index 95e0009cb..9da02c6f0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json @@ -300,8 +300,8 @@ "Save": "Guardar", "nota":"Notas", "Acceso":"Accesos", - "nota":"Notas", "LCONTACTSTATUS": "Estado del Contacto", "LCONTACTEDSTUDENTS": "Estudiantes contactados", - "Commercial Section": "Sección comercial" + "Commercial Section": "Sección comercial", + "ActiveStudents":"Mostrar solo estudiantes activos" } diff --git a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql index a5f03687f..7e12ba2d8 100644 --- a/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql +++ b/cd2024bfs4g1-model/src/main/resources/db/migration/V33__create_view_students_with_bootcamps_validos.sql @@ -1,45 +1,58 @@ drop view v_students_with_bootcamps; create or replace view v_students_with_bootcamps as -select -st.*, -uu.*, -ss.status, -vres.employment_status, -vres.v_employment_status_id, -concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id, -bot_activ.validos -from -students st -left join usr_user uu on -st.user_id = uu.usr_id -left join employment_status es on -st.employment_status_id = es.id -left join student_status ss on -st.student_status_id = ss.id -left join v_recent_employment_status vres on -st.id = vres.student_id -left join student_bootcamp sb on -sb.student_id = st.id -left join ( -select -count(*) validos , -sb.student_id -from -student_bootcamp sb -join bootcamps b on -b.id = sb.bootcamp_id -where -b.end_date >= current_date -group by -sb.student_id -)bot_activ on -st.id = bot_activ.student_id -group by -st.id, -ss.status, -vres.employment_status, -vres.v_employment_status_id, -uu.usr_id, -bot_activ.student_id, -bot_activ.validos; \ No newline at end of file +select st.*,uu.*,ss.status,vres.employment_status,vres.v_employment_status_id,concat(concat('|', string_agg(sb.bootcamp_id::text, '|')), '|') bootcamps_id,bot_activ.validos +from students st +left join usr_user uu on st.user_id = uu.usr_id +left join employment_status es on st.employment_status_id = es.id +left join student_status ss on st.student_status_id = ss.id +left join v_recent_employment_status vres on st.id = vres.student_id +left join student_bootcamp sb on sb.student_id = st.id +left join (select count(*) validos , sb.student_id + from student_bootcamp sb + join bootcamps b on b.id = sb.bootcamp_id where b.end_date >= current_date + group by sb.student_id)bot_activ on st.id = bot_activ.student_id +group by st.id, ss.status,vres.employment_status,vres.v_employment_status_id,uu.usr_id,bot_activ.student_id,bot_activ.validos +order by st.name collate "es-ES-x-icu"; + +drop view bootcamp_status; + +CREATE OR REPLACE VIEW public.bootcamp_status +AS SELECT bootcamps.id,bootcamps.name,bootcamps.start_date,bootcamps.end_date,bootcamps.description,bootcamps.notes,bootcamps.codigo,bootcamps.op, + CASE + WHEN CURRENT_DATE > bootcamps.end_date THEN 'Finished'::text + WHEN CURRENT_DATE < bootcamps.start_date THEN 'Pending'::text + ELSE 'Started'::text + END AS status + FROM bootcamps + order by name collate "es-ES-x-icu"; + +drop view pending_bootcamps; + +CREATE OR REPLACE VIEW public.pending_bootcamps + AS SELECT bootcamp_status.id,bootcamp_status.name,bootcamp_status.start_date,bootcamp_status.end_date,bootcamp_status.description,bootcamp_status.notes,bootcamp_status.codigo,bootcamp_status.op,bootcamp_status.status + FROM bootcamp_status + WHERE bootcamp_status.status = 'Pending'::text + order by name collate "es-ES-x-icu"; + +CREATE OR REPLACE VIEW public.bootcamp_status +AS SELECT bootcamps.id,bootcamps.name,bootcamps.start_date,bootcamps.end_date,bootcamps.description,bootcamps.notes,bootcamps.codigo,bootcamps.op, + CASE + WHEN CURRENT_DATE > bootcamps.end_date THEN 'Finished'::text + WHEN CURRENT_DATE < bootcamps.start_date THEN 'Pending'::text + ELSE 'Started'::text + END AS status + FROM bootcamps + order by name collate "es-ES-x-icu"; + +drop view sessions_status; + +CREATE OR REPLACE VIEW public.sessions_status +AS SELECT sessions.id,sessions.id_bootcamp,sessions.session_name,sessions.session_date,sessions.link,sessions.password, + CASE + WHEN sessions.session_date::date < CURRENT_DATE THEN 'Finished'::text + WHEN sessions.session_date::date = CURRENT_DATE THEN 'Started'::text + ELSE 'Pending'::text + END AS status + FROM sessions + order by session_name collate "es-ES-x-icu"; From afc24350c1067e71040ff0b4336bac35bf1a357c Mon Sep 17 00:00:00 2001 From: javi2004 Date: Wed, 11 Dec 2024 15:11:34 +0100 Subject: [PATCH 25/36] columnas visibles --- .../main/students/students-table/students-table.component.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html index 0554a9e32..34b5921f0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/students/students-table/students-table.component.html @@ -59,7 +59,7 @@

{{ 'Students' | oTranslate }}

attr="studentsTable" service="students" entity="student" keys="id" columns="id;name;surname1;personal_email;surname2;dni;birth_date;phone;student_status_id;v_employment_status_id; campus_email;fct_school;fct_start;fct_end;tutor;github_user;notes;spain_comunity;location;user_id;status;usr_photo;bootcamps_id;validos;bootcamps_id" - visible-columns="usr_photo;name;surname1;surname2;dni;personal_email;phone;validos;bootcamps_id" + visible-columns="usr_photo;name;surname1;surname2;dni;personal_email;phone" delete-button="false" pageable="true" show-report-on-demand-option="false" show-charts-on-demand-option="false" (onDataLoaded)="goToDetail()"> From 29bfbeb7a45eb534a7f710c487ac74284318ebdd Mon Sep 17 00:00:00 2001 From: Fran Date: Tue, 3 Dec 2024 11:56:10 +0100 Subject: [PATCH 26/36] tarea de link finalizado en todas las vistas --- .../core/service/ISessionBootcampService.java | 20 +++ .../ngx/src/app/login/login.component.html | 3 +- .../ngx/src/app/login/login.component.scss | 25 +++ .../main/ngx/src/app/login/login.component.ts | 37 +++++ .../bootcamp-details.component.css | 41 ++++- .../bootcamp-details.component.html | 87 +++++++++- .../bootcamp-details.component.ts | 109 ++++++++++-- .../new-session-bootcamp.component.css | 0 .../new-session-bootcamp.component.html | 15 ++ .../new-session-bootcamp.component.ts | 18 ++ .../update-session-bootcamp.component.css | 0 .../update-session-bootcamp.component.html | 15 ++ .../update-session-bootcamp.component.ts | 17 ++ .../bootcamps/bootcamps-routing.module.ts | 11 +- .../app/main/bootcamps/bootcamps.module.ts | 6 +- .../src/app/main/data/data-routing.module.ts | 10 +- .../main/ngx/src/app/main/data/data.module.ts | 13 +- .../personal-info-sessions.component.css | 49 ++++++ .../personal-info-sessions.component.html | 56 +++++++ .../personal-info-sessions.component.ts | 94 +++++++++++ .../personal-info/personal-info.component.css | 37 ++++- .../personal-info.component.html | 157 ++++++++++-------- .../personal-info/personal-info.component.ts | 15 +- .../bootcamp-students-table.component.css | 49 +++++- .../bootcamp-students-table.component.html | 116 ++++++++++--- .../bootcamp-students-table.component.ts | 85 +++++++++- .../new-session-bootcamp.component.css | 0 .../new-session-bootcamp.component.html | 16 ++ .../new-session-bootcamp.component.ts | 16 ++ .../personal-tutor-info.component.html | 3 +- .../update-session-tutor.component.css | 0 .../update-session-tutor.component.html | 17 ++ .../update-session-tutor.component.ts | 17 ++ .../ngx/src/app/shared/app.services.config.ts | 5 +- .../src/main/ngx/src/assets/i18n/en.json | 6 + .../src/main/ngx/src/assets/i18n/es.json | 9 +- .../src/main/ngx/src/styles.scss | 8 + .../model/core/dao/SessionBootcampDao.java | 20 +++ .../core/service/SessionBootcampService.java | 50 ++++++ .../main/resources/dao/SessionBootcampDao.xml | 14 ++ .../V28__sessions_table_and_view.sql | 27 +++ .../rest/SessionBootcampRestController.java | 18 ++ 42 files changed, 1174 insertions(+), 137 deletions(-) create mode 100644 cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/ISessionBootcampService.java create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/new-session-bootcamp/new-session-bootcamp.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/new-session-bootcamp/new-session-bootcamp.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/new-session-bootcamp/new-session-bootcamp.component.ts create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/update-session-bootcamp/update-session-tutor.component.css create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/update-session-bootcamp/update-session-tutor.component.html create mode 100644 cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-tutor-info/update-session-bootcamp/update-session-tutor.component.ts create mode 100644 cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/dao/SessionBootcampDao.java create mode 100644 cd2024bfs4g1-model/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/SessionBootcampService.java create mode 100644 cd2024bfs4g1-model/src/main/resources/dao/SessionBootcampDao.xml create mode 100644 cd2024bfs4g1-model/src/main/resources/db/migration/V28__sessions_table_and_view.sql create mode 100644 cd2024bfs4g1-ws/src/main/java/com/campusdual/cd2024bfs4g1/ws/core/rest/SessionBootcampRestController.java diff --git a/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/ISessionBootcampService.java b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/ISessionBootcampService.java new file mode 100644 index 000000000..682a4fdec --- /dev/null +++ b/cd2024bfs4g1-api/src/main/java/com/campusdual/cd2024bfs4g1/api/core/service/ISessionBootcampService.java @@ -0,0 +1,20 @@ +package com.campusdual.cd2024bfs4g1.api.core.service; + +import com.ontimize.jee.common.db.AdvancedEntityResult; +import com.ontimize.jee.common.dto.EntityResult; +import com.ontimize.jee.common.exceptions.OntimizeJEERuntimeException; + +import java.util.List; +import java.util.Map; + +public interface ISessionBootcampService { + EntityResult sessionBootcampQuery(Map keyMap, List attributes) throws OntimizeJEERuntimeException; + + EntityResult sessionBootcampInsert(Map attrMap) throws OntimizeJEERuntimeException; + + EntityResult sessionBootcampUpdate(Map attrMap, Map keyMap) throws OntimizeJEERuntimeException; + + EntityResult sessionBootcampDelete(Map keyMap) throws OntimizeJEERuntimeException; + + AdvancedEntityResult sessionBootcampPaginationQuery(final Map keyMap, final List attrList, final int recordNumber, final int startIndex, final List orderBy) throws OntimizeJEERuntimeException; +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.html index 9beb875f3..3cac983ab 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.html @@ -1,4 +1,5 @@
+
- +
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.scss b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.scss index 817a1edc7..941539398 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.scss +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.scss @@ -173,3 +173,28 @@ } } + +.snow-container { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; +} + +.snow { + background-color: #fff; + border-radius: 50%; + position: absolute; + top: -100px; +} + +@keyframes fall { + 0% { + top: -100px; + } + 100% { + top: 100vh; + } +} \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.ts index 8668b8edf..43b8d1ca6 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/login/login.component.ts @@ -57,6 +57,10 @@ export class LoginComponent implements OnInit { } else { this.authService.clearSessionData(); } + if (this.isHolidaySeason()) { + this.createSnow(1500); // Cantidad de Nieve + } + } public login() { @@ -128,4 +132,37 @@ export class LoginComponent implements OnInit { default: break; } } + + private isHolidaySeason(): boolean {// Control de fechas de nieve + const today = new Date(); + const start = new Date(today.getFullYear(), 11, 1); + const end = new Date(today.getFullYear() + 1, 0, 6); + return today >= start && today <= end; + } + + private getRandomValue(max: number, min: number = 1): number { + return Math.floor(Math.random() * (max - min + 1)) + min; + } + + private createSnow(density: number): void { + const snowContainer = document.querySelector('.snow-container'); + + for (let i = 0; i < density; i++) { + const snowFlake = document.createElement('span'); + const horizontalPosition = `${this.getRandomValue(100)}%`; + const fallDelay = `${this.getRandomValue(10)}s`; + const fallDuration = `${this.getRandomValue(20, 5)}s`; + const flakeSize = `${this.getRandomValue(7, 1)}px`; + const flakeOpacity = Math.random().toFixed(2); + + snowFlake.classList.add('snow'); + snowFlake.style.opacity = flakeOpacity; + snowFlake.style.width = flakeSize; + snowFlake.style.height = flakeSize; + snowFlake.style.animation = `fall ${fallDuration} ${fallDelay} linear infinite`; + snowFlake.style.right = horizontalPosition; + + snowContainer?.appendChild(snowFlake); + } + } } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.css index 502208a59..b157137e0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.css @@ -253,9 +253,8 @@ h3 { .calendar-container { - align-items: flex-start; + display: contents; margin-top: 10px; - max-height: 100vh; padding-bottom: 20px; } @@ -563,6 +562,19 @@ div.notification label { .timetable_table { background-color: #f5f0f2; font-family: 'Roboto', sans-serif; + display: flex; + flex-direction: column; + width: 100%; + height: 90%; + margin: 0; + background-color: #f5f0f2; + border-radius: 15px; + padding: 20px; +} +.table_sesions{ + background-color: #f5f0f2; + font-family: 'Roboto', sans-serif; + height: auto; } o-list img { @@ -577,3 +589,28 @@ o-list img { box-shadow: none; padding-top: 20px; } + +::ng-deep o-table .highlight-today { + background-color: #89b23713; /* Color de fondo suave (un azul muy claro) */ +} + +.check-filtro{ + background-color: #F5F0F2; +} +.toggle{ + padding: 3px; + background-color: #F5F0F2; +} + +.toggle { + overflow: hidden; + display: flex; + align-items: center; +} + +.aligned-container { + display: flex; + justify-content: space-between; + padding: 25px; + background-color: #f5f0f2; +} \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html index 05033d3ab..63441ffc5 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html @@ -32,12 +32,10 @@
-
@@ -200,5 +197,89 @@

{{ 'BootcampDoc' | oTranslate }}

+ + + +
+
+ + + +
+ +
+ + {{ "Add 'Finished'" | oTranslate }} + +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+
+
+ +
+
+ + diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.ts index 13fd2782f..67940940d 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.ts @@ -3,9 +3,10 @@ import { FormControl, ValidationErrors, ValidatorFn } from '@angular/forms'; import { DateAdapter, MAT_DATE_LOCALE } from '@angular/material/core'; import { MatCalendarCellClassFunction } from '@angular/material/datepicker'; import { ActivatedRoute, Router } from '@angular/router'; -import { DialogService, OFileInputComponent, OListComponent, OTableComponent, OTextInputComponent, OValidators } from 'ontimize-web-ngx'; +import { DialogService, Expression, FilterExpressionUtils, OFileInputComponent, OListComponent, OTableComponent, OTextInputComponent, OValidators } from 'ontimize-web-ngx'; import moment from 'moment'; import { ODateInputComponent, ODateRangeInputComponent, OFormComponent, OntimizeService, OTranslateService } from 'ontimize-web-ngx'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; @Component({ selector: 'app-bootcamp-details', @@ -19,12 +20,14 @@ export class BootcampDetailsComponent { @ViewChild("documentsTable") documentsTable: OTableComponent; @ViewChild("fileinput") fileinput: OFileInputComponent; @ViewChild('studentsTable', { static: true }) studentsTable!: OTableComponent; - + @ViewChild('sessionBootcampTable', { static: true }) table: OTableComponent; + selectedStatuses: string[] = ['Started', 'Pending']; months: Date[] = []; validatorsArray: ValidatorFn[] = []; validatorsArray1: ValidatorFn[] = []; validatorsWithoutSpace: ValidatorFn[] = []; + sessionsTable: any; constructor(private router: Router, private actRoute: ActivatedRoute, @@ -57,9 +60,7 @@ export class BootcampDetailsComponent { this.router.navigate([`/main/tutors/${tutorId}`]); this.clearTableSelection(); } - // goToTutorDetail(tutor: any) { - // this.router.navigate(['/main/tutors', tutor.tutor_id]); - // } + clearTableSelection(): void { if (this.studentsTable) { this.studentsTable.clearSelection(); @@ -112,12 +113,6 @@ export class BootcampDetailsComponent { this.bootcampDetailForm.setFieldValue("end_date", endDate); } - // throwChange(enddate: ODateInputComponent) { - // enddate.getControl().updateValueAndValidity(); - // } - // throwChange2(startdate: ODateInputComponent) { - // startdate.getControl().updateValueAndValidity(); - // } @ViewChild("startdate") startDateInput: ODateInputComponent; @ViewChild("enddate") endDateInput: ODateInputComponent; @@ -131,7 +126,9 @@ export class BootcampDetailsComponent { - ngOnInit() { } + ngOnInit() { + + } protected configureBootcamps() { const conf = this.service.getDefaultServiceConfiguration('bootcamps'); @@ -229,6 +226,7 @@ export class BootcampDetailsComponent { } + showMessage = false; onUploadFiles(event) { @@ -256,16 +254,13 @@ export class BootcampDetailsComponent { showError(event: any) { console.log(event); } - // Método para manejar el evento de clic en la acción + actionClick(event) { this.configureDocuments(); - // Se realiza una consulta al servicio personalDocumentService para obtener los datos del archivo correspondiente al evento de clic. this.service.query({ id: event.id }, ['name', 'base64'], 'bootcampFilesContent').subscribe(res => { if (res.data && res.data.length) { - // Si se encuentran datos, se extrae el nombre del archivo y el contenido en base64. let filename = res.data[0].name; let base64 = res.data[0].base64; - // Se crea un enlace temporal para descargar el archivo. const src = `data:text/csv;base64,${base64}`; const link = document.createElement("a"); link.href = src; @@ -294,4 +289,86 @@ export class BootcampDetailsComponent { }); } + + openLink(event: any): void { + const link = event?.link; + + if (!link) { + this.showAlert() + return; + } + window.open(link, '_blank'); + } + + showAlert() { + if (this.dialogService) { + this.dialogService.error('Error en el link', 'El link no existe o no es válido'); + } + } + getRowClass(rowData: any): string { + const today = new Date(); + const sessionDate = new Date(rowData.session_date); + if (isNaN(sessionDate.getTime())) { + console.error('Invalid date format:', rowData.session_date); + return ''; + } + if (sessionDate.toDateString() === today.toDateString()) { + return 'highlight-today'; + } + return ''; + } + + sessionFilters: Expression | null = null; + + + onComboChange(selectedStatuses: string[]): void { + if (selectedStatuses.length === 0) { + this.sessionFilters = null; + } else { + const filter = [{ attr: 'status', value: selectedStatuses }]; + this.table.queryData(filter); + } + } + createFilter(values: Array<{ attr: string, value: any }>): Expression { + const filters: Array = []; + + values.forEach(fil => { + if (fil.value) { + if (fil.attr === 'status') { + if (Array.isArray(fil.value) && fil.value.length > 0) { + const statusFilters = fil.value.map(status => + FilterExpressionUtils.buildExpressionEquals(fil.attr, status) + ); + filters.push(statusFilters.reduce((exp1, exp2) => + FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_OR) + )); + } else { + filters.push(FilterExpressionUtils.buildExpressionEquals(fil.attr, fil.value)); + } + } + } + }); + + return filters.length > 0 + ? filters.reduce((exp1, exp2) => + FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_AND)) + : null; + } + + + + + toggleFinished(event: MatSlideToggleChange): void { + if (event.checked) { + // Si el toggle está activado, añadir 'Finished' + this.selectedStatuses = ['Started', 'Pending', 'Finished']; + } else { + // Si el toggle está desactivado, solo mantener 'Started' y 'Pending' + this.selectedStatuses = ['Started', 'Pending']; + } + } + + + + } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.html new file mode 100644 index 000000000..c2df5b556 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.html @@ -0,0 +1,15 @@ +
+ + + + + + + +
+ +
+
+
diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.ts new file mode 100644 index 000000000..9075f2553 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/new-session-bootcamp/new-session-bootcamp.component.ts @@ -0,0 +1,18 @@ +import { Component, ViewChild } from '@angular/core'; +import { OFormComponent } from 'ontimize-web-ngx'; + +@Component({ + selector: 'app-new-session-bootcamp', + templateUrl: './new-session-bootcamp.component.html', + styleUrls: ['./new-session-bootcamp.component.css'] +}) +export class NewSessionBootcampComponent { + + @ViewChild("newSessionPopup") newSessionPopup:OFormComponent; + + addNewSession(){ + this.newSessionPopup.insert(); + this.newSessionPopup.closeDetail(); + } + +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.css new file mode 100644 index 000000000..e69de29bb diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.html new file mode 100644 index 000000000..00cb04e82 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.html @@ -0,0 +1,15 @@ +
+ + + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.ts new file mode 100644 index 000000000..3e1e4ca4a --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/update-session-bootcamp/update-session-bootcamp.component.ts @@ -0,0 +1,17 @@ +import { Component, ViewChild } from '@angular/core'; +import { OFormComponent } from 'ontimize-web-ngx'; + +@Component({ + selector: 'app-update-session-bootcamp', + templateUrl: './update-session-bootcamp.component.html', + styleUrls: ['./update-session-bootcamp.component.css'] +}) +export class UpdateSessionBootcampComponent { + + @ViewChild("updateSessionPopup") updateSessionPopup:OFormComponent; + updateNewSession(){ + this.updateSessionPopup.update(); + this.updateSessionPopup.closeDetail(); + } + +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps-routing.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps-routing.module.ts index a77320984..7990e12c1 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps-routing.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps-routing.module.ts @@ -7,19 +7,26 @@ import { BootcampNewComponent } from './bootcamp-new/bootcamp-new.component'; import { StudentBootcampDetailComponent } from './bootcamp-details/student-bootcamp-detail/student-bootcamp-detail.component'; import { BootcampTimetableNewComponent } from './bootcamp-details/bootcamp-timetable-new/bootcamp-timetable-new.component'; import { TutorBootcampAddComponent } from './bootcamp-details/tutor-bootcamp-add/tutor-bootcamp-add.component'; +import { NewSessionBootcampComponent } from './bootcamp-details/new-session-bootcamp/new-session-bootcamp.component'; +import { UpdateSessionBootcampComponent } from './bootcamp-details/update-session-bootcamp/update-session-bootcamp.component'; const routes: Routes = [ - + {path:"",pathMatch:"full",component:BootcampListComponent}, {path: 'new',component: BootcampNewComponent}, {path: ':id',component: BootcampDetailsComponent}, + {path:':bootcamp_id/new_tutor', component: TutorBootcampAddComponent}, {path:':id_timetable/newTimetable', component: BootcampTimetableNewComponent}, + {path:':bootcamp_id/session/new', component: NewSessionBootcampComponent}, + {path:':bootcamp_id/session/:id', component: UpdateSessionBootcampComponent}, {path:':bootcamp_id/new', component: StudentBootcampAddComponent}, - {path:':bootcamp_id/new_tutor', component: TutorBootcampAddComponent}, {path:':bootcamp_id/:id', component: StudentBootcampDetailComponent} + + + ]; @NgModule({ diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps.module.ts index 387cf9511..48d19b3f1 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps.module.ts @@ -9,6 +9,8 @@ import { BootcampNewComponent } from './bootcamp-new/bootcamp-new.component'; import { StudentBootcampDetailComponent } from './bootcamp-details/student-bootcamp-detail/student-bootcamp-detail.component'; import { BootcampTimetableNewComponent } from './bootcamp-details/bootcamp-timetable-new/bootcamp-timetable-new.component'; import { TutorBootcampAddComponent } from './bootcamp-details/tutor-bootcamp-add/tutor-bootcamp-add.component'; +import { NewSessionBootcampComponent } from './bootcamp-details/new-session-bootcamp/new-session-bootcamp.component'; +import { UpdateSessionBootcampComponent } from './bootcamp-details/update-session-bootcamp/update-session-bootcamp.component'; @@ -20,7 +22,9 @@ import { TutorBootcampAddComponent } from './bootcamp-details/tutor-bootcamp-add BootcampNewComponent, StudentBootcampDetailComponent, BootcampTimetableNewComponent, - TutorBootcampAddComponent + TutorBootcampAddComponent, + NewSessionBootcampComponent, + UpdateSessionBootcampComponent ], imports: [ diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data-routing.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data-routing.module.ts index 85dc07ba3..aabbbb9d5 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data-routing.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data-routing.module.ts @@ -3,16 +3,22 @@ import { RouterModule, Routes } from '@angular/router'; import { PersonalInfoComponent } from './personal-info/personal-info.component' import { PersonalTutorInfoComponent } from './personal-tutor-info/personal-tutor-info.component'; import { BootcampStudentsTableComponent } from './personal-tutor-info/bootcamp-students-table/bootcamp-students-table.component'; +import { PersonalInfoSessionsComponent } from './personal-info/personal-info-sessions/personal-info-sessions.component'; +import { UpdateSessionTutorComponent } from './personal-tutor-info/update-session-bootcamp/update-session-tutor.component'; +import { NewSessionBootcampComponent } from './personal-tutor-info/new-session-bootcamp/new-session-bootcamp.component'; const routes: Routes = [ {path: 'student',component: PersonalInfoComponent}, {path: 'tutor',component: PersonalTutorInfoComponent}, {path: 'tutor/:id',component: BootcampStudentsTableComponent}, - + {path: 'student/:id',component: PersonalInfoSessionsComponent}, + {path: 'tutor/:id_bootcamp/session/new', component: NewSessionBootcampComponent}, + {path: 'tutor/:id_bootcamp/session/:id', component: UpdateSessionTutorComponent} + ]; @NgModule({ imports: [RouterModule.forChild(routes)], exports: [RouterModule] }) -export class DataRoutingModule { } \ No newline at end of file +export class DataRoutingModule { } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data.module.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data.module.ts index a9da296ab..254d54ac0 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data.module.ts +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/data.module.ts @@ -5,15 +5,18 @@ import { OntimizeWebModule } from 'ontimize-web-ngx'; import { PersonalInfoComponent } from './personal-info/personal-info.component'; import { PersonalTutorInfoComponent } from './personal-tutor-info/personal-tutor-info.component'; import { BootcampStudentsTableComponent } from './personal-tutor-info/bootcamp-students-table/bootcamp-students-table.component'; - - - +import { PersonalInfoSessionsComponent } from './personal-info/personal-info-sessions/personal-info-sessions.component'; +import { UpdateSessionTutorComponent } from './personal-tutor-info/update-session-bootcamp/update-session-tutor.component'; +import { NewSessionBootcampComponent } from './personal-tutor-info/new-session-bootcamp/new-session-bootcamp.component'; @NgModule({ declarations: [ PersonalInfoComponent, PersonalTutorInfoComponent, - BootcampStudentsTableComponent + BootcampStudentsTableComponent, + UpdateSessionTutorComponent, + PersonalInfoSessionsComponent, + NewSessionBootcampComponent ], imports: [ @@ -22,4 +25,4 @@ import { BootcampStudentsTableComponent } from './personal-tutor-info/bootcamp-s DataRoutingModule ] }) -export class DataModule { } \ No newline at end of file +export class DataModule { } diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.css new file mode 100644 index 000000000..8b3ac8aed --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.css @@ -0,0 +1,49 @@ +::ng-deep o-table , +.highlight-today { + background-color: #b2373713; /* Color de fondo suave (un azul muy claro) */ + } + +fieldset { + border-radius: 15px; + padding: 10px; + background-color: #1a3459; + border: solid 2px #7ec117; + border-radius: 15px; + margin: 10px; +} +legend{ + color: #7ec117; +} +o-form { + width: 100%; + height: 100%; + background-color: #1a3459; + } +.general_table{ + width: 98%; + background-color: #f5f0f2; + margin: 0; +} +.label{ + color: #7ec117; + font-size: 16px; + font-weight: bold; +} +.check-filtro{ + background-color: #F5F0F2; +} +.toggle{ + background-color: #1a3459; + overflow: hidden; + display: flex; + align-items: center; +} +.aligned-container { + display: flex; + justify-content: space-between; + padding: 25px; + background-color: #1a3459; +} +.label-alumnos{ + color: #8AB237; +} \ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.html new file mode 100644 index 000000000..a8e34ae45 --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.html @@ -0,0 +1,56 @@ + + +
+
+ {{ 'Sesiones' | oTranslate }} + + + + +
+

{{ 'filetitle' | oTranslate }}

+
+ + + +
+
+
+ + + + + + + + + + + + + + + + + + +
+
+
\ No newline at end of file diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.ts b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.ts new file mode 100644 index 000000000..fcf85b14f --- /dev/null +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info-sessions/personal-info-sessions.component.ts @@ -0,0 +1,94 @@ +import { Component, ViewChild } from '@angular/core'; +import { MatSlideToggleChange } from '@angular/material/slide-toggle'; +import { DialogService, Expression, FilterExpressionUtils, OTableComponent } from 'ontimize-web-ngx'; + +@Component({ + selector: 'app-personal-info-sessions', + templateUrl: './personal-info-sessions.component.html', + styleUrls: ['./personal-info-sessions.component.css'] +}) +export class PersonalInfoSessionsComponent { + + @ViewChild('sessionsTable', { static: true }) table: OTableComponent; + selectedStatuses: string[] = ['Started', 'Pending']; + constructor( + protected dialogService: DialogService + ) { + } + + openLink(event: any): void { + const link = event?.link; + + if (!link) { + this.showAlert() + return; + } + window.open(link, '_blank'); + } + + showAlert() { + if (this.dialogService) { + this.dialogService.error('Error en el link', 'El link no existe o no es válido'); + } + } + + + + getRowClass(rowData: any): string { + const today = new Date(); + const sessionDate = new Date(rowData.session_date); + if (isNaN(sessionDate.getTime())) { + console.error('Invalid date format:', rowData.session_date); + return ''; + } + if (sessionDate.toDateString() === today.toDateString()) { + return 'highlight-today'; + } + return ''; + } + + sessionFilters: Expression | null = null; + + onComboChange(selectedStatuses: string[]): void { + if (selectedStatuses.length === 0) { + this.sessionFilters = null; + } else { + const filter = [{ attr: 'status', value: selectedStatuses }]; + this.table.queryData(filter); + } + } + createFilter(values: Array<{ attr: string, value: any }>): Expression { + const filters: Array = []; + + values.forEach(fil => { + if (fil.value) { + if (fil.attr === 'status') { + if (Array.isArray(fil.value) && fil.value.length > 0) { + const statusFilters = fil.value.map(status => + FilterExpressionUtils.buildExpressionEquals(fil.attr, status) + ); + filters.push(statusFilters.reduce((exp1, exp2) => + FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_OR) + )); + } else { + filters.push(FilterExpressionUtils.buildExpressionEquals(fil.attr, fil.value)); + } + } + } + }); + + return filters.length > 0 + ? filters.reduce((exp1, exp2) => + FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_AND)) + : null; + } + + + toggleFinished(event: MatSlideToggleChange): void { + if (event.checked) { + this.selectedStatuses = ['Started', 'Pending', 'Finished']; + } else { + this.selectedStatuses = ['Started', 'Pending']; + } + } +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css index c90dd02a0..45b45414b 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.css @@ -9,8 +9,9 @@ grid-template-columns: 1fr 1fr 2fr 1fr; } -.datosPersonales { - grid-column: 1/3 +.datosPersonales, +.sesiones { + grid-column: 1 / 3; } .foto { @@ -139,7 +140,8 @@ p { color: black; margin-top: 0px; } -p:last-child{ + +p:last-child { margin-bottom: 0; } @@ -150,10 +152,37 @@ fieldset { border-radius: 15px; } +.sesiones { + margin-top: 0; +} @media (max-width: 1024px) { .grid-container { - grid-template-columns: 1fr ; + grid-template-columns: 1fr 1fr; + } + + .foto { + width: 180px; + height: 180px; } + + fieldset { + padding: 18px; + } + + .o-table { + width: 95%; + } +} + +.o-table { + width: 97%; + background-color: #f5f0f2; + padding: 20px; + font-family: 'Roboto', sans-serif; } +.fila-completa { + grid-column: 1 / -1; + margin-top: 20px; +} diff --git a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html index 6fdb5af91..c00402400 100644 --- a/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html +++ b/cd2024bfs4g1-frontend/src/main/ngx/src/app/main/data/personal-info/personal-info.component.html @@ -4,41 +4,39 @@ columns="id;name" undo-button="no">