Commit e9c35595 authored by Jörg Richter's avatar Jörg Richter

Topicmap selector shows maptype icons (#385)

parent 79a43f90
Pipeline #10539 passed with stages
in 8 minutes and 27 seconds
......@@ -649,7 +649,7 @@ public class AccessControlPlugin extends PluginActivator implements AccessContro
private Topic getUsernameTopicOrThrow(String username) {
Topic usernameTopic = getUsernameTopic(username);
if (usernameTopic == null) {
throw new RuntimeException("User \"" + username + "\" does not exist");
throw new RuntimeException("Unknown user \"" + username + "\"");
}
return usernameTopic;
}
......
......@@ -576,7 +576,7 @@ class PrivilegedAccessImpl implements PrivilegedAccess {
private TopicModelImpl _getUsernameTopicOrThrow(String username) {
TopicModelImpl usernameTopic = _getUsernameTopic(username);
if (usernameTopic == null) {
throw new RuntimeException("User \"" + username + "\" does not exist");
throw new RuntimeException("Unknown user \"" + username + "\"");
}
return usernameTopic;
}
......@@ -634,7 +634,7 @@ class PrivilegedAccessImpl implements PrivilegedAccess {
TopicModelImpl workspace = al.sd.fetchTopic("uri", uri);
// Note: the Access Control plugin creates the System workspace before it performs its first permission check.
if (workspace == null) {
throw new RuntimeException("Workspace \"" + uri + "\" does not exist");
throw new RuntimeException("Unknown workspace \"" + uri + "\"");
}
if (!workspace.getTypeUri().equals("dmx.workspaces.workspace")) {
throw new RuntimeException("Topic \"" + uri + "\" is not a workspace but a \"" + workspace.getTypeUri() +
......
......@@ -10,7 +10,7 @@ import systems.dmx.core.service.Migration;
* Renames data type "Identity" -> "Entity".
*
* Part of DMX 5.0
* Runs on UPDATE
* Runs only on UPDATE
*/
public class Migration4 extends Migration {
......
......@@ -372,7 +372,7 @@ public class TopicmapsPlugin extends PluginActivator implements TopicmapsService
@Override
public void registerTopicmapType(TopicmapType topicmapType) {
logger.info("### Registering topicmap type \"" + topicmapType.getClass().getName() + "\"");
logger.info("### Registering topicmap type \"" + topicmapType.getUri() + "\"");
topicmapTypes.put(topicmapType.getUri(), topicmapType);
}
......
......@@ -2,7 +2,9 @@
<div class="dm5-topicmap-select">
<el-select v-model="topicmapId">
<el-option-group label="Topicmap">
<el-option v-for="topic in topicmapTopics" :label="topic.value" :value="topic.id" :key="topic.id"></el-option>
<el-option v-for="topic in topicmapTopics" :label="topic.value" :value="topic.id" :key="topic.id">
<span class="fa icon">{{icon(topic)}}</span><span>{{topic.value}}</span>
</el-option>
</el-option-group>
</el-select>
<el-button type="text" class="fa fa-info-circle" title="Reveal Topicmap Topic" @click="revealTopicmapTopic">
......@@ -14,6 +16,8 @@
</template>
<script>
import dm5 from 'dm5'
export default {
computed: {
......@@ -51,6 +55,11 @@ export default {
resetTopicmapViewport () {
this.$store.dispatch('resetTopicmapViewport')
},
icon (topicmapTopic) {
const mapTypeUri = topicmapTopic.children['dmx.topicmaps.topicmap_type_uri'].value
return dm5.typeCache.getTopicType(mapTypeUri).getViewConfig('dmx.webclient.icon')
}
}
}
......
......@@ -16,8 +16,6 @@
</template>
<script>
import dm5 from 'dm5'
export default {
created () {
......
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