Commit 79a43f90 authored by Jörg Richter's avatar Jörg Richter

Search/Create dialog: maptypes appear top-level in create menu (#385)

parent b13d227d
Pipeline #10530 passed with stages
in 8 minutes and 45 seconds
......@@ -139,7 +139,8 @@ public class WebSocketServiceImpl implements WebSocketService {
private Predicate<WebSocketConnection> isReadAllowed(long objectId) {
return conn -> {
boolean isReadAllowed = dmx.getPrivilegedAccess().hasPermission(conn.getUsername(), Operation.READ, objectId);
boolean isReadAllowed = dmx.getPrivilegedAccess().hasPermission(conn.getUsername(), Operation.READ,
objectId);
logger.info(conn.getClientId() + " " + conn.getUsername() + " (isReadAllowed) -> " + isReadAllowed);
return isReadAllowed;
};
......
......@@ -23,7 +23,7 @@ org.apache.felix.https.keystore.key.password = ${org.apache.felix.https.keystore
# WebSockets
# The URL the WebSocket clients use to connect to the WebSocket server
# The URL a client uses to connect to the WebSockets server
dmx.websockets.url = ${dmx.websockets.url}
......
......@@ -8,7 +8,7 @@
</div>
<div class="field">
<div class="field-label">Released</div>
Jul 19, 2020
Jul 20, 2020
</div>
<div class="field">
<div class="field-label">License</div>
......
......@@ -17,13 +17,15 @@ export default ({store}) => {
extraMenuItems: state => state.search.extraMenuItems,
createEnabled: state => state.workspaces.isWritable,
markerIds: (_, getters) => getters && getters.visibleTopicIds,
menuTopicTypes: (_, getters) => getters && getters.menuTopicTypes // TODO: why is getters undefined on start?
menuTopicTypes: (_, getters) => getters && getters.menuTopicTypes, // TODO: why is getters undefined on start?
topicmapTypes: state => Object.values(state.topicmaps.topicmapTypes)
},
listeners: {
'topic-click': revealTopic,
'icon-click': revealTopicNoSelect,
'topic-create': createTopic,
'extra-create': createExtra,
'topic-create': createTopic,
'extra-create': createExtra,
'topicmap-create': createTopicmap,
close: _ => store.dispatch('closeSearchWidget')
}
}
......@@ -58,4 +60,8 @@ export default ({store}) => {
function createExtra ({extraItem, value, optionsData}) {
extraItem.create(value, optionsData, store.state.search.pos.model)
}
function createTopicmap ({name, topicmapTypeUri, viewProps}) {
store.dispatch('createTopicmap', {name, topicmapTypeUri, viewProps})
}
}
<template>
<div class="dm5-topicmap-options">
<div class="field-label">Topicmap Type</div>
<el-select v-model="topicmapTypeUri">
<el-option v-for="type in topicmapTypes" :label="type.name" :value="type.uri" :key="type.uri"></el-option>
</el-select>
</div>
</template>
<script>
export default {
data () {
return {
topicmapTypeUri: 'dmx.topicmaps.topicmap'
}
},
computed: {
topicmapTypes () {
return Object.values(this.$store.state.topicmaps.topicmapTypes).filter(type => !type.hidden)
}
}
}
</script>
<style>
</style>
......@@ -77,17 +77,6 @@ export default ({store, dm5}) => {
]
},
extraMenuItems: [{
uri: 'dmx.topicmaps.topicmap',
optionsComp: require('./components/dm5-topicmap-options').default,
create: (name, data) => {
store.dispatch('createTopicmap', {
name,
topicmapTypeUri: data.topicmapTypeUri
})
}
}],
topicmapType: {
uri: 'dmx.topicmaps.topicmap',
name: 'Topicmap',
......
......@@ -49,9 +49,9 @@ const actions = {
createTopicmap ({rootState, dispatch}, {name = 'untitled',
topicmapTypeUri = 'dmx.topicmaps.topicmap',
viewProps = {}}) {
console.log('Creating topicmap', name, topicmapTypeUri, viewProps)
// console.log('Creating topicmap', name, topicmapTypeUri, viewProps)
dm5.restClient.createTopicmap(name, topicmapTypeUri, viewProps).then(topic => {
console.log('Topicmap topic', topic)
// console.log('Topicmap topic', topic)
// update state
topicmapTopics(rootState).push(topic)
initSelection(topic.id, dispatch)
......
......@@ -9,7 +9,7 @@ import extraElementUI from './element-ui'
import 'font-awesome/css/font-awesome.css'
import './websocket'
console.log('[DMX] 2020/07/19')
console.log('[DMX] 2020/07/20')
// 1) Init dm5 library
// The dm5 library must be inited *before* the dm5-webclient component is instantiated.
......
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