-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat/detail-view-integration'
- Loading branch information
Showing
62 changed files
with
3,617 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
<script setup lang="ts"> | ||
import { MapPinIcon } from 'lucide-vue-next'; | ||
const {getUnprefixedId} = useIdPrefix(); | ||
const t = useTranslations(); | ||
const props = defineProps<{entity: EntityFeature}>(); | ||
interface Place { | ||
label: string, | ||
id: string, | ||
relationType: RelationType | null | ||
} | ||
const getRelationGroupTitle = (relation: RelationType) => { | ||
if(props.entity.systemClass === 'person') { | ||
return useRelationGroupTitle(relation, 'person') | ||
} | ||
return useRelationGroupTitle(relation) | ||
} | ||
const collapsibleRelations: Array<{ | ||
relationType: RelationType, | ||
title: string | ||
}> = [ | ||
{ | ||
relationType: { | ||
crmCode:"OA7" | ||
}, | ||
title: t(getRelationGroupTitle({crmCode: "OA7"})) | ||
}, | ||
{ | ||
relationType: { | ||
crmCode: "P107", | ||
inverse: true | ||
}, | ||
title: t(getRelationGroupTitle({crmCode:"P107", inverse: true})) | ||
}, | ||
{ | ||
relationType: { | ||
crmCode: "P107" | ||
}, | ||
title: t(getRelationGroupTitle({crmCode:"P107"})) | ||
} | ||
] | ||
const handledRelations: Array<RelationType> = [ | ||
{ | ||
crmCode: "P107" | ||
}, | ||
{ | ||
crmCode: "P74" | ||
}, | ||
{ | ||
crmCode: "OA7" | ||
}, | ||
{ | ||
crmCode: "OA8" | ||
}, | ||
{ | ||
crmCode: "OA9" | ||
} | ||
] | ||
const emit = defineEmits({ | ||
handledRelations(payload: Array<RelationType>) { | ||
return payload; | ||
}} | ||
); | ||
onMounted(() => { | ||
emit("handledRelations", handledRelations); | ||
}) | ||
</script> | ||
|
||
<template> | ||
<GroupedRelationCollapsible | ||
v-for="rel in collapsibleRelations" | ||
:key="rel.relationType.crmCode + rel.relationType.inverse" | ||
:title="rel.title" | ||
:relations="entity.relations" | ||
:relation-type="rel.relationType" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
<script setup lang="ts"> | ||
import {ChevronLeftIcon,ChevronRightIcon } from "lucide-vue-next" | ||
const t = useTranslations(); | ||
const { getUnprefixedId } = useIdPrefix(); | ||
const props = defineProps<{entity: EntityFeature}>(); | ||
const { data, error, isPending, isPlaceholderData, suspense } = useGetBySystemClass( | ||
computed(() => { | ||
return { system_class: "feature"}; | ||
}), | ||
computed(() => { | ||
return { show: ["none"], limit: 0 }; | ||
}) | ||
); | ||
const isLoading = computed(() => { | ||
return isPending.value || isPlaceholderData.value; | ||
}); | ||
const features = computed(() => { | ||
return data.value?.enities.map((feat) => {return feat.features[0]}) ?? []; | ||
}); | ||
const currentFeatureIndex = computed(() => { | ||
return features.value.findIndex((feature) => feature?.['@id'] === props.entity['@id']); | ||
}) | ||
const previousFeature = computed(() => { | ||
if(currentFeatureIndex.value === 0) { | ||
return null | ||
} | ||
return features.value[currentFeatureIndex.value - 1]; | ||
}) | ||
const nextFeature = computed(() => { | ||
if(currentFeatureIndex.value === features.value.length - 1) { | ||
return null | ||
} | ||
return features.value[currentFeatureIndex.value + 1]; | ||
}) | ||
const collapsibleRelations: Array<{ | ||
relationType: RelationType, | ||
systemClass?: string, | ||
title: string | ||
}> = [ | ||
{ | ||
relationType: { | ||
crmCode:"P46" | ||
}, | ||
systemClass: "artifact", | ||
title: t("Relations.Artifacts") | ||
}, | ||
{ | ||
relationType: { | ||
crmCode:"P46" | ||
}, | ||
systemClass: "human_remains", | ||
title: t("Relations.HumanRemains") | ||
}, | ||
] | ||
const emit = defineEmits({ | ||
handledRelations(payload: Array<RelationType>) { | ||
return payload; | ||
}} | ||
); | ||
const handledRelations: Array<RelationType> = [ | ||
{ | ||
crmCode: "P46" | ||
}, | ||
] | ||
onMounted(() => { | ||
emit("handledRelations", handledRelations); | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div class="flex justify-between" > | ||
<NavLink | ||
v-if="previousFeature" | ||
:href="{ path: `/entities/${ getUnprefixedId(previousFeature['@id'])}`}" | ||
class=" | ||
flex items-center | ||
underline decoration-dotted transition hover:no-underline focus-visible:no-underline | ||
" | ||
> | ||
<ChevronLeftIcon class="size-4" /> | ||
<span>{{ previousFeature.properties.title }}</span> | ||
<span class="sr-only">{{ t("EntitySidebar.PreviousFeature") }}</span> | ||
</NavLink> | ||
<NavLink | ||
v-if="nextFeature" | ||
:href="{ path: `/entities/${ getUnprefixedId(nextFeature['@id'])}`}" | ||
class=" | ||
flex items-center | ||
underline decoration-dotted transition hover:no-underline focus-visible:no-underline | ||
" | ||
> | ||
<span>{{ nextFeature.properties.title }}</span> | ||
<span class="sr-only">{{ t("EntitySidebar.NextFeature") }}</span> | ||
<ChevronRightIcon class="size-4" /> | ||
</NavLink> | ||
</div> | ||
<GroupedRelationCollapsible | ||
v-for="rel in collapsibleRelations" | ||
:key="rel.relationType.crmCode + rel.relationType.inverse" | ||
:title="rel.title" | ||
:relations="entity.relations" | ||
:system-class="rel.systemClass" | ||
:relation-type="rel.relationType" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<script setup lang="ts"> | ||
const t = useTranslations(); | ||
const props = defineProps<{entity: EntityFeature}>(); | ||
const collapsibleRelations: Array<{ | ||
relationType: RelationType, | ||
systemClass?: string, | ||
title: string | ||
}> = [ | ||
{ | ||
relationType: { | ||
crmCode:"P46" | ||
}, | ||
systemClass: "artifact", | ||
title: t("Relations.Artifacts") | ||
}, | ||
{ | ||
relationType: { | ||
crmCode:"P46" | ||
}, | ||
systemClass: "human_remains", | ||
title: t("Relations.HumanRemains") | ||
}, | ||
] | ||
const emit = defineEmits({ | ||
handledRelations(payload: Array<RelationType>) { | ||
return payload; | ||
}} | ||
); | ||
const handledRelations: Array<RelationType> = [ | ||
{ | ||
crmCode: "P46" | ||
}, | ||
] | ||
onMounted(() => { | ||
emit("handledRelations", handledRelations); | ||
}) | ||
</script> | ||
|
||
<template> | ||
<GroupedRelationCollapsible | ||
v-for="rel in collapsibleRelations" | ||
:key="rel.relationType.crmCode + rel.relationType.inverse" | ||
:title="rel.title" | ||
:relations="entity.relations" | ||
:system-class="rel.systemClass" | ||
:relation-type="rel.relationType" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<script setup lang="ts"> | ||
const props = defineProps<{aliases: Array<{ alias: string }>}>(); | ||
const aliasList = computed(() => { | ||
return props.aliases.reduce((acc: string, a: {alias: string}) => { | ||
if(acc.length === 0) { | ||
return a.alias; | ||
} else { | ||
return `${acc}, ` + a.alias; | ||
} | ||
},''); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<CardDescription> | ||
{{ aliasList }} | ||
</CardDescription> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.