Skip to content

Commit

Permalink
Merge pull request #108 from ConductionNL/feature/DIMOC-205/no-save-n…
Browse files Browse the repository at this point in the history
…o-required

you cannot save without required fields being filled
  • Loading branch information
rubenvdlinde authored Aug 6, 2024
2 parents 9e557e6 + b1ebc32 commit 5aa6335
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
12 changes: 7 additions & 5 deletions src/modals/publication/AddPublicationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,24 @@ import { navigationStore, publicationStore } from '../../store/store.js'
<div v-if="success === null" class="form-group">
<NcSelect v-bind="catalogi"
v-model="catalogi.value"
input-label="Catalogi"
input-label="Catalogi *"
:loading="catalogiLoading"
:disabled="publicationLoading"
required />
<NcSelect v-bind="metaData"
v-model="metaData.value"
input-label="MetaData"
input-label="MetaData *"
:loading="metaDataLoading"
:disabled="publicationLoading"
required />
<div v-if="catalogi.value?.id && metaData.value?.id">
<NcTextField :disabled="loading"
label="Titel"
label="Titel *"
required
:value.sync="publication.title" />
<NcTextField :disabled="loading"
label="Samenvatting"
label="Samenvatting *"
required
:value.sync="publication.summary" />
<NcTextArea :disabled="loading"
label="Beschrijving"
Expand Down Expand Up @@ -82,7 +84,7 @@ import { navigationStore, publicationStore } from '../../store/store.js'
</div>
</div>
<NcButton v-if="success === null"
:disabled="(!publication.title && !catalogi?.value?.id && !metaData?.value?.id) || loading"
:disabled="(!publication.title || !catalogi?.value?.id || !metaData?.value?.id || !publication.summary) || loading"
type="primary"
@click="addPublication()">
<template #icon>
Expand Down
8 changes: 5 additions & 3 deletions src/modals/publication/EditPublicationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ import { navigationStore, publicationStore } from '../../store/store.js'
</div>
<div v-if="success === null" class="form-group">
<NcTextField :disabled="loading"
label="Titel"
label="Titel *"
required
:value.sync="publicationItem.title" />
<NcTextField :disabled="loading"
label="Samenvatting"
label="Samenvatting *"
required
:value.sync="publicationItem.summary" />
<NcTextArea :disabled="loading"
label="Beschrijving"
Expand Down Expand Up @@ -66,7 +68,7 @@ import { navigationStore, publicationStore } from '../../store/store.js'
:value.sync="publicationItem.license" />
</div>
<NcButton v-if="success === null"
:disabled="!publicationItem.title"
:disabled="!publicationItem.title || !publicationItem.summary"
type="primary"
@click="updatePublication()">
<template #icon>
Expand Down

0 comments on commit 5aa6335

Please sign in to comment.