From 4c9891b7625a17e1befcd6285af244432904f996 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Tue, 31 Jan 2023 12:38:30 +0100
Subject: [PATCH] person-select: remove the json-ld transformation

We want the users to access all properties of the resources, so
the limited set of transformations wont work here.
---
 packages/person-select/src/person-select.js | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

diff --git a/packages/person-select/src/person-select.js b/packages/person-select/src/person-select.js
index 4a0c3b57..f0ac4317 100644
--- a/packages/person-select/src/person-select.js
+++ b/packages/person-select/src/person-select.js
@@ -14,13 +14,6 @@ import select2CSSPath from 'select2/dist/css/select2.min.css';
 import * as errorUtils from '@dbp-toolkit/common/error';
 import {AdapterLitElement} from '@dbp-toolkit/common';
 
-const personContext = {
-    '@id': '@id',
-    givenName: 'http://schema.org/givenName',
-    familyName: 'http://schema.org/familyName',
-    email: 'http://schema.org/email',
-};
-
 select2(window, $);
 
 export class PersonSelect extends ScopedElementsMixin(AdapterLitElement) {
@@ -185,9 +178,9 @@ export class PersonSelect extends ScopedElementsMixin(AdapterLitElement) {
                         that.$('#person-select-dropdown').addClass('select2-bug');
 
                         that.lastResult = data;
-                        let transformed = that.jsonld.transformMembers(data, personContext);
+                        let members = data['hydra:member'];
                         const results = [];
-                        transformed.forEach((person) => {
+                        members.forEach((person) => {
                             results.push({
                                 id: person['@id'],
                                 text: that.formatPerson(that, person),
@@ -258,14 +251,10 @@ export class PersonSelect extends ScopedElementsMixin(AdapterLitElement) {
                 })
                 .then((person) => {
                     that.object = person;
-                    const transformed = that.jsonld.compactMember(
-                        that.jsonld.expandMember(person),
-                        personContext
-                    );
-                    const identifier = transformed['@id'];
+                    const identifier = person['@id'];
 
                     const option = new Option(
-                        that.formatPerson(this, transformed),
+                        that.formatPerson(this, person),
                         identifier,
                         true,
                         true
-- 
GitLab