-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates for viewers, extraction to scheme label
- Loading branch information
1 parent
152d5a8
commit c57a9f4
Showing
10 changed files
with
233 additions
and
49 deletions.
There are no files selected for viewing
24 changes: 22 additions & 2 deletions
24
arches_lingo/src/arches_lingo/components/generic/ControlledListItemViewer.vue
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 |
---|---|---|
@@ -1,8 +1,28 @@ | ||
<script setup lang="ts"> | ||
import type { ControlledListItem } from "@/arches_lingo/types"; | ||
const props = defineProps<{ value?: ControlledListItem }>(); | ||
withDefaults( | ||
defineProps<{ | ||
value?: ControlledListItem[] | ControlledListItem; | ||
}>(), | ||
{ | ||
value: () => [], | ||
}, | ||
); | ||
</script> | ||
<template> | ||
<p>{{ props.value?.labels }}</p> | ||
<span v-if="value instanceof Array"> | ||
<span | ||
v-for="val in value" | ||
:key="val.list_id" | ||
> | ||
<span>{{ val.labels[0].value }}</span> | ||
</span> | ||
</span> | ||
<span v-else-if="value"> | ||
<span>{{ (value as ControlledListItem).labels[0].value }}</span> | ||
</span> | ||
<span v-else> | ||
<span>{{ $gettext("None") }}</span> | ||
</span> | ||
</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,134 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
import DataTable from "primevue/datatable"; | ||
import Column from "primevue/column"; | ||
import Button from "primevue/button"; | ||
import type { AppellativeStatus } from "@/arches_lingo/types"; | ||
import ControlledListItemViewer from "@/arches_lingo/components/generic/ControlledListItemViewer.vue"; | ||
import ResourceInstanceRelationshipsViewer from "@/arches_lingo/components/generic/ResourceInstanceRelationshipsViewer.vue"; | ||
const expandedRows = ref([]); | ||
const props = defineProps<{ | ||
value?: AppellativeStatus[]; | ||
}>(); | ||
const emits = defineEmits(["editLabel", "deleteLabel"]); | ||
</script> | ||
<template> | ||
<DataTable | ||
v-model:expanded-rows="expandedRows" | ||
:value="props.value" | ||
onrowexp | ||
table-style="min-width: 50rem" | ||
> | ||
<Column | ||
expander | ||
style="width: 3rem" | ||
/> | ||
<Column | ||
field="appellative_status_ascribed_name_content" | ||
header="Label" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
{{ | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_name_content | ||
}} | ||
</template> | ||
</Column> | ||
<Column | ||
field="appellative_status_ascribed_relation" | ||
header="Label Type" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<ControlledListItemViewer | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_relation | ||
" | ||
> | ||
</ControlledListItemViewer> | ||
</template> | ||
</Column> | ||
<Column | ||
field="appellative_status_ascribed_name_language" | ||
header="Label Language" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<ControlledListItemViewer | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_name_language | ||
" | ||
> | ||
</ControlledListItemViewer> | ||
</template> | ||
</Column> | ||
<Column> | ||
<template #body="slotProps"> | ||
<div class="controls"> | ||
<Button | ||
icon="pi pi-file-edit" | ||
aria-label="edit" | ||
@click=" | ||
() => | ||
emits( | ||
'editLabel', | ||
(slotProps.data as AppellativeStatus) | ||
.tileid, | ||
) | ||
" | ||
/> | ||
<Button | ||
icon="pi pi-trash" | ||
aria-label="delete" | ||
@click=" | ||
() => | ||
emits( | ||
'deleteLabel', | ||
(slotProps.data as AppellativeStatus) | ||
.tileid, | ||
) | ||
" | ||
/> | ||
</div> | ||
</template> | ||
</Column> | ||
<template #expansion="slotProps"> | ||
<div class="drawer"> | ||
<div> | ||
Bibliographic Sources: | ||
<ResourceInstanceRelationshipsViewer | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_data_assignment_object_used | ||
" | ||
></ResourceInstanceRelationshipsViewer> | ||
</div> | ||
<div> | ||
Contributors: | ||
<ResourceInstanceRelationshipsViewer | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_data_assignment_actor | ||
" | ||
></ResourceInstanceRelationshipsViewer> | ||
</div> | ||
</div> | ||
</template> | ||
</DataTable> | ||
</template> | ||
<style scoped> | ||
.controls { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.controls button { | ||
margin: 0 0.5rem; | ||
} | ||
</style> |
24 changes: 17 additions & 7 deletions
24
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationshipsViewer.vue
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 |
---|---|---|
@@ -1,15 +1,25 @@ | ||
<script setup lang="ts"> | ||
import { useGettext } from "vue3-gettext"; | ||
import type { ResourceInstanceReference } from "@/arches_lingo/types"; | ||
import arches from "arches"; | ||
const props = defineProps<{ value?: ResourceInstanceReference[] }>(); | ||
const { $gettext } = useGettext(); | ||
withDefaults(defineProps<{ value?: ResourceInstanceReference[] }>(), { | ||
value: (): ResourceInstanceReference[] => [], | ||
}); | ||
</script> | ||
<template> | ||
<div v-if="props.value"> | ||
<div | ||
v-for="val in props.value" | ||
<span v-if="value"> | ||
<span | ||
v-for="val in value" | ||
:key="val.resourceXresourceId" | ||
class="resource-instance-relationship-view" | ||
> | ||
{{ val.display_value }} | ||
</div> | ||
</div> | ||
<a :href="`${arches.urls.resource_editor}${val.resourceId}`"> | ||
{{ val.display_value }} | ||
</a> | ||
</span> | ||
</span> | ||
<span v-else>{{ $gettext("None") }}</span> | ||
</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
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.