Skip to content

Commit

Permalink
fixup! Changes to allow for a single form per tile (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
aarongundel committed Jan 3, 2025
1 parent abd7b09 commit 3f68847
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 77 deletions.
155 changes: 79 additions & 76 deletions arches_lingo/src/arches_lingo/components/generic/MetaStringViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,85 +48,88 @@ function confirmDelete(tileId: string) {
: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
<div v-if="props.metaStrings?.length">
<DataTable
v-model:expanded-rows="expandedRows"
:value="props.metaStrings"
>
<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,
)
"
/>
<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>
</Column>
<template #expansion="slotProps">
<div class="drawer">
<slot
name="drawer"
:row-data="slotProps.data"
></slot>
</div>
</template>
</DataTable>
</DataTable>
</div>
<div v-else>{{ props.metaStringText.noRecords }}</div>
</template>
<style scoped>
.controls {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const metaStringLabel: MetaStringText = {
language: $gettext("Label Language"),
name: $gettext("Label Name"),
type: $gettext("Label Type"),
noRecords: $gettext("No scheme labels were found."),
};
withDefaults(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const metaStringLabel: MetaStringText = {
language: $gettext("Note Language"),
name: $gettext("Note Name"),
type: $gettext("Note Type"),
noRecords: $gettext("No scheme notes were found."),
};
withDefaults(
Expand Down Expand Up @@ -94,7 +95,7 @@ function editSectionValue(tileId: string) {
toast.add({
severity: ERROR,
summary: $gettext("Error"),
detail: $gettext("Could not find the selected label to edit"),
detail: $gettext("Could not find the selected note to edit"),
});
}
}
Expand Down
1 change: 1 addition & 0 deletions arches_lingo/src/arches_lingo/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ export interface MetaStringText {
type: string;
language: string;
deleteConfirm: string;
noRecords: string;
}

export interface AppellativeStatus {
Expand Down

0 comments on commit 3f68847

Please sign in to comment.