diff --git a/src/components/Project/FeaturesListAndMap/FeatureListTable.vue b/src/components/Project/FeaturesListAndMap/FeatureListTable.vue index 6baa852801a92531f99db5c4ca0002cd274a87ba..cc4b12e12e55c74c05befd20f97c08c816682d51 100644 --- a/src/components/Project/FeaturesListAndMap/FeatureListTable.vue +++ b/src/components/Project/FeaturesListAndMap/FeatureListTable.vue @@ -147,6 +147,7 @@ > <td v-if="isOnline" + id="select" class="dt-center" > <div @@ -165,7 +166,10 @@ </div> </td> - <td class="dt-center"> + <td + id="status" + class="dt-center" + > <div v-if="feature.status === 'archived'" data-tooltip="Archivé" @@ -203,7 +207,10 @@ /> </div> </td> - <td class="dt-center"> + <td + id="type" + class="dt-center" + > <router-link :to="{ name: 'details-type-signalement', @@ -216,7 +223,10 @@ {{ feature.feature_type.title }} </router-link> </td> - <td class="dt-center"> + <td + id="name" + class="dt-center" + > <router-link :to="{ name: 'details-signalement-filtre', @@ -230,17 +240,22 @@ {{ feature.title || feature.feature_id }} </router-link> </td> - <td class="dt-center"> + <td + id="update" + class="dt-center" + > {{ feature.updated_on | formatDate }} </td> <td v-if="user" + id="author" class="dt-center" > {{ feature.display_creator || ' ---- ' }} </td> <td v-if="user" + id="last_editor" class="dt-center" > {{ feature.display_last_editor || ' ---- ' }} @@ -706,25 +721,25 @@ and also iPads specifically. /* Label the data */ - td:nth-of-type(1):before { + td#select:before { content: ""; } - td:nth-of-type(2):before { + td#status:before { content: "Statut"; } - td:nth-of-type(3):before { + td#type:before { content: "Type"; } - td:nth-of-type(4):before { + td#name:before { content: "Nom"; } - td:nth-of-type(5):before { + td#update:before { content: "Dernière modification"; } - td:nth-of-type(6):before { + td#author:before { content: "Auteur"; } - td:nth-of-type(7):before { + td#last_editor:before { content: "Dernier éditeur"; } diff --git a/src/views/Project/FeaturesListAndMap.vue b/src/views/Project/FeaturesListAndMap.vue index 1846d6f3357421bb4307834e762e3a0bdb30795e..ebebfcb555d6d666a481aa73b4746ac7cf3ec9f1 100644 --- a/src/views/Project/FeaturesListAndMap.vue +++ b/src/views/Project/FeaturesListAndMap.vue @@ -154,6 +154,9 @@ export default { }, computed: { + ...mapState([ + 'isOnline' + ]), ...mapState('projects', [ 'project', ]), @@ -177,6 +180,17 @@ export default { }, }, + + watch: { + isOnline(newValue, oldValue) { + if (newValue != oldValue && !newValue) { + this.DISPLAY_MESSAGE({ + comment: 'Les signalements du projet non mis en cache ne sont pas accessibles en mode déconnecté', + }); + } + }, + }, + mounted() { if (!this.project) { // Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh @@ -196,6 +210,9 @@ export default { }, methods: { + ...mapMutations([ + 'DISPLAY_MESSAGE', + ]), ...mapActions('feature', [ 'DELETE_FEATURE', ]), @@ -243,7 +260,7 @@ export default { this.UPDATE_CHECKED_FEATURES(newCheckedFeatures); this.modifyStatus(newStatus); } else { - this.$store.commit('DISPLAY_MESSAGE', { + this.DISPLAY_MESSAGE({ comment: `Le signalement ${feature.title} n'a pas pu être modifié`, level: 'negative' }); @@ -253,7 +270,7 @@ export default { } } else { this.fetchPagedFeatures(); - this.$store.commit('DISPLAY_MESSAGE', { + this.DISPLAY_MESSAGE({ comment: 'Tous les signalements ont été modifié avec succès.', level: 'positive' }); @@ -384,6 +401,12 @@ export default { }, fetchPagedFeatures(newUrl) { + if (!navigator.onLine) { + this.DISPLAY_MESSAGE({ + comment: 'Les signalements du projet non mis en cache ne sont pas accessibles en mode déconnecté', + }); + return; + } let url = `${this.API_BASE_URL}projects/${this.projectSlug}/feature-paginated/?limit=${this.pagination.pagesize}&offset=${this.pagination.start}`; //* if receiving next & previous url (// todo : might be not used anymore, to check) if (newUrl && typeof newUrl === 'string') {