1818 <div class =" row" >
1919 <h3 class =" subquestion" >
2020 What is the value of the {{ label }}?
21- <SchemaGuideLink v-bind:anchor =" anchor" />
21+ <q-icon
22+ name =" ion-information-circle-outline"
23+ size =" 24px"
24+ color =" primary"
25+ v-on:click =" showIdentifierHelp = true"
26+ style =" cursor :pointer ;"
27+ />
2228 </h3 >
2329 </div >
2430 <q-input
3945 <div class =" row" >
4046 <h3 class =" subquestion" >
4147 What is the description for the {{ label }}?
42- <SchemaGuideLink anchor =" #definitionsidentifier-description" />
48+ <q-icon
49+ name =" ion-information-circle-outline"
50+ size =" 24px"
51+ color =" primary"
52+ v-on:click =" showDescriptionHelp = true"
53+ style =" cursor :pointer ;"
54+ />
4355 </h3 >
4456 </div >
4557 <q-input
6981 />
7082 </q-card-actions >
7183 </q-card >
84+ <InfoDialog
85+ v-model =" showIdentifierHelp"
86+ v-bind:data =" helpData[identifierType]"
87+ />
88+ <InfoDialog
89+ v-model =" showDescriptionHelp"
90+ v-bind:data =" helpData.description"
91+ />
7292</template >
7393
7494<script lang="ts">
75- import { PropType , computed , defineComponent } from ' vue'
95+ import { PropType , computed , defineComponent , ref } from ' vue'
7696import { byError , identifierValueQueries , unique } from ' src/error-filtering'
7797import { IdentifierTypeType } from ' src/types'
78- import SchemaGuideLink from ' src/components/SchemaGuideLink .vue'
98+ import InfoDialog from ' src/components/InfoDialog .vue'
7999import { useValidation } from ' src/store/validation'
80100
81101export default defineComponent ({
@@ -99,35 +119,83 @@ export default defineComponent({
99119 }
100120 },
101121 components: {
102- SchemaGuideLink
122+ InfoDialog
103123 },
104124 setup (props ) {
105125 const { errors } = useValidation ()
106- const linkInfo = {
107- doi: { label: ' DOI' , anchor: ' #definitionsdoi' },
108- url: { label: ' URL' , anchor: ' #definitionsurl' },
109- swh: {
110- label: ' Software Heritage identifier' ,
111- anchor: ' #definitionsswh-identifier'
112- },
113- other: { label: ' identifier' , anchor: ' #definitionsidentifier' }
126+ const labels = {
127+ doi: ' DOI' ,
128+ url: ' URL' ,
129+ swh: ' Software Heritage identifier' ,
130+ other: ' identifier'
114131 }
115132 const identifierValueErrors = computed (() => {
116133 return identifierValueQueries (props .index , [' doi' , ' url' , ' swh' , ' other' ].indexOf (props .type ))
117134 .filter (byError (errors .value ))
118135 .map (query => query .replace .message )
119136 .filter (unique )
120137 })
138+ const helpData = {
139+ doi: {
140+ title: ' doi' ,
141+ url: ' https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#definitionsdoi' ,
142+ description: ' The DOI (https://en.wikipedia.org/wiki/Digital_object_identifier) of the work.' ,
143+ examples: [
144+ ' 10.5281/zenodo.1003150'
145+ ]
146+ },
147+ url: {
148+ title: ' url' ,
149+ url: ' https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#definitionsurl' ,
150+ description: ' A URL.' ,
151+ examples: [
152+ ' https://research-software-project.org' ,
153+ ' http://research-software-project.org' ,
154+ ' sftp://files.research-software-project.org' ,
155+ ' ftp://files.research-software-project.org'
156+ ]
157+ },
158+ swh: {
159+ title: ' swh' ,
160+ url: ' https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#definitionsswh-identifier' ,
161+ description: ' The Software Heritage identifier (https://www.softwareheritage.org/).' ,
162+ examples: [
163+ ' swh:1:rev:309cf2674ee7a0749978cf8265ab91a60aea0f7d'
164+ ]
165+ },
166+ other: {
167+ title: ' other' ,
168+ url: ' https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#definitionsidentifier' ,
169+ description: ' An identifier that does not fit in the other categories.' ,
170+ examples: [
171+ ' arXiv:2103.06681'
172+ ]
173+ },
174+ description: {
175+ title: ' description' ,
176+ url: ' https://github.com/citation-file-format/citation-file-format/blob/1.2.0/schema-guide.md#definitionsidentifier-description' ,
177+ description: ' A description of the identifier.' ,
178+ examples: [
179+ ' The concept DOI of the work.' ,
180+ ' The URL of version 1.1.0 of the software' ,
181+ ' The Software Heritage link for version 1.1.0.' ,
182+ ' The ArXiv deposit of the encompassing paper.'
183+ ]
184+ }
185+ }
121186 return {
187+ helpData ,
122188 typeOptions: [
123189 { label: ' DOI' , value: ' doi' },
124190 { label: ' URL' , value: ' url' },
125191 { label: ' Software Heritage' , value: ' swh' },
126192 { label: ' Other' , value: ' other' }
127193 ],
128- label: computed (() => linkInfo [props .type ].label ),
129- anchor: computed (() => linkInfo [props .type ].anchor ),
130- identifierValueErrors
194+ identifierType: computed (() => props .type ),
195+ label: computed (() => labels [props .type ]),
196+ identifierValueErrors ,
197+ showDescriptionHelp: ref (false ),
198+ showIdentifierHelp: ref (false )
131199 }
132200 },
133201 emits: [
0 commit comments