diff --git a/src/app/person/person.component.html b/src/app/person/person.component.html
index a16feca..dfd99ee 100644
--- a/src/app/person/person.component.html
+++ b/src/app/person/person.component.html
@@ -189,10 +189,29 @@
{{ 'person_data' | translate | titlecase }}
{{ personAcr.person.first_name }} {{ personAcr.person.last_name }}
+
+
+
+
+
+
+
+
diff --git a/src/app/person/person.component.ts b/src/app/person/person.component.ts
index c968aa8..4e64288 100644
--- a/src/app/person/person.component.ts
+++ b/src/app/person/person.component.ts
@@ -20,6 +20,9 @@ import { LogsService } from '../../services/logs/logs.service';
import { Log } from '../../types/log';
import { appConfig } from '../app.config';
import { PeopleService } from 'src/services/people/people.service';
+import { RegistrationsService } from 'src/services/registrations/registrations.service';
+import { PersonRegistration } from 'src/types/person-registration';
+import { RegistrationPerson } from 'src/types/registration-person';
@Component({
selector: 'app-person',
@@ -44,6 +47,8 @@ export class PersonComponent extends WsComponent implements OnInit {
// override person acr
personAcr: PersonAccreditation;
+ personRegistration: RegistrationPerson;
+ hostInfo: any;
savingPersonAcr = false;
firstNameChange: Subject = new Subject();
lastNameChange: Subject = new Subject();
@@ -62,6 +67,7 @@ export class PersonComponent extends WsComponent implements OnInit {
private personAccreditationService: PersonAccreditationService,
private delegateTypeService: DelegateTypeService,
private zoneService: ZoneService,
+ private registrationsService: RegistrationsService,
private logsService: LogsService,
private peopleService: PeopleService,
private location: Location,
@@ -100,6 +106,10 @@ export class PersonComponent extends WsComponent implements OnInit {
})
);
+ this.registrationsService.getHostInfo(this.selectedEvent.id).subscribe(hostInfo => {
+ this.hostInfo = hostInfo;
+ });
+
if (UserRoleUtil.userHasRoles(currentUser, appConfig.worldskillsLogsAppId, 'Admin', 'ViewLogs')) {
// fetch logs
const params = {
@@ -157,6 +167,9 @@ export class PersonComponent extends WsComponent implements OnInit {
private loadPersonAccreditation(personAcrId: number) {
return this.personAccreditationService.getPersonAccreditation(this.selectedEvent.id, personAcrId).subscribe(person => {
this.personAcr = person;
+ this.registrationsService.getRegisteredGroupPerson(this.selectedEvent.id, this.personAcr.registration.group_id, this.personAcr.registration.id).subscribe(registeredPerson => {
+ this.personRegistration = registeredPerson;
+ });
});
}
diff --git a/src/environments/environment.local-staging.ts b/src/environments/environment.local-staging.ts
index 729328e..17ecf9e 100644
--- a/src/environments/environment.local-staging.ts
+++ b/src/environments/environment.local-staging.ts
@@ -8,6 +8,7 @@ export const environment = {
worldskillsApiOrg: 'https://api.worldskills.show/org',
worldskillsApiPeople: 'https://api.worldskills.show/people',
worldskillsApiLogs: 'https://api.worldskills.show/logs',
+ worldskillsApiRegistrations: 'https://api.worldskills.show/registrations',
worldskillsPeople: 'https://people.worldskills.org',
worldskillsAccreditation: 'https://accreditation.worldskills.org',
worldskillsClientId: '842ea70be298',
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index 896fa1d..a424728 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -8,6 +8,7 @@ export const environment = {
worldskillsApiOrg: 'https://api.worldskills.org/org',
worldskillsApiPeople: 'https://api.worldskills.org/people',
worldskillsApiLogs: 'https://api.worldskills.org/logs',
+ worldskillsApiRegistrations: 'https://api.worldskills.org/registrations',
worldskillsAccreditation: 'https://accreditation.worldskills.org',
worldskillsPeople: 'https://people.worldskills.org',
worldskillsClientId: 'a95703d1aa96',
diff --git a/src/environments/environment.staging.ts b/src/environments/environment.staging.ts
index 6b22b09..6ac7747 100644
--- a/src/environments/environment.staging.ts
+++ b/src/environments/environment.staging.ts
@@ -8,6 +8,7 @@ export const environment = {
worldskillsApiOrg: 'https://api.worldskills.show/org',
worldskillsApiPeople: 'https://api.worldskills.show/people',
worldskillsApiLogs: 'https://api.worldskills.show/logs',
+ worldskillsApiRegistrations: 'https://api.worldskills.show/registrations',
worldskillsAccreditation: 'https://accreditation.worldskills.show',
worldskillsPeople: 'https://people.worldskills.show',
worldskillsClientId: 'a95703d1aa96',
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index 498ddfb..f328f6a 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -8,6 +8,7 @@ export const environment = {
worldskillsApiOrg: 'http://localhost:8080/org',
worldskillsApiPeople: 'http://localhost:8080/people',
worldskillsApiLogs: 'http://localhost:8080/logs',
+ worldskillsApiRegistrations: 'http://localhost:8080/registrations',
worldskillsAccreditation: 'http://localhost:4200/',
worldskillsPeople: 'https://people.worldskills.org',
worldskillsClientId: 'a95703d1aa96',
diff --git a/src/services/registrations/registrations.service.spec.ts b/src/services/registrations/registrations.service.spec.ts
new file mode 100644
index 0000000..74e5fab
--- /dev/null
+++ b/src/services/registrations/registrations.service.spec.ts
@@ -0,0 +1,16 @@
+import { TestBed } from '@angular/core/testing';
+
+import { RegistrationsService } from './registrations.service';
+
+describe('RegistrationsService', () => {
+ let service: RegistrationsService;
+
+ beforeEach(() => {
+ TestBed.configureTestingModule({});
+ service = TestBed.inject(RegistrationsService);
+ });
+
+ it('should be created', () => {
+ expect(service).toBeTruthy();
+ });
+});
diff --git a/src/services/registrations/registrations.service.ts b/src/services/registrations/registrations.service.ts
new file mode 100644
index 0000000..a7ce0e4
--- /dev/null
+++ b/src/services/registrations/registrations.service.ts
@@ -0,0 +1,25 @@
+import { HttpClient } from '@angular/common/http';
+import { Injectable } from '@angular/core';
+import { environment } from '../../environments/environment';
+import { Observable } from 'rxjs';
+import { RegistrationPerson } from '../../types/registration-person';
+import { RegistrationHostInfo } from 'src/types/registration-host-info';
+
+@Injectable({
+ providedIn: 'root'
+})
+export class RegistrationsService {
+
+ constructor(private http: HttpClient) { }
+
+ getHostInfo(eventId: number): Observable {
+ let url = `${environment.worldskillsApiRegistrations}/manage/events/${eventId}/host_info`;
+ return this.http.get(url);
+ }
+
+ getRegisteredGroupPerson(eventId: number, groupId: number, registrationId: number): Observable {
+ let url = `${environment.worldskillsApiRegistrations}/register/events/${eventId}/groups/${groupId}/internal/registered_people/${registrationId}`;
+ return this.http.get(url);
+ }
+
+}
diff --git a/src/types/person-accreditation.ts b/src/types/person-accreditation.ts
index 07134f0..07cf118 100644
--- a/src/types/person-accreditation.ts
+++ b/src/types/person-accreditation.ts
@@ -7,6 +7,7 @@ import {Image} from "./image";
import {PackageOptionZone} from "./package-option-zone";
import {Zone} from "./zone";
import {PersonAccreditationSummary} from "./person-accreditation-summary";
+import { PersonRegistration } from "./person-registration";
export interface PersonAccreditation {
id: number;
@@ -21,6 +22,7 @@ export interface PersonAccreditation {
lines: string;
printed: Date;
image: Image;
+ registration: PersonRegistration;
package_option_zones: PackageOptionZone[];
zones_add: Zone[];
zones_remove: Zone[];
diff --git a/src/types/person-registration.ts b/src/types/person-registration.ts
new file mode 100644
index 0000000..e32e127
--- /dev/null
+++ b/src/types/person-registration.ts
@@ -0,0 +1,5 @@
+
+export interface PersonRegistration {
+ id: number;
+ group_id: number;
+}
diff --git a/src/types/registration-host-info.ts b/src/types/registration-host-info.ts
new file mode 100644
index 0000000..0eaa504
--- /dev/null
+++ b/src/types/registration-host-info.ts
@@ -0,0 +1,5 @@
+
+export interface RegistrationHostInfo {
+ id: number;
+ items: any[];
+}
diff --git a/src/types/registration-person.ts b/src/types/registration-person.ts
new file mode 100644
index 0000000..0bf07a0
--- /dev/null
+++ b/src/types/registration-person.ts
@@ -0,0 +1,7 @@
+import { Person } from "@worldskills/worldskills-angular-lib";
+
+export interface RegistrationPerson {
+ id: number;
+ person: Person;
+ person_host_info: any;
+}