diff --git a/src/components/ProofActionMenuButton.vue b/src/components/ProofActionMenuButton.vue index 68a480f5f3..7568c41f97 100644 --- a/src/components/ProofActionMenuButton.vue +++ b/src/components/ProofActionMenuButton.vue @@ -3,7 +3,7 @@ mdi-dots-vertical - {{ $t('Common.Edit') }} + {{ $t('Common.Edit') }} {{ $t('Common.Delete') }} @@ -65,6 +65,9 @@ export default { proofIsReceipt() { return this.proof.type === 'RECEIPT' }, + proofIsPrivateReceipt() { + return this.proofIsReceipt && !this.proof.is_public + }, userCanDeleteProof() { // user must be proof owner // and proof must not have any prices diff --git a/src/components/ProofEditDialog.vue b/src/components/ProofEditDialog.vue index 06f7cd64f0..52fea8c8ed 100644 --- a/src/components/ProofEditDialog.vue +++ b/src/components/ProofEditDialog.vue @@ -7,7 +7,7 @@ - +

{{ $t('ProofDetail.Privacy') }}

-

- {{ $t('ProofEdit.PrivateWarning') }} -

@@ -51,6 +48,9 @@ export default { }, emits: ['update', 'close'], computed: { + proofIsReceipt() { + return this.proof.type === 'RECEIPT' + }, }, mounted() { this.isPublic = this.proof.is_public diff --git a/src/components/ProofFooter.vue b/src/components/ProofFooter.vue index 7bbd643d9c..17a54a7145 100644 --- a/src/components/ProofFooter.vue +++ b/src/components/ProofFooter.vue @@ -2,7 +2,7 @@ - + @@ -42,6 +42,12 @@ export default { }, userIsProofOwner() { return this.username && (this.proof.owner === this.username) + }, + proofIsReceipt() { + return this.proof.type === 'RECEIPT' + }, + proofIsPrivateReceipt() { + return this.proofIsReceipt && !this.proof.is_public } }, methods: { diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 989bff3bc5..b75622d5fc 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -279,7 +279,6 @@ }, "ProofEdit": { "Title": "Edit a proof", - "PrivateWarning": "When setting your proof to Private, it will be hidden from public view. We recommend hiding any personal information by redacting or folding the document, if possible.", "Save": "Save", "Success": "Proof edited!" }, diff --git a/src/views/AddPriceMultiple.vue b/src/views/AddPriceMultiple.vue index ccaaead3e9..104feeed14 100644 --- a/src/views/AddPriceMultiple.vue +++ b/src/views/AddPriceMultiple.vue @@ -66,24 +66,7 @@

{{ $t('ProofDetail.Privacy') }}

{{ $t('AddPriceMultiple.ProofDetails.ReceiptWarning') }} - {{ $t('AddPriceMultiple.ProofDetails.PrivateWarning') }}

-
- - - -
@@ -376,7 +359,6 @@ export default { userRecentProofsDialog: false, proofSelectedSuccessMessage: false, proofisSelected: false, - proofIsPublic: true, // location data locationSelector: false, locationSelectedDisplayName: '', @@ -490,7 +472,6 @@ export default { this.proofImagePreview = this.getProofUrl(selectedProof) this.proofSelectedSuccessMessage = true this.proofisSelected = true - this.proofIsPublic = selectedProof.is_public }, getProofUrl(proof) { return 'https://prices.openfoodfacts.org/img/0002/qU59gK8PQw.webp' @@ -528,7 +509,6 @@ export default { const store = useAppStore() store.addProof(data) this.addPriceMultipleForm.proof_id = data['id'] - this.proofIsPublic = data['is_public'] this.proofImagePreview = URL.createObjectURL(proofImageCompressed) this.proofSuccessMessage = true } else { @@ -550,21 +530,6 @@ export default { // console.log('Compress complete') // }) }, - updateIsPublicProof() { - const params = { - is_public: this.proofIsPublic - } - api - .updateProof(this.addPriceMultipleForm.proof_id, params) - .then((response) => { - // if response.status == 204 - const store = useAppStore() - store.updateProof(this.addPriceMultipleForm.proof_id, params) - }) - .catch((error) => { - console.log(error) - }) - }, clearProof() { this.proofImage = null this.proofImagePreview = null