-
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.
Merge pull request #153 from archesproject/adg/146-scheme-names
Adds scheme names/labels section
- Loading branch information
Showing
29 changed files
with
943 additions
and
215 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
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
8 changes: 0 additions & 8 deletions
8
arches_lingo/src/arches_lingo/components/generic/ControlledListItemViewer.vue
This file was deleted.
Oops, something went wrong.
Empty file.
142 changes: 142 additions & 0 deletions
142
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,142 @@ | ||
<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 expandedRows = ref([]); | ||
const confirm = useConfirm(); | ||
const props = defineProps<{ | ||
metaStringText: MetaStringText; | ||
metaStrings?: object[]; | ||
}>(); | ||
const emits = defineEmits(["editString", "deleteString"]); | ||
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> | ||
<div v-if="props.metaStrings?.length"> | ||
<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> | ||
</div> | ||
<div v-else>{{ props.metaStringText.noRecords }}</div> | ||
</template> | ||
<style scoped> | ||
.controls { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
.controls button { | ||
margin: 0 0.5rem; | ||
} | ||
</style> |
6 changes: 3 additions & 3 deletions
6
arches_lingo/src/arches_lingo/components/generic/NonLocalizedString.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
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
15 changes: 0 additions & 15 deletions
15
arches_lingo/src/arches_lingo/components/generic/ResourceInstanceRelationshipsViewer.vue
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
...ngo/src/arches_lingo/components/generic/controlled-list-item/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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<script setup lang="ts"> | ||
import type { ControlledListItem } from "@/arches_lingo/types"; | ||
withDefaults( | ||
defineProps<{ | ||
value?: ControlledListItem[] | ControlledListItem; | ||
}>(), | ||
{ | ||
value: () => [], | ||
}, | ||
); | ||
</script> | ||
<template> | ||
<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> |
File renamed without changes.
File renamed without changes.
File renamed without changes.
31 changes: 31 additions & 0 deletions
31
...omponents/generic/resource-instance-relationships/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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script setup lang="ts"> | ||
import { useGettext } from "vue3-gettext"; | ||
import arches from "arches"; | ||
import type { ResourceInstanceReference } from "@/arches_lingo/types"; | ||
const { $gettext } = useGettext(); | ||
withDefaults(defineProps<{ value?: ResourceInstanceReference[] }>(), { | ||
value: (): ResourceInstanceReference[] => [], | ||
}); | ||
</script> | ||
<template> | ||
<span v-if="value"> | ||
<span | ||
v-for="val in value" | ||
:key="val.resourceXresourceId" | ||
class="resource-instance-relationship-view" | ||
> | ||
<a :href="`${arches.urls.resource_editor}${val.resourceId}`"> | ||
{{ val.display_value }} | ||
</a> | ||
</span> | ||
</span> | ||
<span v-else>{{ $gettext("None") }}</span> | ||
</template> | ||
|
||
<style scoped> | ||
.resource-instance-relationship-view { | ||
padding: 0 0.25rem; | ||
} | ||
</style> |
Oops, something went wrong.