Skip to content

Commit 275020b

Browse files
refactor: Replace Bullet component with NcChip and fix signer reactivity
- Replace custom Bullet component with NcChip from @nextcloud/vue - Remove unused Bullet component - Fix reactivity issue by passing signerIndex instead of currentSigner - Signer component now fetches data from store reactively using computed property - This ensures changes in store are properly reflected in the UI Signed-off-by: Vitor Mattos <[email protected]>
1 parent fa6861b commit 275020b

3 files changed

Lines changed: 9 additions & 48 deletions

File tree

src/Components/Bullet/Bullet.vue

Lines changed: 0 additions & 40 deletions
This file was deleted.

src/Components/Signers/Signer.vue

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
</template>
1616
<template #subname>
1717
<div class="signer-subname">
18-
<Bullet v-for="method in identifyMethodsNames" :key="method" :name="method" />
18+
<NcChip v-for="method in identifyMethodsNames"
19+
:key="method"
20+
:text="method"
21+
:no-close="true" />
1922
<NcChip :text="signer.statusText"
2023
:type="chipType"
2124
:icon-path="statusIconPath"
@@ -48,8 +51,6 @@ import NcAvatar from '@nextcloud/vue/components/NcAvatar'
4851
import NcChip from '@nextcloud/vue/components/NcChip'
4952
import NcListItem from '@nextcloud/vue/components/NcListItem'
5053
51-
import Bullet from '../Bullet/Bullet.vue'
52-
5354
import { useFilesStore } from '../../store/files.js'
5455
5556
export default {
@@ -59,10 +60,9 @@ export default {
5960
NcAvatar,
6061
NcChip,
6162
DragVertical,
62-
Bullet,
6363
},
6464
props: {
65-
currentSigner: {
65+
signerIndex: {
6666
type: Number,
6767
required: true,
6868
},
@@ -94,7 +94,8 @@ export default {
9494
},
9595
computed: {
9696
signer() {
97-
return this.filesStore.getFile().signers[this.currentSigner]
97+
const file = this.filesStore.getFile()
98+
return file?.signers?.[this.signerIndex]
9899
},
99100
signerName() {
100101
return this.signer.displayName

src/Components/Signers/Signers.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<transition-group name="signer-list" tag="div">
1616
<Signer v-for="(signer, index) in sortableSigners"
1717
:key="signer.identify || index"
18-
:current-signer="index"
18+
:signer-index="index"
1919
:event="event"
2020
:draggable="!signer.signed">
2121
<template #actions="{closeActions}">
@@ -27,7 +27,7 @@
2727
<ul v-else>
2828
<Signer v-for="(signer, index) in signers"
2929
:key="signer.identify || index"
30-
:current-signer="index"
30+
:signer-index="index"
3131
:event="event">
3232
<template #actions="{closeActions}">
3333
<slot name="actions" :signer="signer" :closeActions="closeActions" />

0 commit comments

Comments
 (0)