-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add flexible order of entries in metadata panel (#551)
* feat: add flexible order of metadata items * style: remove unnecessary Metadata ending and unnecessary files * style: restore semicolons for several files * style: restore the semicolons for some other files * refactor: remove 'components' registration --------- Co-authored-by: orlinmalkja <[email protected]>
- Loading branch information
1 parent
dea5ea6
commit 527c8d5
Showing
8 changed files
with
183 additions
and
68 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
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,19 +1,57 @@ | ||
<template> | ||
<div class="metadata-view t-overflow-auto t-break-all t-px-4 t-pt-4"> | ||
<CollectionMetadata v-if="options.collection?.all" /> | ||
<ManifestMetadata v-if="options.manifest?.all" /> | ||
<ItemMetadata v-if="options.manifest?.all" /> | ||
<component | ||
v-for="(documentType, i) in orderDocumentsMetadata" | ||
:is="documentType" | ||
:key="i" | ||
> | ||
</component> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { computed } from 'vue'; | ||
import { useConfigStore } from '@/stores/config'; | ||
import CollectionMetadata from '@/components/metadata/CollectionMetadata.vue'; | ||
import ManifestMetadata from '@/components/metadata/ManifestMetadata.vue'; | ||
import ItemMetadata from '@/components/metadata/ItemMetadata.vue'; | ||
import { getMetadataView } from '@/utils/metadata'; | ||
import CollectionMetadata from '@/components/metadata/CollectionMetadata.vue' | ||
import ManifestMetadata from '@/components/metadata/ManifestMetadata.vue' | ||
import ItemMetadata from '@/components/metadata/ItemMetadata.vue' | ||
defineProps({ | ||
options: Object, | ||
}); | ||
const configStore = useConfigStore() | ||
const config = computed(() => configStore.config) | ||
const metadataView = computed(() => getMetadataView(config.value.panels)) | ||
const userDocumentsOrder = computed( | ||
() => metadataView.value.connector.options.documentsOrder | ||
) | ||
let orderDocumentsMetadata = computed(() => | ||
getDocumentsOrder(userDocumentsOrder.value) | ||
) | ||
function getDocumentsOrder(userOrderDocuments) { | ||
let orderDocumentsMetadata = [] | ||
if (!userOrderDocuments || userOrderDocuments.length === 0) | ||
return [CollectionMetadata, ManifestMetadata, ItemMetadata] | ||
for (let i = 0; i < userOrderDocuments.length; i++) { | ||
const document = userOrderDocuments[i].toLowerCase() | ||
if (document.includes('collection')) | ||
orderDocumentsMetadata.push(CollectionMetadata) | ||
if (document.includes('manifest')) | ||
orderDocumentsMetadata.push(ManifestMetadata) | ||
if (document.includes('item')) orderDocumentsMetadata.push(ItemMetadata) | ||
} | ||
return orderDocumentsMetadata | ||
} | ||
</script> |
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.