mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-17 21:12:16 +01:00
feat: add customize message action in sidebar
Add 'Customize message' action button in signature request sidebar for signed requests. The button: - Appears with Bell icon alongside other actions - Opens signer identification modal for message editing - Validates signer state, method, and email notification preferences - Is hidden when signer already signed, for current user, or when account method user doesn't accept email notifications Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
This commit is contained in:
parent
d2245ac28c
commit
01dceea32b
1 changed files with 33 additions and 1 deletions
|
|
@ -26,6 +26,14 @@
|
|||
<OrderNumericAscending :size="20" />
|
||||
</template>
|
||||
</NcActionInput>
|
||||
<NcActionButton v-if="canCustomizeMessage(signer)"
|
||||
:close-after-click="true"
|
||||
@click="customizeMessage(signer); closeActions()">
|
||||
<template #icon>
|
||||
<MessageText :size="20" />
|
||||
</template>
|
||||
{{ t('libresign', 'Customize message') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton v-if="canDelete(signer)"
|
||||
aria-label="Delete"
|
||||
:close-after-click="true"
|
||||
|
|
@ -44,9 +52,11 @@
|
|||
{{ t('libresign', 'Request signature') }}
|
||||
</NcActionButton>
|
||||
<NcActionButton v-if="canSendReminder(signer)"
|
||||
icon="icon-comment"
|
||||
:close-after-click="true"
|
||||
@click="sendNotify(signer)">
|
||||
<template #icon>
|
||||
<Bell :size="20" />
|
||||
</template>
|
||||
{{ t('libresign', 'Send reminder') }}
|
||||
</NcActionButton>
|
||||
</template>
|
||||
|
|
@ -194,10 +204,12 @@ import svgSms from '@mdi/svg/svg/message-processing.svg?raw'
|
|||
import svgWhatsapp from '@mdi/svg/svg/whatsapp.svg?raw'
|
||||
import svgXmpp from '@mdi/svg/svg/xmpp.svg?raw'
|
||||
|
||||
import Bell from 'vue-material-design-icons/Bell.vue'
|
||||
import Delete from 'vue-material-design-icons/Delete.vue'
|
||||
import Draw from 'vue-material-design-icons/Draw.vue'
|
||||
import FileDocument from 'vue-material-design-icons/FileDocument.vue'
|
||||
import Information from 'vue-material-design-icons/Information.vue'
|
||||
import MessageText from 'vue-material-design-icons/MessageText.vue'
|
||||
import OrderNumericAscending from 'vue-material-design-icons/OrderNumericAscending.vue'
|
||||
import Pencil from 'vue-material-design-icons/Pencil.vue'
|
||||
import Send from 'vue-material-design-icons/Send.vue'
|
||||
|
|
@ -261,10 +273,12 @@ export default {
|
|||
NcModal,
|
||||
NcNoteCard,
|
||||
NcDialog,
|
||||
Bell,
|
||||
Delete,
|
||||
Draw,
|
||||
FileDocument,
|
||||
Information,
|
||||
MessageText,
|
||||
OrderNumericAscending,
|
||||
Pencil,
|
||||
Send,
|
||||
|
|
@ -323,6 +337,20 @@ export default {
|
|||
return this.filesStore.canSave() && !signer.signed
|
||||
}
|
||||
},
|
||||
canCustomizeMessage() {
|
||||
return (signer) => {
|
||||
if (signer.signed || !signer.signRequestId || signer.me) {
|
||||
return false
|
||||
}
|
||||
|
||||
const method = signer.identifyMethods?.[0]?.method
|
||||
if (method === 'account' && !signer.acceptsEmailNotifications) {
|
||||
return false
|
||||
}
|
||||
|
||||
return !!method
|
||||
}
|
||||
},
|
||||
canRequestSignature() {
|
||||
return (signer) => {
|
||||
if (!this.filesStore.canRequestSign
|
||||
|
|
@ -530,6 +558,10 @@ export default {
|
|||
}
|
||||
this.filesStore.enableIdentifySigner()
|
||||
},
|
||||
customizeMessage(signer) {
|
||||
this.signerToEdit = signer
|
||||
this.filesStore.enableIdentifySigner()
|
||||
},
|
||||
onTabChange(tabId) {
|
||||
if (this.activeTab !== tabId) {
|
||||
this.activeTab = tabId
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue