Skip to content

Commit 8d22c41

Browse files
committed
Revert "Merge branch 'opengraphmeta' into stage" partial
Only removes vue snapshots parts This reverts commit e820282, reversing changes made to 2e3d7e3.
1 parent e820282 commit 8d22c41

File tree

2 files changed

+2
-45
lines changed

2 files changed

+2
-45
lines changed

vue/src/components/SnapshotMap.vue

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ export default {
121121
122122
props: {
123123
geojson: Object,
124-
screenshotFacebook: String,
125-
screenshotTwitter: String,
126124
geoboundsIn: Array,
127125
predecessor: Object
128126
},
@@ -177,7 +175,6 @@ export default {
177175
this.description = this.geojson.views[0].spec.description;
178176
this.legend = this.geojson.views[0].spec.legend;
179177
this.sources = this.geojson.sources;
180-
this.setMetaShare();
181178
},
182179
183180
setupMapbox() {
@@ -265,40 +262,6 @@ export default {
265262
this.layers = [];
266263
this.geobounds = [];
267264
this.map = null;
268-
this.removeMetaTags();
269-
},
270-
271-
addMetaTag(property, content) {
272-
const metaTag = document.createElement('meta');
273-
metaTag.setAttribute('property', property);
274-
metaTag.content = content;
275-
document.getElementsByTagName('head')[0].appendChild(metaTag);
276-
},
277-
278-
removeMetaTags() {
279-
const ogTitle = document.querySelector('[name=\'og:title\']');
280-
const ogDescription = document.querySelector('[name=\'og:description\']');
281-
const ogUrl = document.querySelector('[name=\'og:url\']');
282-
const ogImage = document.querySelector('[name=\'og:image\']');
283-
const twitterImage = document.querySelector('[name=\'twitter:image\']');
284-
if (ogTitle) ogTitle.remove();
285-
if (ogDescription) ogDescription.remove();
286-
if (ogUrl) ogUrl.remove();
287-
if (ogImage) ogImage.remove();
288-
if (twitterImage) twitterImage.remove();
289-
},
290-
291-
setMetaShare() {
292-
this.removeMetaTags();
293-
this.addMetaTag('og:title', this.title);
294-
this.addMetaTag('og:description', this.description);
295-
this.addMetaTag('og:url', `${document.location.origin}/${this.hash}`);
296-
if (this.screenshotFacebook) {
297-
this.addMetaTag('og:image', `${document.location.origin}/media/${this.screenshotFacebook}`);
298-
}
299-
if (this.screenshotTwitter) {
300-
this.addMetaTag('twitter:image', `${document.location.origin}/media/${this.screenshotTwitter}`);
301-
}
302265
}
303266
}
304267
};

vue/src/views/Snapshot.vue

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@
9494
:geojson="geojson"
9595
:geoboundsIn="geobounds"
9696
:predecessor="predecessor"
97-
:screenshotFacebook="screenshotFacebook"
98-
:screenshotTwitter="screenshotTwitter"
9997
/>
10098
</div>
10199
</template>
@@ -130,8 +128,6 @@ export default {
130128
return {
131129
hash: this.$route.params.hash,
132130
bfsNumber: this.$route.params.bfsNumber,
133-
screenshotFacebook: '',
134-
screenshotTwitter: '',
135131
geojson: null,
136132
geobounds: [],
137133
municipalityName: '',
@@ -200,8 +196,6 @@ export default {
200196
id
201197
pk
202198
}
203-
screenshotFacebook
204-
screenshotTwitter
205199
municipality {
206200
bfsNumber
207201
fullname
@@ -211,6 +205,7 @@ export default {
211205
title
212206
topic
213207
thumbnail
208+
screenshot
214209
}
215210
}
216211
}
@@ -241,8 +236,6 @@ export default {
241236
snapshot => !snapshotsIdExamplesExclude.includes(snapshot.id)
242237
);
243238
this.predecessor = (result.data.snapshot.predecessor);
244-
this.screenshotFacebook = result.data.snapshot.screenshotFacebook;
245-
this.screenshotTwitter = (result.data.snapshot.screenshotTwitter);
246239
this.$store.commit('setBfsnumber', result.data.snapshot.municipality.bfsNumber);
247240
this.$store.commit('setBfsname', result.data.snapshot.municipality.fullname);
248241
} else {
@@ -265,6 +258,7 @@ export default {
265258
title
266259
topic
267260
thumbnail
261+
screenshot
268262
}
269263
}
270264

0 commit comments

Comments
 (0)