From 3946ce4299ecbe611392b9bea48129119e74f010 Mon Sep 17 00:00:00 2001 From: daskyrk Date: Fri, 5 Nov 2021 14:41:16 +0800 Subject: [PATCH 1/4] refactor: rename import from app/common to common, update vite config --- shell/app/layout/pages/page-container/page-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/app/layout/pages/page-container/page-container.tsx b/shell/app/layout/pages/page-container/page-container.tsx index 0c326c49e7..f81d767a64 100644 --- a/shell/app/layout/pages/page-container/page-container.tsx +++ b/shell/app/layout/pages/page-container/page-container.tsx @@ -187,7 +187,7 @@ const PageContainer = ({ route }: IProps) => { > {MainContent} - + {/* */} From c3c263cbe9437245bc35d683a4b234dbe2d3e9ac Mon Sep 17 00:00:00 2001 From: daskyrk Date: Fri, 5 Nov 2021 15:19:56 +0800 Subject: [PATCH 2/4] fix: revert test comment --- shell/app/layout/pages/page-container/page-container.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/app/layout/pages/page-container/page-container.tsx b/shell/app/layout/pages/page-container/page-container.tsx index f81d767a64..0c326c49e7 100644 --- a/shell/app/layout/pages/page-container/page-container.tsx +++ b/shell/app/layout/pages/page-container/page-container.tsx @@ -187,7 +187,7 @@ const PageContainer = ({ route }: IProps) => { > {MainContent} - {/* */} + From 81e23b564edc865bb1e8a80a08624c9b8e704e86 Mon Sep 17 00:00:00 2001 From: daskyrk Date: Thu, 11 Nov 2021 11:16:58 +0800 Subject: [PATCH 3/4] fix: add iteration filter field for manual test plan --- .../project/pages/test-plan/plan-modal.tsx | 6 ++++-- .../project/pages/test-plan/test-plan.tsx | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/shell/app/modules/project/pages/test-plan/plan-modal.tsx b/shell/app/modules/project/pages/test-plan/plan-modal.tsx index 858e63b92a..2ea620adb8 100644 --- a/shell/app/modules/project/pages/test-plan/plan-modal.tsx +++ b/shell/app/modules/project/pages/test-plan/plan-modal.tsx @@ -19,6 +19,7 @@ import routeInfoStore from 'core/stores/route'; import testPlanStore from 'project/stores/test-plan'; import iterationStore from 'project/stores/iteration'; import { FormModalList } from 'app/interface/common'; +import { useLoading } from 'core/stores/loading'; interface IProps { visible: boolean; @@ -37,6 +38,7 @@ const TestPlanModal = (props: IProps) => { const iterationList = iterationStore.useStore((s) => s.iterationList); const { getTestPlanItem, addTestPlan, updateTestPlan } = testPlanStore.effects; const { cleanTestPlan } = testPlanStore.reducers; + const [loadingIterationList] = useLoading(iterationStore, ['getIterations']); const handleOk = (values: any) => { const copy = { ...values }; @@ -57,7 +59,7 @@ const TestPlanModal = (props: IProps) => { }; React.useEffect(() => { - if (!iterationList.length) { + if (!iterationList.length && !loadingIterationList) { iterationStore.effects.getIterations({ pageNo: 1, pageSize: 100, @@ -65,7 +67,7 @@ const TestPlanModal = (props: IProps) => { withoutIssueSummary: true, }); } - }, [iterationList.length, params.projectId]); + }, [iterationList.length, params.projectId, loadingIterationList]); React.useEffect(() => { visible && testPlanId && getTestPlanItem(testPlanId); diff --git a/shell/app/modules/project/pages/test-plan/test-plan.tsx b/shell/app/modules/project/pages/test-plan/test-plan.tsx index a6181e3cbf..0a641da857 100644 --- a/shell/app/modules/project/pages/test-plan/test-plan.tsx +++ b/shell/app/modules/project/pages/test-plan/test-plan.tsx @@ -20,6 +20,7 @@ import { isEmpty } from 'lodash'; import { useEffectOnce } from 'react-use'; import { useLoading } from 'core/stores/loading'; import testPlanStore from 'project/stores/test-plan'; +import iterationStore from 'project/stores/iteration'; import i18n from 'i18n'; import { ColumnProps } from 'core/common/interface'; import './test-plan.scss'; @@ -48,6 +49,7 @@ const TestPlan = () => { const [filterObj, setFilterObj] = React.useState({ isArchived: 'false' }); const [page, planList] = testPlanStore.useStore((s) => [s.planPaging, s.planList]); const [isFetching] = useLoading(testPlanStore, ['getPlanList']); + const iterationList = iterationStore.useStore((s) => s.iterationList); const updateModalProp = (a: object) => { setModalProp({ @@ -245,6 +247,20 @@ const TestPlan = () => { mode: 'multiple', }, }, + { + type: Select, + name: 'iterationName', + customProps: { + options: iterationList.map(({ id, title }) => ( + + )), + allowClear: true, + placeholder: i18n.t('dop:owned iteration'), + mode: 'multiple', + }, + }, { type: Input, name: 'name', From 512c6bba3965effd19452ffdbf941f5f76062428 Mon Sep 17 00:00:00 2001 From: daskyrk Date: Tue, 23 Nov 2021 11:00:40 +0800 Subject: [PATCH 4/4] fix: manual test plan form circular render, iteration search key --- shell/app/modules/project/pages/test-plan/plan-modal.tsx | 5 +++-- shell/app/modules/project/pages/test-plan/test-plan.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/shell/app/modules/project/pages/test-plan/plan-modal.tsx b/shell/app/modules/project/pages/test-plan/plan-modal.tsx index 2ea620adb8..dc350b0322 100644 --- a/shell/app/modules/project/pages/test-plan/plan-modal.tsx +++ b/shell/app/modules/project/pages/test-plan/plan-modal.tsx @@ -20,6 +20,7 @@ import testPlanStore from 'project/stores/test-plan'; import iterationStore from 'project/stores/iteration'; import { FormModalList } from 'app/interface/common'; import { useLoading } from 'core/stores/loading'; +import { useMount } from 'react-use'; interface IProps { visible: boolean; @@ -58,7 +59,7 @@ const TestPlanModal = (props: IProps) => { } }; - React.useEffect(() => { + useMount(() => { if (!iterationList.length && !loadingIterationList) { iterationStore.effects.getIterations({ pageNo: 1, @@ -67,7 +68,7 @@ const TestPlanModal = (props: IProps) => { withoutIssueSummary: true, }); } - }, [iterationList.length, params.projectId, loadingIterationList]); + }); React.useEffect(() => { visible && testPlanId && getTestPlanItem(testPlanId); diff --git a/shell/app/modules/project/pages/test-plan/test-plan.tsx b/shell/app/modules/project/pages/test-plan/test-plan.tsx index 0a641da857..e876f36ac2 100644 --- a/shell/app/modules/project/pages/test-plan/test-plan.tsx +++ b/shell/app/modules/project/pages/test-plan/test-plan.tsx @@ -249,7 +249,7 @@ const TestPlan = () => { }, { type: Select, - name: 'iterationName', + name: 'iterationID', customProps: { options: iterationList.map(({ id, title }) => (