Skip to content

Commit 55d2324

Browse files
committed
Fixed #22
1 parent 762dfc6 commit 55d2324

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

src/components/ServicePanel.vue

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@
1616
<button title="Edit metadata" @click="editMetadata(p.row)" v-show="supports('updateService')"><i class="fas fa-edit"></i></button>
1717
<button title="Replace process graph" @click="replaceProcessGraph(p.row)" v-show="supports('updateService')"><i class="fas fa-retweet"></i></button>
1818
<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>
2020
</template>
2121
</DataTable>
2222
</template>
2323

2424
<script>
25-
import EventBus from '../eventbus.js';
25+
import Config from '../../config';
26+
import EventBus from '../eventbus';
2627
import WorkPanelMixin from './WorkPanelMixin.vue';
27-
import Utils from '../utils.js';
28+
import Utils from '../utils';
2829
import Field from './blocks/field';
2930
3031
export default {
@@ -74,6 +75,12 @@ export default {
7475
EventBus.$on('serviceCreated', this.serviceCreated);
7576
},
7677
methods: {
78+
isMapServiceSupported(mapType) {
79+
if (typeof mapType !== 'string') {
80+
return false;
81+
}
82+
return Config.supportedMapServices.includes(mapType.toLowerCase());
83+
},
7784
listServices() {
7885
return this.connection.listServices();
7986
},
@@ -102,9 +109,10 @@ export default {
102109
103110
this.$refs.table.addData(service);
104111
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+
}
108116
if (this.supports('describeService')) {
109117
buttons.push({text: 'Details', action: () => this.serviceInfo(service)});
110118
}

0 commit comments

Comments
 (0)