Add link full name as page header

master
Max Ehrlicher-Schmidt 4 years ago
parent 5222c65af9
commit 100f53100d

@ -1,6 +1,7 @@
<app-data-page
[dataService]="dataService"
[propertiesInfo]="propertiesInfo"
[getHeadline]="getHeadline"
[headlineDataPath]="headlineDataPath"
[headlineIconName]="headlineIconName"
[pageDataGQLType]="pageDataGQLType"

@ -13,6 +13,13 @@ export class ParticipantComponent implements OnInit {
type: 'Group',
title: 'Allgemein',
properties: [
{
type: 'Link',
linkText: 'Zur Person',
link: (data) => {
return '/person/' + data['contactInformation.person.id'];
},
},
{ dataPath: 'dateRange', translation: 'Zeitraum' },
{ dataPath: 'usernamefLotte', translation: 'User fLotte' },
{ dataPath: 'usernameSlack', translation: 'User Slack' },
@ -104,14 +111,24 @@ export class ParticipantComponent implements OnInit {
},
];
headlineDataPath = 'contactInformation.person.name';
getHeadline = (pageData) => {
return (
pageData['contactInformation.person.firstName'] +
' ' +
pageData['contactInformation.person.name'] +
' (Aktive*r)'
);
};
headlineIconName = 'directions_run';
pageDataGQLType: string = 'Participant';
pageDataGQLUpdateInputType: string = 'ParticipantUpdateInput';
dataService: any;
constructor(private participantsService: ParticipantsService, private workshopsService: WorkshopsService) {
constructor(
private participantsService: ParticipantsService,
private workshopsService: WorkshopsService
) {
this.workshopsService.loadTableData();
this.workshopsService.tableData.subscribe((data) => {
this.propertiesInfo.find(

@ -1,6 +1,7 @@
<app-data-page
[dataService]="dataService"
[propertiesInfo]="propertiesInfo"
[getHeadline]="getHeadline"
[headlineDataPath]="headlineDataPath"
[headlineIconName]="headlineIconName"
[pageDataGQLType]="pageDataGQLType"

@ -30,10 +30,21 @@ export class PersonComponent implements OnInit {
],
editableReferences: false,
linkToTable: () => '/table/contactInformation',
linkToTableParams: (person) => {
return { "person.name": person.name, "person.firstName": person.firstName,};
},
},
];
headlineDataPath = 'name';
getHeadline = (pageData) => {
return (
pageData['firstName'] +
' ' +
pageData['name'] +
' (Person)'
);
};
headlineIconName = 'person';
pageDataGQLType: string = 'Person';
pageDataGQLUpdateInputType: string = 'PersonUpdateInput';

Loading…
Cancel
Save