From 0fa46e00f7c5c4fc27615de24dfc53516a4bfb89 Mon Sep 17 00:00:00 2001 From: Youssef Date: Mon, 11 Oct 2021 11:03:37 +0100 Subject: [PATCH 1/3] fix copy button link --- frontend/src/component/feature/FeatureView2/FeatureView2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx b/frontend/src/component/feature/FeatureView2/FeatureView2.tsx index 49851a7dd6..47a123b6db 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx +++ b/frontend/src/component/feature/FeatureView2/FeatureView2.tsx @@ -110,7 +110,7 @@ const FeatureView2 = () => { tooltip="Copy" data-loading component={Link} - to={`${history.location.pathname}/copy`} + to={`${history.location.pathname}/strategy/copy`} > From cdd14206b71e15570d7973a7422b0dca905bfac5 Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 12 Oct 2021 06:11:02 +0100 Subject: [PATCH 2/3] fix copy link path --- frontend/src/component/feature/FeatureView2/FeatureView2.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx b/frontend/src/component/feature/FeatureView2/FeatureView2.tsx index 47a123b6db..28715ba501 100644 --- a/frontend/src/component/feature/FeatureView2/FeatureView2.tsx +++ b/frontend/src/component/feature/FeatureView2/FeatureView2.tsx @@ -110,7 +110,7 @@ const FeatureView2 = () => { tooltip="Copy" data-loading component={Link} - to={`${history.location.pathname}/strategy/copy`} + to={`/projects/${projectId}/features2/${featureId}/strategies/copy`} > From a139cd4034943ba6a81bc865113a18c83147195e Mon Sep 17 00:00:00 2001 From: Youssef Date: Tue, 12 Oct 2021 08:39:31 +0100 Subject: [PATCH 3/3] fix reload env and setting tabs --- .../src/component/project/Project/Project.tsx | 78 ++++++++++--------- .../ProjectEnvironment/ProjectEnvironment.tsx | 2 - 2 files changed, 41 insertions(+), 39 deletions(-) diff --git a/frontend/src/component/project/Project/Project.tsx b/frontend/src/component/project/Project/Project.tsx index e9cc62d9db..305ad5d659 100644 --- a/frontend/src/component/project/Project/Project.tsx +++ b/frontend/src/component/project/Project/Project.tsx @@ -33,42 +33,6 @@ const Project = () => { const { a11yProps, activeTabIdx, setActiveTab } = useTabs(0); const basePath = `/projects/${id}`; - - useEffect(() => { - const created = params.get('created'); - const edited = params.get('edited'); - - if (created || edited) { - const text = created ? 'Project created' : 'Project updated'; - setToastData({ - show: true, - type: 'success', - text, - }); - } - /* eslint-disable-next-line */ - }, []); - - useEffect(() => { - const tabIdx = tabData.findIndex(tab => tab.name === activeTab); - if(tabIdx > 0) { - setActiveTab(tabIdx); - } else { - setActiveTab(0); - } - - /* eslint-disable-next-line */ - }, []); - - const goToTabWithName = (name: string) => { - const index = tabData.findIndex(t => t.name === name); - if(index >= 0) { - const tab = tabData[index]; - history.push(tab.path); - setActiveTab(index); - } - } - const tabData = [ { title: 'Overview', @@ -102,7 +66,47 @@ const Project = () => { path: `${basePath}/settings`, name: 'settings', }, - ].filter(tab => !tab.disabled); + ] + + useEffect(() => { + const created = params.get('created'); + const edited = params.get('edited'); + + if (created || edited) { + const text = created ? 'Project created' : 'Project updated'; + setToastData({ + show: true, + type: 'success', + text, + }); + } + + tabData.filter(tab => !tab.disabled); + + /* eslint-disable-next-line */ + }, []); + + useEffect(() => { + const tabIdx = tabData.findIndex(tab => tab.name === activeTab); + if(tabIdx > 0) { + setActiveTab(tabIdx); + } else { + setActiveTab(0); + } + + /* eslint-disable-next-line */ + }, []); + + const goToTabWithName = (name: string) => { + const index = tabData.findIndex(t => t.name === name); + if(index >= 0) { + const tab = tabData[index]; + history.push(tab.path); + setActiveTab(index); + } + } + + const renderTabs = () => { diff --git a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx index 73a107bee3..1570066c59 100644 --- a/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx +++ b/frontend/src/component/project/ProjectEnvironment/ProjectEnvironment.tsx @@ -45,8 +45,6 @@ const ProjectEnvironmentList = ({ projectId }: ProjectEnvironmentListProps) => { const { removeEnvironmentFromProject, addEnvironmentToProject } = useProjectApi(); - console.log(project); - // local state const [selectedEnv, setSelectedEnv] = useState(); const [confirmName, setConfirmName] = useState('');