Skip to content

Commit

Permalink
Filtering firstname with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
Vijeinath committed Sep 23, 2020
1 parent 717e97f commit fc68a89
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/app/search/browsing/browsing.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ export class BrowsingComponent implements OnInit {
getListName(alphaRes: any): string {
switch (this.resTypeSelected) {
case "author": {
return alphaRes.hasFirstName ? `${alphaRes.hasLastName[0].value}, ${alphaRes.hasFirstName[0].value}` : alphaRes.hasLastName[0].value;
return (alphaRes.hasFirstName && alphaRes.hasFirstName[0].value !== "_") ? `${alphaRes.hasLastName[0].value}, ${alphaRes.hasFirstName[0].value}` : alphaRes.hasLastName[0].value;
}
case "book": {
return alphaRes.hasBookTitle[0].value;
Expand Down
2 changes: 1 addition & 1 deletion src/app/search/results/pipe/bibliography.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class BibliographyPipe implements PipeTransform {
const book = detailPas.occursIn[0];

const authors = book.isWrittenBy
.map(author => author.hasFirstName ? {firstName: author.hasFirstName[0].value, lastName: author.hasLastName[0].value} :
.map(author => (author.hasFirstName && author.hasFirstName[0].value !== "_") ? {firstName: author.hasFirstName[0].value, lastName: author.hasLastName[0].value} :
{lastName: author.hasLastName[0].value}
)
.sort((author1, author2) => author1.lastName < author2.lastName ? -1 : (author1.lastName > author2.lastName ? 1 : 0)
Expand Down
2 changes: 1 addition & 1 deletion src/app/search/results/pipe/title.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export class TitlePipe implements PipeTransform {
const book = passage.occursIn[0];

const authors = book.isWrittenBy
.map(author => author.hasFirstName ? {firstName: author.hasFirstName[0].value, lastName: author.hasLastName[0].value} :
.map(author => (author.hasFirstName && author.hasFirstName[0].value !== "_") ? {firstName: author.hasFirstName[0].value, lastName: author.hasLastName[0].value} :
{lastName: author.hasLastName[0].value}
)
.sort((author1, author2) => author1.lastName < author2.lastName ? -1 : (author1.lastName > author2.lastName ? 1 : 0)
Expand Down

0 comments on commit fc68a89

Please sign in to comment.