Skip to content

Commit f02979d

Browse files
committed
adds mock snapshot store for new-municipality route.
1 parent c9a4bc6 commit f02979d

File tree

3 files changed

+71
-18
lines changed

3 files changed

+71
-18
lines changed

vue/.env.production

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
VUE_APP_GRAPHQL_URI=/graphql/
22
VUE_APP_DJANGOBASEURL=
3+
VUE_APP_SNAPSHOTSTOREURL=

vue/src/components/SnapshotList.vue

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
<v-subheader
1717
v-if="showTopic(index) && withTopic"
1818
class="px-0">{{ snapshot.topic }}</v-subheader>
19-
<v-list-item class="px-0 mb-4" dense
20-
21-
:to="createRouteLink(snapshot.pk)">
19+
<v-list-item class="px-0 mb-4"
20+
v-if="!snapshot.requestable"
21+
:to="createRouteLink(snapshot.pk)" dense
22+
>
2223
<v-list-item-avatar tile size="64" class="my-0">
2324
<v-img
2425
v-if="snapshot.thumbnail"
@@ -38,6 +39,32 @@
3839
</v-btn>
3940
</v-list-item-action>
4041
</v-list-item>
42+
<v-list-item class="px-0 mb-4 requestable"
43+
v-if="snapshot.requestable"
44+
:inactive="true" dense
45+
>
46+
<v-list-item-avatar tile size="64" class="my-0">
47+
<v-img
48+
v-if="snapshot.thumbnail"
49+
:src="snapshot.thumbnail"
50+
class="requestable-filter"
51+
>
52+
</v-img>
53+
</v-list-item-avatar>
54+
<v-list-item-content>
55+
<v-list-item-title style="font-weight:700">{{ snapshot.title }}</v-list-item-title>
56+
</v-list-item-content>
57+
<v-list-item-action style="margin:0 0 4px 0; align-self: center;">
58+
<v-btn icon
59+
class="nobg"
60+
v-on:click.stop="function(){}"
61+
:href="djangobaseurl + '/signup/'"
62+
target="_blank"
63+
>
64+
<v-icon color="grey lighten-1" >mdi-arrow-right-bold-circle-outline</v-icon>
65+
</v-btn>
66+
</v-list-item-action>
67+
</v-list-item>
4168
</div>
4269
</v-list>
4370
</template>
@@ -70,6 +97,13 @@
7097
.v-image__image {
7198
background-color: rgba(0, 0, 0, 0.1);
7299
}
100+
.requestable.v-list-item {
101+
border: 1px dashed #9b9b9b73;
102+
}
103+
.requestable-filter {
104+
filter: grayscale(100%) brightness(110%);
105+
opacity: 0.35;
106+
}
73107
</style>
74108

75109

vue/src/views/Snapshot.vue

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"hasSnapshot.p2": "Erkunden Sie unsere weiteren Fallbeispiele um ein besseres Bild der Möglichkeiten für Ihre Gemeinde zu erhalten.",
99
"noSnapshot.title": "Datenverfügbarkeit",
1010
"noSnapshot.municipalityText": "diese Gemeinde",
11-
"noSnapshot.p1": "Für {municipalityText} stehen zur Zeit noch keine Daten zur Verfügung.",
11+
"noSnapshot.p1": "Für {municipalityText} sind zur Zeit noch keine Analysen freigeschaltet.",
1212
"noSnapshot.p2": "Erkunden Sie unsere Fallbeispiele um ein besseres Bild der Möglichkeiten für Ihre Gemeinde zu erhalten.",
1313
"listtitle": "Fallbeispiele",
1414
"listtitleMore": "Weitere Fallbeispiele"
@@ -47,19 +47,32 @@
4747
<div id="snapshotnavContent" class="ma-4">
4848
<search :dense="true" :term="municipalityName"/>
4949

50-
<div class="nodata pb-8">
51-
<div v-if="!hash" class="smaller hint">
52-
<h4>{{ $t('noSnapshot.title') }}</h4>
50+
<div v-if="!hash" class="nodata pb-8">
51+
<div class="smaller hint">
52+
<!-- <h4>{{ $t('noSnapshot.title') }}</h4> -->
5353
<p>{{ $t('noSnapshot.p1', { municipalityText: municipalityText }) }}</p>
5454
<p>{{ $t('noSnapshot.p2') }}</p>
5555
</div>
56+
</div>
5657

57-
<snapshot-list
58-
v-if="snapshotsMunicipality"
59-
:snapshots="snapshotsMunicipality"
60-
/>
58+
<div class="useractions">
59+
<v-btn small block outlined color="primary">
60+
<router-link key="signup" :to="'/' + $i18n.locale + '/signup/'">
61+
{{ $t('calltoactionText', { municipalityText: municipalityText }) }}
62+
</router-link>
63+
</v-btn>
6164
</div>
6265

66+
<snapshot-list
67+
v-if="hash"
68+
:snapshots="snapshotsMunicipality" :withTopic="false"
69+
/>
70+
71+
<snapshot-list
72+
v-if="snapshotsStore"
73+
:snapshots="snapshotsStore" :withTopic="true"
74+
/>
75+
6376
<v-subheader
6477
class="px-0 snapshot-list-title">{{ listtitleText }}
6578
</v-subheader>
@@ -69,13 +82,6 @@
6982
:snapshots="snapshotsExamples" :withTopic="false"
7083
/>
7184

72-
<div class="useractions">
73-
<v-btn small block outlined color="primary">
74-
<router-link key="signup" :to="'/' + $i18n.locale + '/signup/'">
75-
{{ $t('calltoactionText', { municipalityText: municipalityText }) }}
76-
</router-link>
77-
</v-btn>
78-
</div>
7985
</div>
8086

8187
<v-toolbar
@@ -134,9 +140,11 @@ export default {
134140
return {
135141
hash: this.$route.params.hash,
136142
bfsNumber: this.$route.params.bfsNumber,
143+
snapshotStoreUrl: process.env.VUE_APP_SNAPSHOTSTOREURL,
137144
geojson: null,
138145
geobounds: [],
139146
municipalityName: '',
147+
snapshotsStore: [],
140148
snapshotsExamples: [],
141149
snapshotsIdExamplesExclude: [],
142150
snapshotsMunicipality: [],
@@ -148,6 +156,16 @@ export default {
148156
},
149157
150158
async mounted() {
159+
fetch(`${this.snapshotStoreUrl}/pipelines.${this.$i18n.locale}.json`)
160+
.then(response => response.json())
161+
.then((data) => {
162+
data.forEach((el, i) => {
163+
data[i].thumbnail = `${this.snapshotStoreUrl}/${el.thumbnail}`;
164+
});
165+
166+
this.snapshotsStore = data;
167+
});
168+
151169
if (this.hash) {
152170
await this.getSnapshotInfo(this.hash);
153171

0 commit comments

Comments
 (0)