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 #197 from CampusDual/BFS42024-180
BFS42024-180
- Loading branch information
Showing
20 changed files
with
434 additions
and
5 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
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
14 changes: 14 additions & 0 deletions
14
cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial-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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { NgModule } from '@angular/core'; | ||
import { RouterModule, Routes } from '@angular/router'; | ||
import { CommercialSectionComponent } from './commercial-section/commercial-section.component'; | ||
|
||
const routes: Routes = [ | ||
{ path:'', pathMatch:'full', component: CommercialSectionComponent}, | ||
]; | ||
|
||
|
||
@NgModule({ | ||
imports: [RouterModule.forChild(routes)], | ||
exports: [RouterModule] | ||
}) | ||
export class CommercialRoutingModule { } |
75 changes: 75 additions & 0 deletions
75
.../src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.component.css
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,75 @@ | ||
.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; | ||
} | ||
|
54 changes: 54 additions & 0 deletions
54
...src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.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,54 @@ | ||
<o-form-layout-manager #formLayoutManager attr="commercialSectionLayout" mode="tab" title="{{'Commercial Section' | oTranslate}}"> | ||
<o-form-layout-tabgroup-options label-columns="name;surname1"></o-form-layout-tabgroup-options> | ||
<div class="table_container"> | ||
<o-form editable-detail="no" show-header="no" layout-align="start stretch" class="commercial-filters-form" fxFill> | ||
<o-column-collapsible title="{{'FILTERS' | oTranslate}}" appearance="legacy" expanded="no" elevation="10" | ||
icon="filter_list" class="collapsible-2"> | ||
<div class="filter_style"> | ||
<o-combo attr="bootcamps_id" class="bootcamp" label="Bootcamps" read-only="no" service="bootcamps" entity="futureBootcamp" | ||
keys="id" columns="id;name" value-column="id" query-on-init="true" searchable="yes" | ||
visible-columns="name" translate="yes" null-selection="true" sort="ASC" ></o-combo> | ||
|
||
<o-combo attr="student_status_id" label="LSTATUS" null-selection="true" service="studentstatus" | ||
entity="studentStatus" keys="id" columns="id;status" value-column="id" visible-columns="status" | ||
read-only="no" sort="ASC"> | ||
</o-combo> | ||
|
||
<o-combo attr="status" label="LCONTACTSTATUS" null-selection="true" multiple="true" [static-data]="dataArray" service="students" | ||
entity="commercialStudent" columns="status" value-column="key" visible-columns="value" | ||
read-only="no" sort="ASC"> | ||
</o-combo> | ||
|
||
<div class="centered-actions" fxLayout="row" fxLayoutAlign="center" fxLayoutGap="8px"> | ||
<o-button attr="clear" [oFilterBuilderClear]="commercialFilterBuilder" type="STROKED" | ||
label="{{'CLEAR' | oTranslate}}" layout-padding color="primary"> | ||
</o-button> | ||
</div> | ||
</div> | ||
|
||
<o-filter-builder #commercialFilterBuilder attr="thefilter" | ||
filters="bootcamps_id:bootcamps_id;student_status_id:student_status_id;status:status" | ||
[target]="tableCommercial" query-on-change="yes" query-on-change-delay="500" | ||
[expression-builder]="createFilter"> | ||
</o-filter-builder> | ||
</o-column-collapsible> | ||
|
||
<div> | ||
<h1 class="titulo_tablas">{{ 'LCONTACTEDSTUDENTS' | oTranslate }}</h1> | ||
<o-table #tableCommercial virtual-scroll="false" class="general_table" attr="commercialTable" service="students" entity="commercialStudent" | ||
sort-columns="name" keys="id" columns="id;name;surname1;personal_email;surname2;dni;birth_date;phone;employment_status_id;udemy;status; | ||
campus_email;fct_school;fct_start;fct_end;tutor;github_user;notes;surnames;spain_comunity;location;student_status_id;bootcamps_id" | ||
visible-columns="name;surname1;surname2;personal_email;phone;status" insert-button="false" delete-button="false" pageable="true" | ||
show-report-on-demand-option="false" show-charts-on-demand-option="false" detail-mode="none" (onClick)="goToDetail($event)"> | ||
<o-table-column attr="name" title="Name"></o-table-column> | ||
<o-table-column attr="surname1" title="FIRST_SURNAME"></o-table-column> | ||
<o-table-column attr="surname2" title="LAST_SURNAME"></o-table-column> | ||
<o-table-column attr="personal_email" title="Email"></o-table-column> | ||
<o-table-column attr="phone" title="LPHONE"></o-table-column> | ||
<o-table-column attr="status" title="LCONTACTSTATUS"></o-table-column> | ||
<o-table-paginator page-size="20" page-size-options="10;20;40"></o-table-paginator> | ||
</o-table> | ||
</div> | ||
</o-form> | ||
</div> | ||
</o-form-layout-manager> |
23 changes: 23 additions & 0 deletions
23
.../main/ngx/src/app/main/commercial/commercial-section/commercial-section.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 { CommercialSectionComponent } from './commercial-section.component'; | ||
|
||
describe('CommercialSectionComponent', () => { | ||
let component: CommercialSectionComponent; | ||
let fixture: ComponentFixture<CommercialSectionComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ CommercialSectionComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(CommercialSectionComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
70 changes: 70 additions & 0 deletions
70
...d/src/main/ngx/src/app/main/commercial/commercial-section/commercial-section.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,70 @@ | ||
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."); | ||
} | ||
} | ||
|
||
|
||
createFilter(values: Array<{ attr: string, value: any }>): Expression | null { | ||
const filters: Array<Expression> = values | ||
.filter(fil => fil.value != null && fil.value.toString().trim() !== '') | ||
.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); | ||
|
||
return filters.length > 0 | ||
? filters.reduce((exp1, exp2) => | ||
FilterExpressionUtils.buildComplexExpression(exp1, exp2, FilterExpressionUtils.OP_AND) | ||
) | ||
: null; | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercial.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 { } |
7 changes: 7 additions & 0 deletions
7
cd2024bfs4g1-frontend/src/main/ngx/src/app/main/commercial/commercialstatus.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,7 @@ | ||
const commercialStatus: string[] = [ | ||
"Interesado", | ||
"Inactivo", | ||
"Inscrito" | ||
]; | ||
|
||
export default commercialStatus; |
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
2 changes: 1 addition & 1 deletion
2
...rontend/src/main/ngx/src/app/main/students/students-detail/students-detail.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
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
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
Oops, something went wrong.