🐛 Fix issue showing too much data error (#2200)

* fix bug showing too much data error

* init when node changes

* revert node settings chagnes

* revert node settings chagnes
This commit is contained in:
Mutasem Aldmour 2021-09-15 10:11:59 +02:00 committed by GitHub
parent ef14b41a16
commit 4db451d9d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -269,6 +269,9 @@ export default mixins(
MAX_DISPLAY_ITEMS_AUTO_ALL, MAX_DISPLAY_ITEMS_AUTO_ALL,
}; };
}, },
mounted() {
this.init();
},
computed: { computed: {
hasNodeRun(): boolean { hasNodeRun(): boolean {
return Boolean(this.node && this.workflowRunData && this.workflowRunData.hasOwnProperty(this.node.name)); return Boolean(this.node && this.workflowRunData && this.workflowRunData.hasOwnProperty(this.node.name));
@ -422,6 +425,18 @@ export default mixins(
}, },
}, },
methods: { methods: {
init() {
// Reset the selected output index every time another node gets selected
this.outputIndex = 0;
this.maxDisplayItems = 25;
this.refreshDataSize();
if (this.displayMode === 'Binary') {
this.closeBinaryDataDisplay();
if (this.binaryData.length === 0) {
this.displayMode = 'Table';
}
}
},
closeBinaryDataDisplay () { closeBinaryDataDisplay () {
this.binaryDataDisplayVisible = false; this.binaryDataDisplayVisible = false;
this.binaryDataDisplayData = null; this.binaryDataDisplayData = null;
@ -606,17 +621,8 @@ export default mixins(
}, },
}, },
watch: { watch: {
node (newNode, oldNode) { node() {
// Reset the selected output index every time another node gets selected this.init();
this.outputIndex = 0;
this.maxDisplayItems = 25;
this.refreshDataSize();
if (this.displayMode === 'Binary') {
this.closeBinaryDataDisplay();
if (this.binaryData.length === 0) {
this.displayMode = 'Table';
}
}
}, },
jsonData () { jsonData () {
this.refreshDataSize(); this.refreshDataSize();
@ -629,8 +635,6 @@ export default mixins(
this.runIndex = Math.min(this.runIndex, this.maxRunIndex); this.runIndex = Math.min(this.runIndex, this.maxRunIndex);
}, },
}, },
mounted () {
},
}); });
</script> </script>