Skip to content

Commit

Permalink
Merge branch 'master' into l10n_master
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Jan 17, 2025
2 parents 8cb2e94 + d823949 commit 3bb56fd
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 217 deletions.
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ User dashboard:

⚙️ Settings:
- changed-files:
- any-glob-to-any-file: 'src/views/UserSettings.vue'
- any-glob-to-any-file: 'src/views/Settings.vue'

Action menus:
- changed-files:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [1.112.2](https://github.com/openfoodfacts/open-prices-frontend/compare/v1.112.1...v1.112.2) (2025-01-15)


### Bug Fixes

* **Price add multiple:** fix hide ProofCard close button in the top-right. ref [#1254](https://github.com/openfoodfacts/open-prices-frontend/issues/1254) ([d2a94d5](https://github.com/openfoodfacts/open-prices-frontend/commit/d2a94d5fde7969020af6d80b2f3c58e01c56a3c1))


### Technical

* **Contribution assistant:** button block on mobile. Small fixes. ref [#1271](https://github.com/openfoodfacts/open-prices-frontend/issues/1271) ([ae34c0a](https://github.com/openfoodfacts/open-prices-frontend/commit/ae34c0a787c9bf657c040899431ffa6c91b0a131))
* **User dashboard:** remove unused UserSettings page. ref [#950](https://github.com/openfoodfacts/open-prices-frontend/issues/950) ([c78bb03](https://github.com/openfoodfacts/open-prices-frontend/commit/c78bb03b4f265b3ff392b313855faf3d49183795))
* **User dashboard:** Use 'My dashboard' wording instead of 'Dashboard' ([dea64ba](https://github.com/openfoodfacts/open-prices-frontend/commit/dea64bacd9cadf234f0839be28a7de2b9c64799c))

## [1.112.1](https://github.com/openfoodfacts/open-prices-frontend/compare/v1.112.0...v1.112.1) (2025-01-15)


Expand Down
4 changes: 2 additions & 2 deletions src/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
</v-btn>
</template>
<template v-else #append>
<v-btn v-if="!$vuetify.display.smAndUp" icon="mdi-account-circle" to="/dashboard" :aria-label="$t('Common.Dashboard')" />
<v-btn v-else class="text-lowercase" prepend-icon="mdi-account-circle" to="/dashboard" :aria-label="$t('Common.Dashboard')">
<v-btn v-if="!$vuetify.display.smAndUp" icon="mdi-account-circle" to="/dashboard" :aria-label="$t('Common.MyDashboard')" />
<v-btn v-else class="text-lowercase" prepend-icon="mdi-account-circle" to="/dashboard" :aria-label="$t('Common.MyDashboard')">
{{ username }}
</v-btn>
</template>
Expand Down
2 changes: 1 addition & 1 deletion src/components/PriceAlreadyUploadedListCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default {
},
proofPriceUploadedListSum() {
return this.proofPriceUploadedList.reduce((acc, priceUploaded) => {
return acc + parseFloat(priceUploaded.price)*parseInt(priceUploaded.receipt_quantity)
return acc + parseFloat(priceUploaded.price)*parseFloat(priceUploaded.receipt_quantity)
}, 0)
}
},
Expand Down
5 changes: 3 additions & 2 deletions src/components/PriceInputRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
density="compact"
:label="$t('Common.QuantityBought')"
type="text"
inputmode="numeric"
inputmode="decimal"
:rules="receiptQuantityRules"
:prepend-inner-icon="PROOF_TYPE_RECEIPT_ICON"
hide-details="auto"
Expand Down Expand Up @@ -143,7 +143,8 @@ export default {
if (!this.priceForm.receipt_quantity) return [() => true] // optional field
return [
value => !isNaN(value) || this.$t('PriceRules.Number'),
value => Number(value) >= 1 || this.$t('PriceRules.Positive'),
value => Number(value) >= 0 || this.$t('PriceRules.Positive'),
value => !value.match(/\.\d{3}/) || this.$t('PriceRules.TwoDecimals'),
]
},
productIsTypeCategory() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PricePriceRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<v-tooltip v-if="price.price_without_discount" activator="parent" open-on-click location="top">{{ $t('PriceCard.FullPrice') }} {{ getPriceValueDisplay(price.price_without_discount) }}</v-tooltip>
</v-chip>
</span>
<span v-if="!hidePriceReceiptQuantity && price.receipt_quantity && price.receipt_quantity > 1" class="mr-1">
<span v-if="!hidePriceReceiptQuantity && price.receipt_quantity" class="mr-1">
<v-chip class="ml-1" variant="outlined" size="small" density="comfortable">
x{{ price.receipt_quantity }}
</v-chip>
Expand Down
7 changes: 3 additions & 4 deletions src/router.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 19 additions & 9 deletions src/views/ContributionAssistant.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
</v-col>
</v-row>
<v-row>
<v-col cols="12">
<v-col cols="12" lg="6">
<h3 class="mb-4">
{{ $t('ContributionAssistant.LabelsExtractionSteps.SendLabels') }}
</h3>
<v-btn color="primary" :disabled="!extractedLabels.length" :loading="processLabelsLoading" @click="processLabels">
<v-btn class="float-right" color="primary" :block="!$vuetify.display.smAndUp" :disabled="!extractedLabels.length" :loading="processLabelsLoading" @click="processLabels">
{{ $t('ContributionAssistant.LabelsExtractionSteps.SendLabelsButton') }}
</v-btn>
</v-col>
Expand Down Expand Up @@ -106,7 +106,7 @@
{{ $t('ContributionAssistant.PriceAddConfirmationMessage', { numberOfPricesAdded: productPriceFormsWithoutPriceId.length, date: proofObject.date, locationName: locationName }) }}
</p>
</v-alert>
<v-btn class="float-right mt-4" color="primary" :loading="loading" @click="addPrices">
<v-btn class="float-right mt-4" color="primary" :block="!$vuetify.display.smAndUp" :loading="loading" @click="addPrices">
{{ $t('Common.UploadMultiplePrices', productPriceFormsWithoutPriceId.length) }}
</v-btn>
</v-col>
Expand All @@ -129,19 +129,29 @@
>
<strong>{{ $t('ContributionAssistant.PriceAddProgress', { numberOfPricesAdded: numberOfPricesAdded, totalNumberOfPrices: productPriceFormsWithoutPriceId.length }) }}</strong>
</v-progress-linear>
<v-btn class="mt-4" color="primary" :aria-label="$t('Common.Dashboard')" to="/dashboard" :disabled="!allDone">
{{ $t('ContributionAssistant.GoToDashboard') }}
</v-btn>
<v-btn class="mt-4 ml-4" color="primary" :to="'/proofs/' + proofObject.id" :disabled="!allDone">
</v-col>
</v-row>
<v-row class="text-center">
<v-col>
<v-btn color="primary" :block="!$vuetify.display.smAndUp" :to="'/proofs/' + proofObject.id" :disabled="!allDone">
{{ $t('ContributionAssistant.GoToProof') }}
</v-btn>
<v-btn class="mt-4 ml-4" color="primary" :disabled="!allDone" @click="reloadPage">
</v-col>
<v-col>
<v-btn color="primary" :block="!$vuetify.display.smAndUp" :disabled="!allDone" @click="reloadPage">
{{ $t('ContributionAssistant.AddNewProof') }}
</v-btn>
<v-btn v-if="proofIdsFromQueryParam" class="mt-4 ml-4" color="primary" :disabled="!allDone" @click="nextProof">
</v-col>
<v-col v-if="proofIdsFromQueryParam.length > 1">
<v-btn :block="!$vuetify.display.smAndUp" color="primary" :disabled="!allDone" @click="nextProof">
{{ $t('ContributionAssistant.NextProof') }}
</v-btn>
</v-col>
<v-col>
<v-btn color="primary" :block="!$vuetify.display.smAndUp" :aria-label="$t('Common.MyDashboard')" to="/dashboard" :disabled="!allDone">
{{ $t('ContributionAssistant.GoToDashboard') }}
</v-btn>
</v-col>
</v-row>
<v-row v-if="nextProofSuggestions.length">
<v-col>
Expand Down
8 changes: 4 additions & 4 deletions src/views/PriceAddMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

<v-row v-if="step === 2">
<v-col cols="12" md="6">
<ProofCard :proof="proofObject" :hideProofActions="true" :readonly="true" />
<ProofCard mode="Uploaded" :proof="proofObject" :hideProofActions="true" :readonly="true" />
</v-col>
<v-col cols="12" md="6">
<!-- Step 2a: product prices already uploaded -->
Expand Down Expand Up @@ -129,9 +129,9 @@
color="primary"
:block="!$vuetify.display.smAndUp"
prepend-icon="mdi-account-circle"
@click="goToDashboard"
@click="goToUserDashboard"
>
{{ $t('Common.Dashboard') }}
{{ $t('Common.MyDashboard') }}
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -316,7 +316,7 @@ export default {
reloadPage() {
window.location.reload()
},
goToDashboard() {
goToUserDashboard() {
this.$router.push({ path: '/dashboard', query: { multipleSuccess: 'true' } })
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/views/PriceAddSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export default {
if (!data['id']) {
alert(`Form error: ${JSON.stringify(data)}`)
} else {
this.goToDashboard()
this.goToUserDashboard()
}
this.loading = false
})
Expand All @@ -140,7 +140,7 @@ export default {
this.loading = false
})
},
goToDashboard() {
goToUserDashboard() {
this.$router.push({ path: '/dashboard', query: { singleSuccess: 'true' } })
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/ProofAddMultiple.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
color="primary"
:block="!$vuetify.display.smAndUp"
prepend-icon="mdi-account-circle"
@click="goToDashboard"
@click="goToUserDashboard"
>
{{ $t('Common.Dashboard') }}
{{ $t('Common.MyDashboard') }}
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -101,7 +101,7 @@ export default {
reloadPage() {
window.location.reload()
},
goToDashboard() {
goToUserDashboard() {
this.$router.push({ path: '/dashboard', query: { proofSingleSuccess: 'true' } })
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/ProofAddSingle.vue
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@
color="primary"
:block="!$vuetify.display.smAndUp"
prepend-icon="mdi-account-circle"
@click="goToDashboard"
@click="goToUserDashboard"
>
{{ $t('Common.Dashboard') }}
{{ $t('Common.MyDashboard') }}
</v-btn>
</v-col>
</v-row>
Expand Down Expand Up @@ -84,7 +84,7 @@ export default {
reloadPage() {
window.location.reload()
},
goToDashboard() {
goToUserDashboard() {
this.$router.push({ path: '/dashboard', query: { proofSingleSuccess: 'true' } })
}
}
Expand Down
Loading

0 comments on commit 3bb56fd

Please sign in to comment.