Commit f75c0fce authored by Jörg Richter's avatar Jörg Richter
Browse files

Adapt to renamed injection `dm5` -> `dmx`

See dmx-platform/dmx-platform#13
parent 1c9bccf5
Pipeline #11860 passed with stages
in 1 minute and 2 seconds
......@@ -5,7 +5,7 @@
<script>
export default {
inject: ['dm5'],
inject: ['dmx'],
computed: {
topicmapId () {
......@@ -20,7 +20,7 @@ export default {
// update client state + sync view (for immediate visual feedback)
this.$store.dispatch('_deleteTopic', this.topicmapId)
// update server state
this.dm5.rpc.deleteTopic(this.topicmapId).then(response => {
this.dmx.rpc.deleteTopic(this.topicmapId).then(response => {
this.$store.dispatch('_processDirectives', response.directives)
})
}).catch(() => {}) // suppress unhandled rejection on Cancel
......
......@@ -41,7 +41,7 @@ export default {
// console.log('dm5-geomap-renderer destroyed')
},
inject: ['dm5'],
inject: ['dmx'],
props: {
quillConfig: Object
......@@ -134,7 +134,7 @@ export default {
showDetails (topic) {
this.loading = true
this.dm5.rpc.getTopic(topic.id, true, true).then(topic => {
this.dmx.rpc.getTopic(topic.id, true, true).then(topic => {
this.domainTopic = topic
this.loading = false
this.updatePopup()
......
import GeomapsService from './geomaps-service'
export default ({dm5, axios: http}) => {
export default ({dmx, axios: http}) => {
const service = new GeomapsService(dm5, http)
const service = new GeomapsService(dmx, http)
return {
actions: {
......
export default function GeomapsService (dm5, http) {
export default function GeomapsService (dmx, http) {
this.getGeomap = geomapId => {
return http.get(`/geomaps/${geomapId}`).then(response =>
......@@ -11,35 +11,35 @@ export default function GeomapsService (dm5, http) {
children: includeChildren,
assocChildren: includeAssocChildren
}}).then(response =>
dm5.utils.instantiateMany(response.data, dm5.Topic)
dmx.utils.instantiateMany(response.data, dmx.Topic)
)
}
this.setGeomapState = dm5.utils.debounce((geomapId, lon, lat, zoom) => {
this.setGeomapState = dmx.utils.debounce((geomapId, lon, lat, zoom) => {
console.log('setGeomapState', lon, lat, zoom)
http.put(`/geomaps/${geomapId}/center/${lon}/${lat}/zoom/${zoom}`)
}, 3000)
//
// Note: Geomap was supposed to extend dm5.Topic. That works when built on my dev system (also in production mode)
// Note: Geomap was supposed to extend dmx.Topic. That works when built on my dev system (also in production mode)
// but fails at runtime when built via GitLab CI/CD: "TypeError: Cannot call a class constructor without |new|".
// As a workaround we don't extend. Actually no Topic features are needed, just the "id".
class Geomap /* extends dm5.Topic */ {
class Geomap /* extends dmx.Topic */ {
constructor (geomap) {
// super(geomap.topic)
this.id = geomap.topic.id
this.viewProps = geomap.viewProps
this.geoCoordTopics = geomap.geoCoordTopics // instantiating dm5.Topic objects not required at the moment
this.geoCoordTopics = geomap.geoCoordTopics // instantiating dmx.Topic objects not required at the moment
}
removeTopic (id) {
// TODO; skeleton needed by dm5-topicmap-panel contract
// TODO; skeleton needed by dmx-topicmap-panel contract
}
removeAssoc (id) {
// TODO; skeleton needed by dm5-topicmap-panel contract
// TODO; skeleton needed by dmx-topicmap-panel contract
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment