-
Notifications
You must be signed in to change notification settings - Fork 0
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
genericizes label viewer #161
Merged
aarongundel
merged 10 commits into
adg/146-scheme-names
from
adg/146-genericize-label-viewer
Jan 2, 2025
Merged
Changes from 8 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7b2737d
genericizes label viewer
aarongundel 3f728bf
Merge branch 'adg/146-scheme-names' into adg/146-genericize-label-viewer
aarongundel 832365b
rename label viewer to metastring viewer
aarongundel bc16aa5
Merge branch 'adg/146-scheme-names' into adg/146-genericize-label-viewer
aarongundel e61f26c
imports from constants, fix zoom
aarongundel 694cac1
Merge branch 'adg/146-scheme-names' into adg/146-genericize-label-viewer
aarongundel 0868230
adds notes section (#162)
aarongundel eb985a4
Merge branch 'adg/146-scheme-names' into adg/146-genericize-label-viewer
aarongundel 82f4dcf
pr feedback
aarongundel d3e539f
pr feedback :ping_pong:
aarongundel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -1,164 +0,0 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
import { useGettext } from "vue3-gettext"; | ||
import DataTable from "primevue/datatable"; | ||
import Column from "primevue/column"; | ||
import Button from "primevue/button"; | ||
import ConfirmDialog from "primevue/confirmdialog"; | ||
import { useConfirm } from "primevue/useconfirm"; | ||
|
||
import ControlledListItem from "@/arches_lingo/components/generic/ControlledListItem.vue"; | ||
import ResourceInstanceRelationships from "@/arches_lingo/components/generic/ResourceInstanceRelationships.vue"; | ||
|
||
import type { AppellativeStatus } from "@/arches_lingo/types"; | ||
|
||
const { $gettext } = useGettext(); | ||
const confirm = useConfirm(); | ||
|
||
const props = defineProps<{ | ||
value?: AppellativeStatus[]; | ||
}>(); | ||
|
||
const emits = defineEmits(["editLabel", "deleteLabel"]); | ||
|
||
const expandedRows = ref([]); | ||
|
||
function confirmDelete(tileId: string) { | ||
confirm.require({ | ||
header: $gettext("Confirmation"), | ||
message: $gettext("Are you sure you want to delete this label?"), | ||
accept: () => { | ||
emits("deleteLabel", tileId); | ||
}, | ||
rejectProps: { | ||
label: "Cancel", | ||
severity: "secondary", | ||
outlined: true, | ||
}, | ||
acceptProps: { | ||
label: "Delete", | ||
severity: "danger", | ||
}, | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ConfirmDialog | ||
:pt="{ root: { style: { fontFamily: 'sans-serif' } } }" | ||
></ConfirmDialog> | ||
<DataTable | ||
v-model:expanded-rows="expandedRows" | ||
:value="props.value" | ||
table-style="min-width: 50rem" | ||
> | ||
<Column | ||
expander | ||
style="width: 3rem" | ||
/> | ||
<Column | ||
field="appellative_status_ascribed_name_content" | ||
:header="$gettext('Label')" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
{{ | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_name_content | ||
}} | ||
</template> | ||
</Column> | ||
<Column | ||
field="appellative_status_ascribed_relation" | ||
:header="$gettext('Label Type')" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<ControlledListItem | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_relation | ||
" | ||
> | ||
</ControlledListItem> | ||
</template> | ||
</Column> | ||
<Column | ||
field="appellative_status_ascribed_name_language" | ||
:header="$gettext('Label Language')" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<ControlledListItem | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_ascribed_name_language | ||
" | ||
> | ||
</ControlledListItem> | ||
</template> | ||
</Column> | ||
<Column> | ||
<template #body="slotProps"> | ||
<div class="controls"> | ||
<Button | ||
icon="pi pi-file-edit" | ||
:aria-label="$gettext('edit')" | ||
@click=" | ||
() => | ||
emits( | ||
'editLabel', | ||
(slotProps.data as AppellativeStatus) | ||
.tileid, | ||
) | ||
" | ||
/> | ||
<Button | ||
icon="pi pi-trash" | ||
:aria-label="$gettext('delete')" | ||
severity="danger" | ||
outlined | ||
@click=" | ||
() => | ||
confirmDelete( | ||
(slotProps.data as AppellativeStatus) | ||
.tileid, | ||
) | ||
" | ||
/> | ||
</div> | ||
</template> | ||
</Column> | ||
<template #expansion="slotProps"> | ||
<div class="drawer"> | ||
<div> | ||
{{ $gettext("Bibliographic Sources") }}: | ||
<ResourceInstanceRelationships | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_data_assignment_object_used | ||
" | ||
></ResourceInstanceRelationships> | ||
</div> | ||
<div> | ||
{{ $gettext("Contributors") }}: | ||
<ResourceInstanceRelationships | ||
:value=" | ||
(slotProps.data as AppellativeStatus) | ||
.appellative_status_data_assignment_actor | ||
" | ||
></ResourceInstanceRelationships> | ||
</div> | ||
</div> | ||
</template> | ||
</DataTable> | ||
</template> | ||
<style scoped> | ||
.controls { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.controls button { | ||
margin: 0 0.5rem; | ||
} | ||
</style> | ||
138 changes: 138 additions & 0 deletions
138
arches_lingo/src/arches_lingo/components/generic/MetaStringViewer.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 |
---|---|---|
@@ -0,0 +1,138 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
import { useGettext } from "vue3-gettext"; | ||
import DataTable from "primevue/datatable"; | ||
import Column from "primevue/column"; | ||
import Button from "primevue/button"; | ||
import ConfirmDialog from "primevue/confirmdialog"; | ||
import { useConfirm } from "primevue/useconfirm"; | ||
|
||
import type { MetaString, MetaStringText } from "@/arches_lingo/types.ts"; | ||
import { SECONDARY } from "@/arches_lingo/constants.ts"; | ||
import { DANGER } from "@/arches_references/constants.ts"; | ||
|
||
const { $gettext } = useGettext(); | ||
const confirm = useConfirm(); | ||
|
||
const props = defineProps<{ | ||
metaStringText: MetaStringText; | ||
metaStrings?: object[]; | ||
}>(); | ||
|
||
const emits = defineEmits(["editString", "deleteString"]); | ||
const expandedRows = ref([]); | ||
function confirmDelete(tileId: string) { | ||
confirm.require({ | ||
header: $gettext("Confirmation"), | ||
message: props.metaStringText.deleteConfirm, | ||
group: props.metaStringText.name, | ||
accept: () => { | ||
emits("deleteString", tileId); | ||
}, | ||
rejectProps: { | ||
label: $gettext("Cancel"), | ||
severity: SECONDARY, | ||
outlined: true, | ||
}, | ||
acceptProps: { | ||
label: $gettext("Delete"), | ||
severity: DANGER, | ||
}, | ||
}); | ||
} | ||
</script> | ||
|
||
<template> | ||
<ConfirmDialog | ||
:pt="{ root: { style: { fontFamily: 'sans-serif' } } }" | ||
:group="metaStringText.name" | ||
></ConfirmDialog> | ||
<DataTable | ||
v-model:expanded-rows="expandedRows" | ||
:value="props.metaStrings" | ||
> | ||
<Column | ||
expander | ||
style="width: 3rem" | ||
/> | ||
<Column | ||
:header="props.metaStringText.name" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<slot | ||
name="name" | ||
:row-data="slotProps.data" | ||
></slot> | ||
</template> | ||
</Column> | ||
<Column | ||
:header="props.metaStringText.type" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<slot | ||
name="type" | ||
:row-data="slotProps.data" | ||
></slot> | ||
</template> | ||
</Column> | ||
<Column | ||
:header="props.metaStringText.language" | ||
sortable | ||
> | ||
<template #body="slotProps"> | ||
<slot | ||
name="language" | ||
:row-data="slotProps.data" | ||
></slot> | ||
</template> | ||
</Column> | ||
<Column> | ||
<template #body="slotProps"> | ||
<div class="controls"> | ||
<Button | ||
icon="pi pi-file-edit" | ||
:aria-label="$gettext('edit')" | ||
@click=" | ||
() => | ||
emits( | ||
'editString', | ||
(slotProps.data as MetaString).tileid, | ||
) | ||
" | ||
/> | ||
<Button | ||
icon="pi pi-trash" | ||
:aria-label="$gettext('delete')" | ||
severity="danger" | ||
outlined | ||
@click=" | ||
() => | ||
confirmDelete( | ||
(slotProps.data as MetaString).tileid, | ||
) | ||
" | ||
/> | ||
</div> | ||
</template> | ||
</Column> | ||
<template #expansion="slotProps"> | ||
<div class="drawer"> | ||
<slot | ||
name="drawer" | ||
:row-data="slotProps.data" | ||
></slot> | ||
</div> | ||
</template> | ||
</DataTable> | ||
</template> | ||
<style scoped> | ||
.controls { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.controls button { | ||
margin: 0 0.5rem; | ||
} | ||
</style> |
2 changes: 1 addition & 1 deletion
2
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationships.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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've seen this repeated enough that I'm wondering if there's some base style setting we can tweak to obviate this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps we could create a constant with this object value? I'm not sure there's a supported way to tweak the base style, though. cc @jacobtylerwalls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I recall the problem is that primevue appends DOM elements for modals and tooltips outside the
<main>
element.