Skip to content

Commit

Permalink
fixed the entity display bn on the entity details page
Browse files Browse the repository at this point in the history
Signed-off-by: wadeking98 <wkingnumber2@gmail.com>
  • Loading branch information
wadeking98 committed Mar 14, 2023
1 parent 90fed9f commit e0bee83
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/entity/EntityResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,8 @@ export default class EntityResult extends Vue {
get entityBusinessNumber(): string | undefined {
return selectFirstAttrItem(
{ key: "type", value: "business_number" },
this.entityCredentials?.map((cred) => {
// find the latest business number
this.entityCredentials?.filter(cred => cred.latest)?.map((cred) => {
return {
type: cred.type,
text: cred.value,
Expand Down Expand Up @@ -858,7 +859,7 @@ export default class EntityResult extends Vue {
var fullCredentials: ICredentialDisplayType[] = [];
this.selectedTopicFullCredentialSet.forEach((credSet) => {
//filter out all the raltionship credentials
//filter out all the relationship credentials
fullCredentials.push(
...credSet.credentials
.filter((cred) => !this.isRelationshipCred(cred))
Expand Down
1 change: 1 addition & 0 deletions src/interfaces/api/v4/credential.interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface ICredentialDisplayType {
id: number;
credential_type: string;
rel_id?: string;
latest?: boolean;
type: string;
authority: string;
authorityLink: string | URL;
Expand Down
1 change: 1 addition & 0 deletions src/utils/entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export function credOrRelationshipToDisplay(
if (isCredential(item)) {
const credItem = item as ICredential;
display.id = credItem.id;
display.latest = credItem.latest;
display.authority = credItem.credential_type.issuer.name;
display.authorityLink = credItem.credential_type.issuer.url;
display.type = credItem.names[0]?.type;
Expand Down

0 comments on commit e0bee83

Please sign in to comment.