Skip to content

Commit

Permalink
Add quasar positive feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
c-martinez committed Apr 12, 2023
1 parent e20aad4 commit eb88e13
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/AuthorCardEditing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ import axios from 'axios'
import { byError, emailQueries, orcidQueries } from 'src/error-filtering'
import { computed, defineComponent } from 'vue'
import InfoDialog from 'components/InfoDialog.vue'
import { useQuasar } from 'quasar'
import { useValidation } from 'src/store/validation'
export default defineComponent({
Expand Down Expand Up @@ -192,6 +193,7 @@ export default defineComponent({
}
},
setup (props) {
const $q = useQuasar()
const { errors } = useValidation()
const orcidErrors = computed(() => {
const orcidErrors = orcidQueries(props.index)
Expand All @@ -211,7 +213,7 @@ export default defineComponent({
},
watch: {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
orcid (oldVal, newVal) {
orcid (_oldVal, _newVal) {
if (this.orcid.length === 37 && this.orcidErrors.length === 0) {
// If a valid orcid is found, look for data in the orcid API (maybe only if we do not have data already)
const orcidSearchApi = 'https://pub.orcid.org/v3.0/expanded-search/?q=orcid:'
Expand Down Expand Up @@ -239,6 +241,17 @@ export default defineComponent({
resp.config.props.$emit('update', 'email', resp.data['expanded-result'][0].email[0])
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
resp.config.props.$emit('update', 'affiliation', resp.data['expanded-result'][0]['institution-name'][0])
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call
resp.config.props.$q.notify({
message: 'Author information fetched from ORCID API!',
color: 'primary',
progress: true,
timeout: 800,
actions: [
{ label: 'Dismiss', color: 'white' }
]
})
})
}
}
Expand Down

0 comments on commit eb88e13

Please sign in to comment.