Browse Source

feat(widget-library): Add an Issue-type widget (#30917)

Add and issue type widget to showcase the issue
widget capabilities in the widget library.
Shruthi 3 years ago
parent
commit
5fcd10cf4b

+ 6 - 6
static/app/views/dashboardsV2/widgetLibrary/data.tsx

@@ -96,17 +96,17 @@ export const DEFAULT_WIDGETS: Readonly<Array<WidgetTemplate>> = [
   },
   {
     id: undefined,
-    title: t('Top Issues'),
-    description: t('Issues with the most error events.'),
+    title: t('Latest Unresolved Issues'),
+    description: t('Most recently seen unresolved issues.'),
     displayType: DisplayType.TABLE,
-    widgetType: WidgetType.DISCOVER,
+    widgetType: WidgetType.ISSUE,
     interval: '5m',
     queries: [
       {
         name: '',
-        conditions: 'event.type:error',
-        fields: ['issue', 'count()', 'any(message)'],
-        orderby: '-count',
+        conditions: 'is:unresolved',
+        fields: ['issue', 'assignee', 'title'],
+        orderby: 'date',
       },
     ],
   },

+ 1 - 1
tests/js/spec/components/modals/dashboardWidgetLibraryModal.spec.jsx

@@ -60,7 +60,7 @@ describe('Modals -> DashboardWidgetLibraryModal', function () {
     expect(screen.queryByText('LCP by Country')).toBeInTheDocument();
     expect(screen.queryByText('Miserable Users')).toBeInTheDocument();
     expect(screen.queryByText('Slow vs Fast Transactions')).toBeInTheDocument();
-    expect(screen.queryByText('Top Issues')).toBeInTheDocument();
+    expect(screen.queryByText('Latest Unresolved Issues')).toBeInTheDocument();
     expect(screen.queryByText('Top Unhandled Error Types')).toBeInTheDocument();
     expect(screen.queryByText('Users Affected by Errors')).toBeInTheDocument();