diff --git a/src/components/feature/FeatureListTable.vue b/src/components/feature/FeatureListTable.vue index ed7f0dac060041a1badf0b1f4137cf458d8ba7b6..b509c122c1f46d8f8da10c4a3df0a44ce1f4565a 100644 --- a/src/components/feature/FeatureListTable.vue +++ b/src/components/feature/FeatureListTable.vue @@ -133,7 +133,7 @@ {{ feature.properties.updated_on }} </td> <td class="center" v-if="user"> - {{ feature.properties.creator.username || " ---- " }} + {{ getUserName(feature) }} </td> </tr> <tr v-if="filteredFeatures.length === 0" class="odd"> @@ -288,6 +288,12 @@ export default { }, methods: { + getUserName(feature){ + if(!feature.properties.creator) { + return " ---- "; + } + return feature.properties.creator.username || " ---- " + }, getFeatureDisplayName(feature) { return feature.properties.title || feature.id; }, diff --git a/src/views/project/Project_detail.vue b/src/views/project/Project_detail.vue index cd3ee96b93b04a86d2c3d27514a75881b1c5b7c7..20ce21a52d7cb9a8bbdf0fb92180c47597dbf481 100644 --- a/src/views/project/Project_detail.vue +++ b/src/views/project/Project_detail.vue @@ -663,10 +663,13 @@ export default { this.$store.dispatch("map/INITIATE_MAP"); const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.$route.params.slug}/feature/?output=geojson`; let self = this; + this.checkForOfflineFeature(); axios .get(url) .then((response) => { - const features = response.data.features; + let features = response.data.features; + self.arraysOffline.forEach(x=>x.geojson.properties.color="red"); + features=response.data.features.concat(self.arraysOffline.map(x=>x.geojson)); const featureGroup = mapUtil.addFeatures(features); if (featureGroup && featureGroup.getLayers().length > 0) { mapUtil @@ -678,7 +681,7 @@ export default { .catch((error) => { throw error; }); - this.checkForOfflineFeature(); + }