Adds subtitles to external dropdowns (Researchers, Organisations). (Issue #139)
This commit is contained in:
parent
68b699ea63
commit
d1c04289ce
|
@ -11,6 +11,7 @@ public class ResearcherBuilder extends Builder<Researcher> {
|
|||
private String name;
|
||||
private String id;
|
||||
private int status;
|
||||
private String tag;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
|
@ -48,6 +49,15 @@ public class ResearcherBuilder extends Builder<Researcher> {
|
|||
return this;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public ResearcherBuilder tag(String tag) {
|
||||
this.tag = tag;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Researcher build() {
|
||||
Researcher researcher = new Researcher();
|
||||
|
@ -55,6 +65,7 @@ public class ResearcherBuilder extends Builder<Researcher> {
|
|||
researcher.setLabel(label);
|
||||
researcher.setName(name);
|
||||
researcher.setStatus(status);
|
||||
researcher.setTag(tag);
|
||||
return researcher;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ public class ResearcherManager {
|
|||
.label(externalListingItem.getAbbreviation())
|
||||
.id(externalListingItem.getId())
|
||||
.name(externalListingItem.getName())
|
||||
.tag(externalListingItem.getTag())
|
||||
.build();
|
||||
researchers.add(researcher);
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ public class Researcher implements DataModel<eu.eudat.data.entities.Researcher,
|
|||
private String name;
|
||||
private String id;
|
||||
private int status;
|
||||
private String tag;
|
||||
|
||||
public String getLabel() {
|
||||
return label;
|
||||
|
@ -43,12 +44,21 @@ public class Researcher implements DataModel<eu.eudat.data.entities.Researcher,
|
|||
this.status = status;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Researcher fromDataModel(eu.eudat.data.entities.Researcher entity) {
|
||||
this.id = entity.getReference();
|
||||
this.label = entity.getUri();
|
||||
this.name = entity.getLabel();
|
||||
this.status = entity.getStatus();
|
||||
this.tag = "Internal";
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ public class ExternalSourcesItemModel {
|
|||
private String uri;
|
||||
private String remoteId;
|
||||
private String abbreviation;
|
||||
private String tag;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
|
@ -56,4 +57,12 @@ public class ExternalSourcesItemModel {
|
|||
public void setAbbreviation(String abbreviation) {
|
||||
this.abbreviation = abbreviation;
|
||||
}
|
||||
|
||||
public String getTag() {
|
||||
return tag;
|
||||
}
|
||||
|
||||
public void setTag(String tag) {
|
||||
this.tag = tag;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ public class OrganisationsExternalSourcesModel extends ExternalListingItem<Organ
|
|||
model.setId(item.get("pid"));
|
||||
model.setUri(item.get("uri"));
|
||||
model.setName(item.get("name"));
|
||||
model.setTag(item.get("tag"));
|
||||
this.add(model);
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -12,6 +12,7 @@ public class ResearchersExternalSourcesModel extends ExternalListingItem<Researc
|
|||
model.setId(item.get("pid"));
|
||||
model.setUri(item.get("uri"));
|
||||
model.setName(item.get("name"));
|
||||
model.setTag(item.get("tag"));
|
||||
this.add(model);
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -12,6 +12,7 @@ public class ServiceExternalSourcesModel extends ExternalListingItem<ServiceExte
|
|||
model.setId(item.get("pid"));
|
||||
model.setUri(item.get("label"));
|
||||
model.setName(item.get("name"));
|
||||
model.setTag(item.get("tag"));
|
||||
this.add(model);
|
||||
}
|
||||
return this;
|
||||
|
|
|
@ -77,14 +77,16 @@ export class GeneralTabComponent extends BaseComponent implements OnInit {
|
|||
filterFn: this.filterOrganisations.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterOrganisations('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['name'],
|
||||
titleFn: (item) => item['name']
|
||||
titleFn: (item) => item['name'],
|
||||
subtitleFn: (item) => item ? item['tag'] : null
|
||||
};
|
||||
|
||||
this.researchersAutoCompleteConfiguration = {
|
||||
filterFn: this.filterResearchers.bind(this),
|
||||
initialItems: (excludedItems: any[]) => this.filterResearchers('').map(result => result.filter(resultItem => excludedItems.map(x => x.id).indexOf(resultItem.id) === -1)),
|
||||
displayFn: (item) => item['name'],
|
||||
titleFn: (item) => item['name']
|
||||
titleFn: (item) => item['name'],
|
||||
subtitleFn: (item) => item ? item['tag'] : null
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue