Skip to content

Commit 79cd902

Browse files
authored
Merge pull request #429 from citation-file-format/develop
Develop
2 parents 818c2bf + 625173e commit 79cd902

22 files changed

Lines changed: 75 additions & 63 deletions

package-lock.json

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

quasar.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ module.exports = configure(function () {
100100
positive: '#21BA45',
101101
negative: '#C10015',
102102
info: '#31CCEC',
103-
warning: '#F2C037'
103+
warning: '#F9E3A4'
104104

105105
}
106106
},

src/author-errors.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getMyErrors } from 'src/store/validator'
1+
import { messageErrorType, getMyErrors } from 'src/store/validator'
22

33
export const authorErrors = (index:number) => {
44
const myErrors = [
@@ -17,5 +17,5 @@ export const authorErrors = (index:number) => {
1717
return {
1818
hasError: errors.some(result => result.hasError),
1919
messages: errors[0].hasError ? errors[0].messages : []
20-
}
20+
} as messageErrorType
2121
}

src/authors-errors.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { AuthorsType } from 'src/types'
2-
import { getMyErrors } from 'src/store/validator'
2+
import { messageErrorType, getMyErrors } from 'src/store/validator'
33
import { authorErrors } from 'src/author-errors'
44

55
export const authorsErrors = (authors:AuthorsType) => {
@@ -9,8 +9,12 @@ export const authorsErrors = (authors:AuthorsType) => {
99
]
1010
const myChildrenErrors = authors?.map((_, index) => authorErrors(index))
1111
const errors = myChildrenErrors === undefined ? myErrors : [...myErrors, ...myChildrenErrors]
12+
let allMessages = [] as string[]
13+
errors.forEach(error => {
14+
allMessages = allMessages.concat(error.messages)
15+
})
1216
return {
13-
hasError: errors.some(result => result.hasError),
14-
messages: errors.map(result => result.messages.join(', '))
15-
}
17+
hasError: errors.some(error => error.hasError),
18+
messages: allMessages
19+
} as messageErrorType
1620
}

src/components/AuthorCardEditing.vue

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<q-card
33
flat
44
bordered
5-
v-bind:class="['bg-formcard', 'q-pa-md', authorErrors.hasError ? 'red-border' : '']"
5+
class="bg-formcard q-pa-md"
66
>
77
<div class="row">
88
<q-input
@@ -17,6 +17,7 @@
1717
v-bind:error="givenNamesError.hasError"
1818
v-bind:error-message="givenNamesError.messages.join(', ')"
1919
v-on:update:modelValue="$emit('update', 'givenNames', $event)"
20+
ref="givenNamesRef"
2021
/>
2122
</div>
2223
<div class="row">
@@ -94,6 +95,7 @@
9495
bg-color="white"
9596
class="col"
9697
dense
98+
hint="Format: https://orcid.org/0000-0000-0000-0000"
9799
label="orcid"
98100
outlined
99101
standout
@@ -106,7 +108,7 @@
106108
</div>
107109

108110
<q-banner
109-
v-if="authorErrors.hasError && authorErrors.messages.length > 0"
111+
v-if="authorErrors.messages.length > 0"
110112
class="bg-warning text-negative"
111113
>
112114
<div
@@ -153,7 +155,7 @@
153155

154156
<script lang="ts">
155157
/* eslint-disable @typescript-eslint/restrict-template-expressions */
156-
import { computed, defineComponent } from 'vue'
158+
import { computed, defineComponent, onMounted, ref } from 'vue'
157159
import { getMyErrors } from 'src/store/validator'
158160
import { authorErrors } from 'src/author-errors'
159161
@@ -198,7 +200,12 @@ export default defineComponent({
198200
}
199201
},
200202
setup (props) {
203+
const givenNamesRef = ref<HTMLElement | null>(null)
204+
onMounted(() => {
205+
givenNamesRef.value?.focus()
206+
})
201207
return {
208+
givenNamesRef,
202209
givenNamesError: computed(() => getMyErrors(`/authors/${props.index}/given-names`)),
203210
nameParticleError: computed(() => getMyErrors(`/authors/${props.index}/name-particle`)),
204211
familyNamesError: computed(() => getMyErrors(`/authors/${props.index}/family-names`)),
@@ -207,6 +214,7 @@ export default defineComponent({
207214
affiliationError: computed(() => getMyErrors(`/authors/${props.index}/affiliation`)),
208215
orcidError: computed(() => getMyErrors(`/authors/${props.index}/orcid`)),
209216
authorErrors: computed(() => authorErrors(props.index))
217+
210218
}
211219
},
212220
emits: ['closePressed', 'removePressed', 'update', 'moveUp', 'moveDown']

src/components/IdentifierCardEditing.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<q-card
33
flat
44
bordered
5-
v-bind:class="['bg-formcard', 'q-pa-md', identifierErrors.hasError ? 'red-border' : '']"
5+
class="bg-formcard q-pa-md"
66
>
77
<q-card-section>
88
<div class="row items-center no-wrap">

src/components/Preview.vue

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
wrap="hard"
3737
/>
3838
<div class="validation-msg">
39-
<p>
39+
<p v-bind:class="isValidCFF ? '' : 'invalid'">
4040
Your CITATION.cff is {{ isValidCFF ? "valid" : "not valid" }}
4141
</p>
4242
</div>
@@ -122,5 +122,7 @@ export default defineComponent({
122122
border-color: #C10015 !important;
123123
border-width: 2px !important;
124124
}
125-
125+
.invalid {
126+
color: var(--q-negative);
127+
}
126128
</style>

src/components/ScreenAbstract.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
<div id="form">
77
<div id="form-title">
8-
<p class="page-title">
8+
<h1 class="page-title">
99
Abstract
10-
</p>
10+
</h1>
1111
</div>
1212

1313
<div id="form-content">

src/components/ScreenAuthors.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</q-btn>
5353

5454
<q-banner
55-
v-if="authorsErrors.hasError"
55+
v-if="authorsErrors.messages.length > 0"
5656
class="bg-warning text-negative"
5757
>
5858
<div

src/components/ScreenFinishAdvanced.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
Use the buttons below to download your CITATION.cff file, or reset the form to start over.
2525
</p>
2626
<div class="row">
27-
<DownloadButton class="col-4 q-ma-lg" />
2827
<q-btn
2928
class="col-4 q-ma-lg"
3029
color="primary"
@@ -34,6 +33,7 @@
3433
size="xl"
3534
v-on:click="createAnother"
3635
/>
36+
<DownloadButton class="col-4 q-ma-lg" />
3737
</div>
3838
</div>
3939
<div v-else>

0 commit comments

Comments
 (0)