From c8e41c58c3ccc222a9ec5501ee7212a00950d4a5 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 15:30:34 +0300 Subject: [PATCH 1/8] Update input syntax in student-table component --- .../student-add-form/student-add-form.html | 1 - .../student-add-form/student-add-form.ts | 9 +++--- .../student/student-table/student-table.html | 14 +++----- .../student/student-table/student-table.ts | 32 ++++++++++--------- 4 files changed, 26 insertions(+), 30 deletions(-) diff --git a/uniplanWeb/src/app/features/student/student-add-form/student-add-form.html b/uniplanWeb/src/app/features/student/student-add-form/student-add-form.html index a31bbe7..2c64ee6 100644 --- a/uniplanWeb/src/app/features/student/student-add-form/student-add-form.html +++ b/uniplanWeb/src/app/features/student/student-add-form/student-add-form.html @@ -3,7 +3,6 @@ Име: - //todo diff --git a/uniplanWeb/src/app/features/student/student-add-form/student-add-form.ts b/uniplanWeb/src/app/features/student/student-add-form/student-add-form.ts index 157d98e..2a4b888 100644 --- a/uniplanWeb/src/app/features/student/student-add-form/student-add-form.ts +++ b/uniplanWeb/src/app/features/student/student-add-form/student-add-form.ts @@ -10,6 +10,9 @@ import { FormsModule } from '@angular/forms'; @Component({ selector: 'app-student-add-form', + templateUrl: './student-add-form.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './student-add-form.scss', imports: [ MatDialogModule, MatFormField, @@ -18,12 +21,8 @@ import { FormsModule } from '@angular/forms'; MatInputModule, AddForm, ], - templateUrl: './student-add-form.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './student-add-form.scss', }) export class StudentAddForm { - //todo studentName = ''; facultyNumber = ''; faculty = ''; @@ -31,7 +30,7 @@ export class StudentAddForm { course = ''; type = ''; - constructor(private dialogRef: MatDialogRef) {} + constructor(private dialogRef: MatDialogRef) { } save() { if (!this.studentName.trim()) { diff --git a/uniplanWeb/src/app/features/student/student-table/student-table.html b/uniplanWeb/src/app/features/student/student-table/student-table.html index 67e9fc1..a9ff6c0 100644 --- a/uniplanWeb/src/app/features/student/student-table/student-table.html +++ b/uniplanWeb/src/app/features/student/student-table/student-table.html @@ -1,6 +1,5 @@
- +
@@ -49,8 +48,7 @@
No.
- +
@@ -88,12 +86,10 @@ @@ -102,4 +98,4 @@
{{element.position}} - -
-
+ \ No newline at end of file diff --git a/uniplanWeb/src/app/features/student/student-table/student-table.ts b/uniplanWeb/src/app/features/student/student-table/student-table.ts index acffefe..139b2fa 100644 --- a/uniplanWeb/src/app/features/student/student-table/student-table.ts +++ b/uniplanWeb/src/app/features/student/student-table/student-table.ts @@ -1,7 +1,8 @@ import { Component, - Input, + input, SimpleChanges, + effect, OnChanges, OnInit, ChangeDetectionStrategy @@ -112,14 +113,13 @@ export const ELEMENT_STUDENT_DATA: StudentElm[] = [ changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './student-table.scss', }) -export class StudentTable implements OnInit, OnChanges { - //todo - @Input() searchText = ''; - @Input() searchFacNum = ''; - @Input() searchMajor = ''; - @Input() subtype = ''; - - @Input() subtypes: string[] = []; +export class StudentTable implements OnInit { + searchText = input(''); + searchFacNum = input(''); + searchMajor = input(''); + subtype = input(''); + //! + subtypes: string[] = []; displayedColumns: string[] = [ 'position', @@ -140,20 +140,22 @@ export class StudentTable implements OnInit, OnChanges { this.applyFilters(); } - ngOnChanges(changes: SimpleChanges): void { - this.applyFilters(); + constructor() { + effect(() => { + this.applyFilters(); + }); } applyFilters(): void { - const name = this.searchText.toLowerCase(); - const major = this.searchMajor.toLowerCase(); + const name = this.searchText().toLowerCase(); + const major = this.searchMajor().toLowerCase(); const facNum = this.searchFacNum; this.dataSourceFilter = this.originalData.filter((student) => { const matchName = !name || student.name.toLowerCase().includes(name); const matchMajor = !major || student.major.toLowerCase().includes(major); - const matchFacNum = !facNum || student.facultyNumber.includes(facNum); - const matchSubtype = !this.subtype || student.subtype === this.subtype; + const matchFacNum = !facNum || student.facultyNumber.includes(facNum()); + const matchSubtype = !this.subtype || student.subtype === this.subtype(); return matchName && matchMajor && matchFacNum && matchSubtype; }); From 53cece357aaa2fdd3889a35487a1fe9af5fb1c6c Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 15:36:39 +0300 Subject: [PATCH 2/8] Refactor input in student-filters component --- .../student/student-filters/student-filters.html | 6 +++--- .../student/student-filters/student-filters.ts | 13 ++++++------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/uniplanWeb/src/app/features/student/student-filters/student-filters.html b/uniplanWeb/src/app/features/student/student-filters/student-filters.html index 8162f6d..20d3f5a 100644 --- a/uniplanWeb/src/app/features/student/student-filters/student-filters.html +++ b/uniplanWeb/src/app/features/student/student-filters/student-filters.html @@ -2,17 +2,17 @@ > + (searchTextChange)="searchTextChange.emit($event)"> > + (searchTextChange)="searchFacNumChange.emit($event)"> > + (searchTextChange)="searchMajorChange.emit($event)"> (''); @Output() searchTextChange = new EventEmitter(); - @Input() internalSearchFacNum = ''; + internalSearchFacNum = input(''); @Output() searchFacNumChange = new EventEmitter(); - @Input() internalSearchMajor = ''; + internalSearchMajor = input(''); @Output() searchMajorChange = new EventEmitter(); - @Input() subtypes: string[] = []; - @Input() selectedSubtype = ''; + subtypes = input([]); + selectedSubtype = input(''); @Output() subtypeChange = new EventEmitter(); } From 57eb19c9561b4dd2477033493c3f4cf57842025d Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 15:40:24 +0300 Subject: [PATCH 3/8] Update input syntax inmajor-table component --- .../features/major/major-table/major-table.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/uniplanWeb/src/app/features/major/major-table/major-table.ts b/uniplanWeb/src/app/features/major/major-table/major-table.ts index a479685..a077fa0 100644 --- a/uniplanWeb/src/app/features/major/major-table/major-table.ts +++ b/uniplanWeb/src/app/features/major/major-table/major-table.ts @@ -1,5 +1,5 @@ -import { Component, Input, OnInit, ChangeDetectionStrategy } from '@angular/core'; +import { Component, input, OnInit, ChangeDetectionStrategy } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; import { MatTableModule } from '@angular/material/table'; @@ -30,16 +30,16 @@ export class MajorTable implements OnInit { dataSource: MajorElm[] = []; facultyMap = new Map(); - @Input() searchText = ''; - @Input() faculty: string = ''; - @Input() type: string = ''; - @Input() subtype: string = ''; + searchText = input(''); + faculty = input(''); + type = input(''); + subtype = input(''); constructor( private dialog: MatDialog, private service: MajorService, private facultyService: FacultyService - ) {} + ) { } ngOnInit(): void { this.loadMajors(); @@ -69,13 +69,13 @@ export class MajorTable implements OnInit { get filteredMajors(): MajorElm[] { return this.dataSource.filter((major) => { - const matchesFaculty = !this.faculty || major.facultyId === this.faculty; - const matchesType = !this.type || major.courseType === this.type; + const matchesFaculty = !this.faculty || major.facultyId === this.faculty(); + const matchesType = !this.type || major.courseType === this.type(); const matchesSubtype = - !this.subtype || major.courseSubtype === this.subtype; + !this.subtype || major.courseSubtype === this.subtype(); const matchesSearch = !this.searchText || - major.majorName.toLowerCase().includes(this.searchText.toLowerCase()); + major.majorName.toLowerCase().includes(this.searchText().toLowerCase()); return matchesFaculty && matchesType && matchesSubtype && matchesSearch; }); From 89caa936a48b94252bd985bb5b4014e6cf69c137 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 15:44:31 +0300 Subject: [PATCH 4/8] Update input syntax in major-filters component --- .../major/major-filters/major-filters.ts | 27 +++++++++---------- .../major/major-options/major-options.ts | 10 +++---- .../features/major/major-table/major-table.ts | 2 +- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/uniplanWeb/src/app/features/major/major-filters/major-filters.ts b/uniplanWeb/src/app/features/major/major-filters/major-filters.ts index 6af86ae..570edb4 100644 --- a/uniplanWeb/src/app/features/major/major-filters/major-filters.ts +++ b/uniplanWeb/src/app/features/major/major-filters/major-filters.ts @@ -1,5 +1,5 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { FiltersForm } from '../../../core/shared/filters-form/filters-form'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -9,29 +9,26 @@ import { FacultyService } from '../../faculty/faculty-service'; @Component({ selector: 'app-major-filters', + templateUrl: './major-filters.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './major-filters.scss', imports: [ FiltersForm, MatFormFieldModule, MatInputModule, MatIconModule, InputFilter -], - templateUrl: './major-filters.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './major-filters.scss', + ], }) export class MajorFilters { - //todo - @Input() internalSearchText = ''; - - @Input() faculties: { id: string; name: string }[] = []; - - @Input() types: string[] = []; - @Input() subtypes: string[] = []; + internalSearchText = input(''); + faculties = input<{ id: string; name: string }[]>([]); + types = input([]); + subtypes = input([]); - @Input() selectedFaculty = ''; - @Input() selectedType = ''; - @Input() selectedSubtype = ''; + selectedFaculty = input(''); + selectedType = input(''); + selectedSubtype = input(''); @Output() facultyChange = new EventEmitter(); @Output() typeChange = new EventEmitter(); diff --git a/uniplanWeb/src/app/features/major/major-options/major-options.ts b/uniplanWeb/src/app/features/major/major-options/major-options.ts index e5a0660..233bebb 100644 --- a/uniplanWeb/src/app/features/major/major-options/major-options.ts +++ b/uniplanWeb/src/app/features/major/major-options/major-options.ts @@ -9,18 +9,18 @@ import { AddButton } from '../../../core/shared/add-button/add-button'; @Component({ selector: 'app-major-options', + templateUrl: './major-options.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './major-options.scss', imports: [ MatTableModule, MatIconModule, MatButtonModule, AddButton -], - templateUrl: './major-options.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './major-options.scss', + ], }) export class MajorOptions { - constructor(private dialog: MatDialog) {} + constructor(private dialog: MatDialog) { } openAddForm() { this.dialog.open(MajorAddForm, { diff --git a/uniplanWeb/src/app/features/major/major-table/major-table.ts b/uniplanWeb/src/app/features/major/major-table/major-table.ts index a077fa0..9e89dc3 100644 --- a/uniplanWeb/src/app/features/major/major-table/major-table.ts +++ b/uniplanWeb/src/app/features/major/major-table/major-table.ts @@ -12,10 +12,10 @@ import { FacultyService } from '../../faculty/faculty-service'; @Component({ selector: 'app-major-table', - imports: [MatTableModule, MatIconModule, MatButtonModule], templateUrl: './major-table.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './major-table.scss', + imports: [MatTableModule, MatIconModule, MatButtonModule], }) export class MajorTable implements OnInit { displayedColumns: string[] = [ From 0790bd775ac2105a9f950f9d2480600aed5a20a9 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 15:48:12 +0300 Subject: [PATCH 5/8] Format code --- .../faculty-delete-form/faculty-delete-form.ts | 4 ++-- .../faculty/faculty-options/faculty-options.ts | 10 +++++----- .../features/faculty/faculty-table/faculty-table.ts | 10 +++++----- .../features/major/major-add-form/major-add-form.ts | 11 +++++------ .../major/major-delete-form/major-delete-form.ts | 4 ++-- .../features/major/major-edit-form/major-edit-form.ts | 9 ++++----- 6 files changed, 23 insertions(+), 25 deletions(-) diff --git a/uniplanWeb/src/app/features/faculty/faculty-delete-form/faculty-delete-form.ts b/uniplanWeb/src/app/features/faculty/faculty-delete-form/faculty-delete-form.ts index 6a27b3f..b3955fb 100644 --- a/uniplanWeb/src/app/features/faculty/faculty-delete-form/faculty-delete-form.ts +++ b/uniplanWeb/src/app/features/faculty/faculty-delete-form/faculty-delete-form.ts @@ -9,10 +9,10 @@ import { FacultyService } from '../faculty-service'; @Component({ selector: 'app-faculty-delete-form', - imports: [DeleteForm, MatDialogModule], templateUrl: './faculty-delete-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './faculty-delete-form.scss', + imports: [DeleteForm, MatDialogModule], }) export class FacultyDeleteForm { constructor( @@ -20,7 +20,7 @@ export class FacultyDeleteForm { private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: { id: string; facultyName: string } - ) {} + ) { } deleteFaculty(): void { this.facultyService.deleteFaculty(this.data.id).subscribe({ diff --git a/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts b/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts index 64ac111..78bb40f 100644 --- a/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts +++ b/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts @@ -9,18 +9,18 @@ import { AddButton } from '../../../core/shared/add-button/add-button'; @Component({ selector: 'app-faculty-options', + templateUrl: './faculty-options.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './faculty-options.scss', imports: [ MatTableModule, MatIconModule, MatButtonModule, AddButton -], - templateUrl: './faculty-options.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './faculty-options.scss', + ], }) export class FacultyOptions { - constructor(private dialog: MatDialog) {} + constructor(private dialog: MatDialog) { } openAddForm() { this.dialog.open(FacultyAddForm, { diff --git a/uniplanWeb/src/app/features/faculty/faculty-table/faculty-table.ts b/uniplanWeb/src/app/features/faculty/faculty-table/faculty-table.ts index e631512..7084dad 100644 --- a/uniplanWeb/src/app/features/faculty/faculty-table/faculty-table.ts +++ b/uniplanWeb/src/app/features/faculty/faculty-table/faculty-table.ts @@ -11,15 +11,15 @@ import { FacultyDeleteForm } from '../faculty-delete-form/faculty-delete-form'; @Component({ selector: 'app-faculty-table', + templateUrl: './faculty-table.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './faculty-table.scss', imports: [ MatTableModule, MatIconModule, MatButtonModule, MatDialogModule -], - templateUrl: './faculty-table.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './faculty-table.scss', + ], }) export class FacultyTable { displayedColumns: string[] = [ @@ -33,7 +33,7 @@ export class FacultyTable { constructor( private facultyService: FacultyService, private dialog: MatDialog - ) {} + ) { } ngOnInit(): void { this.loadFaculties(); diff --git a/uniplanWeb/src/app/features/major/major-add-form/major-add-form.ts b/uniplanWeb/src/app/features/major/major-add-form/major-add-form.ts index 2daa689..6c2f6a5 100644 --- a/uniplanWeb/src/app/features/major/major-add-form/major-add-form.ts +++ b/uniplanWeb/src/app/features/major/major-add-form/major-add-form.ts @@ -16,6 +16,9 @@ import { FacultyService } from '../../faculty/faculty-service'; @Component({ selector: 'app-major-add-form', + templateUrl: './major-add-form.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './major-add-form.scss', imports: [ MatDialogModule, MatFormField, @@ -25,13 +28,9 @@ import { FacultyService } from '../../faculty/faculty-service'; AddForm, MatFormFieldModule, MatSelectModule -], - templateUrl: './major-add-form.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './major-add-form.scss', + ], }) export class MajorAddForm implements OnInit { - //todo majorName = ''; faculty = ''; type = ''; @@ -43,7 +42,7 @@ export class MajorAddForm implements OnInit { private dialogRef: MatDialogRef, private majorService: MajorService, private facultyService: FacultyService - ) {} + ) { } ngOnInit(): void { this.facultyService.getFaculties().subscribe({ diff --git a/uniplanWeb/src/app/features/major/major-delete-form/major-delete-form.ts b/uniplanWeb/src/app/features/major/major-delete-form/major-delete-form.ts index d75cd12..69a64fe 100644 --- a/uniplanWeb/src/app/features/major/major-delete-form/major-delete-form.ts +++ b/uniplanWeb/src/app/features/major/major-delete-form/major-delete-form.ts @@ -10,10 +10,10 @@ import { switchMap } from 'rxjs'; @Component({ selector: 'app-major-delete-form', - imports: [DeleteForm, MatDialogModule], templateUrl: './major-delete-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './major-delete-form.scss', + imports: [DeleteForm, MatDialogModule], }) export class MajorDeleteForm { constructor( @@ -21,7 +21,7 @@ export class MajorDeleteForm { private dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data: { id: string; courseId: string; name: string } - ) {} + ) { } deleteMajor(): void { this.majorService diff --git a/uniplanWeb/src/app/features/major/major-edit-form/major-edit-form.ts b/uniplanWeb/src/app/features/major/major-edit-form/major-edit-form.ts index 1c4b806..af80c03 100644 --- a/uniplanWeb/src/app/features/major/major-edit-form/major-edit-form.ts +++ b/uniplanWeb/src/app/features/major/major-edit-form/major-edit-form.ts @@ -17,6 +17,9 @@ import { FacultyElm } from '../../../core/interfaces/faculty-elm'; @Component({ selector: 'app-major-edit-form', + templateUrl: './major-edit-form.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './major-edit-form.scss', imports: [ EditForm, MatDialogModule, @@ -26,13 +29,9 @@ import { FacultyElm } from '../../../core/interfaces/faculty-elm'; MatInputModule, MatSelectModule, MatOptionModule -], - templateUrl: './major-edit-form.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './major-edit-form.scss', + ], }) export class MajorEditForm implements OnInit { - //todo majorName = ''; facultyId = ''; From 12119bf8e97b494df3df34cdb9c2ea45a86d5fd3 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 16 Jun 2026 16:20:26 +0300 Subject: [PATCH 6/8] Change input syntax in shared package --- uniplanWeb/src/app/core/shared/add-form/add-form.ts | 6 +++--- .../src/app/core/shared/delete-form/delete-form.ts | 6 +++--- .../src/app/core/shared/edit-form/edit-form.ts | 6 +++--- .../src/app/core/shared/filters-form/filters-form.ts | 12 ++++++------ .../src/app/core/shared/input-filter/input-filter.ts | 6 +++--- .../student/student-filters/student-filters.html | 4 ++-- .../features/student/student-table/student-table.ts | 9 +++++---- 7 files changed, 25 insertions(+), 24 deletions(-) diff --git a/uniplanWeb/src/app/core/shared/add-form/add-form.ts b/uniplanWeb/src/app/core/shared/add-form/add-form.ts index bb4b843..0af1334 100644 --- a/uniplanWeb/src/app/core/shared/add-form/add-form.ts +++ b/uniplanWeb/src/app/core/shared/add-form/add-form.ts @@ -1,18 +1,18 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatDialogModule, MatDialogRef } from '@angular/material/dialog'; import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'app-add-form', - imports: [MatDialogModule, FormsModule, MatInputModule], standalone: true, templateUrl: './add-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './add-form.scss', + imports: [MatDialogModule, FormsModule, MatInputModule], }) export class AddForm { - @Input() title: string = ''; + title=input(''); @Output() saveClicked = new EventEmitter(); } diff --git a/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts b/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts index d0eb4b4..595818f 100644 --- a/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts +++ b/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts @@ -1,17 +1,17 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { FormsModule } from '@angular/forms'; import { MatDialogModule } from '@angular/material/dialog'; import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'app-delete-form', - imports: [MatDialogModule, FormsModule, MatInputModule], templateUrl: './delete-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './delete-form.scss', + imports: [MatDialogModule, FormsModule, MatInputModule], }) export class DeleteForm { - @Input() title: string = ''; + title=input(''); @Output() deleteClicked = new EventEmitter(); } diff --git a/uniplanWeb/src/app/core/shared/edit-form/edit-form.ts b/uniplanWeb/src/app/core/shared/edit-form/edit-form.ts index 6947946..e5617cd 100644 --- a/uniplanWeb/src/app/core/shared/edit-form/edit-form.ts +++ b/uniplanWeb/src/app/core/shared/edit-form/edit-form.ts @@ -1,16 +1,16 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { MatDialogModule } from '@angular/material/dialog'; @Component({ selector: 'app-edit-form', - imports: [MatDialogModule], standalone: true, templateUrl: './edit-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './edit-form.scss', + imports: [MatDialogModule], }) export class EditForm { - @Input() title: string = ''; + title = input(''); @Output() saveClicked = new EventEmitter(); } diff --git a/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts b/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts index 53e9bb0..89cfc26 100644 --- a/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts +++ b/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts @@ -1,25 +1,25 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { MatOptionModule } from '@angular/material/core'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatSelectModule } from '@angular/material/select'; @Component({ selector: 'app-filters-form', - imports: [MatFormFieldModule, MatSelectModule, MatOptionModule], standalone: true, templateUrl: './filters-form.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './filters-form.scss', + imports: [MatFormFieldModule, MatSelectModule, MatOptionModule], }) export class FiltersForm { - @Input() label = ''; + label = input(''); - @Input() options: string[] = []; + options = input([]); - @Input() objectOptions: { id: string; name: string }[] = []; + objectOptions = input<{ id: string; name: string }[]>([]); - @Input() selected = ''; + selected = input(''); @Output() selectionChange = new EventEmitter(); onChange(value: string) { diff --git a/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts b/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts index 1f70c70..7ac9923 100644 --- a/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts +++ b/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts @@ -1,5 +1,5 @@ -import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; import { MatIconModule } from '@angular/material/icon'; import { MatFormField, MatInputModule } from '@angular/material/input'; @@ -12,7 +12,7 @@ import { MatFormField, MatInputModule } from '@angular/material/input'; styleUrl: './input-filter.scss', }) export class InputFilter { - @Input() label: string = ''; - @Input() searchText = ''; + label = input(''); + searchText = input(''); @Output() searchTextChange = new EventEmitter(); } diff --git a/uniplanWeb/src/app/features/student/student-filters/student-filters.html b/uniplanWeb/src/app/features/student/student-filters/student-filters.html index 20d3f5a..6c6fa18 100644 --- a/uniplanWeb/src/app/features/student/student-filters/student-filters.html +++ b/uniplanWeb/src/app/features/student/student-filters/student-filters.html @@ -16,8 +16,8 @@ diff --git a/uniplanWeb/src/app/features/student/student-table/student-table.ts b/uniplanWeb/src/app/features/student/student-table/student-table.ts index 139b2fa..1bb2cb8 100644 --- a/uniplanWeb/src/app/features/student/student-table/student-table.ts +++ b/uniplanWeb/src/app/features/student/student-table/student-table.ts @@ -5,6 +5,7 @@ import { effect, OnChanges, OnInit, + signal, ChangeDetectionStrategy } from '@angular/core'; import { StudentElm } from '../../../core/interfaces/student-elm'; @@ -108,17 +109,17 @@ export const ELEMENT_STUDENT_DATA: StudentElm[] = [ @Component({ selector: 'app-student-table', - imports: [MatTableModule, MatIconModule, MatButtonModule], templateUrl: './student-table.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './student-table.scss', + imports: [MatTableModule, MatIconModule, MatButtonModule], + }) export class StudentTable implements OnInit { searchText = input(''); searchFacNum = input(''); searchMajor = input(''); - subtype = input(''); - //! + subtype = signal(''); subtypes: string[] = []; displayedColumns: string[] = [ @@ -136,7 +137,7 @@ export class StudentTable implements OnInit { dataSourceFilter: StudentElm[] = ELEMENT_STUDENT_DATA; ngOnInit(): void { - this.subtypes = StudentTable.getFilterOptions(this.originalData).subtypes; + //this.subtypes = StudentTable.getFilterOptions(this.originalData).subtypes; this.applyFilters(); } From ea89054991c2a8d4dc347bde1341c968fbea8c84 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Wed, 17 Jun 2026 11:42:39 +0300 Subject: [PATCH 7/8] Add new files --- .../app/core/shared/add-form/add-form.html | 2 +- .../src/app/core/shared/add-form/add-form.ts | 2 +- .../core/shared/delete-form/delete-form.ts | 2 +- .../app/core/shared/edit-form/edit-form.html | 2 +- .../shared/filters-form/filters-form.html | 8 ++--- .../core/shared/filters-form/filters-form.ts | 2 ++ .../shared/input-filter/input-filter.html | 4 +-- .../core/shared/input-filter/input-filter.ts | 2 +- .../app/core/shared/main-panel/main-panel.ts | 9 +++--- .../app/core/shared/main-panel/table/table.ts | 5 ++-- .../navmenu-component/navmenu-component.ts | 5 ++-- .../faculty-add-form/faculty-add-form.ts | 10 +++---- .../faculty-options/faculty-options.ts | 1 - .../major/major-filters/major-filters.html | 30 +++++-------------- .../major/major-filters/major-filters.ts | 6 ++-- .../features/major/major-table/major-table.ts | 8 ++--- .../student-filters/student-filters.ts | 10 +++---- .../student-options/student-options.ts | 4 +-- .../student/student-table/student-table.ts | 26 ++++++++-------- .../app/layout-component/layout-component.ts | 4 +-- 20 files changed, 64 insertions(+), 78 deletions(-) diff --git a/uniplanWeb/src/app/core/shared/add-form/add-form.html b/uniplanWeb/src/app/core/shared/add-form/add-form.html index 522da87..6d5116a 100644 --- a/uniplanWeb/src/app/core/shared/add-form/add-form.html +++ b/uniplanWeb/src/app/core/shared/add-form/add-form.html @@ -1,4 +1,4 @@ -

{{title}}

+

{{title()}}

diff --git a/uniplanWeb/src/app/core/shared/add-form/add-form.ts b/uniplanWeb/src/app/core/shared/add-form/add-form.ts index 0af1334..ed2fb9e 100644 --- a/uniplanWeb/src/app/core/shared/add-form/add-form.ts +++ b/uniplanWeb/src/app/core/shared/add-form/add-form.ts @@ -12,7 +12,7 @@ import { MatInputModule } from '@angular/material/input'; imports: [MatDialogModule, FormsModule, MatInputModule], }) export class AddForm { - title=input(''); + title = input(''); @Output() saveClicked = new EventEmitter(); } diff --git a/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts b/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts index 595818f..09cd147 100644 --- a/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts +++ b/uniplanWeb/src/app/core/shared/delete-form/delete-form.ts @@ -11,7 +11,7 @@ import { MatInputModule } from '@angular/material/input'; imports: [MatDialogModule, FormsModule, MatInputModule], }) export class DeleteForm { - title=input(''); + title = input(''); @Output() deleteClicked = new EventEmitter(); } diff --git a/uniplanWeb/src/app/core/shared/edit-form/edit-form.html b/uniplanWeb/src/app/core/shared/edit-form/edit-form.html index 522da87..6d5116a 100644 --- a/uniplanWeb/src/app/core/shared/edit-form/edit-form.html +++ b/uniplanWeb/src/app/core/shared/edit-form/edit-form.html @@ -1,4 +1,4 @@ -

{{title}}

+

{{title()}}

diff --git a/uniplanWeb/src/app/core/shared/filters-form/filters-form.html b/uniplanWeb/src/app/core/shared/filters-form/filters-form.html index 64b657e..60eecc7 100644 --- a/uniplanWeb/src/app/core/shared/filters-form/filters-form.html +++ b/uniplanWeb/src/app/core/shared/filters-form/filters-form.html @@ -1,17 +1,17 @@ - {{ label }} - + {{ label() }} + Всички @if (isObjectMode()) { - @for (option of objectOptions; track option) { + @for (option of objectOptions(); track option) { {{ option.name }} } } @else { - @for (option of options; track option) { + @for (option of options(); track option) { {{ option }} diff --git a/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts b/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts index 89cfc26..97e0096 100644 --- a/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts +++ b/uniplanWeb/src/app/core/shared/filters-form/filters-form.ts @@ -12,6 +12,7 @@ import { MatSelectModule } from '@angular/material/select'; styleUrl: './filters-form.scss', imports: [MatFormFieldModule, MatSelectModule, MatOptionModule], }) + export class FiltersForm { label = input(''); @@ -20,6 +21,7 @@ export class FiltersForm { objectOptions = input<{ id: string; name: string }[]>([]); selected = input(''); + @Output() selectionChange = new EventEmitter(); onChange(value: string) { diff --git a/uniplanWeb/src/app/core/shared/input-filter/input-filter.html b/uniplanWeb/src/app/core/shared/input-filter/input-filter.html index 6a05b58..b0a8b63 100644 --- a/uniplanWeb/src/app/core/shared/input-filter/input-filter.html +++ b/uniplanWeb/src/app/core/shared/input-filter/input-filter.html @@ -1,10 +1,10 @@ - {{ label }} + {{ label() }} search diff --git a/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts b/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts index 7ac9923..49074de 100644 --- a/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts +++ b/uniplanWeb/src/app/core/shared/input-filter/input-filter.ts @@ -5,11 +5,11 @@ import { MatFormField, MatInputModule } from '@angular/material/input'; @Component({ selector: 'app-input-filter', - imports: [MatFormField, MatInputModule, MatIconModule], standalone: true, templateUrl: './input-filter.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './input-filter.scss', + imports: [MatFormField, MatInputModule, MatIconModule], }) export class InputFilter { label = input(''); diff --git a/uniplanWeb/src/app/core/shared/main-panel/main-panel.ts b/uniplanWeb/src/app/core/shared/main-panel/main-panel.ts index d205b1b..7b0eb84 100644 --- a/uniplanWeb/src/app/core/shared/main-panel/main-panel.ts +++ b/uniplanWeb/src/app/core/shared/main-panel/main-panel.ts @@ -18,6 +18,9 @@ import { FacultyService } from '../../../features/faculty/faculty-service'; @Component({ selector: 'app-main-panel', + templateUrl: './main-panel.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './main-panel.scss', imports: [ FacultyOptions, MajorOptions, @@ -27,11 +30,7 @@ import { FacultyService } from '../../../features/faculty/faculty-service'; StudentOptions, StudentTable, StudentFilters -], - standalone: true, - templateUrl: './main-panel.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './main-panel.scss', + ], }) export class MainPanel { currentView = 'home'; diff --git a/uniplanWeb/src/app/core/shared/main-panel/table/table.ts b/uniplanWeb/src/app/core/shared/main-panel/table/table.ts index 94edec0..0cac9cc 100644 --- a/uniplanWeb/src/app/core/shared/main-panel/table/table.ts +++ b/uniplanWeb/src/app/core/shared/main-panel/table/table.ts @@ -2,10 +2,9 @@ import { Component, ViewChild, ViewContainerRef, ChangeDetectionStrategy } from @Component({ selector: 'app-table', - standalone: true, - imports: [], templateUrl: './table.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './table.scss', + imports: [], }) -export class Table {} +export class Table { } diff --git a/uniplanWeb/src/app/core/shared/navmenu-component/navmenu-component.ts b/uniplanWeb/src/app/core/shared/navmenu-component/navmenu-component.ts index d28b20a..40c193e 100644 --- a/uniplanWeb/src/app/core/shared/navmenu-component/navmenu-component.ts +++ b/uniplanWeb/src/app/core/shared/navmenu-component/navmenu-component.ts @@ -6,11 +6,10 @@ import { LoginAuthService } from '../../../services/login-auth-service'; @Component({ selector: 'app-navmenu-component', - standalone: true, - imports: [CommonModule], templateUrl: './navmenu-component.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrls: ['./navmenu-component.scss'], + imports: [CommonModule], }) export class NavmenuComponent implements OnInit { isSidebarCollapsed = false; @@ -19,7 +18,7 @@ export class NavmenuComponent implements OnInit { constructor( public authService: LoginAuthService, public viewService: ViewService - ) {} + ) { } ngOnInit(): void { this.checkViewport(); diff --git a/uniplanWeb/src/app/features/faculty/faculty-add-form/faculty-add-form.ts b/uniplanWeb/src/app/features/faculty/faculty-add-form/faculty-add-form.ts index 81d040a..5b9e7ad 100644 --- a/uniplanWeb/src/app/features/faculty/faculty-add-form/faculty-add-form.ts +++ b/uniplanWeb/src/app/features/faculty/faculty-add-form/faculty-add-form.ts @@ -15,6 +15,9 @@ import { @Component({ selector: 'app-faculty-add-form', + templateUrl: './faculty-add-form.html', + changeDetection: ChangeDetectionStrategy.Eager, + styleUrl: './faculty-add-form.scss', imports: [ MatDialogModule, MatFormField, @@ -24,10 +27,7 @@ import { MatSelectModule, MatOptionModule, AddForm -], - templateUrl: './faculty-add-form.html', - changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './faculty-add-form.scss', + ], }) export class FacultyAddForm implements OnInit { facultyName = ''; @@ -39,7 +39,7 @@ export class FacultyAddForm implements OnInit { private dialogRef: MatDialogRef, private facultyService: FacultyService, private universityService: UniversityService - ) {} + ) { } ngOnInit(): void { this.universityService.getAllUniversities().subscribe({ diff --git a/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts b/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts index 78bb40f..2fa6474 100644 --- a/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts +++ b/uniplanWeb/src/app/features/faculty/faculty-options/faculty-options.ts @@ -1,4 +1,3 @@ - import { Component, ChangeDetectionStrategy } from '@angular/core'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; diff --git a/uniplanWeb/src/app/features/major/major-filters/major-filters.html b/uniplanWeb/src/app/features/major/major-filters/major-filters.html index f5381b5..3a61847 100644 --- a/uniplanWeb/src/app/features/major/major-filters/major-filters.html +++ b/uniplanWeb/src/app/features/major/major-filters/major-filters.html @@ -1,30 +1,16 @@
- - + - + - + -
+ \ No newline at end of file diff --git a/uniplanWeb/src/app/features/major/major-filters/major-filters.ts b/uniplanWeb/src/app/features/major/major-filters/major-filters.ts index 570edb4..e100e1e 100644 --- a/uniplanWeb/src/app/features/major/major-filters/major-filters.ts +++ b/uniplanWeb/src/app/features/major/major-filters/major-filters.ts @@ -1,5 +1,5 @@ -import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, Output, ChangeDetectionStrategy, model } from '@angular/core'; import { FiltersForm } from '../../../core/shared/filters-form/filters-form'; import { MatFormFieldModule } from '@angular/material/form-field'; import { MatInputModule } from '@angular/material/input'; @@ -21,8 +21,10 @@ import { FacultyService } from '../../faculty/faculty-service'; ], }) export class MajorFilters { - internalSearchText = input(''); + internalSearchText = model(''); + faculties = input<{ id: string; name: string }[]>([]); + types = input([]); subtypes = input([]); diff --git a/uniplanWeb/src/app/features/major/major-table/major-table.ts b/uniplanWeb/src/app/features/major/major-table/major-table.ts index 9e89dc3..8fa6df5 100644 --- a/uniplanWeb/src/app/features/major/major-table/major-table.ts +++ b/uniplanWeb/src/app/features/major/major-table/major-table.ts @@ -69,12 +69,12 @@ export class MajorTable implements OnInit { get filteredMajors(): MajorElm[] { return this.dataSource.filter((major) => { - const matchesFaculty = !this.faculty || major.facultyId === this.faculty(); - const matchesType = !this.type || major.courseType === this.type(); + const matchesFaculty = !this.faculty() || major.facultyId === this.faculty(); + const matchesType = !this.type() || major.courseType === this.type(); const matchesSubtype = - !this.subtype || major.courseSubtype === this.subtype(); + !this.subtype() || major.courseSubtype === this.subtype(); const matchesSearch = - !this.searchText || + !this.searchText() || major.majorName.toLowerCase().includes(this.searchText().toLowerCase()); return matchesFaculty && matchesType && matchesSubtype && matchesSearch; diff --git a/uniplanWeb/src/app/features/student/student-filters/student-filters.ts b/uniplanWeb/src/app/features/student/student-filters/student-filters.ts index d553232..b414a63 100644 --- a/uniplanWeb/src/app/features/student/student-filters/student-filters.ts +++ b/uniplanWeb/src/app/features/student/student-filters/student-filters.ts @@ -1,22 +1,22 @@ -import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core'; +import { Component, EventEmitter, input, model, Output, ChangeDetectionStrategy } from '@angular/core'; import { InputFilter } from '../../../core/shared/input-filter/input-filter'; import { FiltersForm } from '../../../core/shared/filters-form/filters-form'; @Component({ selector: 'app-student-filters', - imports: [InputFilter, FiltersForm], templateUrl: './student-filters.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './student-filters.scss', + imports: [InputFilter, FiltersForm], }) export class StudentFilters { - internalSearchText = input(''); + internalSearchText = model(''); @Output() searchTextChange = new EventEmitter(); - internalSearchFacNum = input(''); + internalSearchFacNum = model(''); @Output() searchFacNumChange = new EventEmitter(); - internalSearchMajor = input(''); + internalSearchMajor = model(''); @Output() searchMajorChange = new EventEmitter(); subtypes = input([]); diff --git a/uniplanWeb/src/app/features/student/student-options/student-options.ts b/uniplanWeb/src/app/features/student/student-options/student-options.ts index 04b7c24..61ede14 100644 --- a/uniplanWeb/src/app/features/student/student-options/student-options.ts +++ b/uniplanWeb/src/app/features/student/student-options/student-options.ts @@ -5,13 +5,13 @@ import { StudentAddForm } from '../student-add-form/student-add-form'; @Component({ selector: 'app-student-options', - imports: [AddButton], templateUrl: './student-options.html', changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './student-options.scss', + imports: [AddButton], }) export class StudentOptions { - constructor(private dialog: MatDialog) {} + constructor(private dialog: MatDialog) { } openAddForm() { this.dialog.open(StudentAddForm, { diff --git a/uniplanWeb/src/app/features/student/student-table/student-table.ts b/uniplanWeb/src/app/features/student/student-table/student-table.ts index 1bb2cb8..61cde49 100644 --- a/uniplanWeb/src/app/features/student/student-table/student-table.ts +++ b/uniplanWeb/src/app/features/student/student-table/student-table.ts @@ -5,7 +5,7 @@ import { effect, OnChanges, OnInit, - signal, + effect, ChangeDetectionStrategy } from '@angular/core'; import { StudentElm } from '../../../core/interfaces/student-elm'; @@ -113,14 +113,14 @@ export const ELEMENT_STUDENT_DATA: StudentElm[] = [ changeDetection: ChangeDetectionStrategy.Eager, styleUrl: './student-table.scss', imports: [MatTableModule, MatIconModule, MatButtonModule], - }) -export class StudentTable implements OnInit { +export class StudentTable { searchText = input(''); searchFacNum = input(''); searchMajor = input(''); - subtype = signal(''); - subtypes: string[] = []; + subtype = input(''); + + subtypes = input([]); displayedColumns: string[] = [ 'position', @@ -136,13 +136,13 @@ export class StudentTable implements OnInit { originalData: StudentElm[] = ELEMENT_STUDENT_DATA; dataSourceFilter: StudentElm[] = ELEMENT_STUDENT_DATA; - ngOnInit(): void { - //this.subtypes = StudentTable.getFilterOptions(this.originalData).subtypes; - this.applyFilters(); - } - constructor() { effect(() => { + this.searchText(); + this.searchMajor(); + this.searchFacNum(); + this.subtype(); + this.applyFilters(); }); } @@ -150,13 +150,13 @@ export class StudentTable implements OnInit { applyFilters(): void { const name = this.searchText().toLowerCase(); const major = this.searchMajor().toLowerCase(); - const facNum = this.searchFacNum; + const facNum = this.searchFacNum(); this.dataSourceFilter = this.originalData.filter((student) => { const matchName = !name || student.name.toLowerCase().includes(name); const matchMajor = !major || student.major.toLowerCase().includes(major); - const matchFacNum = !facNum || student.facultyNumber.includes(facNum()); - const matchSubtype = !this.subtype || student.subtype === this.subtype(); + const matchFacNum = !facNum || student.facultyNumber.includes(facNum); + const matchSubtype = !this.subtype() || student.subtype === this.subtype(); return matchName && matchMajor && matchFacNum && matchSubtype; }); diff --git a/uniplanWeb/src/app/layout-component/layout-component.ts b/uniplanWeb/src/app/layout-component/layout-component.ts index 20f4876..c4ca360 100644 --- a/uniplanWeb/src/app/layout-component/layout-component.ts +++ b/uniplanWeb/src/app/layout-component/layout-component.ts @@ -4,10 +4,10 @@ import { MainPanel } from "../core/shared/main-panel/main-panel"; @Component({ selector: 'app-layout-component', - imports: [NavmenuComponent, MainPanel], templateUrl: './layout-component.html', changeDetection: ChangeDetectionStrategy.Eager, - styleUrl: './layout-component.scss' + styleUrl: './layout-component.scss', + imports: [NavmenuComponent, MainPanel], }) export class LayoutComponent { From 7efec8082a5f29c929f5ac64cf1a810efa393810 Mon Sep 17 00:00:00 2001 From: PIPetkova19 Date: Tue, 23 Jun 2026 10:00:00 +0300 Subject: [PATCH 8/8] Remove unused imports from student-table.ts --- .../src/app/features/student/student-table/student-table.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/uniplanWeb/src/app/features/student/student-table/student-table.ts b/uniplanWeb/src/app/features/student/student-table/student-table.ts index 61cde49..93a61da 100644 --- a/uniplanWeb/src/app/features/student/student-table/student-table.ts +++ b/uniplanWeb/src/app/features/student/student-table/student-table.ts @@ -2,7 +2,6 @@ import { Component, input, SimpleChanges, - effect, OnChanges, OnInit, effect,