From e0cdbf1387f69a9443b861a8ca91d5f0f283c841 Mon Sep 17 00:00:00 2001 From: svetaStrech Date: Thu, 23 Nov 2023 22:01:14 +0200 Subject: [PATCH 1/3] copy form cloud --- ui_src/src/components/sideBar/index.js | 4 +- ui_src/src/components/sideBar/style.scss | 10 +++ ui_src/src/components/tag/style.scss | 1 + ui_src/src/const/globalConst.js | 8 +- .../functions/components/functionBox/index.js | 18 ++++ .../components/functionBox/style.scss | 5 ++ .../components/functionDetails/index.js | 23 +++-- .../components/functionDetails/style.scss | 45 +++++++++- .../components/functionList/index.js | 9 +- .../components/testMockEvent/index.js | 75 ++++++++++++---- .../components/testMockEvent/style.scss | 18 +++- .../components/testResult/index.js | 2 +- .../components/functionsApplyModal/index.js | 20 ++--- .../components/functionsApplyModal/style.scss | 86 ++++++++++--------- .../components/functionsModal/index.js | 32 +++++-- .../stationObservabilty/messages/index.js | 5 +- .../stationObservabilty/messages/style.scss | 12 ++- ui_src/src/services/http.js | 4 +- 18 files changed, 276 insertions(+), 101 deletions(-) diff --git a/ui_src/src/components/sideBar/index.js b/ui_src/src/components/sideBar/index.js index 101a4bb2b..4cf58861c 100644 --- a/ui_src/src/components/sideBar/index.js +++ b/ui_src/src/components/sideBar/index.js @@ -195,11 +195,12 @@ function SideBar() { addUserModalFlip(false); }; - const MenuItem = ({ icon, activeIcon, name, route, onClick, onMouseEnter, onMouseLeave }) => { + const MenuItem = ({ icon, activeIcon, name, route, onClick, onMouseEnter, onMouseLeave, badge }) => { return (
{state.route === route ? activeIcon : hoveredItem === route ? activeIcon : icon}

{name}

+ {badge && }
); }; @@ -459,6 +460,7 @@ function SideBar() { onMouseEnter={() => setHoveredItem('functions')} onMouseLeave={() => setHoveredItem('')} route="functions" + badge={'Alpha'} /> } diff --git a/ui_src/src/components/sideBar/style.scss b/ui_src/src/components/sideBar/style.scss index 02f29dfa9..0fd5a2f2a 100644 --- a/ui_src/src/components/sideBar/style.scss +++ b/ui_src/src/components/sideBar/style.scss @@ -150,6 +150,16 @@ .align-items-center { display: flex; } + .badge { + color: #f5f5f5; + border-radius: 32px; + padding: 1px 10px; + margin-top: 2px; + font-size: 8px; + font-family: 'InterSemiBold'; + background: var(--purple); + cursor: pointer; + } } .menu-content { diff --git a/ui_src/src/components/tag/style.scss b/ui_src/src/components/tag/style.scss index cf93b7876..ee6445d69 100644 --- a/ui_src/src/components/tag/style.scss +++ b/ui_src/src/components/tag/style.scss @@ -13,6 +13,7 @@ line-height: 14px; overflow: hidden; text-overflow: ellipsis; + white-space: nowrap; } .close { display: flex; diff --git a/ui_src/src/const/globalConst.js b/ui_src/src/const/globalConst.js index f8cac055b..dda72a66e 100644 --- a/ui_src/src/const/globalConst.js +++ b/ui_src/src/const/globalConst.js @@ -72,7 +72,7 @@ export const planType = { ENTERPRISE: 'plan-cloud-enterprise', BUSINESS: 'plan-cloud-business', GROWTH: 'plan-cloud-growth-buckets', - FREE: 'plan-cloud-free', + FREE: 'plan-cloud-free' }; export const githubUrls = { @@ -82,9 +82,9 @@ export const githubUrls = { MEMPHIS_GIT_SSH: 'git@github.com:memphisdev/onboarding-app.git' }, functions: { - DOWNLOAD_URL: 'https://github.com/memphisdev/memphis-dev-functions/archive/refs/heads/master.zip', - MEMPHIS_GIT_HTTPS: 'https://github.com/memphisdev/memphis-dev-functions.git', - MEMPHIS_GIT_SSH: 'git@github.com:memphisdev/memphis-dev-functions.git' + DOWNLOAD_URL: 'https://github.com/memphisdev/function-templates/archive/refs/heads/master.zip', + MEMPHIS_GIT_HTTPS: 'https://github.com/memphisdev/function-templates.git', + MEMPHIS_GIT_SSH: 'git@github.com:memphisdev/function-templates.git' } }; diff --git a/ui_src/src/domain/functions/components/functionBox/index.js b/ui_src/src/domain/functions/components/functionBox/index.js index b13a671f0..7e449e13d 100644 --- a/ui_src/src/domain/functions/components/functionBox/index.js +++ b/ui_src/src/domain/functions/components/functionBox/index.js @@ -37,6 +37,7 @@ import { ApiEndpoints } from '../../../../const/apiEndpoints'; import { httpRequest } from '../../../../services/http'; import AttachFunctionModal from '../attachFunctionModal'; import CloudModal from '../../../../components/cloudModal'; +import TestMockEvent from '../../components/testFunctionModal/components/testMockEvent'; import { Context } from '../../../../hooks/store'; function FunctionBox({ funcDetails, integrated, isTagsOn = true, onClick = null, onApply, doneUninstall, startInstallation, funcIndex, referredFunction }) { @@ -49,6 +50,7 @@ function FunctionBox({ funcDetails, integrated, isTagsOn = true, onClick = null, const [cloudModal, setCloudModal] = useState(false); const [loader, setLoader] = useState(false); const [openUpgradeModal, setOpenUpgradeModal] = useState(false); + const [isTestFunctionModalOpen, setIsTestFunctionModalOpen] = useState(false); useEffect(() => { const url = window.location.href; @@ -191,6 +193,19 @@ function FunctionBox({ funcDetails, integrated, isTagsOn = true, onClick = null, )} + {isCloud() && functionDetails?.installed && ( +