mirror of
https://github.com/nextcloud/richdocuments.git
synced 2025-12-17 21:12:14 +01:00
Digital Signature: Hide digital signature inputs from user settings
Since Collabora Online already supports digital signatures via the settings iframe, this patch is intended to only hide the UI inputs. The related variables will still be sent to Online through checkfileinfo, and migration cases will be handled as well. Online PR: https://github.com/CollaboraOnline/online/pull/12913 Signed-off-by: codewithvk <vivek.javiya@collabora.com>
This commit is contained in:
parent
dc9ffcfdbf
commit
be61dde32e
3 changed files with 0 additions and 174 deletions
|
|
@ -52,18 +52,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
textarea#documentSigningCertField {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
textarea#documentSigningKeyField {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
textarea#documentSigningCaField {
|
||||
width: 600px;
|
||||
}
|
||||
|
||||
input#zoteroAPIKeyField {
|
||||
width: 300px;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,98 +0,0 @@
|
|||
<!--
|
||||
- SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
|
||||
- SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-->
|
||||
|
||||
<template>
|
||||
<div class="doc-signing-field">
|
||||
<NcTextArea :value="localValue"
|
||||
:label="label"
|
||||
:disabled="disabled"
|
||||
:placeholder="placeholder"
|
||||
:helper-text="helperText"
|
||||
@update:value="handleUpdate" />
|
||||
<div class="doc-signing-actions">
|
||||
<NcButton type="secondary" @click="onClickSave">
|
||||
{{ t('richdocuments', 'Save') }}
|
||||
</NcButton>
|
||||
<NcButton type="secondary" :title="t('richdocuments', 'Remove')" @click="onClickRemove">
|
||||
<DeleteIcon :size="20" />
|
||||
</NcButton>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import NcTextArea from '@nextcloud/vue/dist/Components/NcTextArea.js'
|
||||
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
|
||||
import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue'
|
||||
|
||||
export default {
|
||||
name: 'DocSigningField',
|
||||
components: {
|
||||
NcTextArea,
|
||||
NcButton,
|
||||
DeleteIcon,
|
||||
},
|
||||
props: {
|
||||
label: {
|
||||
type: String,
|
||||
required: true,
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
placeholder: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
helperText: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
localValue: this.value,
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
value(newVal) {
|
||||
this.localValue = newVal
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
t(scope, text) {
|
||||
return window.t ? window.t(scope, text) : text
|
||||
},
|
||||
handleUpdate(val) {
|
||||
this.localValue = val
|
||||
this.$emit('update:value', val)
|
||||
},
|
||||
onClickSave() {
|
||||
this.$emit('save', this.localValue)
|
||||
},
|
||||
onClickRemove() {
|
||||
this.$emit('remove')
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.doc-signing-field {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.doc-signing-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -34,41 +34,6 @@
|
|||
</em>
|
||||
</p>
|
||||
|
||||
<!-- Document signing -->
|
||||
<div class="docsign-section">
|
||||
<p class="doc_sign_head">
|
||||
<strong>{{ t('richdocuments', 'Document signing') }}</strong>
|
||||
</p>
|
||||
<template v-if="hasDocumentSigningSupport">
|
||||
<div class="input-wrapper">
|
||||
<!-- Document Signing Cert -->
|
||||
<DocSigningField v-model="documentSigningCert"
|
||||
:label="t('richdocuments', 'Enter document signing cert (in PEM format)')"
|
||||
@save="val => setDocumentSigningCert(val)"
|
||||
@remove="() => setDocumentSigningCert('')" />
|
||||
<!-- Document Signing Key -->
|
||||
<DocSigningField v-model="documentSigningKey"
|
||||
:label="t('richdocuments', 'Enter document signing key')"
|
||||
@save="val => setDocumentSigningKey(val)"
|
||||
@remove="() => setDocumentSigningKey('')" />
|
||||
<!-- Document Signing CA -->
|
||||
<DocSigningField v-model="documentSigningCa"
|
||||
:label="t('richdocuments', 'Enter document signing CA chain')"
|
||||
@save="val => setDocumentSigningCa(val)"
|
||||
@remove="() => setDocumentSigningCa('')" />
|
||||
<p>
|
||||
<em>
|
||||
{{ t('richdocuments', 'To use document signing, specify your signing certificate, key and CA chain here.') }}
|
||||
</em>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
<p v-else>
|
||||
<em>
|
||||
{{ t('richdocuments', 'This instance does not support document signing, because the feature is missing or disabled. Please contact the administrator.') }}
|
||||
</em>
|
||||
</p>
|
||||
</div>
|
||||
<!-- user settings iframe -->
|
||||
<CoolFrame v-if="tokenGenerated"
|
||||
:iframe-type="'user'"
|
||||
|
|
@ -85,7 +50,6 @@ import { showError, showSuccess } from '@nextcloud/dialogs'
|
|||
import NcSettingsSection from '@nextcloud/vue/dist/Components/NcSettingsSection.js'
|
||||
import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
|
||||
import NcButton from '@nextcloud/vue/dist/Components/NcButton.js'
|
||||
import DocSigningField from './DocSigningField.vue'
|
||||
import DeleteIcon from 'vue-material-design-icons/TrashCanOutline.vue'
|
||||
import FolderIcon from 'vue-material-design-icons/FolderOutline.vue'
|
||||
import axios from '@nextcloud/axios'
|
||||
|
|
@ -103,7 +67,6 @@ export default {
|
|||
NcSettingsSection,
|
||||
NcTextField,
|
||||
NcButton,
|
||||
DocSigningField,
|
||||
FolderIcon,
|
||||
DeleteIcon,
|
||||
CoolFrame,
|
||||
|
|
@ -120,10 +83,6 @@ export default {
|
|||
hasSettingIframeSupport: this.initial.hasSettingIframeSupport || false,
|
||||
settingIframeUrl: this.initial.setting_iframe_url || '',
|
||||
zoteroAPIKey: this.initial.zoteroAPIKey || '',
|
||||
hasDocumentSigningSupport: this.initial.hasDocumentSigningSupport || false,
|
||||
documentSigningCert: this.initial.documentSigningCert || '',
|
||||
documentSigningKey: this.initial.documentSigningKey || '',
|
||||
documentSigningCa: this.initial.documentSigningCa || '',
|
||||
tokenGenerated: false,
|
||||
accessToken: '',
|
||||
accessTokenTTL: '',
|
||||
|
|
@ -181,24 +140,6 @@ export default {
|
|||
this.templateFolder = ''
|
||||
}
|
||||
},
|
||||
async setDocumentSigningCert(val) {
|
||||
const success = await this.updateSetting({ documentSigningCertInput: val })
|
||||
if (success) {
|
||||
this.documentSigningCert = val
|
||||
}
|
||||
},
|
||||
async setDocumentSigningKey(val) {
|
||||
const success = await this.updateSetting({ documentSigningKeyInput: val })
|
||||
if (success) {
|
||||
this.documentSigningKey = val
|
||||
}
|
||||
},
|
||||
async setDocumentSigningCa(val) {
|
||||
const success = await this.updateSetting({ documentSigningCaInput: val })
|
||||
if (success) {
|
||||
this.documentSigningCa = val
|
||||
}
|
||||
},
|
||||
async updateSetting(settings) {
|
||||
try {
|
||||
const response = await axios.post(
|
||||
|
|
@ -242,11 +183,6 @@ export default {
|
|||
gap: 1rem;
|
||||
}
|
||||
|
||||
.doc_sign_head {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.msg {
|
||||
display: inline-block;
|
||||
margin-bottom: 1rem;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue