Browse Source
Merge pull request #980 from Collinbrown95/feature/approval-button-shortcut
Adding keyboard shortcut for approval button
pull/1007/head
Hiroki Nakayama
4 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
20 additions and
0 deletions
-
frontend/components/containers/annotation/ApproveButton.vue
-
frontend/layouts/annotation.vue
|
|
@ -2,11 +2,13 @@ |
|
|
|
<v-tooltip bottom> |
|
|
|
<template v-slot:activator="{ on }"> |
|
|
|
<v-btn |
|
|
|
v-shortkey.once="['enter']" |
|
|
|
:disabled="disabled" |
|
|
|
class="text-capitalize ps-1 pe-1" |
|
|
|
min-width="36" |
|
|
|
outlined |
|
|
|
v-on="on" |
|
|
|
@shortkey="approveNextPage" |
|
|
|
@click="approveDocument" |
|
|
|
> |
|
|
|
<v-icon v-if="approved"> |
|
|
@ -35,6 +37,16 @@ export default { |
|
|
|
disabled: { |
|
|
|
type: Boolean, |
|
|
|
default: false |
|
|
|
}, |
|
|
|
value: { |
|
|
|
type: Number, |
|
|
|
default: 1, |
|
|
|
required: true |
|
|
|
}, |
|
|
|
length: { |
|
|
|
type: Number, |
|
|
|
default: 1, |
|
|
|
required: true |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
@ -44,6 +56,12 @@ export default { |
|
|
|
this.approve({ |
|
|
|
projectId: this.$route.params.id |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** Approves document and moves to the next page */ |
|
|
|
approveNextPage() { |
|
|
|
const page = Math.min(this.value + 1, this.length) |
|
|
|
this.$emit('input', page) |
|
|
|
this.approveDocument() |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
@ -30,6 +30,8 @@ |
|
|
|
<v-col> |
|
|
|
<approve-button |
|
|
|
v-if="canViewApproveButton" |
|
|
|
v-model="page" |
|
|
|
:length="total" |
|
|
|
:approved="approved" |
|
|
|
:disabled="currentDoc ? false : true" |
|
|
|
/> |
|
|
|