Skip to content

Commit ea3b7a4

Browse files
feat: add request signature and details actions to file menu
Add two new menu actions to FileEntryActions component: - Request signature button: appears when file has no signers - Details button: appears when file has signers Both actions open the sidebar with the request signature tab active, providing quick access to signature request management. Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
1 parent 0062298 commit ea3b7a4

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

src/views/FilesList/FileEntry/FileEntryActions.vue

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ import svgDelete from '@mdi/svg/svg/delete.svg?raw'
6363
import svgFileDocument from '@mdi/svg/svg/file-document-outline.svg?raw'
6464
import svgPencil from '@mdi/svg/svg/pencil-outline.svg?raw'
6565
import svgSignature from '@mdi/svg/svg/signature.svg?raw'
66+
import svgInformation from '@mdi/svg/svg/information-outline.svg?raw'
6667
import svgTextBoxCheck from '@mdi/svg/svg/text-box-check.svg?raw'
6768
6869
import { loadState } from '@nextcloud/initial-state'
@@ -152,6 +153,16 @@ export default {
152153
},
153154
},
154155
mounted() {
156+
this.registerAction({
157+
id: 'request-signature',
158+
title: t('libresign', 'Request signature'),
159+
iconSvgInline: svgSignature,
160+
})
161+
this.registerAction({
162+
id: 'details',
163+
title: t('libresign', 'Details'),
164+
iconSvgInline: svgInformation,
165+
})
155166
this.registerAction({
156167
id: 'rename',
157168
title: t('libresign', 'Rename'),
@@ -184,7 +195,11 @@ export default {
184195
methods: {
185196
visibleIf(action) {
186197
let visible = false
187-
if (action.id === 'rename') {
198+
if (action.id === 'request-signature') {
199+
visible = (this.source?.signers?.length ?? 0) === 0
200+
} else if (action.id === 'details') {
201+
visible = (this.source?.signers?.length ?? 0) > 0
202+
} else if (action.id === 'rename') {
188203
visible = true
189204
} else if (action.id === 'sign') {
190205
visible = this.filesStore.canSign(this.file)
@@ -201,7 +216,10 @@ export default {
201216
async onActionClick(action) {
202217
this.openedMenu = null
203218
this.sidebarStore.hideSidebar()
204-
if (action.id === 'sign') {
219+
if (action.id === 'details' || action.id === 'request-signature') {
220+
this.filesStore.selectFile(this.source.id)
221+
this.sidebarStore.activeRequestSignatureTab()
222+
} else if (action.id === 'sign') {
205223
const signUuid = this.source.signers
206224
.reduce((accumulator, signer) => {
207225
if (signer.me) {

0 commit comments

Comments
 (0)