diff --git a/src/App.vue b/src/App.vue index 35f6b5813208e656bc7afb8fc9ac27db8d15cae6..9aecfde05cf40539810e6f6dfd7d963f572444ee 100644 --- a/src/App.vue +++ b/src/App.vue @@ -145,8 +145,8 @@ <div class="desktop flex push-right-desktop"> <router-link v-if="user" - :to="{name: 'my_account'}" - class="item" + :to="{name: isSharedProject ? '' : 'my_account'}" + :class="['item', {disable: isSharedProject}]" > {{ userFullname || user.username || "Utilisateur inconnu" }} </router-link> diff --git a/src/assets/js/map-util.js b/src/assets/js/map-util.js index 5a966b9cd02ebe5ae117ef3be89d24524c2b19ee..68c59bb6489fa424dceb84b2219e74673a64a5ce 100644 --- a/src/assets/js/map-util.js +++ b/src/assets/js/map-util.js @@ -541,12 +541,16 @@ const mapUtil = { date_maj = formatDate(new Date(feature.properties.updated_on)); feature_type_url = '/geocontrib/projet/' + project_slug + '/type-signalement/' + feature_type.slug + '/'; feature_url = feature_type_url + 'signalement/' + feature.properties.feature_id + '/'; - //status=feature.properties.status; } else { feature_type = feature.properties ? feature.properties.feature_type : feature.feature_type; status = feature.properties ? feature.properties.status.label : feature.status.label; } + //* adapt link url for shared-project restricted navigation + if (window.location.pathname.includes('projet-partage')) { + feature_url = feature_url.replace('projet', 'projet-partage'); + feature_type_url = feature_type_url.replace('projet', 'projet-partage'); + } let author = ''; const creator = feature.properties ? feature.properties.creator : feature.creator; if (creator) { diff --git a/src/store/modules/feature_type.store.js b/src/store/modules/feature_type.store.js index f8ac20f86e412b09156b6ee26261a92fc5e30c42..524b9dc108bf9c373867ae3876ee2f3af0184fb3 100644 --- a/src/store/modules/feature_type.store.js +++ b/src/store/modules/feature_type.store.js @@ -165,7 +165,7 @@ const feature_type = { }); }, - async SEND_FEATURES_FROM_GEOJSON({ state, dispatch, rootGetters }, payload) { + async SEND_FEATURES_FROM_GEOJSON({ state, dispatch, rootState }, payload) { let { feature_type_slug, geojson } = payload; //* check if geojson then build a file if(!geojson && !state.fileToImport && state.fileToImport.size === 0 ) return; @@ -173,7 +173,7 @@ const feature_type = { let fileToImport; const { name, type } = geojson || state.fileToImport; - if (!rootGetters['projects/project'].moderation) { + if (rootState.projects.project.moderation) { if (state.fileToImport && state.fileToImport.size > 0) { //* if data in a binary file, read it as text const textFile = await state.fileToImport.text(); geojson = JSON.parse(textFile); diff --git a/src/store/modules/map.store.js b/src/store/modules/map.store.js index 9aa4745f03fc7c358801b3973c8de73c1fa4667b..083f852da9448d883304e01d92baf05f5bdc7164 100644 --- a/src/store/modules/map.store.js +++ b/src/store/modules/map.store.js @@ -104,8 +104,8 @@ const map = { }); }, - INITIATE_MAP({ state, rootGetters, commit }, el) { - const project = rootGetters['projects/project']; + INITIATE_MAP({ state, rootState, commit }, el) { + const project = rootState.projects.project; let mapDefaultViewCenter = [46, 2]; // defaultMapView.center; let mapDefaultViewZoom = 5; // defaultMapView.zoom; mapUtil.createMap(el, { diff --git a/src/views/feature_type/Feature_type_detail.vue b/src/views/feature_type/Feature_type_detail.vue index fd9ff464f2159f5c1d43fbff72331d4da21f3bac..1beab1d4ae462542b6390695b535570590d84a6e 100644 --- a/src/views/feature_type/Feature_type_detail.vue +++ b/src/views/feature_type/Feature_type_detail.vue @@ -539,9 +539,9 @@ export default { slug: this.slug, feature_type_slug: this.$route.params.feature_type_slug, }; - if (this.$route.params.geojson) { + if (this.$route.params.geojson) { //* import after redirection, for instance with data from catalog payload['geojson'] = this.$route.params.geojson; - } else if (this.fileToImport && !this.fileToImport.name) { + } else if (this.fileToImport.size > 0) { //* import directly from geojson payload['fileToImport'] = this.fileToImport; } else { this.importError = "La ressource n'a pas pu ÃĒtre rÊcupÊrÊ.";