From 928d99439e09d3b1ad1ed774cbeb17f56e9bfbe4 Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Thu, 23 Jan 2025 17:57:20 +0100 Subject: [PATCH 1/4] Fix production deployment --- deployment/codefresh-prod.yaml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/deployment/codefresh-prod.yaml b/deployment/codefresh-prod.yaml index 30eaef42..4251cdb3 100644 --- a/deployment/codefresh-prod.yaml +++ b/deployment/codefresh-prod.yaml @@ -15,13 +15,21 @@ steps: type: parallel stage: prepare steps: - - title: Cloning cloud-harness repository... - type: git-clone - stage: prepare - repo: https://github.com/MetaCell/cloud-harness.git - revision: '${{CLOUDHARNESS_BRANCH}}' - working_directory: . - git: github + clone_cloud_harness: + title: Cloning cloud-harness repository... + type: git-clone + stage: prepare + repo: https://github.com/MetaCell/cloud-harness.git + revision: '${{CLOUDHARNESS_BRANCH}}' + working_directory: . + git: github + clone_nwb-explorer_git_nwb-explorer: + title: Cloning nwb-explorer.git repository... + type: git-clone + repo: https://github.com/MetaCell/nwb-explorer.git + revision: development + working_directory: applications/nwb-explorer/dependencies/ + git: github prepare_deployment: title: Prepare helm chart image: python:3.9.10 From 7f70c132e544d3704564155d822a00a612a7c03d Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Thu, 23 Jan 2025 17:59:27 +0100 Subject: [PATCH 2/4] Update version numbers on apps --- applications/osb-portal/package.json | 2 +- applications/workspaces/server/setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/applications/osb-portal/package.json b/applications/osb-portal/package.json index ec3bfa62..c6d76aec 100644 --- a/applications/osb-portal/package.json +++ b/applications/osb-portal/package.json @@ -1,6 +1,6 @@ { "name": "frontend", - "version": "0.7.0", + "version": "0.8.0", "description": "", "main": "index.js", "scripts": { diff --git a/applications/workspaces/server/setup.py b/applications/workspaces/server/setup.py index e111b4b1..5e6234fe 100644 --- a/applications/workspaces/server/setup.py +++ b/applications/workspaces/server/setup.py @@ -4,7 +4,7 @@ from setuptools import setup, find_packages NAME = "workspaces" -VERSION = "0.7.0" +VERSION = "0.8.0" # To install the library, run the following # From 62c9ea283cca1c8d78f10c0962a9194a5108ed3d Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Fri, 24 Jan 2025 10:55:37 +0100 Subject: [PATCH 3/4] #931 fix text search --- .../RepositoriesWorkspacesSearchField.tsx | 12 ++- .../common/SearchFilterReposWorkspaces.tsx | 18 ++-- .../pages/Repositories/RepositoriesPage.tsx | 96 ++++++++++--------- 3 files changed, 68 insertions(+), 58 deletions(-) diff --git a/applications/osb-portal/src/components/common/RepositoriesWorkspacesSearchField.tsx b/applications/osb-portal/src/components/common/RepositoriesWorkspacesSearchField.tsx index 0e5fbe55..a3227f55 100644 --- a/applications/osb-portal/src/components/common/RepositoriesWorkspacesSearchField.tsx +++ b/applications/osb-portal/src/components/common/RepositoriesWorkspacesSearchField.tsx @@ -10,6 +10,7 @@ import SearchIcon from "@mui/icons-material/Search"; //style import { bgRegular, chipTextColor } from "../../theme"; import styled from "@mui/system/styled"; +import { debounce } from "lodash"; const StyledTextField = styled(TextField)(({ theme }) => ({ backgroundColor: bgRegular, @@ -44,21 +45,24 @@ interface RepositoriesSearchProps { } export default (props: RepositoriesSearchProps) => { + + const handleChange = React.useCallback(debounce((event: React.ChangeEvent) => { + // Timout improves responsiveness while typing + props.filterChanged(event.target.value); + }, 1000), []); + return ( { - props.filterChanged(e.target.value.toLowerCase()); - }} + onChange={handleChange} InputProps={{ startAdornment: ( diff --git a/applications/osb-portal/src/components/common/SearchFilterReposWorkspaces.tsx b/applications/osb-portal/src/components/common/SearchFilterReposWorkspaces.tsx index 65eec78c..f9167bf9 100644 --- a/applications/osb-portal/src/components/common/SearchFilterReposWorkspaces.tsx +++ b/applications/osb-portal/src/components/common/SearchFilterReposWorkspaces.tsx @@ -181,9 +181,14 @@ export const SearchFilterReposWorkspaces = ( } ); }, 500), - [] - ); + [] ); + const handleTagsChange = React.useCallback((event, value) => props?.setSearchFilterValues({ + ...props?.searchFilterValues, + tags: value, + }) + , [props?.searchFilterValues]); + return ( <> @@ -223,12 +228,7 @@ export const SearchFilterReposWorkspaces = ( onInputChange={(event, value) => { handleTagInput(value); }} - onChange={(event, value) => - props?.setSearchFilterValues({ - ...props?.searchFilterValues, - tags: value, - }) - } + onChange={handleTagsChange} onClose={(event, reason) => handleTagInput("")} renderTags={(value, getTagProps) => value.map((option, index) => ( @@ -309,6 +309,8 @@ export const SearchFilterReposWorkspaces = ( ); + + }; export default SearchFilterReposWorkspaces; diff --git a/applications/osb-portal/src/pages/Repositories/RepositoriesPage.tsx b/applications/osb-portal/src/pages/Repositories/RepositoriesPage.tsx index 6b45de92..a54132de 100644 --- a/applications/osb-portal/src/pages/Repositories/RepositoriesPage.tsx +++ b/applications/osb-portal/src/pages/Repositories/RepositoriesPage.tsx @@ -62,6 +62,32 @@ const customButtonStyle = { }, }; +const CustomButton = ({ + listType, + Icon, + changeListView, + listView +}: { + listType: string; + Icon: ReactElement; + changeListView: (type: string) => void; + listView: string; +}) => { + if (listType === listView) { + return ( + changeListView(listType)}> + {Icon} + + ); + } else { + return ( + changeListView(listType)}> + {Icon} + + ); + } +}; + export const StyledIconButton = styled(IconButton)(() => customButtonStyle); export const StyledActiveIconButton = styled(IconButton)(() => ({ @@ -105,25 +131,23 @@ export const RepositoriesPage = ({ const [tabValue, setTabValue] = React.useState(RepositoriesTab.all); const [listView, setListView] = React.useState("list"); - - - const openRepoUrl = (repositoryId: number) => { + const openRepoUrl = React.useCallback((repositoryId: number) => { navigate(`/repositories/${repositoryId}`); - }; + }, []); - const debouncedHandleSearchFilter = (newTextFilter: string) => { + const handleSearchFilter = React.useCallback((newTextFilter: string) => { setSearchFilterValues({ ...searchFilterValues, text: newTextFilter }); - debounce(() => updateReposList(newTextFilter), 500)(); - }; + }, []); - const setReposValues = (reposDetails) => { + const setReposValues = React.useCallback((reposDetails) => { setRepositories(reposDetails.osbrepositories); setTotal(reposDetails.pagination.total); setTotalPages(reposDetails.pagination.numberOfPages); setLoading(false); - }; + }, []); - const updateReposList = (updatedSearchFilterValues) => { + const updateReposList = React.useCallback( + async (updatedSearchFilterValues) => { const isSearchFieldsEmpty = updatedSearchFilterValues?.tags?.length === 0 && updatedSearchFilterValues?.types?.length === 0 && @@ -150,48 +174,30 @@ export const RepositoriesPage = ({ setReposValues(reposDetails); }); } - }; + }, [page, tabValue, user?.id]); - const handleRefreshRepositories = () => { + const handleRefreshRepositories = React.useCallback(() => { updateReposList(searchFilterValues); - } + }, [searchFilterValues]); - const handleTabChange = (event: any, newValue: RepositoriesTab) => { + const handleTabChange = React.useCallback((event: any, newValue: RepositoriesTab) => { setTotal(0); setTabValue(newValue); setPage(1) - }; + }, []); - const changeListView = (type: string) => { + const changeListView = React.useCallback((type: string) => { setListView(type); - }; + }, []); - const handleChangePage = (event: unknown, current: number) => { + const handleChangePage = React.useCallback((event: unknown, current: number) => { setPage(current); - }; + }, []); - const CustomButton = ({ - listType, - Icon, - }: { - listType: string; - Icon: ReactElement; - }) => { - if (listType === listView) { - return ( - changeListView(listType)}> - {Icon} - - ); - } else { - return ( - changeListView(listType)}> - {Icon} - - ); - } - }; - React.useEffect(() => updateReposList(searchFilterValues), [page, searchFilterValues, tabValue, counter]); + + React.useEffect(() => { + updateReposList(searchFilterValues) + }, [page, searchFilterValues, tabValue, counter]); return ( <> @@ -261,13 +267,11 @@ export const RepositoriesPage = ({ variant="contained" aria-label="Disabled elevation buttons" > - } listType="grid" /> - } listType="list" /> + } listType="grid" listView={listView} changeListView={changeListView} /> + } listType="list" listView={listView} changeListView={changeListView} /> - debouncedHandleSearchFilter(newTextFilter) - } + filterChanged={handleSearchFilter} searchFilterValues={searchFilterValues} setSearchFilterValues={setSearchFilterValues} hasTypes={true} From a521a01f7ef169cf92ce9f059e46b69282485b66 Mon Sep 17 00:00:00 2001 From: Filippo Ledda Date: Mon, 3 Feb 2025 11:45:04 +0100 Subject: [PATCH 4/4] Updae prod deployment --- deployment/codefresh-prod.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deployment/codefresh-prod.yaml b/deployment/codefresh-prod.yaml index 4251cdb3..3dbb0a4a 100644 --- a/deployment/codefresh-prod.yaml +++ b/deployment/codefresh-prod.yaml @@ -27,12 +27,12 @@ steps: title: Cloning nwb-explorer.git repository... type: git-clone repo: https://github.com/MetaCell/nwb-explorer.git - revision: development + revision: master working_directory: applications/nwb-explorer/dependencies/ git: github prepare_deployment: title: Prepare helm chart - image: python:3.9.10 + image: python:3.12 stage: prepare working_directory: . commands: