This repository has been archived by the owner on Feb 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from CampusDual/BFS42024-19
BFS42024-19
- Loading branch information
Showing
15 changed files
with
177 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
...tend/src/main/ngx/src/app/main/bootcamps/bootcamp-details/bootcamp-details.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<o-table attr="studentsTable" service="students" entity="student" keys="id" | ||
columns="id;name;surnames" | ||
visible-columns="name;surnames" query-rows="2"> | ||
<o-table-column attr="name" title="Name"></o-table-column> | ||
<o-table-column attr="surnames" title="Surnames"></o-table-column> | ||
</o-table> | ||
<o-form keys="id" service="bootcamps" entity="bootcamp"> | ||
<o-text-input attr="id" sql-type="INTEGER" enabled="no"></o-text-input> | ||
<o-table attr="studentsBootcampTable" service="studentBootcamps" entity="studentsWithBootcamp" keys="id" | ||
parent-keys="bootcamp_id:id" | ||
columns="id;name;surnames" | ||
visible-columns="name;surnames" query-rows="10" | ||
detail-mode="false" | ||
delete-button="false"> | ||
</o-table> | ||
</o-form> |
Empty file.
23 changes: 23 additions & 0 deletions
23
.../main/bootcamps/bootcamp-details/student-bootcamp-add/student-bootcamp-add.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!-- | ||
<o-table attr="studentsTable" service="students" entity="student" keys="id" | ||
columns="id;name;surnames;email" | ||
visible-columns="name;surnames;email" query-rows="3"> | ||
</o-table> --> | ||
|
||
<o-form #studentBootcampForm service="studentBootcamps" entity="studentBootcamp" editable-detail="no" show-header="no"> | ||
<o-text-input attr="bootcamp_id" sql-type="INTEGER" enabled="no"></o-text-input> | ||
<o-combo | ||
attr="student_id" | ||
label="Students" | ||
value-column="id" | ||
columns="id;name;surnames" | ||
service ="students" | ||
entity="student" | ||
visible-columns="name;surnames" | ||
searchable="yes"> | ||
</o-combo> | ||
|
||
</o-form> | ||
<o-button label="Add" (click)="addStudentBootcamp()"></o-button> | ||
<o-button label="Return" (click)="navigateBack()"></o-button> | ||
|
23 changes: 23 additions & 0 deletions
23
...in/bootcamps/bootcamp-details/student-bootcamp-add/student-bootcamp-add.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { StudentBootcampAddComponent } from './student-bootcamp-add.component'; | ||
|
||
describe('StudentBootcampAddComponent', () => { | ||
let component: StudentBootcampAddComponent; | ||
let fixture: ComponentFixture<StudentBootcampAddComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ StudentBootcampAddComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(StudentBootcampAddComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
21 changes: 21 additions & 0 deletions
21
...pp/main/bootcamps/bootcamp-details/student-bootcamp-add/student-bootcamp-add.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Component, ViewChild } from '@angular/core'; | ||
import { OFormComponent } from 'ontimize-web-ngx'; | ||
|
||
@Component({ | ||
selector: 'app-student-bootcamp-add', | ||
templateUrl: './student-bootcamp-add.component.html', | ||
styleUrls: ['./student-bootcamp-add.component.css'] | ||
}) | ||
export class StudentBootcampAddComponent { | ||
|
||
@ViewChild('studentBootcampForm') studentBootcampForm:OFormComponent; | ||
|
||
addStudentBootcamp() { | ||
this.studentBootcampForm.insert(); | ||
} | ||
|
||
|
||
navigateBack() { | ||
window.history.back(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 6 additions & 2 deletions
8
cd2024bfs4g1-frontend/src/main/ngx/src/app/main/bootcamps/bootcamps-routing.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 0 additions & 35 deletions
35
...odel/src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentBootcampDao.java
This file was deleted.
Oops, something went wrong.
49 changes: 49 additions & 0 deletions
49
.../src/main/java/com/campusdual/cd2024bfs4g1/model/core/service/StudentBootcampService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.campusdual.cd2024bfs4g1.model.core.service; | ||
|
||
import com.campusdual.cd2024bfs4g1.api.core.service.IStudentBootcampService; | ||
import com.campusdual.cd2024bfs4g1.model.core.dao.StudentBootcampDao; | ||
import com.ontimize.jee.common.dto.EntityResult; | ||
import com.ontimize.jee.common.dto.EntityResultMapImpl; | ||
import com.ontimize.jee.common.exceptions.OntimizeJEERuntimeException; | ||
import com.ontimize.jee.server.dao.DefaultOntimizeDaoHelper; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.context.annotation.Lazy; | ||
import org.springframework.dao.DuplicateKeyException; | ||
import org.springframework.stereotype.Service; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
@Service("StudentBootcampService") | ||
@Lazy | ||
public class StudentBootcampService implements IStudentBootcampService { | ||
|
||
@Autowired | ||
private StudentBootcampDao studentBootcampDao; | ||
|
||
@Autowired | ||
private DefaultOntimizeDaoHelper daoHelper; | ||
|
||
@Override | ||
public EntityResult studentBootcampInsert(Map<String, Object> attrMap) throws OntimizeJEERuntimeException { | ||
try { | ||
return this.daoHelper.insert(this.studentBootcampDao, attrMap); | ||
} catch (DuplicateKeyException e) { | ||
EntityResult entityResultError = new EntityResultMapImpl(); | ||
entityResultError.setCode(EntityResult.OPERATION_WRONG); | ||
entityResultError.setMessage("The student already exists in the bootcamp"); | ||
return entityResultError; | ||
} catch (Exception generalException) { | ||
throw generalException; | ||
} | ||
} | ||
|
||
@Override | ||
public EntityResult studentBootcampDelete(Map<String, Object> keyMap) throws OntimizeJEERuntimeException { | ||
return this.daoHelper.delete(this.studentBootcampDao, keyMap); | ||
} | ||
@Override | ||
public EntityResult studentsWithBootcampQuery(Map<String, Object> keysValues, List<String> attributes) { | ||
return this.daoHelper.query(this.studentBootcampDao, keysValues, attributes); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters