Skip to content

Commit

Permalink
Fix reset kernel - Transform Dataset (#5586)
Browse files Browse the repository at this point in the history
Co-authored-by: Yohann Paris <[email protected]>
  • Loading branch information
Tom-Szendrey and YohannParis authored Nov 21, 2024
1 parent 1511919 commit 18fe683
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ const defaultPreview = computed(() => {
props.assets.forEach((asset, index) => {
code += `#d${index + 1} = ${asset.name}\n`;
});
// add first dataset to the code
code += 'd1';
return code;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ const updateOutputs = () => {
renderOutputs(outputs);
};
const clear = () => {
renderOutputs([]);
};
onMounted(() => {
updateOutputs();
});
Expand All @@ -61,6 +65,10 @@ watch(
);
const messageType = computed(() => props.jupyterMessage.header.msg_type);
defineExpose({
clear
});
</script>

<style scoped>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -406,9 +406,9 @@ const clearOutputs = () => {
}
for (let i = 0; i < notebookCells.value.length; i++) {
const el = notebookCells.value[i];
if (el.codeCell) {
for (let j = 0; j < el.codeCell.length; j++) {
el.codeCell[j].clear();
if (el.codeOutputCell) {
for (let j = 0; j < el.codeOutputCell.length; j++) {
el.codeOutputCell[j].clear();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
class="flex flex-column"
v-else-if="['stream', 'display_data', 'execute_result', 'error'].includes(m.header.msg_type)"
>
<tera-beaker-code-cell-output :jupyter-message="m" />
<tera-beaker-code-cell-output ref="codeOutputCell" :jupyter-message="m" />
<aside class="ml-auto">
<label class="px-2">Display on node thumbnail</label>
<Checkbox :model-value="msg.selected" @change="emit('on-selected', $event)" binary />
Expand Down Expand Up @@ -137,6 +137,7 @@ const props = defineProps<{
}>();
const codeCell = ref(null);
const codeOutputCell = ref(null);
const resp = ref(<HTMLElement | null>null);
// Reference for showThought, initially set to false
const showThought = ref(false);
Expand Down Expand Up @@ -214,7 +215,8 @@ onMounted(() => {
});
defineExpose({
codeCell
codeCell,
codeOutputCell
});
function onDeleteRequested(msgId: string) {
Expand Down

0 comments on commit 18fe683

Please sign in to comment.