Removed empty dependency loop errors
This commit is contained in:
@@ -56,12 +56,14 @@ function pushDependenciesToStack(nodeId, graph, stack, computation){
|
|||||||
oriented: true
|
oriented: true
|
||||||
});
|
});
|
||||||
const loop = pather.find(nodeId, nodeId);
|
const loop = pather.find(nodeId, nodeId);
|
||||||
computation.errors.push({
|
if (loop.length) {
|
||||||
type: 'dependencyLoop',
|
computation.errors.push({
|
||||||
details: {
|
type: 'dependencyLoop',
|
||||||
nodes: loop.map(node => node.id)
|
details: {
|
||||||
},
|
nodes: loop.map(node => node.id)
|
||||||
});
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
stack.push(linkedNode);
|
stack.push(linkedNode);
|
||||||
}, true);
|
}, true);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-if="creature && creature.computeErrors">
|
<div v-if="creature && errors && errors.length">
|
||||||
<v-btn
|
<v-btn
|
||||||
fab
|
fab
|
||||||
small
|
small
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
v-if="expanded"
|
v-if="expanded"
|
||||||
class="character-sheet-errors"
|
class="character-sheet-errors"
|
||||||
>
|
>
|
||||||
<template v-for="(error, index) in creature.computeErrors">
|
<template v-for="(error, index) in errors">
|
||||||
<dependency-loop-error
|
<dependency-loop-error
|
||||||
v-if="error.type === 'dependencyLoop'"
|
v-if="error.type === 'dependencyLoop'"
|
||||||
:key="index + 'dependencyLoopError'"
|
:key="index + 'dependencyLoopError'"
|
||||||
@@ -84,13 +84,8 @@ export default {
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
errors() {
|
errors() {
|
||||||
if (!this.creature || !this.creature.computeErrors) return;
|
if (!this.creature || !this.creature.computeErrors) return [];
|
||||||
return this.creature.computeErrors.map(error => {
|
return this.creature.computeErrors;
|
||||||
error.text = error.type;
|
|
||||||
if (error.type === 'dependencyLoop') {
|
|
||||||
error.text = 'Dependency Loop Detected';
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-alert
|
<v-alert
|
||||||
v-if="model && model.details && model.details.nodes && model.details.nodes.length"
|
|
||||||
border="bottom"
|
border="bottom"
|
||||||
colored-border
|
colored-border
|
||||||
elevation="2"
|
elevation="2"
|
||||||
|
|||||||
Reference in New Issue
Block a user