-
Notifications
You must be signed in to change notification settings - Fork 38
KDS-648: KdsEmptyState Implementation #61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,16 +1,14 @@ | ||||||||||||||||||||||||||||||||||||||||||
| <script setup lang="ts"> | ||||||||||||||||||||||||||||||||||||||||||
| import { onMounted, ref } from "vue"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| import { Button } from "@knime/components"; | ||||||||||||||||||||||||||||||||||||||||||
| import { KdsEmptyState } from "@knime/kds-components"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| import { pythonScriptingService } from "@/python-scripting-service"; | ||||||||||||||||||||||||||||||||||||||||||
| import { usePythonPreviewStatusStore, useSessionStatusStore } from "@/store"; | ||||||||||||||||||||||||||||||||||||||||||
| import { usePythonPreviewStatusStore } from "@/store"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const IFRAME_SOURCE = "./preview.html"; | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| const iframe = ref<HTMLIFrameElement | null>(null); | ||||||||||||||||||||||||||||||||||||||||||
| const pythonPreviewStatus = usePythonPreviewStatusStore(); | ||||||||||||||||||||||||||||||||||||||||||
| const sessionStatus = useSessionStatusStore(); | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| onMounted(() => { | ||||||||||||||||||||||||||||||||||||||||||
| pythonPreviewStatus.updateViewCallback = () => { | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -32,29 +30,17 @@ onMounted(() => { | |||||||||||||||||||||||||||||||||||||||||
| :src="IFRAME_SOURCE" | ||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| <div | ||||||||||||||||||||||||||||||||||||||||||
| v-show="!pythonPreviewStatus.hasValidView" | ||||||||||||||||||||||||||||||||||||||||||
| class="placeholder-container" | ||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||
| <img id="preview-img" src="/assets/plot-placeholder.svg" /> | ||||||||||||||||||||||||||||||||||||||||||
| <div v-if="!pythonPreviewStatus.isExecutedOnce" class="placeholder-text"> | ||||||||||||||||||||||||||||||||||||||||||
| Run the code to see the preview. | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| <div v-else class="placeholder-text"> | ||||||||||||||||||||||||||||||||||||||||||
| The view cannot be displayed.<br /> | ||||||||||||||||||||||||||||||||||||||||||
| Check the error message and re-execute the script. | ||||||||||||||||||||||||||||||||||||||||||
| </div> | ||||||||||||||||||||||||||||||||||||||||||
| <Button | ||||||||||||||||||||||||||||||||||||||||||
| :with-border="true" | ||||||||||||||||||||||||||||||||||||||||||
| compact | ||||||||||||||||||||||||||||||||||||||||||
| :disabled=" | ||||||||||||||||||||||||||||||||||||||||||
| !sessionStatus.isRunningSupported || | ||||||||||||||||||||||||||||||||||||||||||
| sessionStatus.status === 'RUNNING_ALL' || | ||||||||||||||||||||||||||||||||||||||||||
| sessionStatus.status === 'RUNNING_SELECTED' | ||||||||||||||||||||||||||||||||||||||||||
| " | ||||||||||||||||||||||||||||||||||||||||||
| @click="pythonScriptingService.runScript()" | ||||||||||||||||||||||||||||||||||||||||||
| >Run code</Button | ||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||
| <div v-if="!pythonPreviewStatus.hasValidView" class="empty-state-container"> | ||||||||||||||||||||||||||||||||||||||||||
| <KdsEmptyState | ||||||||||||||||||||||||||||||||||||||||||
| v-if="!pythonPreviewStatus.isExecutedOnce" | ||||||||||||||||||||||||||||||||||||||||||
| headline="Run the code to see the preview" | ||||||||||||||||||||||||||||||||||||||||||
| description="Views generated by the Python script will be displayed here." | ||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
senemdilli marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||||||||||||||||||||||||||||||||
| <KdsEmptyState | ||||||||||||||||||||||||||||||||||||||||||
| v-else | ||||||||||||||||||||||||||||||||||||||||||
| headline="The view cannot be displayed" | ||||||||||||||||||||||||||||||||||||||||||
| description="Check the error message and re-execute the script." | ||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+35
to
+43
|
||||||||||||||||||||||||||||||||||||||||||
| v-if="!pythonPreviewStatus.isExecutedOnce" | |
| headline="Run the code to see the preview" | |
| description="Views generated by the Python script will be displayed here." | |
| /> | |
| <KdsEmptyState | |
| v-else | |
| headline="The view cannot be displayed" | |
| description="Check the error message and re-execute the script." | |
| /> | |
| :headline=" | |
| pythonPreviewStatus.isExecutedOnce | |
| ? 'The view cannot be displayed' | |
| : 'Run the code to see the preview' | |
| " | |
| :description=" | |
| pythonPreviewStatus.isExecutedOnce | |
| ? 'Check the error message and re-execute the script.' | |
| : 'Views generated by the Python script will be displayed here.' | |
| " | |
| /> |
Uh oh!
There was an error while loading. Please reload this page.