diff --git a/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.html b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.html new file mode 100644 index 0000000..3c5f774 --- /dev/null +++ b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.html @@ -0,0 +1,47 @@ +
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
L.p. {{getElementNumber(element)}} Id {{element.id}} ImiÄ™ {{element.name}} Nazwisko {{element.surname}} Indeks {{element?.student?.index}} Wybierz + +
+
+
+ diff --git a/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.sass b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.sass new file mode 100644 index 0000000..e69de29 diff --git a/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.spec.ts b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.spec.ts new file mode 100644 index 0000000..51f65f3 --- /dev/null +++ b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.spec.ts @@ -0,0 +1,23 @@ +import { ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PersonSelectorComponent } from './person-selector.component'; + +describe('PersonSelectorComponent', () => { + let component: PersonSelectorComponent; + let fixture: ComponentFixture; + + beforeEach(async () => { + await TestBed.configureTestingModule({ + declarations: [ PersonSelectorComponent ] + }) + .compileComponents(); + + fixture = TestBed.createComponent(PersonSelectorComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.ts b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.ts new file mode 100644 index 0000000..4114dd6 --- /dev/null +++ b/src/main/webapp/src/app/component/selector/person-selector/person-selector.component.ts @@ -0,0 +1,36 @@ +import { Component } from '@angular/core'; +import {Person} from "../../../model/person"; +import {MatDialogRef} from "@angular/material/dialog"; +import {BasicDataSource} from "../../../dataSource/basic-data-source"; +import {AbstractListComponent} from "../../abstract-list.component"; +import {PersonService} from "../../../service/person.service"; + +@Component({ + selector: 'app-person-selector', + templateUrl: './person-selector.component.html', + styleUrls: ['./person-selector.component.sass'] +}) +export class PersonSelectorComponent extends AbstractListComponent{ + + dataSource: BasicDataSource; + displayedColumns: Map = new Map([ + ['lp', true], + ['id', true], + ['name', true], + ['surname', true], + ['index', true], + ['select', true], + ]); + + constructor( + public dialogRef: MatDialogRef, + private personService: PersonService + ) { + super(); + this.dataSource = new BasicDataSource(personService); + } + + select(person: Person) { + this.dialogRef.close(person); + } +}