From 16fa3a66b82c3fdb2fbd9f440a0343711a47003c Mon Sep 17 00:00:00 2001 From: anovazzi1 Date: Wed, 16 Aug 2023 17:28:35 -0300 Subject: [PATCH] chore(Makefile): simplify install_frontend target by removing unnecessary conditional statement feat(Makefile): add install_frontendc target to install frontend dependencies using npm ci for clean installs feat(Makefile): add frontendc target to install frontend dependencies using npm ci and run frontend chore(ApiModal/index.tsx): reformat codesArray for better readability --- Makefile | 13 ++++++++----- src/frontend/src/modals/ApiModal/index.tsx | 8 +++++++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9e9f876d9..f96931a4d 100644 --- a/Makefile +++ b/Makefile @@ -32,11 +32,10 @@ lint: poetry run ruff . --fix install_frontend: - @if [ "$(clean)" = "true" ]; then \ - cd src/frontend && npm ci; \ - else \ - cd src/frontend && npm install; \ - fi + cd src/frontend && npm install; + +install_frontendc: + cd src/frontend && npm ci; run_frontend: cd src/frontend && npm start @@ -44,6 +43,10 @@ run_frontend: frontend: make install_frontend make run_frontend + +frontendc: + make install_frontendc + make run_frontend install_backend: poetry install diff --git a/src/frontend/src/modals/ApiModal/index.tsx b/src/frontend/src/modals/ApiModal/index.tsx index 8410ee7d4..5bd93df45 100644 --- a/src/frontend/src/modals/ApiModal/index.tsx +++ b/src/frontend/src/modals/ApiModal/index.tsx @@ -49,7 +49,13 @@ const ApiModal = forwardRef( const pythonCode = getPythonCode(flow, tweak.current, tabsState); const widgetCode = getWidgetCode(flow, tabsState); const tweaksCode = buildTweaks(flow); - const codesArray = [curl_code, pythonApiCode, pythonCode, widgetCode, pythonCode]; + const codesArray = [ + curl_code, + pythonApiCode, + pythonCode, + widgetCode, + pythonCode, + ]; const [tabs, setTabs] = useState(tabsArray(codesArray, 0)); function startState() {