-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from source-data/EEB7/initial-ux-rework
EEB7: Initial UX rework
- Loading branch information
Showing
24 changed files
with
513 additions
and
942 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
frontend/src/components/filtering/by-reviewing-service.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<template lang="pug"> | ||
v-card(flat) | ||
v-card-title Review sources | ||
v-card-text | ||
v-chip-group(v-model="selectedRev" mandatory column) | ||
span(v-for="serviceId in this.reviewingList" :key="`${serviceId}-chip`") | ||
router-link(:to="{ path: `/refereed-preprints/${serviceId2Slug(serviceId)}` }") | ||
v-chip( | ||
:value="serviceId2Slug(serviceId)" :disabled="loadingRecords" | ||
) | ||
| {{ serviceId2Name(serviceId) }} | ||
|
||
InfoCardsReviewServiceSummaryGraph( | ||
:service_name="serviceId2Name(serviceSlug2Id(selectedRev))", | ||
:url="reviewingService(serviceSlug2Id(selectedRev)).url", | ||
:peer_review_policy="reviewingService(serviceSlug2Id(selectedRev)).peer_review_policy", | ||
:review_requested_by="reviewingService(serviceSlug2Id(selectedRev)).review_requested_by", | ||
:reviewer_selected_by="reviewingService(serviceSlug2Id(selectedRev)).reviewer_selected_by", | ||
:review_coverage="reviewingService(serviceSlug2Id(selectedRev)).review_coverage", | ||
:reviewer_identity_known_to="reviewingService(serviceSlug2Id(selectedRev)).reviewer_identity_known_to", | ||
:competing_interests="reviewingService(serviceSlug2Id(selectedRev)).competing_interests", | ||
:public_interaction="reviewingService(serviceSlug2Id(selectedRev)).public_interaction", | ||
:opportunity_for_author_response="reviewingService(serviceSlug2Id(selectedRev)).opportunity_for_author_response", | ||
:recommendation="reviewingService(serviceSlug2Id(selectedRev)).recommendation", | ||
).px-0.mt-2 | ||
</template> | ||
|
||
<script> | ||
import { mapGetters, mapState } from 'vuex' | ||
import { serviceId2Slug, serviceId2Name, serviceSlug2Id } from '../../store/by-reviewing-service' | ||
import InfoCardsReviewServiceSummaryGraph from '../review-service-info/review-service-summary-graph.vue' | ||
export default { | ||
components: { | ||
InfoCardsReviewServiceSummaryGraph, | ||
}, | ||
data () { | ||
return { | ||
selectedRev: undefined, | ||
} | ||
}, | ||
beforeMount () { | ||
this.selectedRev = this.$route.params.service | ||
}, | ||
computed: { | ||
...mapState('highlights', ['loadingRecords']), | ||
...mapGetters('byReviewingService', ['records', 'reviewingService']), | ||
reviewingList () { | ||
const ids = this.records.map( | ||
(r) => {return r.id} | ||
).sort().reverse() | ||
return ids | ||
}, | ||
}, | ||
methods: { | ||
onSelect (selectedItemId) { | ||
this.$emit('change', selectedItemId) | ||
}, | ||
reviewingListId(i, j) { | ||
return this.reviewingList[(i-1)*2 + (j-1)] | ||
}, | ||
serviceId2Slug, | ||
serviceId2Name, | ||
serviceSlug2Id | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
/* After the user clicks on a reviewing service's button, all rev service buttons are disabled. | ||
* This makes the clicked-on-but-disabled button distinct from all the other disabled buttons. | ||
*/ | ||
.v-btn--active.v-btn--disabled::before { | ||
opacity: 0.5 !important; | ||
} | ||
</style> |
31 changes: 31 additions & 0 deletions
31
frontend/src/components/filtering/by-simple-search-query.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<template lang="pug"> | ||
v-text-field( | ||
v-model="query" | ||
:loading="loadingRecords" | ||
placeholder="keywords, authors, doi" | ||
prepend-icon="mdi-magnify" | ||
hide-details | ||
@keyup.enter="onSubmit" | ||
) | ||
</template> | ||
|
||
<script> | ||
import { mapState } from 'vuex' | ||
export default { | ||
data: function() { | ||
return { | ||
query: '' | ||
} | ||
}, | ||
computed: { | ||
...mapState('fulltextSearch', ['loadingRecords']) | ||
}, | ||
methods: { | ||
onSubmit() { | ||
this.$store.dispatch('fulltextSearch/search', this.query).then( | ||
() => {this.$store.dispatch('highlights/listByCurrent', 'fulltextSearch')} | ||
) | ||
}, | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.