From dd00d59dbe20bbbb2a65ed554df987a154a2dc82 Mon Sep 17 00:00:00 2001 From: Pascal Barth Date: Mon, 4 Nov 2024 08:09:43 +0100 Subject: [PATCH] PB-1037: Report a problem : add problem category selector to help our helpdesk team sort all the feedback they receive, it is not mandatory to select a feedback "category" when creating one. This will be added to the title of the email, in a manner that enables automatic rules to sort it out in the mailbox --- src/api/feedback.api.js | 10 +++- src/modules/i18n/locales/de.json | 14 ++++- src/modules/i18n/locales/en.json | 14 ++++- src/modules/i18n/locales/fr.json | 14 ++++- src/modules/i18n/locales/it.json | 14 ++++- src/modules/i18n/locales/rm.json | 14 ++++- .../components/help/ReportProblemButton.vue | 57 ++++++++++++++++++- .../help/feedback/FeedbackButton.vue | 3 +- tests/cypress/tests-e2e/reportProblem.cy.js | 47 ++++++++++++--- 9 files changed, 160 insertions(+), 27 deletions(-) diff --git a/src/api/feedback.api.js b/src/api/feedback.api.js index 929f77803..f6e260a62 100644 --- a/src/api/feedback.api.js +++ b/src/api/feedback.api.js @@ -12,6 +12,7 @@ export const KML_MAX_SIZE = 2 * 1024 * 1024 /** * @param {String} subject Mandatory * @param {String} text Mandatory + * @param {String | null} [options.category=null] Default is `null` * @param {String | null} [options.kmlFileUrl=null] Default is `null` * @param {String | null} [options.kml=null] Default is `null` * @param {String | null} [options.email=null] Default is `null` @@ -19,7 +20,13 @@ export const KML_MAX_SIZE = 2 * 1024 * 1024 * @returns {Promise} True if successful, false otherwise */ export default async function sendFeedback(subject, text, options) { - const { kmlFileUrl = null, kml = null, email = null, attachment = null } = options + const { + category = null, + kmlFileUrl = null, + kml = null, + email = null, + attachment = null, + } = options try { let kmlData = null @@ -41,6 +48,7 @@ export default async function sendFeedback(subject, text, options) { const data = { subject, feedback: text, + category: category, version: APP_VERSION, ua: navigator.userAgent, permalink: window.location.href, diff --git a/src/modules/i18n/locales/de.json b/src/modules/i18n/locales/de.json index 31f4b892b..71d437f5c 100644 --- a/src/modules/i18n/locales/de.json +++ b/src/modules/i18n/locales/de.json @@ -67,6 +67,7 @@ "cancel": "Abbrechen", "canton": "Kanton", "catalog": "Katalog", + "category_not_selected_warning": "Keine Kategorie ausgewählt", "ch.swisstopo.pixelkarte-farbe": "Karte farbig", "ch.swisstopo.pixelkarte-grau": "Karte SW", "ch.swisstopo.swissimage": "Luftbilder", @@ -222,16 +223,21 @@ "featuresearch_results_header": "Gehe zum Objekt ...", "featuretree_tooltip": "Suchen Sie alle Objekte in einem Rechteck", "feedback_attachment": "Datei hinzufügen :", + "feedback_category": "1. Ihre Meldung betrifft (erforderlich): ", + "feedback_category_application_service": "Eine Anwendung / einen Dienst", + "feedback_category_background_map": "Einen Fehler der Hintergrundkarte", + "feedback_category_other": "Etwas anderes", + "feedback_category_thematic_map": "Eine thematische Karte", "feedback_create_geometry": "Sie haben die Möglichkeit, dem Bericht eine Zeichnung beizulegen: ", - "feedback_description": "1. Melden Sie uns in diesem Feld Änderungen in der Karte, Verbesserungen der Daten oder Fragen zu dieser Website (erforderlich) :", + "feedback_description": "2. Melden Sie uns in diesem Feld Änderungen in der Karte, Verbesserungen der Daten oder Fragen zu dieser Website (erforderlich) :", "feedback_disclaimer": "Mit dem Absenden Ihrer Meldung erklären Sie sich mit den Nutzungsbedingungen einverstanden.", - "feedback_drawing": "2. Markieren Sie den betroffenen Ort in der Karte :", + "feedback_drawing": "3. Markieren Sie den betroffenen Ort in der Karte :", "feedback_email": "Ihre E-Mail Adresse (optional)", "feedback_empty_warning": "Die Berichtsnachricht darf nicht leer sein", "feedback_error_message": "Problem: Meldung konnte nicht übermittelt werden", "feedback_invalid_email": "ungültige E-Mail", "feedback_kml_attached": "Die aktuelle Zeichung wird übermittelt. ", - "feedback_mail": "3. Ihre E-Mail Adresse :", + "feedback_mail": "4. Ihre E-Mail Adresse* :", "feedback_modify_drawing": "Zeichnung editieren", "feedback_permalink": "Folgender Link wird übermittelt: ", "feedback_placeholder": "Fügen Sie eine .pdf, .zip, .jpg, .jpeg, .kml, .kmz oder .gpx Datei hinzu", @@ -420,6 +426,7 @@ "nga_service_link_href": "https://www.bakom.admin.ch/bakom/de/home.html", "nga_service_link_label": "www.bakom.admin.ch", "no_email": "Das E-Mail-Feld ist erforderlich", + "no_email_feedback": "Ohne angegebene E-Mail Adresse werden Sie keine Antwort bekommen", "no_feature_results": "Keine Objekte gefunden", "no_file": "Keine Datei", "no_layer_found": "Keine Layer gefunden", @@ -542,6 +549,7 @@ "search_in_catalogue_placeholder": "Suche in importierten Karten", "search_placeholder": "Suche nach Adressen, Parzellen oder Karten", "search_title": "Ort suchen oder Karte hinzufügen:", + "select_category": "Kategorie auswählen", "select_feature_annotation": "Klicke, um den Text zu selektieren", "select_feature_linepolygon": "Klicke, um die Flächenlinie zu selektieren", "select_feature_marker": "Klicke, um das Symbol zu selektieren", diff --git a/src/modules/i18n/locales/en.json b/src/modules/i18n/locales/en.json index 5e570cf08..568bc7771 100644 --- a/src/modules/i18n/locales/en.json +++ b/src/modules/i18n/locales/en.json @@ -67,6 +67,7 @@ "cancel": "Cancel", "canton": "Canton", "catalog": "Catalog", + "category_not_selected_warning": "Category not selected", "ch.swisstopo.pixelkarte-farbe": "Color map", "ch.swisstopo.pixelkarte-grau": "Grey map", "ch.swisstopo.swissimage": "Aerial imagery", @@ -222,16 +223,21 @@ "featuresearch_results_header": "Go to the object ...", "featuretree_tooltip": "Search for all features inside a rectangle", "feedback_attachment": "Attach a file :", + "feedback_category": "1. Subject of your message (required):", + "feedback_category_application_service": "An application or a service", + "feedback_category_background_map": "Revision of the background map", + "feedback_category_other": "Other", + "feedback_category_thematic_map": "A thematic map layer", "feedback_create_geometry": "You have the possibility to attach a drawing to your report: ", - "feedback_description": "1. Report in this field changes in the map, improvements to the data or questions about this website (required) :", + "feedback_description": "2. Report in this field changes in the map, improvements to the data or questions about this website (required) :", "feedback_disclaimer": "By submitting your message, you agree to the terms of use.", - "feedback_drawing": "2. Indicate the appropriate location on the map :", + "feedback_drawing": "3. Indicate the appropriate location on the map :", "feedback_email": "Your Email (optional)", "feedback_empty_warning": "Report message can not be empty", "feedback_error_message": "Problem: Your message could not be sent", "feedback_invalid_email": "Invalid email", "feedback_kml_attached": "The current drawing will be transferred. ", - "feedback_mail": "3. Your Email :", + "feedback_mail": "4. Your Email* :", "feedback_modify_drawing": "Modify drawing", "feedback_permalink": "The following URL will be transferred: ", "feedback_placeholder": "Attach a pdf, zip, jpg, jpeg, kml, kmz or gpx file", @@ -420,6 +426,7 @@ "nga_service_link_href": "https://www.bakom.admin.ch/bakom/en/homepage.html", "nga_service_link_label": "www.bakom.admin.ch", "no_email": "The e-mail field is required", + "no_email_feedback": "Without Email, you wont recieve an answer", "no_feature_results": "No objects found", "no_file": "No file", "no_layer_found": "No layer found", @@ -542,6 +549,7 @@ "search_in_catalogue_placeholder": "Search in imported maps", "search_placeholder": "Search for addresses, parcels or maps", "search_title": "Search for a place or add a map:", + "select_category": "Select a category", "select_feature_annotation": "Click to select the text", "select_feature_linepolygon": "Click to select the line or the surface", "select_feature_marker": "Click to select the marker", diff --git a/src/modules/i18n/locales/fr.json b/src/modules/i18n/locales/fr.json index d8742dc7c..f3e4b1981 100644 --- a/src/modules/i18n/locales/fr.json +++ b/src/modules/i18n/locales/fr.json @@ -67,6 +67,7 @@ "cancel": "Annuler", "canton": "Canton", "catalog": "Catalogue", + "category_not_selected_warning": "Catégorie non sélectionnée", "ch.swisstopo.pixelkarte-farbe": "Cartes couleurs", "ch.swisstopo.pixelkarte-grau": "Cartes N&B", "ch.swisstopo.swissimage": "Photo aérienne", @@ -222,16 +223,21 @@ "featuresearch_results_header": "Aller sur l'objet ...", "featuretree_tooltip": "Rechercher tous les objets situés dans un rectangle", "feedback_attachment": "Joindre un fichier :", + "feedback_category": "1. Sujet de votre message (obligatoire) :", + "feedback_category_application_service": "Une application ou un service", + "feedback_category_background_map": "Une révision du fond de plan", + "feedback_category_other": "Autre chose", + "feedback_category_thematic_map": "Une carte thématique", "feedback_create_geometry": "Vous avez la possibilité d'associer un dessin à votre annonce: ", - "feedback_description": "1. Faites-nous part de modifications de la carte, d’amélioration des données ou posez des questions sur ce site dans ce champ (obligatoire) :", + "feedback_description": "2. Faites-nous part de modifications de la carte, d’amélioration des données ou posez des questions sur ce site dans ce champ (obligatoire) :", "feedback_disclaimer": "En envoyant votre message, vous acceptez les conditions d'utilisation.", - "feedback_drawing": "2. Indiquez le lieu concerné dans la carte :", + "feedback_drawing": "3. Indiquez le lieu concerné dans la carte :", "feedback_email": "Votre email (facultatif)", "feedback_empty_warning": "Le message ne peut pas être vide", "feedback_error_message": "Problème lors de l'envoi", "feedback_invalid_email": "e-mail invalide", "feedback_kml_attached": "Le dessin actuel va être envoyé. ", - "feedback_mail": "3. Votre email :", + "feedback_mail": "4. Votre email* :", "feedback_modify_drawing": "Modifier le dessin", "feedback_permalink": "Le lien suivant sera transféré: ", "feedback_placeholder": "Joindre un pdf, zip, jpg, jpeg, kml, kmz ou gpx", @@ -420,6 +426,7 @@ "nga_service_link_href": "https://www.bakom.admin.ch/bakom/fr/page-daccueil.html", "nga_service_link_label": "www.bakom.admin.ch", "no_email": "Le champ email est requis", + "no_email_feedback": "Sans indiquer une adresse e-mail, vous ne recevrez pas de réponse", "no_feature_results": "Pas d'objets trouvés", "no_file": "Pas de fichier", "no_layer_found": "Pas de couche trouvée", @@ -542,6 +549,7 @@ "search_in_catalogue_placeholder": "Rechercher dans les cartes importées", "search_placeholder": "Recherche d'adresse, parcelles ou cartes", "search_title": "Rechercher un lieu ou ajouter une carte :", + "select_category": "Sélectionner une catégorie", "select_feature_annotation": "Cliquer pour selectionner l'annotation", "select_feature_linepolygon": "Cliquer pour selectionner le trait ou la surface", "select_feature_marker": "Cliquer pour sélectionner le symbole", diff --git a/src/modules/i18n/locales/it.json b/src/modules/i18n/locales/it.json index 7a2fa28c6..5fdfb2585 100644 --- a/src/modules/i18n/locales/it.json +++ b/src/modules/i18n/locales/it.json @@ -67,6 +67,7 @@ "cancel": "Annullare", "canton": "Cantone", "catalog": "Catalogo", + "category_not_selected_warning": "Categoria non selezionata", "ch.swisstopo.pixelkarte-farbe": "Carta a colori", "ch.swisstopo.pixelkarte-grau": "Carta B/N", "ch.swisstopo.swissimage": "Veduta aerea", @@ -222,16 +223,21 @@ "featuresearch_results_header": "Vai all'oggetto ...", "featuretree_tooltip": "Ricerca tutti gli oggetti in un rettangolo", "feedback_attachment": "Aggiungere un allegato :", + "feedback_category": "1. Il suo messaggio / problema riguarda (obbligatorio):", + "feedback_category_application_service": "L’utilizzo o un servizio del sistema", + "feedback_category_background_map": "Una revisione dello sfondo della mappa", + "feedback_category_other": "Qualcos’altro", + "feedback_category_thematic_map": "Una mappa tematica (e il suo contenuto)", "feedback_create_geometry": "Avete la possibilità di associare un disegno al vostro annuncio:", - "feedback_description": "1. Ci comunichi in questo campo cambiamenti nella mappa, miglioramenti dei dati o domande su questo sito (obbligatorio) :", + "feedback_description": "2. Ci comunichi in questo campo cambiamenti nella mappa, miglioramenti dei dati o domande su questo sito (obbligatorio) :", "feedback_disclaimer": "Inviando un messaggio, l’utente accetta le condizioni generali d'utilizzo.", - "feedback_drawing": "2. Indichi il luogo interessato sulla mappa:", + "feedback_drawing": "3. Indichi il luogo interessato sulla mappa:", "feedback_email": "La sua email (facoltativo)", "feedback_empty_warning": "Il messaggio di segnalazione non può essere vuoto", "feedback_error_message": "Errore! Messaggio non trasmesso", "feedback_invalid_email": "e-mail non valide", "feedback_kml_attached": "Il disegno attuale verrà inviato.", - "feedback_mail": "3. La sua email :", + "feedback_mail": "4. La sua email* :", "feedback_modify_drawing": "Modificare il disegno", "feedback_permalink": "Il seguente link verrá inviato: ", "feedback_placeholder": "Aggiungere un pdf, zip, jpeg, kml, kmz o gpx", @@ -420,6 +426,7 @@ "nga_service_link_href": "https://www.bakom.admin.ch/bakom/it/pagina-iniziale.html", "nga_service_link_label": "www.bakom.admin.ch", "no_email": "Il campo email è obbligatorio", + "no_email_feedback": "Senza l'inserimento dell'indirizzo e-mail non riceverete alcuna risposta.", "no_feature_results": "Nessun oggetto trovato", "no_file": "Nessun file", "no_layer_found": "Nessun layer trovato", @@ -542,6 +549,7 @@ "search_in_catalogue_placeholder": "Cerca nelle mappe importate", "search_placeholder": "Ricerca di indirizzi, parcelle o mappe", "search_title": "Cercare un luogo od aggiungi un set di dati :", + "select_category": "Seleziona categoria", "select_feature_annotation": "Cliccare per selezionare il testo", "select_feature_linepolygon": "Cliccare per selezionare la linea o la superficie", "select_feature_marker": "Cliccare per selezionare il simbolo", diff --git a/src/modules/i18n/locales/rm.json b/src/modules/i18n/locales/rm.json index 266018dfb..bcb84c3d3 100644 --- a/src/modules/i18n/locales/rm.json +++ b/src/modules/i18n/locales/rm.json @@ -67,6 +67,7 @@ "cancel": "Interrumper", "canton": "Chantun", "catalog": "Catalog", + "category_not_selected_warning": "Categoria betg tschernida", "ch.swisstopo.pixelkarte-farbe": "Charta en colur", "ch.swisstopo.pixelkarte-grau": "Charta en alv e nair", "ch.swisstopo.swissimage": "Fotografia ord l'aria", @@ -220,16 +221,21 @@ "featuresearch_results_header": "Ir al object ...", "featuretree_tooltip": "Tschertga tut ils objects in rectangul", "feedback_attachment": "Agiuntar datoteca :", + "feedback_category": "1. Sia missiva / ses problem concerna (obligatoric): ", + "feedback_category_application_service": "Utilisaziun u in servetsch dal sistem", + "feedback_category_background_map": "Ina repassada da las fundas da la charta", + "feedback_category_other": "Insatge auter", + "feedback_category_thematic_map": "Ina charta dal tema (e ses cuntegn)", "feedback_create_geometry": "Vus pudais agiuntar in dissegn a Voss rapport: ", - "feedback_description": "1. As annunziai en quest champ midadas da la charta, meglieraziuns da las datas u dumondas davart questa pagina d'internet (obligatorica) :", + "feedback_description": "2. As annunziai en quest champ midadas da la charta, meglieraziuns da las datas u dumondas davart questa pagina d'internet (obligatorica) :", "feedback_disclaimer": "Cun trametter Vossa novitad As declerais Vus d'accord cun las cundiziuns d'utilisaziun", - "feedback_drawing": "2. Marcai il lieu pertutgà en la charta :", + "feedback_drawing": "3. Marcai il lieu pertutgà en la charta :", "feedback_email": "Ihre E-Mail Adresse (optional)", "feedback_empty_warning": "La messadi dal raport po betg esser vegnida lasciada basa", "feedback_error_message": "Problem: rapport na tramess cun success", "feedback_invalid_email": "ungültige E-Mail", "feedback_kml_attached": "Trametter dissegn actual", - "feedback_mail": "3. Voss e-mail:", + "feedback_mail": "4. Voss e-mail:", "feedback_modify_drawing": "Editar la dissegn", "feedback_permalink": "Il suandant link vegn transmess:", "feedback_placeholder": "Agiuntai ina datoteca .pdf, .zip, .jpg, .jpeg, .kml, .kmz u .gpx", @@ -418,6 +424,7 @@ "nga_service_link_href": "https://www.bakom.admin.ch/bakom/de/home.html", "nga_service_link_label": "www.bakom.admin.ch", "no_email": "Il champ da posta eletronicala è necessari", + "no_email_feedback": "Senza che l'adressa dad e-mail vegnis inserida, na survegnis Vus nagina resposta.", "no_feature_results": "Chattà nagins objects", "no_file": "Nagina datoteca", "no_layer_found": "Nagut strato chattà", @@ -540,6 +547,7 @@ "search_in_catalogue_placeholder": "Tschertga en chartas importadas", "search_placeholder": "Tschertga d'adressas, parcellas u cartas", "search_title": "Tschertgar lieu u agiuntar charta :", + "select_category": "Tscherner ina categoria", "select_feature_annotation": "Cliccar per tscherner il text", "select_feature_linepolygon": "Cliccar per tscherner il Lingia / surfatscha", "select_feature_marker": "Cliccar per tscherner il indicatur", diff --git a/src/modules/menu/components/help/ReportProblemButton.vue b/src/modules/menu/components/help/ReportProblemButton.vue index ef3822a9b..325521be5 100644 --- a/src/modules/menu/components/help/ReportProblemButton.vue +++ b/src/modules/menu/components/help/ReportProblemButton.vue @@ -7,6 +7,7 @@ import sendFeedback, { ATTACHMENT_MAX_SIZE, KML_MAX_SIZE } from '@/api/feedback. import { createShortLink } from '@/api/shortlink.api' import HeaderLink from '@/modules/menu/components/header/HeaderLink.vue' import SendActionButtons from '@/modules/menu/components/help/common/SendActionButtons.vue' +import DropdownButton, { DropdownItem } from '@/utils/components/DropdownButton.vue' import EmailInput from '@/utils/components/EmailInput.vue' import FileInput from '@/utils/components/FileInput.vue' import SimpleWindow from '@/utils/components/SimpleWindow.vue' @@ -20,6 +21,28 @@ const acceptedFileTypes = ['.kml', '.gpx', '.pdf', '.zip', '.jpg', '.jpeg', '.km const i18n = useI18n() const store = useStore() +const feedbackCategories = [ + new DropdownItem( + 'feedback_category_background_map', + i18n.t('feedback_category_background_map'), + 'feedback_category_background_map' + ), + new DropdownItem( + 'feedback_category_thematic_map', + i18n.t('feedback_category_thematic_map'), + 'feedback_category_thematic_map' + ), + new DropdownItem( + 'feedback_category_application_service', + i18n.t('feedback_category_application_service'), + 'feedback_category_application_service' + ), + new DropdownItem( + 'feedback_category_other', + i18n.t('feedback_category_other'), + 'feedback_category_other' + ), +] const props = defineProps({ showAsLink: { @@ -37,6 +60,7 @@ const reportProblemCloseSuccessful = ref(null) const showReportProblemForm = ref(false) const feedback = ref({ message: null, + category: null, kml: null, email: null, file: null, @@ -63,6 +87,7 @@ const isTemporaryKmlValid = computed( ) const isFormValid = computed( () => + feedback.value.category && isMessageValid.value && isEmailValid.value && isAttachmentValid.value && @@ -94,9 +119,10 @@ async function sendReportProblem() { request.value.pending = true try { const feedbackSentSuccessfully = await sendFeedback( - '[web-mapviewer] Problem report', // subject + '[Problem Report]', // subject feedback.value.message, { + category: feedback.value.category, email: feedback.value.email, attachment: feedback.value.file, kml: feedback.value.kml, @@ -168,6 +194,10 @@ function toggleDrawingOverlay() { ...dispatcher, }) } + +function selectItem(dropdownItem) { + feedback.value.category = dropdownItem.value +}