-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #248 from Dataport/feature/add-download-button-in-…
…bgw-gfi Feature/add download button in bgw gfi
- Loading branch information
Showing
5 changed files
with
165 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<template> | ||
<v-btn | ||
class="text-none bgw-link-button" | ||
text | ||
:href="link" | ||
target="_blank" | ||
:title="$t('plugins.gfi.button.details')" | ||
:aria-label="$t('plugins.gfi.button.details')" | ||
onmousedown="return false" | ||
> | ||
{{ $t('plugins.gfi.button.details') }} | ||
</v-btn> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import { mapGetters } from 'vuex' | ||
export default Vue.extend({ | ||
name: 'ActionButton', | ||
computed: { | ||
...mapGetters('plugin/gfi', ['currentProperties']), | ||
link() { | ||
return `https://www.schleswig-holstein.de/DE/fachinhalte/B/badegewaesser/DarstellungBadestelle.html#bgst=${this.currentProperties.fid}` | ||
}, | ||
}, | ||
}) | ||
</script> | ||
<style lang="scss" scoped> | ||
.bgw-link-button { | ||
margin-right: 0.4em; | ||
margin-top: 0.5em; | ||
box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.2), 0 4px 5px 0 rgba(0, 0, 0, 0.14), | ||
0 1px 10px 0 rgba(0, 0, 0, 0.12); | ||
border: 3px solid transparent; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
<template> | ||
<v-card | ||
v-if="infoFields.length > 0 && currentProperties" | ||
class="bgw-gfi-content" | ||
> | ||
<v-card-actions v-if="!hasWindowSize || !hasSmallWidth"> | ||
<v-spacer></v-spacer> | ||
<v-btn | ||
icon | ||
small | ||
:aria-label="$t('plugins.gfi.header.close')" | ||
@click="close(true)" | ||
> | ||
<v-icon small>fa-xmark</v-icon> | ||
</v-btn> | ||
</v-card-actions> | ||
<v-card-title class="bgw-gfi-title"> | ||
{{ currentProperties.bgw_name }} | ||
</v-card-title> | ||
<v-card-text> | ||
<v-simple-table dense> | ||
<tbody> | ||
<tr v-for="item in info" :key="item[0]"> | ||
<td>{{ $t(item[0]) }}</td> | ||
<td>{{ item[1] }}</td> | ||
</tr> | ||
</tbody> | ||
</v-simple-table> | ||
<ActionButton></ActionButton> | ||
</v-card-text> | ||
</v-card> | ||
</template> | ||
|
||
<script lang="ts"> | ||
import Vue from 'vue' | ||
import { mapActions, mapGetters } from 'vuex' | ||
import ActionButton from './ActionButton.vue' | ||
export default Vue.extend({ | ||
name: 'BgwGfiContent', | ||
components: { ActionButton }, | ||
data: () => ({ | ||
infoFields: [], | ||
}), | ||
computed: { | ||
...mapGetters(['map', 'configuration']), | ||
...mapGetters('plugin/gfi', ['currentProperties']), | ||
...mapGetters(['hasSmallWidth', 'hasWindowSize']), | ||
info(): Array<string[]> { | ||
return this.infoFields.map(({ key, label }) => [ | ||
label, | ||
this.currentProperties[key], | ||
]) | ||
}, | ||
}, | ||
mounted() { | ||
this.infoFields = this.configuration.gfi.infoFields | ||
}, | ||
methods: { | ||
...mapActions('plugin/gfi', ['close']), | ||
}, | ||
}) | ||
</script> | ||
|
||
<style lang="scss" scoped> | ||
.bgw-gfi-title { | ||
word-break: break-word; | ||
font-size: medium; | ||
font-weight: bold; | ||
} | ||
</style> |