diff --git a/src/modals/publication/AddPublicationModal.vue b/src/modals/publication/AddPublicationModal.vue
index 099246f6..9b57bf69 100644
--- a/src/modals/publication/AddPublicationModal.vue
+++ b/src/modals/publication/AddPublicationModal.vue
@@ -21,19 +21,34 @@ import { navigationStore, publicationStore } from '../../store/store.js'
-
-
-
-
-
- Toevoegen
-
@@ -134,7 +144,6 @@ export default {
description: '',
reference: '',
license: '',
- modified: new Date(),
featured: false,
portal: '',
category: '',
@@ -185,13 +194,19 @@ export default {
})
.then((response) => {
response.json().then((data) => {
+ const selectedCatalogus = data.results.filter((catalogus) => catalogus.id.toString() === navigationStore.selectedCatalogus.toString())[0]
this.catalogi = {
options: Object.entries(data.results).map((catalog) => ({
id: catalog[1].id,
label: catalog[1].title,
})),
-
+ value: navigationStore.selectedCatalogus
+ ? {
+ id: selectedCatalogus.id,
+ label: selectedCatalogus.title,
+ }
+ : null,
}
})
this.catalogiLoading = false
@@ -269,7 +284,6 @@ export default {
description: '',
reference: '',
license: '',
- modified: new Date(),
featured: false,
portal: '',
category: '',
@@ -324,4 +338,8 @@ export default {
flex-direction: row;
align-items: center;
}
+
+.apm-submit-button {
+ margin-block-start: 1rem
+}
diff --git a/src/modals/publication/EditPublicationModal.vue b/src/modals/publication/EditPublicationModal.vue
index 43a40a87..6f1674ba 100644
--- a/src/modals/publication/EditPublicationModal.vue
+++ b/src/modals/publication/EditPublicationModal.vue
@@ -41,17 +41,11 @@ import { navigationStore, publicationStore } from '../../store/store.js'
label="Portaal"
:value.sync="publicationItem.portal" />
- Published
+ Publicatie datum
-
- Modified
-
-
{
response.json().then((data) => {
publicationStore.setPublicationItem(data)
+ this.publicationItem = publicationStore.publicationItem
})
this.loading = false
})
@@ -180,65 +171,6 @@ export default {
this.loading = false
})
},
- fetchCatalogi() {
- this.catalogiLoading = true
- fetch('/index.php/apps/opencatalogi/api/catalogi', {
- method: 'GET',
- })
- .then((response) => {
- response.json().then((data) => {
-
- const selectedCatalogi = data.results.find((catalogi) => catalogi.id.toString() === this.publicationItem.catalogi.toString())
-
- this.catalogi = {
- inputLabel: 'Catalogi',
- options: data.results.map((catalog) => ({
- id: catalog.id,
- label: catalog.title,
- })),
- // FIXME: for some reason the NcSelect uses the id instead of the label when displaying
- value: [{
- id: selectedCatalogi.id ?? '',
- label: selectedCatalogi.title ?? '',
- }],
- }
- })
- this.catalogiLoading = false
- })
- .catch((err) => {
- console.error(err)
- this.catalogiLoading = false
- })
- },
- fetchMetaData() {
- this.metaDataLoading = true
- fetch('/index.php/apps/opencatalogi/api/metadata', {
- method: 'GET',
- })
- .then((response) => {
- response.json().then((data) => {
- const selectedMetaData = data.results.find((metadata) => metadata.id.toString() === this.publicationItem.metaData.toString())
-
- this.metaData = {
- inputLabel: 'MetaData',
- options: data.results.map((metaData) => ({
- id: metaData.id,
- label: metaData.title,
- })),
- // FIXME: for some reason the NcSelect uses the id instead of the label when displaying
- value: {
- id: selectedMetaData.id,
- label: selectedMetaData.title,
- },
- }
- })
- this.metaDataLoading = false
- })
- .catch((err) => {
- console.error(err)
- this.metaDataLoading = false
- })
- },
updatePublication() {
this.loading = true
fetch(