fix: institution visisbility button & refactor ID type (full OpenAlex link vs ID) into parent component
LocationBasedServices/smartguide/pipeline/head This commit looks good

This commit is contained in:
Kazgatari
2026-07-28 09:11:40 +02:00
parent ae8332dc3d
commit b2e70c2bb3
3 changed files with 97 additions and 35 deletions
@@ -109,8 +109,17 @@ export class AuthorSelectorComponent {
this.toggleVisibility.emit(id);
}
private cleanId(id: string | undefined): string {
if (!id) return '';
const lower = id.toLowerCase().trim();
return lower.includes('/') ? lower.split('/').pop()! : lower;
}
isAlreadyAdded(id: string | undefined): boolean {
if (!id) return false;
return this.comparisonAuthors().some((i) => i.id === id);
const cleanTarget = this.cleanId(id);
return this.comparisonAuthors().some(
(i) => this.cleanId(i.id) === cleanTarget,
);
}
}