forked from pkp/ui-library
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pkp/pkp-lib#10743 Refine Reviewer manager
- Loading branch information
1 parent
c8d9700
commit 171b4ae
Showing
25 changed files
with
505 additions
and
139 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
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
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,70 @@ | ||
<template> | ||
<span> | ||
<PkpPopover> | ||
<template #button> | ||
<span class="flex gap-x-1"> | ||
<Icon | ||
v-for="icon in icons" | ||
:key="icon" | ||
:class="iconSize" | ||
:icon="icon" | ||
/> | ||
</span> | ||
</template> | ||
<span class="text-base-normal uppercase text-default">{{ label }}</span> | ||
</PkpPopover> | ||
</span> | ||
</template> | ||
<script setup> | ||
import {computed} from 'vue'; | ||
import Icon from '@/components/Icon/Icon.vue'; | ||
import PkpPopover from '@/components/Popover/Popover.vue'; | ||
import {useLocalize} from '@/composables/useLocalize'; | ||
const props = defineProps({ | ||
reviewMethod: {type: Number, required: true}, | ||
sizeVariants: { | ||
required: false, | ||
type: String, | ||
default: () => 'default', | ||
validator: (prop) => ['default', 'large'].includes(prop), | ||
}, | ||
}); | ||
const {t} = useLocalize(); | ||
const icons = computed(() => { | ||
switch (props.reviewMethod) { | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS: | ||
return ['OpenReview', 'AnonymousReview']; | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS: | ||
return ['AnonymousReview', 'AnonymousReview']; | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN: | ||
return ['OpenReview', 'OpenReview']; | ||
} | ||
return ['OpenReview', 'OpenReview']; | ||
}); | ||
const label = computed(() => { | ||
switch (props.reviewMethod) { | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_ANONYMOUS: | ||
return t('editor.submissionReview.anonymous'); | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_DOUBLEANONYMOUS: | ||
return t('editor.submissionReview.doubleAnonymous'); | ||
case pkp.const.SUBMISSION_REVIEW_METHOD_OPEN: | ||
return t('editor.submissionReview.open'); | ||
} | ||
return t('editor.submissionReview.open'); | ||
}); | ||
const iconSize = computed(() => { | ||
if (props.sizeVariants === 'large') { | ||
return 'h-6 w-6'; | ||
} | ||
return 'h-5 w-5'; | ||
}); | ||
</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.