Skip to content

Commit c68a30b

Browse files
committed
Merge remote-tracking branch 'origin/main' into 503-prep-2.0.1
2 parents 5cf662c + 4422e9f commit c68a30b

2 files changed

Lines changed: 73 additions & 16 deletions

File tree

README.dev.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,24 @@ git push origin gh-pages
111111
- After `gh-pages` is created, select it as the source for deployment of [GitHub pages](https://github.com/citation-file-format/cff-initializer-javascript/settings/pages).
112112
- Enable write permissions for `secrets.GITHUB_TOKEN` on workflows (see, e.g. [this post](https://github.com/peaceiris/actions-gh-pages/issues/744#issuecomment-1119685318)). This is done on [Settings -> Actions -> General -> Workflow permissions](https://github.com/citation-file-format/cff-initializer-javascript/settings/actions).
113113

114+
## Previewing
115+
116+
This is app is previewed using [Netlify](https://netlify.com) automatically by the [Preview workflow](.github/workflows/preview.yml).
117+
The main branch is previewed into <https://cffinit.netlify.app/main> and each Pull Request is previewing into a `https://cffinit.netlify.app/PRXXX` page.
118+
The way this works is:
119+
120+
- The branch `gh-preview` is served by Netlify. There is a folder `main` and several folders `PRXXX` in that branch.
121+
- After a Pull Request or a push to `main` is created, the workflow runs.
122+
- The workflow changes the `publicPath` configuration in [quasar.conf.js](quasar.conf.js) to reflect the folder `main` or `PRXXX`.
123+
- This is stored in a environment variable `PUBLICPATH` to be used later.
124+
- We use `sed` with a `-i` to replace the value in-place.
125+
- The workflow builds the app (using the `npm run build` command) into a folder `./dist`.
126+
- The GitHub action `peaceiris/actions-gh-pages@v3` pushes the contents of `./dist` to the branch [gh-preview](https://github.com/citation-file-format/cff-initializer-javascript/tree/gh-preview) in the indicated path.
127+
- After the push is complete, we create a comment on the pull request (if applicable) with the link to the preview page.
128+
129+
For this to work, you need a `gh-preview` branch to exist and to enable write permissions for `secrets.GITHUB_TOKEN`.
130+
See the section on [Publishing](#publishing) for details on how to do this.
131+
114132
## Making a release
115133

116134
This section describes how to make a release in 2 parts:

src/components/IdentifierCardEditing.vue

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,24 @@
55
class="bg-formcard q-pa-md"
66
>
77
<q-card-section>
8-
<div class="row items-center no-wrap">
8+
<div class="items-center no-wrap">
99
<q-option-group
1010
inline
1111
type="radio"
1212
v-bind:error="typeError.hasError"
1313
v-bind:error-message="typeError.messages.join(', ')"
1414
v-bind:model-value="type"
1515
v-bind:options="typeOptions"
16-
v-on:update:modelValue="
17-
$emit('updateType', 'type', $event)
18-
"
16+
v-on:update:modelValue="$emit('updateType', 'type', $event)"
1917
/>
2018
</div>
21-
<div class="q-gutter-md items-center no-wrap">
19+
<div class="q-mt-md items-center no-wrap">
20+
<div class="row">
21+
<q-label class="text-dark">
22+
What is the value of the {{ label }}?
23+
<SchemaGuideLink v-bind:anchor="anchor" />
24+
</q-label>
25+
</div>
2226
<q-input
2327
bg-color="white"
2428
label="Value"
@@ -28,12 +32,16 @@
2832
v-bind:error="valueError.hasError"
2933
v-bind:error-message="valueError.messages.join(', ')"
3034
v-bind:model-value="value"
31-
v-on:update:modelValue="
32-
$emit('updateValue', 'value', $event)
33-
"
35+
v-on:update:modelValue="$emit('updateValue', 'value', $event)"
3436
/>
3537
</div>
36-
<div class="q-gutter-md items-center no-wrap">
38+
<div class="q-mt-md items-center no-wrap">
39+
<div class="row">
40+
<q-label class="text-dark">
41+
What is the description for the {{ label }}?
42+
<SchemaGuideLink anchor="#definitionsidentifier-description" />
43+
</q-label>
44+
</div>
3745
<q-input
3846
bg-color="white"
3947
label="Description"
@@ -43,9 +51,7 @@
4351
v-bind:error="descriptionError.hasError"
4452
v-bind:error-message="descriptionError.messages.join(', ')"
4553
v-bind:model-value="description"
46-
v-on:update:modelValue="
47-
$emit('updateDescription', 'description', $event)
48-
"
54+
v-on:update:modelValue="$emit('updateDescription', 'description', $event)"
4955
/>
5056
</div>
5157
</q-card-section>
@@ -88,6 +94,7 @@ import { IdentifierTypeType } from '../types'
8894
import { computed, defineComponent, PropType } from 'vue'
8995
import { getMyErrors } from 'src/store/validator'
9096
import { identifierErrors } from 'src/identifier-errors'
97+
import SchemaGuideLink from 'src/components/SchemaGuideLink.vue'
9198
9299
export default defineComponent({
93100
name: 'IdentifierCardEditing',
@@ -97,11 +104,11 @@ export default defineComponent({
97104
required: true
98105
},
99106
type: {
100-
type: String,
107+
type: String as PropType<IdentifierTypeType>,
101108
default: ''
102109
},
103110
value: {
104-
type: String as PropType<IdentifierTypeType>,
111+
type: String,
105112
default: ''
106113
},
107114
description: {
@@ -113,20 +120,52 @@ export default defineComponent({
113120
default: 0
114121
}
115122
},
123+
components: {
124+
SchemaGuideLink
125+
},
116126
setup (props) {
127+
const linkInfo = {
128+
doi: { label: 'DOI', anchor: '#definitionsdoi' },
129+
url: { label: 'URL', anchor: '#definitionsurl' },
130+
swh: {
131+
label: 'Software Heritage identifier',
132+
anchor: '#definitionsswh-identifier'
133+
},
134+
other: { label: 'identifier', anchor: '#definitionsidentifier' }
135+
}
136+
117137
return {
118138
typeOptions: [
119139
{ label: 'DOI', value: 'doi' },
120140
{ label: 'URL', value: 'url' },
121141
{ label: 'Software Heritage', value: 'swh' },
122142
{ label: 'Other', value: 'other' }
123143
],
144+
label: computed(() => linkInfo[props.type].label),
145+
anchor: computed(() => linkInfo[props.type].anchor),
124146
typeError: computed(() => getMyErrors(`/identifiers/${props.index}/type`)),
125147
valueError: computed(() => getMyErrors(`/identifiers/${props.index}/value`)),
126-
descriptionError: computed(() => getMyErrors(`/identifiers/${props.index}/description`)),
148+
descriptionError: computed(() =>
149+
getMyErrors(`/identifiers/${props.index}/description`)
150+
),
127151
identifierErrors: computed(() => identifierErrors(props.index))
128152
}
129153
},
130-
emits: ['closePressed', 'removePressed', 'updateType', 'updateValue', 'updateDescription', 'moveUp', 'moveDown']
154+
emits: [
155+
'closePressed',
156+
'removePressed',
157+
'updateType',
158+
'updateValue',
159+
'updateDescription',
160+
'moveUp',
161+
'moveDown'
162+
]
131163
})
132164
</script>
165+
<style scoped>
166+
.row {
167+
display: flex;
168+
flex-direction: row;
169+
column-gap: 10px;
170+
}
171+
</style>

0 commit comments

Comments
 (0)