Skip to content

Commit dae934b

Browse files
authored
Merge pull request #355 from citation-file-format/346-license-validation
improve license field on license screen
2 parents ff7ffc8 + 8166b8f commit dae934b

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/components/ScreenLicense.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,15 @@
1616
<q-select
1717
bg-color="white"
1818
label="license"
19+
clearable
1920
outlined
2021
standout
2122
use-input
2223
v-bind:model-value="license"
2324
v-bind:options="options"
2425
v-bind:error="false"
2526
v-bind:error-message="''"
26-
v-on:filter="filterFn"
27+
v-on:filter="licenseFilterFunction"
2728
v-on:update:model-value="setLicense"
2829
/>
2930
</div>
@@ -48,17 +49,16 @@ export default defineComponent({
4849
StepperActions
4950
},
5051
setup () {
51-
const cff = useCff()
52+
const { license, setLicense } = useCff()
5253
const licenses = schema.definitions['license-enum'].enum
5354
const options = ref(licenses)
5455
5556
return {
56-
license: cff.license,
57-
licenses: licenses,
57+
license,
58+
licenses,
5859
options,
59-
setLicense: cff.setLicense,
60-
61-
filterFn (val: string, update: (a:unknown) => void) {
60+
setLicense,
61+
licenseFilterFunction (val: string, update: (a: unknown) => void) {
6262
if (val === '') {
6363
update(() => {
6464
options.value = licenses

src/store/cffstr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function useCffstr () {
3030
} = useCff()
3131

3232
const notEmpty = (value: unknown, prop: unknown, subject: unknown) => {
33-
return value !== undefined
33+
return value !== undefined && value !== null
3434
}
3535

3636
const makeJavascriptObject = () => {

0 commit comments

Comments
 (0)