From cf4db5cd4a48f3b06bf082f0803c9a629b2f0f7a Mon Sep 17 00:00:00 2001 From: Matthias Mohr Date: Sun, 5 Jan 2025 01:50:32 +0100 Subject: [PATCH] Improvements for Collections Items --- src/components/modals/CollectionModal.vue | 84 +++++++++++++++++------ src/components/modals/Modal.vue | 7 ++ 2 files changed, 71 insertions(+), 20 deletions(-) diff --git a/src/components/modals/CollectionModal.vue b/src/components/modals/CollectionModal.vue index 78036452e..823c81dca 100644 --- a/src/components/modals/CollectionModal.vue +++ b/src/components/modals/CollectionModal.vue @@ -1,19 +1,33 @@ @@ -22,20 +36,27 @@ import Modal from './Modal.vue'; import Collection from '../Collection.vue'; import Utils from '../../utils.js'; import StacMigrate from '@radiantearth/stac-migrate'; +import AsyncButton from '@openeo/vue-components/components/internal/AsyncButton.vue'; +import Tabs from '@openeo/vue-components/components/Tabs.vue'; +import Tab from '@openeo/vue-components/components/Tab.vue'; export default { name: 'CollectionModal', components: { + AsyncButton, MapExtentViewer: () => import('../maps/MapExtentViewer.vue'), Modal, Collection, - Items: () => import('@openeo/vue-components/components/Items.vue') + Items: () => import('@openeo/vue-components/components/Items.vue'), + Tabs, + Tab }, data() { return { items: [], itemsPage: 0, - itemPages: null + itemPages: null, + showHiddenMap: false }; }, props: { @@ -44,7 +65,7 @@ export default { } }, computed: { - ...Utils.mapState(['connection']), + ...Utils.mapState(['connection', 'pageLimit']), ...Utils.mapGetters(['supports']), currentItems() { if (this.items.length >= this.itemsPage) { @@ -77,7 +98,7 @@ export default { }, async nextItems() { if (!this.itemPages) { - this.itemPages = await this.connection.listCollectionItems(this.collection.id); + this.itemPages = await this.connection.listCollectionItems(this.collection.id, null, null, this.pageLimit); } let items = await this.itemPages.nextPage(); items = items.map(item => StacMigrate.item(item, this.collection, false)); @@ -109,7 +130,30 @@ export default { .vue-component.items > .searchable-list > h2 { display: block; font-size: 1.4em; - margin-top: 1.5em; border-bottom-style: dotted; } + +.modal.collection { + .map-extent { + height: 300px; + } + .modal-content { + padding: 0; + overflow: hidden; + width: 100%; + height: 100%; + } + .items .pagination { + margin: 1em 0; + } + #collection-modal { + width: 100%; + height: 100%; + + > .tabsBody > .tabContent { + padding: 1em; + overflow: auto; + } + } +} \ No newline at end of file diff --git a/src/components/modals/Modal.vue b/src/components/modals/Modal.vue index 7bdf988b6..622887d24 100644 --- a/src/components/modals/Modal.vue +++ b/src/components/modals/Modal.vue @@ -39,6 +39,10 @@ export default { type: String, default: "auto" }, + height: { + type: String, + default: "auto" + }, show: { type: Boolean, default: true @@ -69,6 +73,9 @@ export default { if (this.minWidth) { style['min-width'] = this.minWidth; } + if (this.height) { + style['height'] = this.height; + } if (Array.isArray(this.position)) { style.position = 'absolute'; style.left = this.position[0] + 'px';