diff --git a/conf_apache_dev.md b/conf_apache_dev.md new file mode 100644 index 0000000000000000000000000000000000000000..03d656dfd0c6e211460a41be3ea4b98e472c4c0c --- /dev/null +++ b/conf_apache_dev.md @@ -0,0 +1,39 @@ + +# intro + +ceci permet de faire tourner le front en local sur /geocontrib +et de faire pointer /api sur n'importe quel backend (dev, local ou autre ) + +# configuration apache + +dans la configuration apache generale (httpd.conf ou commande a2enmod ), activer les modules : +* mod_headers +* mod_proxy +* mod_ssl +* mod_proxy_http + + +``` + <Location /geocontrib > + ProxyPass http://localhost:8080/geocontrib + </Location> + + + SSLProxyEngine On + <Location /api > + ProxyPass https://geocontrib.dev.neogeo.fr/geocontrib/api + RequestHeader set Referer https://geocontrib.dev.neogeo.fr/ + </Location> + ``` + + +# configuration projet vueJS + +remplacer dans le fichier config.json du projet +``` +DOMAIN":"http://localhost:8010/", par "DOMAIN":"http://localhost/", +``` +et +``` +"VUE_APP_DJANGO_API_BASE":"http://localhost:8010/api/", par "VUE_APP_DJANGO_API_BASE":"http://localhost/api/", +``` diff --git a/nginx.conf b/nginx.conf index b1a4d31d8d61c35ab78d0b999c673d28a23b5a2d..3ea3849f16c06b3f6da02bfaff5147374320b925 100644 --- a/nginx.conf +++ b/nginx.conf @@ -27,6 +27,18 @@ server { proxy_pass http://geocontrib_site; } + location /geocontrib/cas { + proxy_pass_header Set-Cookie; + proxy_set_header X-NginX-Proxy true; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header Host $host; + proxy_read_timeout 300s; + proxy_redirect off; + + proxy_pass http://geocontrib_site; + } + location /geocontrib/admin { proxy_pass_header Set-Cookie; proxy_set_header X-NginX-Proxy true; diff --git a/package.json b/package.json index 8f55afdbe57b2ad2089383f64f4e017bdb6981cb..07dc504cde35df55e6c8a36fac8195321eae375b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "geocontrib-frontend", - "version": "2.3.2-rc2", + "version": "2.3.2-rc4", "private": true, "scripts": { "serve": "npm run init-proxy & npm run init-serve", diff --git a/src/assets/icons/fa-icons.js b/src/assets/icons/fa-icons.js index 6ee50a04c0bdcf03d8af346aa3f45b5ae8277a61..25b11db565ad90ac90592970d82d23d1568cc9b1 100644 --- a/src/assets/icons/fa-icons.js +++ b/src/assets/icons/fa-icons.js @@ -1,4 +1,5 @@ const faIcons = [ + 'circle', 'address-book', 'address-card', 'adjust', diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index da388ae4d557cea90b06bd042558b32c38661b03..9c279ef6e2634edb7751f6122e349debf5952bc2 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -298,8 +298,7 @@ const mapUtil = { const currentValue = properties[colorsStyle.custom_field_name]; const colorStyle = colorsStyle.colors[currentValue]; return colorStyle ? colorStyle : featureType.color - } - else{ + } else { return featureType.color; } }, @@ -310,7 +309,12 @@ const mapUtil = { vectorTileLayerStyles: { "default": (properties) => { const featureType = featureTypes.find((x) => x.slug.split('-')[0] === '' + properties.feature_type_id); - const color = this.retrieveFeatureColor(featureType, properties) + + const color = this.retrieveFeatureColor(featureType, properties); + const colorValue = + color.value && color.value.length ? + color.value : typeof color === 'string' && color.length ? + color : '#000000'; const hiddenStyle = ({ radius: 0, @@ -318,7 +322,17 @@ const mapUtil = { weight: 0, fill: false, color: featureType.color, - }) + }); + + const defaultStyle = { + radius: 4, + fillOpacity: 0.5, + weight: 3, + fill: true, + color: colorValue, + }; + + // Filtre sur le feature type if (form_filters && form_filters.type.selected) { if (featureType.title !== form_filters.type.selected) { @@ -337,13 +351,7 @@ const mapUtil = { return hiddenStyle; } } - return ({ - radius: 4, - fillOpacity: 0.5, - weight: 3, - fill: true, - color: color, - }); + return defaultStyle; }, }, // subdomains: "0123", @@ -398,7 +406,10 @@ const mapUtil = { if (color == undefined){ color = featureType.color; } - const colorValue = color.value ? color.value : color; + const colorValue = + color.value && color.value.length ? + color.value : typeof color === 'string' && color.length ? + color : '#000000'; if (geomJSON.type === 'Point') { if ( customFieldOption && @@ -407,7 +418,10 @@ const mapUtil = { featureType.colors_style.value.icons && !!Object.keys(featureType.colors_style.value.icons).length ) { - if (featureType.colors_style.value.icons[customFieldOption]) { + if ( + featureType.colors_style.value.icons[customFieldOption] && + featureType.colors_style.value.icons[customFieldOption] !== 'circle' + ) { const iconHTML = ` <i class="fas fa-${featureType.colors_style.value.icons[customFieldOption]} fa-lg" @@ -428,16 +442,16 @@ const mapUtil = { .addTo(featureGroup); } else { L.circleMarker(geomJSON.coordinates, { - color: color, + color: colorValue, radius: 4, fillOpacity: 0.5, weight: 3, }) - .bindPopup(popupContent) - .addTo(featureGroup); + .bindPopup(popupContent) + .addTo(featureGroup); } } else { - if (featureType.icon) { + if (featureType.icon && featureType.icon !== 'circle') { const iconHTML = ` <i class="fas fa-${featureType.icon} fa-lg" diff --git a/src/components/feature_type/SymbologySelector.vue b/src/components/feature_type/SymbologySelector.vue index cd3c2409e6c8a375c139fd075818b7c58b25aa56..32c201bc0748bb34e354670d69974ee016be0af1 100644 --- a/src/components/feature_type/SymbologySelector.vue +++ b/src/components/feature_type/SymbologySelector.vue @@ -14,7 +14,7 @@ v-model.lazy="form.color.value" /> </div> - <div class="required inline field"> + <!-- <div class="required inline field"> <label>Symbole</label> <button class="ui icon button picker-button" @@ -27,7 +27,7 @@ class="icon alt" /> </button> - </div> + </div> --> </div> <div :class="isIconPickerModalOpen ? 'active' : ''" diff --git a/src/service-worker.js b/src/service-worker.js index dac6068b2cb19d00474c971971347d4f6fbb87a1..8a743071b19d358e8943689d387cd3225c77e0c8 100644 --- a/src/service-worker.js +++ b/src/service-worker.js @@ -14,7 +14,7 @@ if (workbox) { // Since we have a SPA here, this should be index.html always. // https://stackoverflow.com/questions/49963982/vue-router-history-mode-with-pwa-in-offline-mode workbox.routing.registerNavigationRoute('/geocontrib/index.html', { - blacklist: [/\/api/,/\/admin/,/\/media/], + blacklist: [/\/api/,/\/admin/,/\/media/,/\/cas/], }) workbox.routing.registerRoute( diff --git a/src/store/modules/feature.store.js b/src/store/modules/feature.store.js index fd331b50afb9e4fcb3aa32a7db9b895167c7cf90..8a1c1a0ed02754624638eb2e3a4621fed7571ec6 100644 --- a/src/store/modules/feature.store.js +++ b/src/store/modules/feature.store.js @@ -250,7 +250,7 @@ const feature = { } let updateMsg = { project: rootState.project_slug, - type: 'put', + type: routeName === "editer-signalement" ? "put" : "post", featureId: state.form.feature_id, geojson: geojson }; diff --git a/src/views/feature_type/Feature_type_symbology.vue b/src/views/feature_type/Feature_type_symbology.vue index 619efa1d9a4b0b74e802bf234f98c421d343e3ab..f49cb9053473aba19eb9a4ee789cde9316b44406 100644 --- a/src/views/feature_type/Feature_type_symbology.vue +++ b/src/views/feature_type/Feature_type_symbology.vue @@ -234,7 +234,16 @@ export default { this.GET_PROJECT_FEATURE_TYPES(this.$route.params.slug) .then(() => { this.loading = false; - this.success = 'La modification de la symbologie a été prise en compte.' + this.success = + 'La modification de la symbologie a été prise en compte. Vous allez être redirigé vers la page d\'acceuil du projet.'; + setTimeout(() => { + this.$router.push({ + name: 'project_detail', + params: { + slug: this.$store.state.project_slug, + }, + }) + }, 1500); }) .catch((err) => { console.error(err); diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index 58d661af8c45fe224f92764f42dfc257f5623f13..80652c3db400d08eb0027ff3f978b6084b8bbad0 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -715,26 +715,6 @@ export default { } } }, - - features: { - deep: true, - handler(newValue, oldValue) { - if (newValue && newValue.length && newValue !== oldValue) { - mapUtil.addFeatures( - this.features, - {}, - true, - this.feature_types - ); - this.mapLoading = false; - } - } - }, - featuresLoading(newValue) { - if (!newValue && this.features && this.features.length === 0) { - this.mapLoading = false; - } - } }, created() { @@ -969,6 +949,7 @@ export default { true, this.$store.state.feature_type.feature_types ); + this.mapLoading = false; this.GET_PROJECT_FEATURES({ project_slug: this.slug,