Skip to content

Commit 54dd2fb

Browse files
committed
update info dialog example rendering
1 parent 79801ee commit 54dd2fb

2 files changed

Lines changed: 42 additions & 6 deletions

File tree

src/components/InfoDialog.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,11 @@
3333
<li
3434
v-for="item in data.examples"
3535
v-bind:key="item"
36+
class="q-mt-sm"
3637
>
37-
{{ item }}
38+
<div v-for="(line, index) in item.split('\n')" :key="index">
39+
{{ line }}
40+
</div>
3841
</li>
3942
</ul>
4043
</q-card-section>

src/components/ScreenAuthors.vue

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,13 @@
88
<div id="form-content">
99
<h2 class="question">
1010
Who are the author(s) of the work?
11-
<SchemaGuideLink anchor="#authors" />
11+
<q-icon
12+
name="ion-information-circle-outline"
13+
size="24px"
14+
color="primary"
15+
v-on:click="showAuthorsHelp = true"
16+
style="cursor:pointer;"
17+
/>
1218
</h2>
1319
<div class="scroll-to-bottom-container">
1420
<span class="bottom" />
@@ -59,6 +65,10 @@
5965
{{ screenMessage }}
6066
</div>
6167
</q-banner>
68+
<InfoDialog
69+
v-model="showAuthorsHelp"
70+
v-bind:data="helpData.authors"
71+
/>
6272
</div>
6373
</template>
6474

@@ -69,7 +79,7 @@ import { moveDown, moveUp } from 'src/updown'
6979
import AuthorCardEditing from 'components/AuthorCardEditing.vue'
7080
import AuthorCardViewing from 'components/AuthorCardViewing.vue'
7181
import { AuthorType } from 'src/types'
72-
import SchemaGuideLink from 'components/SchemaGuideLink.vue'
82+
import InfoDialog from 'components/InfoDialog.vue'
7383
import { scrollToBottom } from 'src/scroll-to-bottom'
7484
import { useCff } from 'src/store/cff'
7585
import { useStepperErrors } from 'src/store/stepper-errors'
@@ -78,9 +88,9 @@ import { useValidation } from 'src/store/validation'
7888
export default defineComponent({
7989
name: 'ScreenAuthors',
8090
components: {
81-
SchemaGuideLink,
8291
AuthorCardEditing,
83-
AuthorCardViewing
92+
AuthorCardViewing,
93+
InfoDialog
8494
},
8595
setup () {
8696
onUpdated(() => {
@@ -132,15 +142,38 @@ export default defineComponent({
132142
.filter(byError(errors.value))
133143
.map(query => query.replace.message)
134144
})
145+
const helpData = {
146+
authors: {
147+
title: 'authors',
148+
url: [
149+
{
150+
text: 'Click here to see the documentation for authors.',
151+
link: 'https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#authors'
152+
},
153+
{
154+
text: 'How to deal with unknown individual authors?',
155+
link: 'https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#how-to-deal-with-unknown-individual-authors'
156+
}
157+
],
158+
description: 'The authors of a software or dataset.',
159+
examples: [
160+
' given-names: Jane\n family-names: Doe',
161+
' name: "The Research Software project"',
162+
' given-names: John\n family-names: Doe\n name: "The Research Software project"'
163+
]
164+
}
165+
}
135166
return {
136167
addAuthor,
137168
authors,
138169
authorsErrors,
139170
editingId,
171+
helpData,
140172
moveAuthorDown,
141173
moveAuthorUp,
142174
removeAuthor,
143-
setAuthorField
175+
setAuthorField,
176+
showAuthorsHelp: ref(false)
144177
}
145178
}
146179
})

0 commit comments

Comments
 (0)