From 1e6cd93878d9e20da3ca2b9df544da981299fab6 Mon Sep 17 00:00:00 2001 From: Iain Walmsley Date: Fri, 12 Apr 2024 09:07:20 +0100 Subject: [PATCH 1/4] feat: add streamlit front-end ED-87 fix: remove duplicate from front-end/back-end overlap ED-87 fix: remove errant changes --- code/workspaces/web-app/public/image_config.json | 9 +++++---- .../web-app/src/components/stacks/stackDescriptions.js | 5 ++++- datalab.code-workspace | 6 +++++- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/code/workspaces/web-app/public/image_config.json b/code/workspaces/web-app/public/image_config.json index d42459d8c..b00aa3d53 100644 --- a/code/workspaces/web-app/public/image_config.json +++ b/code/workspaces/web-app/public/image_config.json @@ -130,15 +130,16 @@ "sharedRLibs": "/data/packages/R/%p/%v" }, "streamlit": { + "displayName": "Streamlit", "category": "PUBLISH", - "userCanChooseFile": true, - "userCanChooseConda": true, "versions": [ { - "displayName": "Dask 2023.1/Spark 3.3.0", + "displayName": "Streamlit", "image": "nerc/jupyterlab:ee1e157f36f5-spark-3.3.0" } - ] + ], + "userCanChooseFile": true, + "userCanChooseConda": true }, "vscode": { "displayName": "VS Code Server", diff --git a/code/workspaces/web-app/src/components/stacks/stackDescriptions.js b/code/workspaces/web-app/src/components/stacks/stackDescriptions.js index 4901ea97f..d7ae4decf 100644 --- a/code/workspaces/web-app/src/components/stacks/stackDescriptions.js +++ b/code/workspaces/web-app/src/components/stacks/stackDescriptions.js @@ -10,8 +10,9 @@ import zeppelinLogo from '../../assets/images/zeppelin-logo.svg'; import vscodeLogo from '../../assets/images/vscode-logo.svg'; import daskLogo from '../../assets/images/dask-logo.svg'; import sparkLogo from '../../assets/images/apache-spark-logo.svg'; +import streamlitLogo from '../../assets/images/streamlit-logo.svg'; -const { JUPYTER, JUPYTERLAB, ZEPPELIN, RSTUDIO, RSHINY, NBVIEWER, PANEL, VOILA, VSCODE, PROJECT, DASK, SPARK } = stackTypes; +const { JUPYTER, JUPYTERLAB, ZEPPELIN, RSTUDIO, RSHINY, NBVIEWER, PANEL, VOILA, VSCODE, PROJECT, DASK, SPARK, STREAMLIT } = stackTypes; const jupyterDescription = 'Web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.'; const jupyterlabDescription = 'Web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text.'; @@ -24,6 +25,7 @@ const rshinyDescription = 'Shiny is an R package that makes it easy to build int const nbviewerDescription = 'NBViewer is a simple way to share notebooks. Any Jupyter notebook can be served as a web page.'; const panelDescription = 'Panel is a Python library that lets you create custom interactive web apps and dashboards by connecting user-defined widgets to plots, images, tables, or text.'; const voilaDescription = 'Voila is a library that allows for rendering of live Jupyter notebooks with interactive widgets.'; +const streamlitDescription = 'A faster way to build and share data apps. Streamlit turns data scripts into shareable web apps in minutes. All in pure Python.'; const projectDescription = 'A project lets users share information'; const daskDescription = 'Dask natively scales Python across multiple workers, providing advanced parallelism for analytics and enabling performance at scale.'; const sparkDescription = 'Spark is an open-source cluster-computing framework for large-scale data processing.'; @@ -42,5 +44,6 @@ const stackDescriptions = { [PROJECT]: { description: projectDescription, initial: true }, [DASK]: { description: daskDescription, logo: daskLogo }, [SPARK]: { description: sparkDescription, logo: sparkLogo }, + [STREAMLIT]: { description: streamlitDescription, logo: streamlitLogo }, }; export default stackDescriptions; diff --git a/datalab.code-workspace b/datalab.code-workspace index 31b8eae7a..793f85a55 100644 --- a/datalab.code-workspace +++ b/datalab.code-workspace @@ -31,13 +31,16 @@ }, "settings": { "editor.codeActionsOnSave": { - "source.fixAll": true + "source.fixAll": "explicit" }, "editor.formatOnSave": true, "editor.tabSize": 2, "eslint.workingDirectories": [ "./code" ], + "jest": { + "runMode": "on-demand" + } "eslint.format.enable": true, "jest.disabledWorkspaceFolders": [ "datalab" @@ -89,6 +92,7 @@ "setup", "signin", "signout", + "streamlit", "unmount", "updateable", "uppercase", From 429a42af0c310ea57cb138c4b309afd2b7ffc177 Mon Sep 17 00:00:00 2001 From: Iain Walmsley Date: Mon, 15 Apr 2024 14:30:08 +0100 Subject: [PATCH 2/4] fix: add displayName to streamlit in image_config & fix snapshots ED-87 --- code/development-env/config/local/image_config.json | 11 ++++++----- code/workspaces/common/src/config/image_config.json | 11 ++++++----- code/workspaces/web-app/public/image_config.json | 2 +- .../typeAndVersionFormUtils.spec.js.snap | 2 +- .../src/config/__snapshots__/images.spec.js.snap | 3 ++- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/code/development-env/config/local/image_config.json b/code/development-env/config/local/image_config.json index d42459d8c..e8c39f871 100644 --- a/code/development-env/config/local/image_config.json +++ b/code/development-env/config/local/image_config.json @@ -130,15 +130,16 @@ "sharedRLibs": "/data/packages/R/%p/%v" }, "streamlit": { + "displayName": "Streamlit", "category": "PUBLISH", - "userCanChooseFile": true, - "userCanChooseConda": true, "versions": [ { - "displayName": "Dask 2023.1/Spark 3.3.0", + "displayName": "Streamlit", "image": "nerc/jupyterlab:ee1e157f36f5-spark-3.3.0" } - ] + ], + "userCanChooseFile": true, + "userCanChooseConda": true }, "vscode": { "displayName": "VS Code Server", @@ -173,4 +174,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/workspaces/common/src/config/image_config.json b/code/workspaces/common/src/config/image_config.json index b0a65ee13..05ccd53ef 100644 --- a/code/workspaces/common/src/config/image_config.json +++ b/code/workspaces/common/src/config/image_config.json @@ -130,15 +130,16 @@ "sharedRLibs": "/data/packages/R/%p/%v" }, "streamlit": { + "displayName": "Streamlit", "category": "PUBLISH", - "userCanChooseFile": true, - "userCanChooseConda": true, "versions": [ { - "displayName": "Dask 2023.1/Spark 3.3.0", + "displayName": "Streamlit", "image": "nerc/jupyterlab:ee1e157f36f5-spark-3.3.0" } - ] + ], + "userCanChooseFile": true, + "userCanChooseConda": true }, "vscode": { "displayName": "VS Code Server", @@ -174,4 +175,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/workspaces/web-app/public/image_config.json b/code/workspaces/web-app/public/image_config.json index b00aa3d53..e8c39f871 100644 --- a/code/workspaces/web-app/public/image_config.json +++ b/code/workspaces/web-app/public/image_config.json @@ -174,4 +174,4 @@ ] } } -} +} \ No newline at end of file diff --git a/code/workspaces/web-app/src/components/stacks/__snapshots__/typeAndVersionFormUtils.spec.js.snap b/code/workspaces/web-app/src/components/stacks/__snapshots__/typeAndVersionFormUtils.spec.js.snap index a26ef3118..26c959a23 100644 --- a/code/workspaces/web-app/src/components/stacks/__snapshots__/typeAndVersionFormUtils.spec.js.snap +++ b/code/workspaces/web-app/src/components/stacks/__snapshots__/typeAndVersionFormUtils.spec.js.snap @@ -39,7 +39,7 @@ Array [ "value": "spark", }, Object { - "text": undefined, + "text": "Streamlit", "value": "streamlit", }, Object { diff --git a/code/workspaces/web-app/src/config/__snapshots__/images.spec.js.snap b/code/workspaces/web-app/src/config/__snapshots__/images.spec.js.snap index 1829d19fd..47036af38 100644 --- a/code/workspaces/web-app/src/config/__snapshots__/images.spec.js.snap +++ b/code/workspaces/web-app/src/config/__snapshots__/images.spec.js.snap @@ -110,11 +110,12 @@ Object { }, "streamlit": Object { "category": "PUBLISH", + "displayName": "Streamlit", "userCanChooseConda": true, "userCanChooseFile": true, "versions": Array [ Object { - "displayName": "Dask 2023.1/Spark 3.3.0", + "displayName": "Streamlit", "image": "nerc/jupyterlab:ee1e157f36f5-spark-3.3.0", }, ], From 2e15dee98830066dacc641d89a2ff3935e392ecf Mon Sep 17 00:00:00 2001 From: Iain Walmsley Date: Mon, 15 Apr 2024 14:32:36 +0100 Subject: [PATCH 3/4] fix: adding streamlit logo --- .../src/assets/images/streamlit-logo.svg | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 code/workspaces/web-app/src/assets/images/streamlit-logo.svg diff --git a/code/workspaces/web-app/src/assets/images/streamlit-logo.svg b/code/workspaces/web-app/src/assets/images/streamlit-logo.svg new file mode 100644 index 000000000..fb823f21f --- /dev/null +++ b/code/workspaces/web-app/src/assets/images/streamlit-logo.svg @@ -0,0 +1,70 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + From 9a5de2475ac3d3686dc1e098414ca316cbf4709f Mon Sep 17 00:00:00 2001 From: Iain Walmsley Date: Mon, 15 Apr 2024 14:35:35 +0100 Subject: [PATCH 4/4] chore: lossless compression of streamlit svg --- .../src/assets/images/streamlit-logo.svg | 71 +------------------ 1 file changed, 1 insertion(+), 70 deletions(-) diff --git a/code/workspaces/web-app/src/assets/images/streamlit-logo.svg b/code/workspaces/web-app/src/assets/images/streamlit-logo.svg index fb823f21f..4dc88c03b 100644 --- a/code/workspaces/web-app/src/assets/images/streamlit-logo.svg +++ b/code/workspaces/web-app/src/assets/images/streamlit-logo.svg @@ -1,70 +1 @@ - - - - - - image/svg+xml - - - - - - - - - - - - - + \ No newline at end of file