mirror of
https://github.com/LibreSign/libresign.git
synced 2025-12-17 21:12:16 +01:00
Merge pull request #6213 from LibreSign/feat/persist-signer-identify-tab-preference
feat: persist signer identify tab preference
This commit is contained in:
commit
ceddbb77b0
2 changed files with 20 additions and 2 deletions
|
|
@ -199,6 +199,7 @@ class AccountService {
|
|||
$info['crl_filters'] = $this->getUserConfigCrlFilters($user);
|
||||
$info['crl_sort'] = $this->getUserConfigCrlSort($user);
|
||||
$info['grid_view'] = $this->getUserConfigByKey('grid_view', $user) === '1';
|
||||
$info['signer_identify_tab'] = $this->getUserConfigByKey('signer_identify_tab', $user);
|
||||
|
||||
return array_filter($info);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,9 @@
|
|||
:size="size"
|
||||
:name="modalTitle"
|
||||
@closing="filesStore.disableIdentifySigner()">
|
||||
<NcAppSidebar :name="modalTitle">
|
||||
<NcAppSidebar :name="modalTitle"
|
||||
:active="activeTab"
|
||||
@update:active="onTabChange">
|
||||
<NcAppSidebarTab v-for="method in enabledMethods()"
|
||||
:id="`tab-${method.name}`"
|
||||
:key="method.name"
|
||||
|
|
@ -225,6 +227,7 @@ import router from '../../router/router.js'
|
|||
import { useFilesStore } from '../../store/files.js'
|
||||
import { useSidebarStore } from '../../store/sidebar.js'
|
||||
import { useSignStore } from '../../store/sign.js'
|
||||
import { useUserConfigStore } from '../../store/userconfig.js'
|
||||
|
||||
const iconMap = {
|
||||
svgAccount,
|
||||
|
|
@ -274,7 +277,8 @@ export default {
|
|||
const filesStore = useFilesStore()
|
||||
const signStore = useSignStore()
|
||||
const sidebarStore = useSidebarStore()
|
||||
return { filesStore, signStore, sidebarStore }
|
||||
const userConfigStore = useUserConfigStore()
|
||||
return { filesStore, signStore, sidebarStore, userConfigStore }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
@ -287,6 +291,7 @@ export default {
|
|||
showConfirmRequest: false,
|
||||
showConfirmRequestSigner: false,
|
||||
selectedSigner: null,
|
||||
activeTab: '',
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
|
|
@ -399,6 +404,8 @@ export default {
|
|||
async mounted() {
|
||||
subscribe('libresign:edit-signer', this.editSigner)
|
||||
this.filesStore.disableIdentifySigner()
|
||||
|
||||
this.activeTab = this.userConfigStore.signer_identify_tab || ''
|
||||
},
|
||||
beforeUnmount() {
|
||||
unsubscribe('libresign:edit-signer')
|
||||
|
|
@ -418,6 +425,10 @@ export default {
|
|||
}
|
||||
}
|
||||
}, 1000)
|
||||
|
||||
this.debouncedTabChange = debounce((tabId) => {
|
||||
this.userConfigStore.update('signer_identify_tab', tabId)
|
||||
}, 500)
|
||||
},
|
||||
methods: {
|
||||
getSvgIcon(name) {
|
||||
|
|
@ -486,6 +497,12 @@ export default {
|
|||
this.signerToEdit = signer
|
||||
this.filesStore.enableIdentifySigner()
|
||||
},
|
||||
onTabChange(tabId) {
|
||||
if (this.activeTab !== tabId) {
|
||||
this.activeTab = tabId
|
||||
this.debouncedTabChange(tabId)
|
||||
}
|
||||
},
|
||||
updateSigningOrder(signer, value) {
|
||||
const order = parseInt(value, 10)
|
||||
const file = this.filesStore.getFile()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue