Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Commit

Permalink
Merge pull request #191 from CampusDual/develop
Browse files Browse the repository at this point in the history
Sincronizar BD2
  • Loading branch information
juanjo-alvarez authored Dec 10, 2024
2 parents ac97277 + 756616d commit fef2108
Show file tree
Hide file tree
Showing 20 changed files with 345 additions and 28 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package com.campusdual.cd2024bfs4g1.api.core.service;

import com.ontimize.jee.common.dto.EntityResult;
import com.ontimize.jee.common.exceptions.OntimizeJEERuntimeException;

import java.util.List;
import java.util.Map;

public interface INotesService {

EntityResult notesInsert(Map<String, Object> attrMap) throws OntimizeJEERuntimeException;

EntityResult notesDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException;

EntityResult notesQuery(Map<String, Object> keysValues, List<String> attributes);




}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.espaciador{
margin-bottom: 10px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<div>
<o-form #notesForm service="notes" entity="notes" show-header="no" confirm-exit="false"
undo-button="false" label-header-align="center" after-insert-mode="close">
<o-text-input attr="id_students" sql-type="INTEGER" enabled="no" hidden></o-text-input>

<div class="espaciador">
<label>{{ todayDate }}</label>
</div>
<!-- Campo de texto -->
<label for="LNOTE" class="espaciador">{{'LNOTE' | oTranslate}}</label>
<o-text-input attr="nota" sql-type="VARCHAR" required="yes"></o-text-input>

<o-date-input #date label-visible="false" attr="fecha" format="DD/MM/YYYY" hidden></o-date-input>
<!-- Botón de acción -->
<div fxLayout="row" fxLayoutGap="16px" fxLayoutWrap style="margin-top: 10px;">
<o-button attr="addbutton" id="Add" type="RAISED" label="Add" color="primary" (click)="addNotes()"></o-button>
</div>

</o-form>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';

import { NotesAddComponent } from './notes-add.component';

describe('NotesAddComponent', () => {
let component: NotesAddComponent;
let fixture: ComponentFixture<NotesAddComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ NotesAddComponent ]
})
.compileComponents();

fixture = TestBed.createComponent(NotesAddComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import { Component, ViewChild } from '@angular/core';
import { ODateInputComponent, OFormComponent } from 'ontimize-web-ngx';

@Component({
selector: 'app-notes-add',
templateUrl: './notes-add.component.html',
styleUrls: ['./notes-add.component.css']
})
export class NotesAddComponent {
todayDate: string = '';
todayTimestamp: number = 0;
@ViewChild('notesForm') notesForm: OFormComponent;
@ViewChild('date') date: ODateInputComponent;

ngOnInit() {

const today = new Date();
const day = today.getDate().toString().padStart(2, '0');
const month = (today.getMonth() + 1).toString().padStart(2, '0');
const year = today.getFullYear();
this.todayDate = `${day}/${month}/${year}`;


const [dd, mm, yyyy] = this.todayDate.split('/').map(Number);
const parsedDate = new Date(yyyy, mm - 1, dd);
this.todayTimestamp = parsedDate.getTime();

}

ngAfterViewInit() {
if (this.date) {
this.date.setValue(this.todayTimestamp);
console.log("TiSt"+this.todayTimestamp);
console.log("Date: "+ this.date.getValue().toString());
}
}
addNotes() {
this.notesForm.insert();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ padding: 0;
.user-grid {
grid-column: 1 / 2;
}
.fct-container fieldset {
width: 100%;
}
.documentsGrid {
grid-column: 1 / 3;
}
Expand Down Expand Up @@ -317,3 +320,36 @@ grid-column: 1 / 3;
font-size: 12px;
color: #1a3459;
}

.notas {
margin: 10px;
overflow: hidden;
}
.fromatotextotitulo{
font-size: 15px;
}
.fromatotexto{
font-size: 17px;
color: black;
padding-top: 10px;
padding-bottom: 10px;
padding-right: 10px;
}

div.notification label {
background-color: #8AB237;
color: white;
padding: 10px;
position: fixed;
bottom: 20px;
right: 20px;
border-radius: 5px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
opacity: 1;
transition: opacity 0.5s ease;
}

.notification.hide {
opacity: 0;
}

Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
<legend>{{"Personal data"|oTranslate}}</legend>
<div class="datosPrincipales1">
<div class="foto">
<o-image #UsrPhoto attr="usr_photo" empty-image="assets/images/no-image.png"
sql-type="OTHER" class="avatar" (onChange)="onImageChange($event)"
max-file-size="409600" accept-file-type="image/png,image/jpeg,image/gif,image/jpg"
label="PROFILE.EDIT_PHOTO" ></o-image>
<p class="p_info_foto">{{'Info_foto' | oTranslate}}</p>
<o-image #UsrPhoto attr="usr_photo" empty-image="assets/images/no-image.png" sql-type="OTHER"
class="avatar" (onChange)="onImageChange($event)" max-file-size="409600"
accept-file-type="image/png,image/jpeg,image/gif,image/jpg" label="PROFILE.EDIT_PHOTO"></o-image>
<p class="p_info_foto">{{'Info_foto' | oTranslate}}</p>
</div>

<div>
Expand Down Expand Up @@ -78,6 +77,7 @@
columns="id;status" value-column="id" description-columns="status" query-on-init="true" sort="ASC">
</o-combo>
</div>

</fieldset>
</div>
<div class="gridDatos">
Expand Down Expand Up @@ -245,16 +245,43 @@ <h3>{{ 'Historial_Laboral' | oTranslate }}</h3>
</o-date-input>
</div>
</fieldset>
<div class="notes">
<fieldset title="Notas">
<legend for="LNOTES">{{'LNOTES' | oTranslate}}</legend>
<o-textarea-input attr="notes" required="no" max-length="1000"></o-textarea-input>
</fieldset>
</div>
</div>
<div *ngIf="showMessage" class="notification">
<label for="subida">{{ 'subida' | oTranslate }}</label>
<fieldset title="User" class="user-grid">
<legend>{{'OtherInformation'|oTranslate}}</legend>
<div class="githubUser">
<label for="LGITHUB_USER">{{'LGITHUB_USER' | oTranslate}}</label>
<o-text-input attr="github_user" required="no" max-length="200"></o-text-input>
</div>
<div class="udemy">
<div class="checkbox-container">
<o-checkbox attr="udemy"></o-checkbox>
</div>
</div>
</fieldset>
</div>
</mat-tab>
<mat-tab label="{{'LNOTE' | oTranslate}}">

<o-form-layout-manager class="selectedrow" mode="dialog">
<o-form-layout-dialog-options class="popup">
<o-list #list attr="notesList" sort-columns="id:DESC" service="notes" entity="notes" keys="id" parent-keys="id_students:id" insert-button="true"
delete-button="true" insert-form-route="new_note" columns="id;nota;id_students;fecha" quick-filter="false"
refresh-button="false" insert-button="true" delete-button="true" detail-mode="true" selectable="true"
detail-button-in-row="true" edit-button-in-row="false" pagination-controls="false"
insert-button-position="" show-buttons-text="false" controls="false">
<mat-card class="notas list_container o-list-container" #idNota *ngFor="let notas of list.dataArray">
<mat-card-header >
<mat-card-title class="fromatotextotitulo"><a>{{ notas.fecha | date:'dd/MM/yyyy' }}</a></mat-card-title>
<mat-card-subtitle class="fromatotexto">{{ notas.nota }} </mat-card-subtitle>
</mat-card-header>
</mat-card>

</o-list>
</o-form-layout-dialog-options>
</o-form-layout-manager>
</mat-tab>

</mat-tab-group>
</o-form>
<div *ngIf="showMessage" class="notification">
<label for="subida">{{ 'subida' | oTranslate }}</label>
</div>
</o-form>
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@ import { StudentsTableComponent } from './students-table/students-table.componen
import { BootcampStudentAddComponent } from './students-detail/bootcamp-student-add/bootcamp-student-add.component';
import { EmploymentHistoryNewComponent } from './students-detail/employment-history-new/employment-history-new.component';
import { EmploymentHistoryDetailsComponent } from './students-detail/employment-history-details/employment-history-details.component';
import { NotesAddComponent } from './students-detail/notes-add/notes-add.component';


const routes: Routes = [
{ path:'', pathMatch:'full', component: StudentsTableComponent},
{ path:"new", component:StudentsNewComponent},
{ path:":student_id/new", component:BootcampStudentAddComponent},
{path:':student_id/new_note', component: NotesAddComponent},
{ path:":student_id/new_employment_history", component:EmploymentHistoryNewComponent},
{ path:":student_id/:id", component:EmploymentHistoryDetailsComponent},
{ path:":id", component:StudentsDetailComponent}
{ path:":id", component:StudentsDetailComponent},
];

@NgModule({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { MatIconRegistry } from '@angular/material/icon';
import { DomSanitizer } from '@angular/platform-browser';
import { EmploymentHistoryNewComponent } from './students-detail/employment-history-new/employment-history-new.component';
import { EmploymentHistoryDetailsComponent } from './students-detail/employment-history-details/employment-history-details.component';
import { NotesAddComponent } from './students-detail/notes-add/notes-add.component';


@NgModule({
Expand All @@ -22,7 +23,8 @@ import { EmploymentHistoryDetailsComponent } from './students-detail/employment-
StudentsTableComponent,
BootcampStudentAddComponent,
EmploymentHistoryNewComponent,
EmploymentHistoryDetailsComponent
EmploymentHistoryDetailsComponent,
NotesAddComponent
],
imports: [
CommonModule,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ export const SERVICE_CONFIG: Object = {
},
'employmentstatushistory':{
'path': '/employmentstatushistory'
},
'notes':{
'path': '/notes'
}

};
3 changes: 2 additions & 1 deletion cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"nota":"Notes"
}
3 changes: 2 additions & 1 deletion cd2024bfs4g1-frontend/src/main/ngx/src/assets/i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,5 +294,6 @@
"date_change":"Fecha del cambio",
"DUPLICATED_USRLOGIN_NAME": "El nombre de usuario ya existe",
"Download" : "Descargar",
"Save": "Guardar"
"Save": "Guardar",
"nota":"Notas"
}
24 changes: 16 additions & 8 deletions cd2024bfs4g1-frontend/src/main/ngx/src/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -324,22 +324,22 @@ label{
background: none;
}
.list_container .o-list-container {
position: relative;
position: relative;
}

.list_container .o-list-container .add-button {
position: absolute;
right: 10px;
top: -40px;
position: absolute;
right: 10px;
top: -40px;
background-color: #8AB237;
color: #1a3459;
border-radius: 8px;
width: 100px;
height: 30px;
display: flex;
display: flex;
justify-content: center;
align-items: center;

}

o-column.o-column .o-container > .o-container-title span{
Expand Down Expand Up @@ -379,8 +379,8 @@ o-column.o-column .o-container > .o-container-title span{

margin: 16px;
}
.o-form .o-form-toolbar .o-form-toolbar-header
.mat-toolbar-tools .o-form-toolbar-button, .o-form .o-form-toolbar
.o-form .o-form-toolbar .o-form-toolbar-header
.mat-toolbar-tools .o-form-toolbar-button, .o-form .o-form-toolbar
.o-form-toolbar-header .mat-toolbar-tools .o-form-toolbar-button[disabled]{
border-radius:10px;
}
Expand All @@ -389,3 +389,11 @@ o-column.o-column .o-container > .o-container-title span{
border-radius: 10px;
}




.mat-mdc-fab.mat-primary, .mat-mdc-mini-fab.mat-primary, .mat-mdc-fab.mat-accent, .mat-mdc-mini-fab.mat-accent {
--mdc-fab-container-color: #7ec117;
--mat-mdc-fab-color: #1a3459;
margin-bottom: 20px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.campusdual.cd2024bfs4g1.model.core.dao;


import com.ontimize.jee.server.dao.common.ConfigurationFile;
import com.ontimize.jee.server.dao.jdbc.OntimizeJdbcDaoSupport;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Repository;

@Lazy
@Repository(value = "NotesDao")
@ConfigurationFile(
configurationFile = "dao/NotesDao.xml",
configurationFilePlaceholder = "dao/placeholders.properties")
public class NotesDao extends OntimizeJdbcDaoSupport {

public static final String ATTR_ID = "id";
public static final String ATTR_ID_STUDENTS = "id_students";
public static final String ATTR_NOTA = "nota";
public static final String ATTR_FECHA = "fecha";

}
Loading

0 comments on commit fef2108

Please sign in to comment.