Skip to content

Commit

Permalink
Merge pull request #1100 from geoadmin/feat-PB-1037-report-problem-ad…
Browse files Browse the repository at this point in the history
…d-extra-options

PB-1037: Add dropdown to select feedback category
  • Loading branch information
sami-nouidri-swisstopo authored Jan 9, 2025
2 parents 8b67003 + 9fe0ffe commit 65fed51
Show file tree
Hide file tree
Showing 11 changed files with 196 additions and 29 deletions.
10 changes: 9 additions & 1 deletion src/api/feedback.api.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,21 @@ 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`
* @param {File | null} [options.attachment=null] Default is `null`
* @returns {Promise<Boolean>} 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
Expand All @@ -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,
Expand Down
6 changes: 6 additions & 0 deletions src/config/feedback.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/**
* Email subject for feedback emails.
*
* @type {String}
*/
export const FEEDBACK_EMAIL_SUBJECT = '[Problem Report]'
14 changes: 11 additions & 3 deletions src/modules/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href='https://www.geo.admin.ch/de/allgemeine-nutzungsbedingungen-bgdi#feedback' target='_blank'>Nutzungsbedingungen</a> 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",
Expand Down Expand Up @@ -422,6 +428,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",
Expand Down Expand Up @@ -546,6 +553,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",
Expand Down
14 changes: 11 additions & 3 deletions src/modules/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href='https://www.geo.admin.ch/en/general-terms-of-use-fsdi#feedback' target='_blank'>terms of use</a>.",
"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",
Expand Down Expand Up @@ -422,6 +428,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 receive an answer",
"no_feature_results": "No objects found",
"no_file": "No file",
"no_layer_found": "No layer found",
Expand Down Expand Up @@ -546,6 +553,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",
Expand Down
14 changes: 11 additions & 3 deletions src/modules/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href='https://www.geo.admin.ch/fr/conditions-generales-utilisation-ifdg#feedback' target='_blank'>conditions d'utilisation</a>.",
"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",
Expand Down Expand Up @@ -422,6 +428,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",
Expand Down Expand Up @@ -546,6 +553,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",
Expand Down
14 changes: 11 additions & 3 deletions src/modules/i18n/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href='https://www.geo.admin.ch/it/condizioni-generali-di-utilizzo-ifdg' target='_blank'>condizioni generali d'utilizzo</a>.",
"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",
Expand Down Expand Up @@ -422,6 +428,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",
Expand Down Expand Up @@ -546,6 +553,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",
Expand Down
14 changes: 11 additions & 3 deletions src/modules/i18n/locales/rm.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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 <a href='https://www.geo.admin.ch/de/allgemeine-nutzungsbedingungen-bgdi' target='_blank'>cundiziuns d'utilisaziun</a>",
"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",
Expand Down Expand Up @@ -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": "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à",
Expand Down Expand Up @@ -544,6 +551,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",
Expand Down
27 changes: 27 additions & 0 deletions src/modules/menu/components/debug/BaseUrlOverrideModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ const store = useStore()
const wmsUrlOverride = ref(getBaseUrlOverride('wms'))
const wmtsUrlOverride = ref(getBaseUrlOverride('wmts'))
const api3UrlOverride = ref(getBaseUrlOverride('api3'))
const viewerDedicatedServicesUrlOverride = ref(getBaseUrlOverride('viewerDedicatedServices'))
function onModalClose(withConfirmation) {
if (withConfirmation) {
setBaseUrlOverrides('wms', wmsUrlOverride.value ?? null)
setBaseUrlOverrides('wmts', wmtsUrlOverride.value ?? null)
setBaseUrlOverrides('api3', api3UrlOverride.value ?? null)
setBaseUrlOverrides(
'viewerDedicatedServices',
viewerDedicatedServicesUrlOverride.value ?? null
)
}
store.dispatch('setHasBaseUrlOverrides', {
hasOverrides: hasBaseUrlOverrides(),
Expand Down Expand Up @@ -95,6 +100,28 @@ function onModalClose(withConfirmation) {
</button>
</div>
</div>
<div class="mb-3">
<label for="viewerDedicatedServicesUrlOverride" class="form-label"
>sys-map base URL</label
>
<div class="input-group">
<input
id="viewerDedicatedServicesUrlOverride"
v-model="viewerDedicatedServicesUrlOverride"
type="url"
class="form-control"
:placeholder="`default: ${getDefaultBaseUrl('viewerDedicatedServices')}`"
/>
<button
class="btn btn-outline-secondary"
type="button"
:disabled="viewerDedicatedServicesUrlOverride === null"
@click="viewerDedicatedServicesUrlOverride = null"
>
<FontAwesomeIcon icon="times" />
</button>
</div>
</div>
</div>
</ModalWithBackdrop>
</template>
Loading

0 comments on commit 65fed51

Please # to comment.