Skip to content

Commit

Permalink
feat(proofs): display the proof receipt privacy status in the proof f…
Browse files Browse the repository at this point in the history
…ooter (#468)
  • Loading branch information
raphodn authored Mar 20, 2024
1 parent a12ead6 commit f1ca0fe
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/ProofEditDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<v-divider></v-divider>

<v-card-text v-if="proof.type === 'RECEIPT'">
<h3>{{ $t('ProofEdit.PrivateWarning') }}</h3>
<h3>{{ $t('ProofDetail.Privacy') }}</h3>
<v-switch
v-model="isPublic"
color="green"
Expand Down
2 changes: 2 additions & 0 deletions src/components/ProofFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<v-row>
<v-col :cols="userIsProofOwner ? '11' : '12'">
<ProofTypeChip class="mr-1" :proof="proof"></ProofTypeChip>
<ProofPrivateChip v-if="proof.type === 'RECEIPT'" class="mr-1" :proof="proof"></ProofPrivateChip>
<PriceCountChip :count="proof.price_count" :withLabel="true" @click="goToProof()"></PriceCountChip>
<RelativeDateTimeChip :dateTime="proof.created"></RelativeDateTimeChip>
</v-col>
Expand All @@ -18,6 +19,7 @@ import { useAppStore } from '../store'
export default {
components: {
'ProofTypeChip': defineAsyncComponent(() => import('../components/ProofTypeChip.vue')),
'ProofPrivateChip': defineAsyncComponent(() => import('../components/ProofPrivateChip.vue')),
'PriceCountChip': defineAsyncComponent(() => import('../components/PriceCountChip.vue')),
'RelativeDateTimeChip': defineAsyncComponent(() => import('../components/RelativeDateTimeChip.vue')),
'ProofActionMenuButton': defineAsyncComponent(() => import('../components/ProofActionMenuButton.vue'))
Expand Down
15 changes: 15 additions & 0 deletions src/components/ProofPrivateChip.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<template>
<v-chip label size="small" density="comfortable">
<v-icon start :icon="proof.is_public ? 'mdi-lock-open-check' : 'mdi-lock-alert'"></v-icon>
<span v-if="proof.is_public" class="text-green">{{ $t('ProofDetail.Public') }}</span>
<span v-else class="text-red">{{ $t('ProofDetail.Private') }}</span>
</v-chip>
</template>

<script>
export default {
props: {
'proof': null,
},
}
</script>
2 changes: 1 addition & 1 deletion src/components/ProofTypeChip.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<v-chip label size="small" density="comfortable">
<v-icon start icon="mdi-paperclip"></v-icon>
<v-icon start icon="mdi-image"></v-icon>
<span v-if="proof.type === 'GDPR_REQUEST'">
<a :href="OFF_WIKI_GDPR_REQUEST_URL" target="_blank">
{{ proofTypeName }}
Expand Down
4 changes: 2 additions & 2 deletions src/views/AddPriceMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@
@change="updateIsPublicProof">
<template v-slot:label>
<v-icon start size="small" :icon="proofIsPublic ? 'mdi-lock-open-check' : 'mdi-lock-alert'" :color="proofIsPublic ? 'green' : 'red'"></v-icon>
<span :style="{ color: proofIsPublic ? 'green' : 'red' }">
{{ proofIsPublic ? $t('AddPriceMultiple.ProofDetails.Public') : $t('AddPriceMultiple.ProofDetails.Private') }}
<span :class="proofIsPublic ? 'text-green' : 'text-red'">
{{ proofIsPublic ? $t('ProofDetail.Public') : $t('ProofDetail.Private') }}
</span>
</template>
</v-switch>
Expand Down

0 comments on commit f1ca0fe

Please sign in to comment.