|
16 | 16 | <button title="Edit metadata" @click="editMetadata(p.row)" v-show="supports('updateService')"><i class="fas fa-edit"></i></button>
|
17 | 17 | <button title="Replace process graph" @click="replaceProcessGraph(p.row)" v-show="supports('updateService')"><i class="fas fa-retweet"></i></button>
|
18 | 18 | <button title="Delete" @click="deleteService(p.row)" v-show="supports('deleteService')"><i class="fas fa-trash"></i></button>
|
19 |
| - <button v-show="p.row.enabled" title="View on map" @click="viewService(p.row)"><i class="fas fa-map"></i></button> |
| 19 | + <button v-show="p.row.enabled && isMapServiceSupported(p.row.type)" title="View on map" @click="viewService(p.row)"><i class="fas fa-map"></i></button> |
20 | 20 | </template>
|
21 | 21 | </DataTable>
|
22 | 22 | </template>
|
23 | 23 |
|
24 | 24 | <script>
|
25 |
| -import EventBus from '../eventbus.js'; |
| 25 | +import Config from '../../config'; |
| 26 | +import EventBus from '../eventbus'; |
26 | 27 | import WorkPanelMixin from './WorkPanelMixin.vue';
|
27 |
| -import Utils from '../utils.js'; |
| 28 | +import Utils from '../utils'; |
28 | 29 | import Field from './blocks/field';
|
29 | 30 |
|
30 | 31 | export default {
|
@@ -74,6 +75,12 @@ export default {
|
74 | 75 | EventBus.$on('serviceCreated', this.serviceCreated);
|
75 | 76 | },
|
76 | 77 | methods: {
|
| 78 | + isMapServiceSupported(mapType) { |
| 79 | + if (typeof mapType !== 'string') { |
| 80 | + return false; |
| 81 | + } |
| 82 | + return Config.supportedMapServices.includes(mapType.toLowerCase()); |
| 83 | + }, |
77 | 84 | listServices() {
|
78 | 85 | return this.connection.listServices();
|
79 | 86 | },
|
@@ -102,9 +109,10 @@ export default {
|
102 | 109 |
|
103 | 110 | this.$refs.table.addData(service);
|
104 | 111 |
|
105 |
| - var buttons = [ |
106 |
| - {text: 'View on map', action: () => this.viewService(service)} |
107 |
| - ]; |
| 112 | + var buttons = []; |
| 113 | + if (this.isMapServiceSupported(service.type)) { |
| 114 | + buttons.push({text: 'View on map', action: () => this.viewService(service)}); |
| 115 | + } |
108 | 116 | if (this.supports('describeService')) {
|
109 | 117 | buttons.push({text: 'Details', action: () => this.serviceInfo(service)});
|
110 | 118 | }
|
|
0 commit comments