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