Display all available entity attributes on EntityModal.

This commit is contained in:
Fabio Manganiello 2023-03-20 14:32:03 +01:00
parent 78bbe71be1
commit 718e0434ba
Signed by untrusted user: blacklight
GPG key ID: D90FBA7F76362774

View file

@ -90,13 +90,6 @@
</div> </div>
</div> </div>
<div v-for="value, attr in entity.data || {}" :key="attr">
<div class="table-row" v-if="value != null">
<div class="title" v-text="prettify(attr)" />
<div class="value" v-text="'' + value" />
</div>
</div>
<div class="table-row" v-if="entity.created_at"> <div class="table-row" v-if="entity.created_at">
<div class="title">Created at</div> <div class="title">Created at</div>
<div class="value" v-text="formatDateTime(entity.created_at)" /> <div class="value" v-text="formatDateTime(entity.created_at)" />
@ -107,6 +100,20 @@
<div class="value" v-text="formatDateTime(entity.updated_at)" /> <div class="value" v-text="formatDateTime(entity.updated_at)" />
</div> </div>
<div v-for="value, attr in entity" :key="attr">
<div class="table-row" v-if="value != null && specialFields.indexOf(attr) < 0">
<div class="title" v-text="prettify(attr)" />
<div class="value" v-text="'' + value" />
</div>
</div>
<div v-for="value, attr in (entity.data || {})" :key="attr">
<div class="table-row" v-if="value != null">
<div class="title" v-text="prettify(attr)" />
<div class="value" v-text="'' + value" />
</div>
</div>
<div class="table-row delete-entity-container"> <div class="table-row delete-entity-container">
<div class="title">Delete Entity</div> <div class="title">Delete Entity</div>
<div class="value"> <div class="value">
@ -152,6 +159,21 @@ import Utils from "@/Utils";
import Entity from "./Entity"; import Entity from "./Entity";
import meta from './meta.json'; import meta from './meta.json';
// These fields have a different rendering logic than the general-purpose one
const specialFields = [
'created_at',
'data',
'description',
'external_id',
'external_url',
'id',
'image_url',
'meta',
'name',
'plugin',
'updated_at',
]
export default { export default {
name: "EntityModal", name: "EntityModal",
components: {Entity, Modal, EditButton, NameEditor, Icon, ConfirmDialog}, components: {Entity, Modal, EditButton, NameEditor, Icon, ConfirmDialog},
@ -188,6 +210,7 @@ export default {
editName: false, editName: false,
editIcon: false, editIcon: false,
configCollapsed: true, configCollapsed: true,
specialFields: specialFields,
} }
}, },