Skip to content
Snippets Groups Projects
Commit 748a5f16 authored by Timothee P's avatar Timothee P :sunflower:
Browse files

Merge branch 'develop' into evol/redmine-ticket-11083-full-responsive-design

parents c0146d82 f25aa074
No related branches found
No related tags found
1 merge request!38Evol/redmine ticket 11083 full responsive design
......@@ -13,7 +13,11 @@
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<div id="app">
<div class="ui active dimmer">
<div class="ui indeterminate text loader">En cours de chargement ...</div>
</div>
</div>
<!-- built files will be auto injected -->
</body>
</html>
......@@ -68,20 +68,25 @@ export default {
selectedLayer: {
get() {
const matchingLayer = this.retrieveLayer(this.layer.title);
return {
name: matchingLayer ? matchingLayer.service : "",
value: this.layer ? this.layer.title : "",
};
if (matchingLayer != undefined){
return {
name: matchingLayer != undefined ? matchingLayer.service : "",
value: this.layer ? this.layer.title : "",
};
}
return []
},
set(newValue) {
const matchingLayer = this.retrieveLayer(this.layer.title);
this.updateLayer({
...this.layer,
service: newValue.name,
title: newValue.value,
id: matchingLayer.id,
});
const matchingLayer = this.retrieveLayer(newValue.title);
if (matchingLayer != undefined){
this.updateLayer({
...this.layer,
service: newValue.name,
title: newValue.value,
id: matchingLayer.id,
});
}
},
},
......@@ -96,7 +101,7 @@ export default {
availableLayers: function () {
return this.layers.map((el) => {
return { name: el.service, value: el.title };
return { id: el.id, name: el.service, value: el.title, title: el.title };
});
},
......@@ -109,7 +114,7 @@ export default {
methods: {
retrieveLayer(title) {
return this.layers.find((el) => el.title === title);
return this.layers.find((el) => el.title === title);
},
removeLayer() {
......@@ -130,12 +135,14 @@ export default {
mounted() {
const matchingLayer = this.retrieveLayer(this.layer.title);
this.updateLayer({
...this.layer,
service: matchingLayer.service,
title: matchingLayer.title,
id: matchingLayer.id,
});
if (matchingLayer != undefined){
this.updateLayer({
...this.layer,
service: matchingLayer.service,
title: matchingLayer.title,
id: matchingLayer.id,
});
}
},
};
</script>
\ No newline at end of file
......@@ -179,6 +179,7 @@ export default new Vuex.Store({
},
LOGOUT({ commit }) {
const pageNoRedirect = ["liste-signalements", "details-type-signalement", "details-signalement", "project_detail", "mentions", "aide", "index"]
axios
.get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}logout/`)
.then((response) => {
......@@ -186,7 +187,7 @@ export default new Vuex.Store({
commit("SET_USER", false);
commit("SET_USER_LEVEL_PROJECTS", null);
commit("SET_USER_PERMISSIONS", null);
router.push("/");
if (!pageNoRedirect.includes(router.history.current.name)) router.push("/");
}
})
.catch((error) => {
......
......@@ -99,7 +99,9 @@ const map = {
GET_BASEMAPS({ commit }, project_slug) {
return axios
.get(`${this.state.configuration.VUE_APP_DJANGO_API_BASE}base-maps/?project__slug=${project_slug}`)
.then((response) => (commit("SET_BASEMAPS", response.data)))
.then((response) => {
commit("SET_BASEMAPS", response.data)
})
.catch((error) => {
throw error;
});
......
<template>
<div v-if="flatpage" class="row">
<div class="ten wide column">
{{ this.$route.params.url }}
<h1>{{ flatpage.title }}</h1>
<div v-html="flatpage.content"></div>
</div>
......@@ -9,13 +8,17 @@
</template>
<script>
import { mapState } from "vuex";
export default {
name: "Default",
computed: {
...mapState(["staticPages"]),
flatpage() {
if (this.$store.state.staticPages) {
return this.$store.state.staticPages.find(
(page) => page.url === this.$route.path
if (this.staticPages) {
return this.staticPages.find(
(page) => page.url === `/${this.$route.name}/`
);
}
return null;
......
......@@ -23,18 +23,23 @@
</template>
<script>
import { mapState } from "vuex";
export default {
name: "With_right_menu",
data() {
return {
sections: [],
};
},
computed: {
...mapState(["staticPages"]),
flatpage() {
if (this.$store.state.staticPages) {
return this.$store.state.staticPages.find(
(page) => page.url === this.$route.path
if (this.staticPages) {
return this.staticPages.find(
(page) => page.url === `/${this.$route.name}/`
);
}
return null;
......
......@@ -21,7 +21,7 @@
</a>
</div>
<div class="ui">
<div v-if="basemaps" class="ui">
<ProjectMappingBasemap
v-for="basemap in basemaps"
:key="basemap.id"
......
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