Skip to content

Commit 9d638b1

Browse files
DavidHedgehogCode
authored andcommitted
AP-19528: Update knio and vite.
- python backend for scripting editor to be compatible with new api - use async await for scriptingService - update vite config - Fix callback on selecting a RadioButton. - Update commit in knime-scripting-editor. - Remove timeout for redirectGatewayOutput AP-19528: (Update the scripting editor frontend to vue3).
1 parent 1a10a6a commit 9d638b1

File tree

15 files changed

+416
-88
lines changed

15 files changed

+416
-88
lines changed

.project

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,4 @@
1414
<natures>
1515
<nature>org.eclipse.m2e.core.maven2Nature</nature>
1616
</natures>
17-
<filteredResources>
18-
<filter>
19-
<id>1667292967902</id>
20-
<name></name>
21-
<type>30</type>
22-
<matcher>
23-
<id>org.eclipse.core.resources.regexFilterMatcher</id>
24-
<arguments>node_modules|\.git|__CREATED_BY_JAVA_LANGUAGE_SERVER__</arguments>
25-
</matcher>
26-
</filter>
27-
</filteredResources>
2817
</projectDescription>

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,3 @@ You can find instructions on how to work with our code or develop extensions for
4949
## Join the Community
5050

5151
* [KNIME Forum](https://tech.knime.org/forum/knime-textprocessing)
52-

org.knime.python3.js.scripting/js-src/python-scripting-editor/src/App.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export default defineComponent({
109109
this.loading = false;
110110
111111
// Notify the backend that the dialog is ready
112-
this.scriptingService.dialogOpened();
112+
await this.scriptingService.initExecutableOptions();
113113
114114
// Set the python executable to the currently selected option -> will start the interactive session
115115
this.pythonExecutableChanged(this.scriptingService.getExecutableSelection());

org.knime.python3.js.scripting/js-src/python-scripting-editor/src/components/CondaEnvironment.vue

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,30 +65,35 @@ export default defineComponent({
6565
:value="value"
6666
alignment="vertical"
6767
:possible-values="executablePossibleSelections"
68-
@input="$emit('input', $event)"
68+
@input="$emit('input', $event.target.value)"
6969
/>
7070
<div
7171
v-if="executableInfo"
7272
class="executable-info"
7373
>
7474
<span v-if="executableInfo.pythonVersion"> Python Version: {{ executableInfo.pythonVersion }} </span>
75-
<table>
76-
<tr>
77-
<th>Name</th>
78-
<th>Version</th>
79-
<th>Build</th>
80-
<th>Channel</th>
81-
</tr>
82-
<tr
83-
v-for="item in executableInfo.packages"
84-
:key="item.name"
85-
>
86-
<td>{{ item.name }}</td>
87-
<td>{{ item.version }}</td>
88-
<td>{{ item.build }}</td>
89-
<td>{{ item.channel }}</td>
90-
</tr>
91-
</table>
75+
<figure>
76+
<figcaption>
77+
"Table to choose your CondaEnvironment"
78+
</figcaption>
79+
<table>
80+
<tr>
81+
<th>Name</th>
82+
<th>Version</th>
83+
<th>Build</th>
84+
<th>Channel</th>
85+
</tr>
86+
<tr
87+
v-for="item in executableInfo.packages"
88+
:key="item.name"
89+
>
90+
<td>{{ item.name }}</td>
91+
<td>{{ item.version }}</td>
92+
<td>{{ item.build }}</td>
93+
<td>{{ item.channel }}</td>
94+
</tr>
95+
</table>
96+
</figure>
9297
</div>
9398
<div v-else>
9499
<!-- TODO(AP-19349) loading animation while we are getting the executable info -->

org.knime.python3.js.scripting/js-src/python-scripting-editor/src/components/WorkspaceTable.vue

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,22 +30,27 @@ export default defineComponent({
3030
</script>
3131

3232
<template>
33-
<table class="workspace-table">
34-
<tr>
35-
<th>Name</th>
36-
<th>Type</th>
37-
<th>Value</th>
38-
</tr>
39-
<tr
40-
v-for="item in workspaceTable"
41-
:key="item.name"
42-
@click="$emit('clicked', item.name)"
43-
>
44-
<td>{{ item.name }}</td>
45-
<td>{{ item.type }}</td>
46-
<td>{{ item.value }}</td>
47-
</tr>
48-
</table>
33+
<figure>
34+
<figcaption>
35+
"Workspace Table"
36+
</figcaption>
37+
<table class="workspace-table">
38+
<tr>
39+
<th>Name</th>
40+
<th>Type</th>
41+
<th>Value</th>
42+
</tr>
43+
<tr
44+
v-for="item in workspaceTable"
45+
:key="item.name"
46+
@click="$emit('clicked', item.name)"
47+
>
48+
<td>{{ item.name }}</td>
49+
<td>{{ item.type }}</td>
50+
<td>{{ item.value }}</td>
51+
</tr>
52+
</table>
53+
</figure>
4954
</template>
5055

5156
<style scoped>

org.knime.python3.js.scripting/js-src/python-scripting-editor/src/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import App from './App.vue';
88
});
99

1010

11-
// configureCompat({ RENDER_FUNCTION: false });
12-
1311
const app = createApp(App);
1412

1513
app.mount('#app');

org.knime.python3.js.scripting/js-src/python-scripting-editor/src/utils/python-scripting-service.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ export class PythonScriptingService extends ScriptingService<PythonNodeSettings>
4242
dialogOpened(): Promise<void> {
4343
return this.sendToService('openedDialog');
4444
}
45+
46+
initExecutableOptions(): Promise<void> {
47+
//
48+
return this.sendToService('initExecutableOptions');
49+
}
50+
51+
sendLastConsoleOutput(): Promise<void> {
52+
return this.sendToService('sendLastConsoleOutput');
53+
}
4554

4655
startInteractive(executableSelection: string): Promise<void> {
4756
return this.sendToService('startInteractive', [executableSelection]);

org.knime.python3.js.scripting/js-src/python-scripting-editor/tsconfig.config.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@
1010
"types": [
1111
"node"
1212
],
13-
"noImplicitThis": false, //https://github.com/vuejs/vetur/issues/2373
1413
}
1514
}

org.knime.python3.js.scripting/js-src/python-scripting-editor/vite.config.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,21 @@ import monacoEditorPlugin from 'vite-plugin-monaco-editor';
88
// https://vitejs.dev/config/
99
export default defineConfig({
1010
plugins: [
11-
vue({
12-
template: {
13-
compilerOptions: {
14-
compatConfig: {
15-
MODE: 2
16-
}
17-
}
18-
}
19-
}),
11+
vue(),
2012
svgLoader(),
2113
monacoEditorPlugin({
2214
languageWorkers: ['editorWorkerService'] // TODO check
2315
})
2416
],
2517
resolve: {
2618
alias: {
27-
// vue: '@vue/compat',
2819
'@': fileURLToPath(new URL('./src', import.meta.url)),
2920
'@@': fileURLToPath(new URL('.', import.meta.url)),
3021
path: 'path-browserify'
31-
}
22+
},
23+
dedupe: [
24+
'vue'
25+
]
3226
},
3327
envPrefix: 'KNIME_',
3428
base: './'

0 commit comments

Comments
 (0)