diff --git a/frontend/package.json b/frontend/package.json index 5e62aac10..5756cfc20 100755 --- a/frontend/package.json +++ b/frontend/package.json @@ -22,10 +22,12 @@ "@babel/node": "^7.13.13", "@babel/preset-env": "^7.13.12", "@morev/vue-transitions": "^3.0.2", + "@types/leaflet": "^1.9.12", "@vee-validate/i18n": "^4.13.2", "@vee-validate/rules": "^4.13.2", "@vee-validate/yup": "^4.13.2", "@vitejs/plugin-vue": "3.2.0", + "@vue-leaflet/vue-leaflet": "^0.10.1", "@vue/apollo-composable": "^4.0.2", "@vue/apollo-option": "^4.0.0", "@vue/compat": "^3.4.31", @@ -45,6 +47,8 @@ "graphql-tag": "^2.12.6", "identity-obj-proxy": "^3.0.0", "jwt-decode": "^3.1.2", + "leaflet": "^1.9.4", + "leaflet-geosearch": "^4.0.0", "portal-vue": "^3.0.0", "qrcanvas-vue": "3", "regenerator-runtime": "^0.13.7", diff --git a/frontend/src/components/UserSettings/CoordinatesDisplay.vue b/frontend/src/components/UserSettings/CoordinatesDisplay.vue new file mode 100644 index 000000000..4ca40b7f5 --- /dev/null +++ b/frontend/src/components/UserSettings/CoordinatesDisplay.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/frontend/src/components/UserSettings/UserGMSLocation.vue b/frontend/src/components/UserSettings/UserGMSLocation.vue deleted file mode 100644 index 2b2d95520..000000000 --- a/frontend/src/components/UserSettings/UserGMSLocation.vue +++ /dev/null @@ -1,6 +0,0 @@ - - diff --git a/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue b/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue new file mode 100644 index 000000000..946dcd577 --- /dev/null +++ b/frontend/src/components/UserSettings/UserGmsLocationCapturing.vue @@ -0,0 +1,91 @@ + + + diff --git a/frontend/src/components/UserSettings/UserLocationMap.vue b/frontend/src/components/UserSettings/UserLocationMap.vue new file mode 100644 index 000000000..8622f90b2 --- /dev/null +++ b/frontend/src/components/UserSettings/UserLocationMap.vue @@ -0,0 +1,218 @@ + + + + + diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index 78ebc1b5b..5090f34af 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -50,6 +50,7 @@ const community = { COMMUNITY_DESCRIPTION: process.env.COMMUNITY_DESCRIPTION ?? 'Die lokale Entwicklungsumgebung von Gradido.', COMMUNITY_SUPPORT_MAIL: process.env.COMMUNITY_SUPPORT_MAIL ?? 'support@supportmail.com', + COMMUNITY_LOCATION: process.env.COMMUNITY_LOCATION ?? '49.280377, 9.690151', } const meta = { diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index b9095a7e4..0d4858e98 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -28,6 +28,15 @@ export const authenticateGmsUserSearch = gql` } ` +export const userLocationQuery = gql` + query { + userLocation { + userLocation + communityLocation + } + } +` + export const authenticateHumhubAutoLogin = gql` query { authenticateHumhubAutoLogin diff --git a/frontend/src/locales/de.json b/frontend/src/locales/de.json index e04778830..05f73a5ec 100644 --- a/frontend/src/locales/de.json +++ b/frontend/src/locales/de.json @@ -312,10 +312,20 @@ "disabled": "Daten werden nicht nach GMS exportiert", "enabled": "Daten werden nach GMS exportiert", "location": { + "button": "Klick mich!", "label": "Positionsbestimmung", - "button": "Klick mich!" + "saveLocation": "Standort speichern", + "updateSuccess": "Standort erfolgreich gespeichert" }, "location-format": "Position auf Karte anzeigen:", + "map": { + "communityCoords": "Ihr Gemeinschafts-Standort: Breitengrad {lat}, Längengrad {lng}", + "communityLocationLabel": "Ihr Gemeinschafts-Standort", + "headline": "Geografische Standorterfassung des Benutzers", + "userCoords": "Ihr Standort: Breitengrad {lat}, Längengrad {lng}", + "userLocationLabel": "Ihr Standort", + "search": "Nach einem Standort suchen" + }, "naming-format": "Namen anzeigen:", "publish-location": { "exact": "Genaue Position", diff --git a/frontend/src/locales/en.json b/frontend/src/locales/en.json index 2aceda935..c6a717e44 100644 --- a/frontend/src/locales/en.json +++ b/frontend/src/locales/en.json @@ -312,10 +312,20 @@ "disabled": "Data not exported to GMS", "enabled": "Data exported to GMS", "location": { - "label": "pinpoint location", - "button": "click me!" + "button": "Click me!", + "label": "Pinpoint location", + "saveLocation": "Save Location", + "updateSuccess": "Location successfully saved" }, "location-format": "Show position on map:", + "map": { + "communityCoords": "Your Community Location: Lat {lat}, Lng {lng}", + "communityLocationLabel": "Your Community-Location", + "headline": "Geographic Location-Capturing of the User", + "userCoords": "Your Location: Lat {lat}, Lng {lng}", + "userLocationLabel": "Your Location", + "search": "Search for a location" + }, "naming-format": "Show Name:", "publish-location": { "exact": "exact position", diff --git a/frontend/src/locales/es.json b/frontend/src/locales/es.json index cc01acb9c..a169cada3 100644 --- a/frontend/src/locales/es.json +++ b/frontend/src/locales/es.json @@ -268,6 +268,23 @@ "warningText": "Aún estas?" }, "settings": { + "GMS": { + "location": { + "button": "¡Haz clic aquí!", + "label": "Ubicación exacta", + "saveLocation": "Guardar ubicación", + "updateSuccess": "Ubicación guardada exitosamente" + }, + "map": { + "communityCoords": "Ubicación de tu comunidad: Lat {lat}, Lng {lng}", + "communityLocationLabel": "Ubicación de tu comunidad", + "headline": "Captura de ubicación geográfica del usuario", + "userCoords": "Tu ubicación: Lat {lat}, Lng {lng}", + "userLocationLabel": "Tu ubicación", + "search": "Buscar una ubicación", + "success": "Ubicación guardada exitosamente" + } + }, "language": { "changeLanguage": "Cambiar idioma", "de": "Deutsch", diff --git a/frontend/src/locales/fr.json b/frontend/src/locales/fr.json index 408983190..a055cbd4f 100644 --- a/frontend/src/locales/fr.json +++ b/frontend/src/locales/fr.json @@ -276,6 +276,23 @@ "warningText": "Êtes-vous toujours connecté?" }, "settings": { + "GMS": { + "location": { + "button": "Cliquez ici !", + "label": "Emplacement précis", + "saveLocation": "Enregistrer l'emplacement", + "updateSuccess": "Emplacement enregistré avec succès" + }, + "map": { + "communityCoords": "Emplacement de votre communauté : Lat {lat}, Long {lng}", + "communityLocationLabel": "Emplacement de votre communauté", + "headline": "Capture de la localisation géographique de l'utilisateur", + "userCoords": "Votre emplacement : Lat {lat}, Long {lng}", + "userLocationLabel": "Votre emplacement", + "search": "Rechercher un emplacement", + "success": "Emplacement enregistré avec succès" + } + }, "hideAmountGDD": "Votre montant GDD est caché.", "hideAmountGDT": "Votre montant GDT est caché.", "language": { diff --git a/frontend/src/locales/nl.json b/frontend/src/locales/nl.json index a0b6aefad..bbbecbe8f 100644 --- a/frontend/src/locales/nl.json +++ b/frontend/src/locales/nl.json @@ -268,6 +268,23 @@ "warningText": "Ben je er nog?" }, "settings": { + "GMS": { + "location": { + "button": "Klik hier!", + "label": "Exacte locatie", + "saveLocation": "Locatie opslaan", + "updateSuccess": "Locatie succesvol opgeslagen" + }, + "map": { + "communityCoords": "Locatie van je gemeenschap: Lat {lat}, Lng {lng}", + "communityLocationLabel": "Locatie van je gemeenschap", + "headline": "Geografische locatiebepaling van de gebruiker", + "userCoords": "Jouw locatie: Lat {lat}, Lng {lng}", + "userLocationLabel": "Jouw locatie", + "search": "Zoek een locatie", + "success": "Locatie succesvol opgeslagen" + } + }, "language": { "changeLanguage": "Taal veranderen", "de": "Deutsch", diff --git a/frontend/src/locales/tr.json b/frontend/src/locales/tr.json index 3e3ac0a04..948c8228f 100644 --- a/frontend/src/locales/tr.json +++ b/frontend/src/locales/tr.json @@ -245,6 +245,23 @@ "warningText": "Hala orada mısın?" }, "settings": { + "GMS": { + "location": { + "button": "Buraya tıklayın!", + "label": "Tam konum", + "saveLocation": "Konumu Kaydet", + "updateSuccess": "Konum başarıyla kaydedildi" + }, + "map": { + "communityCoords": "Topluluk Konumunuz: Enlem {lat}, Boylam {lng}", + "communityLocationLabel": "Topluluk Konumunuz", + "headline": "Kullanıcının Coğrafi Konum Tespiti", + "userCoords": "Konumunuz: Enlem {lat}, Boylam {lng}", + "userLocationLabel": "Konumunuz", + "search": "Konum ara", + "success": "Konum başarıyla kaydedildi" + } + }, "language": { "changeLanguage": "Dili değiştir", "de": "Deutsch", diff --git a/frontend/src/pages/Settings.vue b/frontend/src/pages/Settings.vue index b4b2d458b..33a99044e 100644 --- a/frontend/src/pages/Settings.vue +++ b/frontend/src/pages/Settings.vue @@ -81,100 +81,102 @@ -
- -
{{ $t('settings.allow-community-services') }}
-
- + +
{{ $t('settings.allow-community-services') }}
+
+ + +
{{ $t('Humhub.title') }}
+
+ + + +
+
{{ $t('Humhub.desc') }}
+ + + {{ $t('settings.humhub.naming-format') }} + + + + + +
+
+ + +
{{ $t('GMS.title') }}
+
+ + + +
+
{{ $t('GMS.desc') }}
+
+ -
{{ $t('Humhub.title') }}
-
- - - -
-
{{ $t('Humhub.desc') }}
- - - {{ $t('settings.humhub.naming-format') }} + {{ $t('settings.GMS.naming-format') }} -
-
- + -
{{ $t('GMS.title') }}
+ {{ $t('settings.GMS.location-format') }}
- - + +
-
{{ $t('GMS.desc') }}
-
- - - {{ $t('settings.GMS.naming-format') }} - - - - - - - - {{ $t('settings.GMS.location-format') }} - - - - - - - - {{ $t('settings.GMS.location.label') }} - - - - - -
-
-
- + -
{{ $t('GMS.title') }}
+ {{ $t('settings.GMS.location.label') }}
- - + +
-
{{ $t('GMS.desc') }}
- -
+
+
+ + +
{{ $t('GMS.title') }}
+
+ + + +
+
{{ $t('GMS.desc') }}
+
+