Просмотр исходного кода

ref(js): Make projectIssues compatible with react-router 6 (#76448)

Evan Purkhiser 6 месяцев назад
Родитель
Сommit
89efce89f4

+ 3 - 3
static/app/views/projectDetail/projectIssues.spec.tsx

@@ -95,7 +95,7 @@ describe('ProjectDetail > ProjectIssues', function () {
     expect(router.push).toHaveBeenCalledWith({
       pathname: '/organizations/org-slug/issues/',
       query: {
-        limit: 5,
+        limit: '5',
         query: 'error.unhandled:true is:unresolved',
         sort: 'freq',
         statsPeriod: '14d',
@@ -158,7 +158,7 @@ describe('ProjectDetail > ProjectIssues', function () {
         field: ['issue', 'title', 'count()', 'count_unique(user)', 'project'],
         name: 'Frequent Unhandled Issues',
         query: 'event.type:error error.unhandled:true',
-        sort: ['-count'],
+        sort: '-count',
         statsPeriod: '14d',
       },
     });
@@ -188,7 +188,7 @@ describe('ProjectDetail > ProjectIssues', function () {
     expect(router.push).toHaveBeenCalledWith({
       pathname: `/organizations/${organization.slug}/issues/`,
       query: {
-        limit: 5,
+        limit: '5',
         environment: 'staging',
         statsPeriod: '7d',
         query: 'error.unhandled:true is:unresolved',

+ 2 - 2
static/app/views/projectDetail/projectIssues.tsx

@@ -152,7 +152,7 @@ function ProjectIssues({organization, location, projectId, query, api}: Props) {
       query: {
         name: t('Frequent Unhandled Issues'),
         field: ['issue', 'title', 'count()', 'count_unique(user)', 'project'],
-        sort: ['-count'],
+        sort: '-count',
         query: discoverQuery,
         display: 'top5',
         ...normalizeDateTimeParams(pick(location.query, [...Object.values(URL_PARAM)])),
@@ -168,7 +168,7 @@ function ProjectIssues({organization, location, projectId, query, api}: Props) {
     : [`${IssuesQuery.ALL}`, query].join(' ').trim();
 
   const queryParams = {
-    limit: 5,
+    limit: '5',
     ...normalizeDateTimeParams(
       pick(location.query, [...Object.values(URL_PARAM), 'cursor'])
     ),