Skip to content
This repository was archived by the owner on Sep 3, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
107 changes: 57 additions & 50 deletions src/dispatch/static/dispatch/src/entity/EntitiesTab.vue
Original file line number Diff line number Diff line change
@@ -1,55 +1,62 @@
<template>
<v-container fluid>
<v-row>
<v-col
v-for="entity in entities"
:key="entity.id"
cols="6"
>
<entity-card :entity="entity" />
</v-col>
</v-row>
</v-container>
</template>
<v-container fluid>
<v-row v-if="entities.length >= 1">
<v-col
v-for="entity in entities"
:key="entity.id"
cols="6"
>
<entity-card :entity="entity" />
</v-col>
</v-row>
<v-row v-else>
<v-col cols="12">
<v-card>
<v-card-title>No entities found</v-card-title>
</v-card>
</v-col>
</v-row>
</v-container>
</template>

<script>
import EntityCard from "@/entity/EntityCard.vue"
<script>
import EntityCard from "@/entity/EntityCard.vue"

export default {
name: "EntitiesTab",
components: {
EntityCard,
export default {
name: "EntitiesTab",
components: {
EntityCard,
},
props: {
selected: {
type: Object,
required: true,
},
props: {
selected: {
type: Object,
required: true,
},
},
data() {
return {
headers: [
{ text: "Entity Type", value: "entity_type" },
{ text: "Entity", value: "entity" },
],
};
},
computed: {
entities() {
if (this.selected.signal_instances.length) {
// Concatenate all the entities associated with each SignalInstance
return this.selected.signal_instances.reduce((acc, curr) => {
const entities = curr.entities.map((entity) => ({
entity_type: entity.entity_type,
value: entity.value,
id: entity.id
}));
return acc.concat(entities);
}, []);
} else {
return [];
}
},
data() {
return {
headers: [
{ text: "Entity Type", value: "entity_type" },
{ text: "Entity", value: "entity" },
],
};
},
computed: {
entities() {
if (this.selected.signal_instances.length) {
// Concatenate all the entities associated with each SignalInstance
return this.selected.signal_instances.reduce((acc, curr) => {
const entities = curr.entities.map((entity) => ({
entity_type: entity.entity_type,
value: entity.value,
id: entity.id
}));
return acc.concat(entities);
}, []);
} else {
return [];
}
},
},
};
</script>
},
};
</script>
2 changes: 1 addition & 1 deletion src/dispatch/static/dispatch/src/router/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ export const protectedRoute = [
component: () => import("@/team/Table.vue"),
},
{
path: "entityTpes",
path: "entityTypes",
name: "EntityTypeTable",
meta: { title: "Entity Types", subMenu: "project", group: "knowledge" },
component: () => import("@/entity_type/Table.vue"),
Expand Down