Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion uniplanWeb/src/app/core/shared/add-form/add-form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 mat-dialog-title>{{title}}</h2>
<h2 mat-dialog-title>{{title()}}</h2>
<mat-dialog-content>

<ng-content></ng-content>
Expand Down
4 changes: 2 additions & 2 deletions uniplanWeb/src/app/core/shared/add-form/add-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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';
Expand All @@ -13,7 +13,7 @@ import { TranslatePipe } from '@ngx-translate/core';
imports: [MatDialogModule, FormsModule, MatInputModule, TranslatePipe],
})
export class AddForm {
@Input() title: string = '';
title = input<string>('');

@Output() saveClicked = new EventEmitter<void>();
}
4 changes: 2 additions & 2 deletions uniplanWeb/src/app/core/shared/delete-form/delete-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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';
Expand All @@ -12,7 +12,7 @@ import { TranslatePipe } from '@ngx-translate/core';
imports: [MatDialogModule, FormsModule, MatInputModule, TranslatePipe],
})
export class DeleteForm {
@Input() title: string = '';
title = input<string>('');

@Output() deleteClicked = new EventEmitter<void>();
}
2 changes: 1 addition & 1 deletion uniplanWeb/src/app/core/shared/edit-form/edit-form.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 mat-dialog-title>{{title}}</h2>
<h2 mat-dialog-title>{{title()}}</h2>
<mat-dialog-content>

<ng-content></ng-content>
Expand Down
4 changes: 2 additions & 2 deletions uniplanWeb/src/app/core/shared/edit-form/edit-form.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, Input, Output, ChangeDetectionStrategy } from '@angular/core';
import { Component, EventEmitter, input, Output, ChangeDetectionStrategy } from '@angular/core';
import { MatDialogModule } from '@angular/material/dialog';
import { TranslatePipe } from '@ngx-translate/core';

Expand All @@ -12,7 +12,7 @@ import { TranslatePipe } from '@ngx-translate/core';

})
export class EditForm {
@Input() title: string = '';
title = input<string>('');

@Output() saveClicked = new EventEmitter<void>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<mat-option value>{{'shared.option-all' | translate}}</mat-option>

@if (isObjectMode()) {
@for (option of objectOptions; track option) {
@for (option of objectOptions(); track option) {
<mat-option
[value]="option.id">
{{ option.name }}
</mat-option>
}
} @else {
@for (option of options; track option) {
@for (option of options(); track option) {
<mat-option [value]="option">
{{ option }}
</mat-option>
Expand Down
12 changes: 7 additions & 5 deletions uniplanWeb/src/app/core/shared/filters-form/filters-form.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

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';
Expand All @@ -13,14 +13,16 @@ import { TranslatePipe } from '@ngx-translate/core';
styleUrl: './filters-form.scss',
imports: [MatFormFieldModule, MatSelectModule, MatOptionModule, TranslatePipe],
})

export class FiltersForm {
@Input() label = '';
label = input<string>('');

@Input() options: string[] = [];
options = input<string[]>([]);

@Input() objectOptions: { id: string; name: string }[] = [];
objectOptions = input<{ id: string; name: string }[]>([]);

@Input() selected = '';
selected = input<string>('');

@Output() selectionChange = new EventEmitter<string>();

onChange(value: string) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<mat-form-field appearance="outline" class="filter search-input"
floatLabel="always">
<mat-label>{{ label }}</mat-label>
<mat-label>{{ label() }}</mat-label>
<mat-icon matPrefix>search</mat-icon>
<input
matInput
type="text"
[value]="searchText"
[value]="searchText()"
(input)="searchTextChange.emit($any($event).target.value)" />
</mat-form-field>
8 changes: 4 additions & 4 deletions uniplanWeb/src/app/core/shared/input-filter/input-filter.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@

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';

@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 {
@Input() label: string = '';
@Input() searchText = '';
label = input<string>('');
searchText = input<string>('');
@Output() searchTextChange = new EventEmitter<string>();
}
9 changes: 4 additions & 5 deletions uniplanWeb/src/app/core/shared/main-panel/main-panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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';
Expand Down
5 changes: 2 additions & 3 deletions uniplanWeb/src/app/core/shared/main-panel/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 { }
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -19,7 +18,7 @@ export class NavmenuComponent implements OnInit {
constructor(
public authService: LoginAuthService,
public viewService: ViewService
) {}
) { }

ngOnInit(): void {
this.checkViewport();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import { TranslatePipe } from '@ngx-translate/core';

@Component({
selector: 'app-faculty-add-form',
templateUrl: './faculty-add-form.html',
changeDetection: ChangeDetectionStrategy.Eager,
styleUrl: './faculty-add-form.scss',
imports: [
MatDialogModule,
MatFormField,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Component, ChangeDetectionStrategy } from '@angular/core';
import { MatButtonModule } from '@angular/material/button';
import { MatIconModule } from '@angular/material/icon';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -25,14 +25,14 @@ import { TranslatePipe } from '@ngx-translate/core';
export class MajorFilters {
@Input() internalSearchText = '';

@Input() faculties: { id: string; name: string }[] = [];
faculties = input<{ id: string; name: string }[]>([]);

@Input() types: string[] = [];
@Input() subtypes: string[] = [];
types = input<string[]>([]);
subtypes = input<string[]>([]);

@Input() selectedFaculty = '';
@Input() selectedType = '';
@Input() selectedSubtype = '';
selectedFaculty = input<string>('');
selectedType = input<string>('');
selectedSubtype = input<string>('');

@Output() facultyChange = new EventEmitter<string>();
@Output() typeChange = new EventEmitter<string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
20 changes: 10 additions & 10 deletions uniplanWeb/src/app/features/major/major-table/major-table.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -31,10 +31,10 @@ export class MajorTable implements OnInit {
dataSource: MajorElm[] = [];
facultyMap = new Map<string, string>();

@Input() searchText = '';
@Input() faculty: string = '';
@Input() type: string = '';
@Input() subtype: string = '';
searchText = input<string>('');
faculty = input<string>('');
type = input<string>('');
subtype = input<string>('');

constructor(
private dialog: MatDialog,
Expand Down Expand Up @@ -70,13 +70,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());
!this.searchText() ||
major.majorName.toLowerCase().includes(this.searchText().toLowerCase());

return matchesFaculty && matchesType && matchesSubtype && matchesSearch;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
<app-input-filter
[label]="'features.name-label' | translate"
[(searchText)]="internalSearchText"
(searchTextChange)="searchTextChange.emit($event)">></app-input-filter>
(searchTextChange)="searchTextChange.emit($event)"></app-input-filter>

<app-input-filter
[label]="'student.faculty-number-label' | translate"
[(searchText)]="internalSearchFacNum"
(searchTextChange)="searchFacNumChange.emit($event)">></app-input-filter>
(searchTextChange)="searchFacNumChange.emit($event)"></app-input-filter>

<app-input-filter
[label]="'features.major-label' | translate"
[(searchText)]="internalSearchMajor"
(searchTextChange)="searchMajorChange.emit($event)">></app-input-filter>
(searchTextChange)="searchMajorChange.emit($event)"></app-input-filter>

<app-filters-form
[label]="'features.study-mode-label' | translate"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
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';
import { TranslatePipe } from '@ngx-translate/core';
Expand All @@ -14,13 +14,13 @@ export class StudentFilters {
@Input() internalSearchText = '';
@Output() searchTextChange = new EventEmitter<string>();

@Input() internalSearchFacNum = '';
internalSearchFacNum = model<string>('');
@Output() searchFacNumChange = new EventEmitter<string>();

@Input() internalSearchMajor = '';
internalSearchMajor = model<string>('');
@Output() searchMajorChange = new EventEmitter<string>();

@Input() subtypes: string[] = [];
@Input() selectedSubtype = '';
subtypes = input<string[]>([]);
selectedSubtype = input<string>('');
@Output() subtypeChange = new EventEmitter<string>();
}
Original file line number Diff line number Diff line change
Expand Up @@ -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, {
Expand Down
Loading