Skip to content
Snippets Groups Projects
Commit d025615a authored by Camille Blanchon's avatar Camille Blanchon
Browse files

Merge branch 'redmine-issues/13575' into 'develop'

REDMINE_ISSUE-13575| Mode déconnecté - Désactiver les filtres dans la page liste et carte

See merge request !473
parents 47c70826 d517222e
No related branches found
No related tags found
No related merge requests found
...@@ -147,6 +147,7 @@ ...@@ -147,6 +147,7 @@
> >
<td <td
v-if="isOnline" v-if="isOnline"
id="select"
class="dt-center" class="dt-center"
> >
<div <div
...@@ -165,7 +166,10 @@ ...@@ -165,7 +166,10 @@
</div> </div>
</td> </td>
<td class="dt-center"> <td
id="status"
class="dt-center"
>
<div <div
v-if="feature.status === 'archived'" v-if="feature.status === 'archived'"
data-tooltip="Archivé" data-tooltip="Archivé"
...@@ -203,7 +207,10 @@ ...@@ -203,7 +207,10 @@
/> />
</div> </div>
</td> </td>
<td class="dt-center"> <td
id="type"
class="dt-center"
>
<router-link <router-link
:to="{ :to="{
name: 'details-type-signalement', name: 'details-type-signalement',
...@@ -216,7 +223,10 @@ ...@@ -216,7 +223,10 @@
{{ feature.feature_type.title }} {{ feature.feature_type.title }}
</router-link> </router-link>
</td> </td>
<td class="dt-center"> <td
id="name"
class="dt-center"
>
<router-link <router-link
:to="{ :to="{
name: 'details-signalement-filtre', name: 'details-signalement-filtre',
...@@ -230,17 +240,22 @@ ...@@ -230,17 +240,22 @@
{{ feature.title || feature.feature_id }} {{ feature.title || feature.feature_id }}
</router-link> </router-link>
</td> </td>
<td class="dt-center"> <td
id="update"
class="dt-center"
>
{{ feature.updated_on | formatDate }} {{ feature.updated_on | formatDate }}
</td> </td>
<td <td
v-if="user" v-if="user"
id="author"
class="dt-center" class="dt-center"
> >
{{ feature.display_creator || ' ---- ' }} {{ feature.display_creator || ' ---- ' }}
</td> </td>
<td <td
v-if="user" v-if="user"
id="last_editor"
class="dt-center" class="dt-center"
> >
{{ feature.display_last_editor || ' ---- ' }} {{ feature.display_last_editor || ' ---- ' }}
...@@ -706,25 +721,25 @@ and also iPads specifically. ...@@ -706,25 +721,25 @@ and also iPads specifically.
/* /*
Label the data Label the data
*/ */
td:nth-of-type(1):before { td#select:before {
content: ""; content: "";
} }
td:nth-of-type(2):before { td#status:before {
content: "Statut"; content: "Statut";
} }
td:nth-of-type(3):before { td#type:before {
content: "Type"; content: "Type";
} }
td:nth-of-type(4):before { td#name:before {
content: "Nom"; content: "Nom";
} }
td:nth-of-type(5):before { td#update:before {
content: "Dernière modification"; content: "Dernière modification";
} }
td:nth-of-type(6):before { td#author:before {
content: "Auteur"; content: "Auteur";
} }
td:nth-of-type(7):before { td#last_editor:before {
content: "Dernier éditeur"; content: "Dernier éditeur";
} }
......
...@@ -154,6 +154,9 @@ export default { ...@@ -154,6 +154,9 @@ export default {
}, },
computed: { computed: {
...mapState([
'isOnline'
]),
...mapState('projects', [ ...mapState('projects', [
'project', 'project',
]), ]),
...@@ -177,6 +180,17 @@ export default { ...@@ -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() { mounted() {
if (!this.project) { if (!this.project) {
// Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh // Chargements des features et infos projet en cas d'arrivée directe sur la page ou de refresh
...@@ -196,6 +210,9 @@ export default { ...@@ -196,6 +210,9 @@ export default {
}, },
methods: { methods: {
...mapMutations([
'DISPLAY_MESSAGE',
]),
...mapActions('feature', [ ...mapActions('feature', [
'DELETE_FEATURE', 'DELETE_FEATURE',
]), ]),
...@@ -243,7 +260,7 @@ export default { ...@@ -243,7 +260,7 @@ export default {
this.UPDATE_CHECKED_FEATURES(newCheckedFeatures); this.UPDATE_CHECKED_FEATURES(newCheckedFeatures);
this.modifyStatus(newStatus); this.modifyStatus(newStatus);
} else { } else {
this.$store.commit('DISPLAY_MESSAGE', { this.DISPLAY_MESSAGE({
comment: `Le signalement ${feature.title} n'a pas pu être modifié`, comment: `Le signalement ${feature.title} n'a pas pu être modifié`,
level: 'negative' level: 'negative'
}); });
...@@ -253,7 +270,7 @@ export default { ...@@ -253,7 +270,7 @@ export default {
} }
} else { } else {
this.fetchPagedFeatures(); this.fetchPagedFeatures();
this.$store.commit('DISPLAY_MESSAGE', { this.DISPLAY_MESSAGE({
comment: 'Tous les signalements ont été modifié avec succès.', comment: 'Tous les signalements ont été modifié avec succès.',
level: 'positive' level: 'positive'
}); });
...@@ -384,6 +401,12 @@ export default { ...@@ -384,6 +401,12 @@ export default {
}, },
fetchPagedFeatures(newUrl) { 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}`; 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 receiving next & previous url (// todo : might be not used anymore, to check)
if (newUrl && typeof newUrl === 'string') { if (newUrl && typeof newUrl === 'string') {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment