From ff8c7c49a5b7e3390fb3a4466c0bac9c5a69a8c6 Mon Sep 17 00:00:00 2001 From: "Rossdan Craig rossdan@lastmileai.dev" <> Date: Tue, 30 Jan 2024 00:45:58 -0500 Subject: [PATCH] Download Button [4/n]: Make this enabled for read-only mode I realized that after I moved `readOnly` check on entire group in https://github.com/lastmile-ai/aiconfig/pull/1032, I need to be able to still have the Download button for read-only mode so user can still download the AIConfig. We just need to make sure to define this endpoint in the lastMile repo ## Test Plan Rebase onto https://github.com/lastmile-ai/aiconfig/pull/1045 Go to `aiconfig/python/src/aiconfig/editor/client` and run this command: ``` rm -rf node_modules && yarn && yarn build ``` Then go to `aiconfig` dir and run this command: ``` aiconfig_path=./cookbooks/Gradio/huggingface.aiconfig.json parsers_path=./cookbooks/Gradio/hf_model_parsers.py aiconfig edit --aiconfig-path=$aiconfig_path --server-port=8080 --server-mode=debug_servers --parsers-module-path=$parsers_path ``` readOnly is true Screenshot 2024-01-30 at 00 45 03 readOnly is false Screenshot 2024-01-30 at 00 44 36 --- .../editor/client/src/components/AIConfigEditor.tsx | 9 ++++----- .../aiconfig/editor/server/static/asset-manifest.json | 6 +++--- python/src/aiconfig/editor/server/static/index.html | 2 +- .../static/js/{main.7cef3223.js => main.1afb2184.js} | 6 +++--- ...f3223.js.LICENSE.txt => main.1afb2184.js.LICENSE.txt} | 0 .../js/{main.7cef3223.js.map => main.1afb2184.js.map} | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) rename python/src/aiconfig/editor/server/static/static/js/{main.7cef3223.js => main.1afb2184.js} (94%) rename python/src/aiconfig/editor/server/static/static/js/{main.7cef3223.js.LICENSE.txt => main.1afb2184.js.LICENSE.txt} (100%) rename python/src/aiconfig/editor/server/static/static/js/{main.7cef3223.js.map => main.1afb2184.js.map} (50%) diff --git a/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx b/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx index 7a4e109be..bea26bc68 100644 --- a/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx +++ b/python/src/aiconfig/editor/client/src/components/AIConfigEditor.tsx @@ -987,13 +987,13 @@ export default function AIConfigEditor({ )} - {!readOnly && ( + { {downloadCallback && ( )} {shareCallback && } - {onClearOutputs && ( + {!readOnly && onClearOutputs && (