Skip to content

Commit 8a692c8

Browse files
fix(dop): issue route bug (#2365) (#2416)
* fix(dop): issue route bug * fix: goto route change Co-authored-by: hujiahao-hjh <[email protected]>
1 parent 75b7b7d commit 8a692c8

File tree

3 files changed

+29
-7
lines changed

3 files changed

+29
-7
lines changed

shell/app/common/utils/go-to.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,8 @@ export enum pages {
227227
cmpResourceOwnerRank = '/{orgName}/cmp/resource-rank/owner',
228228
publisherContent = '/{orgName}/dop/publisher/{type}/{publisherItemId}',
229229
iterationDetail = '/{orgName}/dop/projects/{projectId}/issues/iteration/{iterationId}/{issueType}',
230-
taskList = '/{orgName}/dop/projects/{projectId}/issues/task',
231-
bugList = '/{orgName}/dop/projects/{projectId}/issues/bug',
230+
taskList = '/{orgName}/dop/projects/{projectId}/issues/all?type=task',
231+
bugList = '/{orgName}/dop/projects/{projectId}/issues/all?type=bug',
232232
issueDetail = '/{orgName}/dop/projects/{projectId}/issues/{issueType}?id={issueId}&iterationID={iterationId}&type={issueType}',
233233
ticketDetail = '/{orgName}/dop/projects/{projectId}/ticket?id={issueId}&pageNo=1',
234234
backlog = '/{orgName}/dop/projects/{projectId}/issues/backlog?id={issueId}&issueType={issueType}',

shell/app/interface/global.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ interface RouteConfigItem {
396396
pageNameInfo?: () => JSX.Element;
397397
keepQuery?: boolean;
398398
getComp?: (cb: RouterGetComp) => Promise<any>;
399+
render?: (props: { location: Location }) => React.ReactNode;
399400
}
400401

401402
declare function GET_ROUTES(): RouteConfigItem[];

shell/app/modules/project/router.ts renamed to shell/app/modules/project/router.tsx

+26-5
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// You should have received a copy of the GNU Affero General Public License
1212
// along with this program. If not, see <http://www.gnu.org/licenses/>.
1313

14+
import React from 'react';
15+
import { Redirect } from 'react-router-dom';
16+
import { qs } from 'common/utils';
1417
import getAppRouter from 'application/router';
1518
import i18n from 'i18n';
1619
import {
@@ -75,11 +78,29 @@ function getProjectRouter(): RouteConfigItem[] {
7578
},
7679
{
7780
path: 'task',
78-
tabs: COLLABORATE_TABS,
79-
ignoreTabQuery: true,
80-
getComp: (cb) => cb(import('project/pages/issue/task')),
81-
layout: {
82-
noWrapper: true,
81+
render: (props) => {
82+
const { location } = props;
83+
const { search } = location;
84+
const params = qs.parse(search);
85+
return <Redirect to={`all?${qs.stringify({ ...params, type: 'TASK' })}`} />;
86+
},
87+
},
88+
{
89+
path: 'bug',
90+
render: (props) => {
91+
const { location } = props;
92+
const { search } = location;
93+
const params = qs.parse(search);
94+
return <Redirect to={`all?${qs.stringify({ ...params, type: 'BUG' })}`} />;
95+
},
96+
},
97+
{
98+
path: 'requirement',
99+
render: (props) => {
100+
const { location } = props;
101+
const { search } = location;
102+
const params = qs.parse(search);
103+
return <Redirect to={`all?${qs.stringify({ ...params, type: 'REQUIREMENT' })}`} />;
83104
},
84105
},
85106
{

0 commit comments

Comments
 (0)