-
Notifications
You must be signed in to change notification settings - Fork 1
Enhancement/38 use dropdowns for major course type in student add form #73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
DjesikaV
wants to merge
7
commits into
main
Choose a base branch
from
enhancement/38-use-dropdowns-for-Major-Course-Type-in-student-add-form
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
02e5676
add type annotations
5f26813
add access modifiers
8b3e2bd
Enable editing students from table
80d1721
add dropdowns for major, course and type in student-add form
e93fd44
Add major option interface for major dropdown
588cd90
Merge main into branch
660be3e
Merge branch 'main' into enhancement/38-use-dropdowns-for-Major-Cours…
DjesikaV File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 @@ | ||
| export interface MajorOptionElm { | ||
| id: string; | ||
| facultyId: string; | ||
| majorName: string; | ||
| } |
This file contains hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -13,7 +13,7 @@ import { TranslatePipe } from '@ngx-translate/core'; | |
| imports: [MatDialogModule, FormsModule, MatInputModule, TranslatePipe], | ||
| }) | ||
| export class AddForm { | ||
| @Input() title: string = ''; | ||
| @Input() public title: string = ''; | ||
|
|
||
| @Output() saveClicked = new EventEmitter<void>(); | ||
| @Output() public readonly saveClicked :EventEmitter<void> = new EventEmitter<void>(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Use newer syntax |
||
| } | ||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
106 changes: 106 additions & 0 deletions
106
uniplanWeb/src/app/core/shared/main-panel/main-panel.ts
This file contains hidden or 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,106 @@ | ||
| import { Component, ChangeDetectionStrategy } from '@angular/core'; | ||
|
|
||
| import { FacultyOptions } from '../../../features/faculty/faculty-options/faculty-options'; | ||
| import { ViewService } from './view.service'; | ||
| import { MajorOptions } from '../../../features/major/major-options/major-options'; | ||
| import { FacultyTable } from '../../../features/faculty/faculty-table/faculty-table'; | ||
| import { MajorTable } from '../../../features/major/major-table/major-table'; | ||
| import { MajorFilters } from '../../../features/major/major-filters/major-filters'; | ||
| import { StudentOptions } from '../../../features/student/student-options/student-options'; | ||
| import { | ||
| StudentTable, | ||
| ELEMENT_STUDENT_DATA, | ||
| } from '../../../features/student/student-table/student-table'; | ||
| import { StudentFilters } from '../../../features/student/student-filters/student-filters'; | ||
| import { MajorElm } from '../../interfaces/major-elm'; | ||
| import { MajorService } from '../../../features/major/major-service'; | ||
| import { FacultyService } from '../../../features/faculty/faculty-service'; | ||
| import {StudentElm} from '../../interfaces/student-elm'; | ||
| import {FacultyElm} from '../../interfaces/faculty-elm'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-main-panel', | ||
| imports: [ | ||
| FacultyOptions, | ||
| MajorOptions, | ||
| FacultyTable, | ||
| MajorTable, | ||
| MajorFilters, | ||
| StudentOptions, | ||
| StudentTable, | ||
| StudentFilters | ||
| ], | ||
| standalone: true, | ||
| templateUrl: './main-panel.html', | ||
| changeDetection: ChangeDetectionStrategy.Eager, | ||
| styleUrl: './main-panel.scss', | ||
| }) | ||
| export class MainPanel { | ||
| protected currentView: string = 'home'; | ||
|
|
||
| protected majors: MajorElm[] = []; | ||
| protected students: StudentElm[] = ELEMENT_STUDENT_DATA; | ||
|
|
||
| protected searchText: string = ''; | ||
| protected searchFacNum: string = ''; | ||
| protected searchMajor: string = ''; | ||
| protected selectedStudentSubtype: string = ''; | ||
| protected studentSubtypes: string[] = []; | ||
|
|
||
| protected selectedFaculty: string = ''; | ||
| protected selectedType: string = ''; | ||
| protected selectedSubtype: string = ''; | ||
|
|
||
| protected faculties: { id: string; name: string }[] = []; | ||
| protected types: string[] = []; | ||
| protected subtypes: string[] = []; | ||
|
|
||
| private facultyMap: Map<string, string> = new Map<string, string>(); | ||
|
|
||
| public constructor( | ||
| private viewService: ViewService, | ||
| private majorService: MajorService, | ||
| private facultyService: FacultyService | ||
| ) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Main panel doesn't exist anymore |
||
| this.viewService.currentView$.subscribe((view: string): void => { | ||
| this.currentView = view; | ||
| }); | ||
| } | ||
|
|
||
| public ngOnInit(): void { | ||
| this.loadMajorFilters(); | ||
| this.loadStudentFilters(); | ||
|
|
||
| this.majorService.refreshNeeded.subscribe((): void => { | ||
| this.loadMajorFilters(); | ||
| }); | ||
|
|
||
| this.viewService.currentView$.subscribe((view: string): void => { | ||
| this.currentView = view; | ||
| }); | ||
| } | ||
|
|
||
| private loadMajorFilters(): void { | ||
| this.facultyService.getFaculties().subscribe((faculties: FacultyElm[]): void => { | ||
| this.facultyMap = new Map(faculties.map((f: FacultyElm): [any, any] => [f.id, f.facultyName])); | ||
|
|
||
| this.majorService.getMajors().subscribe((data: MajorElm[]): void => { | ||
| this.majors = data; | ||
|
|
||
| const filterOptionsMajor = MajorTable.getFilterOptions( | ||
| this.majors, | ||
| this.facultyMap | ||
| ); | ||
|
|
||
| this.faculties = filterOptionsMajor.faculties; | ||
| this.types = filterOptionsMajor.types; | ||
| this.subtypes = filterOptionsMajor.subtypes; | ||
| }); | ||
| }); | ||
| } | ||
|
|
||
| private loadStudentFilters(): void { | ||
| const filterOptionsStudent = StudentTable.getFilterOptions(this.students); | ||
| this.studentSubtypes = filterOptionsStudent.subtypes; | ||
| } | ||
| } | ||
Empty file.
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use newer syntax->input signal