Skip to content

Commit 511700c

Browse files
- ADD: Added notification if no NFC match is found
1 parent a12c8a8 commit 511700c

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112

113113
<ConfirmModal />
114114
<ChangelogModal />
115-
<v-snackbar-queue timeout="4000" location="top" v-model="snackbarQueue" />
115+
<v-snackbar-queue timeout="4000" location="bottom" v-model="snackbarQueue" />
116116
<v-overlay
117117
:model-value="loading"
118118
class="align-center justify-center"

src/components/inputs/GermplasmAutocomplete.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@
7373
import PlotInformation from '@/components/plot/PlotInformation.vue'
7474
import { QrcodeStream, type DetectedBarcode } from 'vue-qrcode-reader'
7575
76+
import emitter from 'tiny-emitter/instance'
77+
import { useI18n } from 'vue-i18n'
78+
7679
const store = coreStore()
80+
const { t } = useI18n()
7781
7882
const searchMatch = defineModel<CellPlus[] | CellPlus>()
7983
const trialGermplasm = ref<CellPlus[]>([])
@@ -160,9 +164,13 @@
160164
})
161165
162166
if (matches.length > 0) {
163-
searchMatch.value = compProps.multiple ? matches : (matches.length > 0 ? matches[0] : undefined)
167+
searchMatch.value = compProps.multiple ? matches : matches[0]
164168
} else {
165169
searchMatch.value = compProps.multiple ? [] : undefined
170+
emitter.emit('show-snackbar', {
171+
text: t('toastNfcNoMatchFound', { search: matchString.trim() }),
172+
color: 'warning',
173+
})
166174
}
167175
}
168176

src/plugins/i18n/de_DE.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,7 @@
837837
"toastTitleTrialShareCodeUpgrade": "Berechtigungsaufstufung",
838838
"toastTextTrialShareCodeAsNew": "Sicher, dass der Versuch als neuer, separater Versuch importiert werden?",
839839
"toastTitleTrialShareCodeAsNew": "Als neu importieren",
840+
"toastNfcNoMatchFound": "Kein passendes Keimplasma gefunden für '{search}'",
840841
"toastMediaSavedAs": "Mediendatei gespeichert als: {filename}",
841842
"tooltipBrapiExportBrapiTraitRunSearch": "Bitte zuerst eine Suche laufen lassen bevor die Merkmale als neue Merkmale importiert werden.",
842843
"tooltipDontShowAgain": "Nicht nochmal anzeigen.",

src/plugins/i18n/en_GB.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@
843843
"toastTitleBrapiError": "BrAPI error",
844844
"toastTextBrapiTimeout": "The request has timed out. Please try again later.",
845845
"toastTextBrapiCallNotAvailable": "The selected BrAPI server does not support the required API call.",
846+
"toastNfcNoMatchFound": "No matching germplasm found for '{search}'",
846847
"toastDataInputRestrictedTitle": "Data input restricted",
847848
"toastDataInputRestrictedText": "You have selected a plot outside of the marked columns/rows. To disable this restriction, please change the GridScore settings.",
848849
"toastTextTrialShareCodeSameOrHigherPermission": "You already have this trial available on your device with the same or higher permission status.\nDo you want to load your existing trial or import it as a new trial?",

0 commit comments

Comments
 (0)