Skip to content
Snippets Groups Projects
Commit 4c9891b7 authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

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.
parent eda515db
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment