Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changed format for relationship links #159

Merged
merged 2 commits into from
Feb 18, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 35 additions & 24 deletions src/components/entity/EntityResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,22 @@
>
<template #header>
<div>
<div
<span
v-if="
businessAsRelationship[i + relationshipStartIndex].credential
.revoked
"
class="expired-credential"
>
<v-icon>{{mdiCircleMedium}}</v-icon>
Credential expired:
<v-icon>{{ mdiCircleMedium }}</v-icon>
Credential replaced:
{{
businessAsRelationship[i + relationshipStartIndex].credential
.revoked_date | formatDate
}}
</div>
<v-icon v-else>{{mdiCircleMedium}}</v-icon>
</span>

<v-icon v-else>{{ mdiCircleMedium }}</v-icon>
<span @click.stop>
<router-link
:to="`/entity/${
Expand Down Expand Up @@ -247,7 +248,7 @@
<EntityCard
ref="relationships"
:expanded="credentialsExpanded"
v-if="ownedByRelationship"
v-if="ownedByRelationship.length > 0"
>
<template #title>
<div class="flex">
Expand Down Expand Up @@ -281,20 +282,32 @@
</template>
<template #expansionPanels>
<CredentialItem
:cred="credOrRelationshipToDisplay(ownedByRelationship, credSet)"
v-for="(_, i) in ownedByRelationship"
:key="i"
:cred="credOrRelationshipToDisplay(ownedByRelationship[i], credSet)"
:disableDefaultHeader="true"
:effectiveDate="ownedByRelationship.credential.effective_date"
:effectiveDate="ownedByRelationship[i].credential.effective_date"
>
<template #header>
<span
v-if="ownedByRelationship[i].credential.revoked"
class="expired-credential"
>
<v-icon>{{ mdiCircleMedium }}</v-icon>
Credential replaced:
{{ ownedByRelationship[i].credential.revoked_date | formatDate }}
</span>

<v-icon v-else>{{ mdiCircleMedium }}</v-icon>
<span @click.stop>
<router-link
:to="`/entity/${
ownedByRelationship.related_topic &&
ownedByRelationship.related_topic.source_id
ownedByRelationship[i].related_topic &&
ownedByRelationship[i].related_topic.source_id
}`"
class="font-weight-bold"
>
{{ getRelationshipName(ownedByRelationship) }}
{{ getRelationshipName(ownedByRelationship[i]) }}
</router-link>
</span>
</template>
Expand Down Expand Up @@ -365,15 +378,15 @@
<CredentialItem :cred="cred" :timeline="true">
<template #header>
<div class="text-body-2">
<div v-if="cred.revoked" class="expired-credential">
Credential replaced: {{ cred.revoked_date | formatDate }}
</div>
<div
v-else-if="isExpired(cred.attributes)"
class="expired-credential"
>
Credential expired:
{{ isExpired(cred.attributes) | formatDate }}
<div class="expired-credential">
<div v-if="cred.revoked">
Credential replaced:
{{ cred.revoked_date | formatDate }}
</div>
<div v-else-if="isExpired(cred.attributes)">
Credential expired:
{{ isExpired(cred.attributes) | formatDate }}
</div>
</div>
<div
v-if="cred.registration_reason"
Expand Down Expand Up @@ -740,16 +753,14 @@ export default class EntityResult extends Vue {
);
}

get ownedByRelationship(): IRelationship | undefined {
const relationships = this.getRelationships.filter(
get ownedByRelationship(): IRelationship[] {
return this.getRelationships.filter(
(relationship) =>
selectFirstAttrItem(
{ key: "value", value: "IsOwned" },
relationship.attributes
) !== undefined
);

return relationships.length > 0 ? relationships[0] : undefined;
}

get entityName(): string | undefined {
Expand Down