From a934626721282e5f8547017a18b2151501371d9c Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Tue, 18 Mar 2025 12:51:19 +0100 Subject: [PATCH 01/20] hotfix: ensure selected collection is draggable - Update draggable attribute and class logic so that the selected collection remains draggable - Preserve proper styling while allowing user interaction with the selected collection --- .../js/Pages/Submitter/Dataset/Category.vue | 33 ++++++++++++++++--- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/resources/js/Pages/Submitter/Dataset/Category.vue b/resources/js/Pages/Submitter/Dataset/Category.vue index 9b3e6b1..ff45dbc 100644 --- a/resources/js/Pages/Submitter/Dataset/Category.vue +++ b/resources/js/Pages/Submitter/Dataset/Category.vue @@ -69,14 +69,21 @@

Selected Collection

-

- {{ `${selectedCollection.name} (${selectedCollection.number})` }} -

+ ]">

--> + + +
-

Narrower Collections

@@ -189,6 +196,16 @@ const broaderCollections = ref([]); // Reactive list that holds collections dropped by the user const selectedCollectionList: Ref = ref([]); + +// Wrap selectedCollection in an array for draggable (always expects an array) +const selectedCollectionArray = computed({ + get: () => (selectedCollection.value ? [selectedCollection.value] : []), + set: (value: Collection[]) => { + selectedCollection.value = value.length ? value[0] : null + } +}) + + const form = useForm({ collections: [] as number[], }); @@ -277,6 +294,12 @@ const fetchCollections = async (collectionId: number) => { const alreadyDropped = selectedCollectionList.value.find(dc => dc.id === collection.id); return alreadyDropped ? { ...collection, inUse: true } : { ...collection, inUse: false }; }); + // Check if selected collection is in the selected list + if (selectedCollection.value && selectedCollectionList.value.find(dc => dc.id === selectedCollection.value.id)) { + selectedCollection.value = { ...selectedCollection.value, inUse: true }; + } else if (selectedCollection.value) { + selectedCollection.value = { ...selectedCollection.value, inUse: false }; + } } catch (error) { console.error('Error in fetchCollections:', error); } From 9f5d35f7bab74b5ee5db6ff7cb0a519fc8650e0d Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Wed, 19 Mar 2025 13:28:02 +0100 Subject: [PATCH 02/20] hotfix: enhance dataset creation and modal styling - Added `@adonisjs/bodyparser` as a dependency. - Improved the layout and styling of the consent modal in `Create.vue`. - Enhanced the placeholder text for reference values in `Create.vue`. - Added a default empty string for the subject in `Create.vue`. - Updated the styling of the `CardBoxModal` component. --- package-lock.json | 1 + package.json | 1 + resources/js/Components/CardBoxModal.vue | 4 +- .../js/Pages/Submitter/Dataset/Create.vue | 62 +++++++++++-------- 4 files changed, 40 insertions(+), 28 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6cf37e3..14d7224 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "1.0.0", "dependencies": { "@adonisjs/auth": "^9.2.4", + "@adonisjs/bodyparser": "^10.0.3", "@adonisjs/core": "^6.17.0", "@adonisjs/cors": "^2.2.1", "@adonisjs/drive": "^3.2.0", diff --git a/package.json b/package.json index cf45027..07f4e7e 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ }, "dependencies": { "@adonisjs/auth": "^9.2.4", + "@adonisjs/bodyparser": "^10.0.3", "@adonisjs/core": "^6.17.0", "@adonisjs/cors": "^2.2.1", "@adonisjs/drive": "^3.2.0", diff --git a/resources/js/Components/CardBoxModal.vue b/resources/js/Components/CardBoxModal.vue index 6e7f9aa..b0fdf01 100644 --- a/resources/js/Components/CardBoxModal.vue +++ b/resources/js/Components/CardBoxModal.vue @@ -61,10 +61,10 @@ const cancel = () => confirmCancel('cancel');

diff --git a/resources/js/Pages/Submitter/Dataset/Create.vue b/resources/js/Pages/Submitter/Dataset/Create.vue index 934c320..8c8373e 100644 --- a/resources/js/Pages/Submitter/Dataset/Create.vue +++ b/resources/js/Pages/Submitter/Dataset/Create.vue @@ -98,23 +98,23 @@ const flash: ComputedRef = computed(() => { // Computed property to determine the placeholder based on the selected option const getPlaceholder = computed(() => (type: string) => { - + switch (type) { - case 'DOI': - return 'https://doi.org/10.24341/tethys.236'; - case 'Handle': - return '20.500.12345/67890'; - case 'ISBN': - return '978-3-85316-076-3'; - case 'ISSN': - return '1234-5678'; - case 'URL': - return 'https://example.com'; - case 'URN': - return 'urn:nbn:de:1234-5678'; - default: - return '[VALUE]'; - } + case 'DOI': + return 'https://doi.org/10.24341/tethys.236'; + case 'Handle': + return '20.500.12345/67890'; + case 'ISBN': + return '978-3-85316-076-3'; + case 'ISSN': + return '1234-5678'; + case 'URL': + return 'https://example.com'; + case 'URN': + return 'urn:nbn:de:1234-5678'; + default: + return '[VALUE]'; + } }); const mainService = MainService(); @@ -462,7 +462,7 @@ const onMapInitialized = (newItem: any) => { adds a new Keyword */ const addKeyword = () => { - let newSubject: Subject = { value: 'test', language: '', type: 'uncontrolled' }; + let newSubject: Subject = { value: '', language: '', type: 'uncontrolled' }; //this.dataset.files.push(uploadedFiles[i]); form.subjects.push(newSubject); }; @@ -499,16 +499,25 @@ Removes a selected keyword