File tree 3 files changed +37
-7
lines changed
components/nav/issueViews
3 files changed +37
-7
lines changed Original file line number Diff line number Diff line change @@ -201,6 +201,8 @@ export function IssueViewNavItems({
201
201
...v ,
202
202
isAllProjects : isEqual ( v . projects , [ - 1 ] ) ,
203
203
name : v . label ,
204
+ lastVisited : null ,
205
+ visibility : 'owner' ,
204
206
} ) )
205
207
) ;
206
208
} ,
@@ -242,6 +244,8 @@ export function IssueViewNavItems({
242
244
...v ,
243
245
isAllProjects : isEqual ( v . projects , [ - 1 ] ) ,
244
246
name : v . label ,
247
+ lastVisited : null ,
248
+ visibility : 'owner' ,
245
249
} ) )
246
250
) ;
247
251
}
Original file line number Diff line number Diff line change 1
- import type { UseApiQueryOptions } from 'sentry/utils/queryClient' ;
1
+ import type { ApiQueryKey , UseApiQueryOptions } from 'sentry/utils/queryClient' ;
2
2
import { useApiQuery } from 'sentry/utils/queryClient' ;
3
- import type { GroupSearchView } from 'sentry/views/issueList/types' ;
3
+ import type {
4
+ GroupSearchView ,
5
+ GroupSearchViewVisibility ,
6
+ } from 'sentry/views/issueList/types' ;
4
7
5
8
type FetchGroupSearchViewsParameters = {
6
9
orgSlug : string ;
10
+ cursor ?: string ;
11
+ limit ?: number ;
12
+ visibility ?: GroupSearchViewVisibility ;
7
13
} ;
8
14
9
15
export const makeFetchGroupSearchViewsKey = ( {
10
16
orgSlug,
11
- } : FetchGroupSearchViewsParameters ) =>
12
- [ `/organizations/${ orgSlug } /group-search-views/` ] as const ;
17
+ visibility,
18
+ limit,
19
+ cursor,
20
+ } : FetchGroupSearchViewsParameters ) : ApiQueryKey =>
21
+ [
22
+ `/organizations/${ orgSlug } /group-search-views/` ,
23
+ {
24
+ query : {
25
+ per_page : limit ,
26
+ visibility,
27
+ cursor,
28
+ } ,
29
+ } ,
30
+ ] as const ;
13
31
14
32
export const useFetchGroupSearchViews = (
15
- { orgSlug } : FetchGroupSearchViewsParameters ,
33
+ parameters : FetchGroupSearchViewsParameters ,
16
34
options : Partial < UseApiQueryOptions < GroupSearchView [ ] > > = { }
17
35
) => {
18
- return useApiQuery < GroupSearchView [ ] > ( makeFetchGroupSearchViewsKey ( { orgSlug } ) , {
36
+ return useApiQuery < GroupSearchView [ ] > ( makeFetchGroupSearchViewsKey ( parameters ) , {
19
37
staleTime : Infinity ,
20
38
...options ,
21
39
} ) ;
Original file line number Diff line number Diff line change @@ -16,17 +16,25 @@ export type IssueUpdateData =
16
16
| MarkReviewed
17
17
| GroupStatusResolution ;
18
18
19
+ export enum GroupSearchViewVisibility {
20
+ OWNER = 'owner' ,
21
+ ORGANIZATION = 'organization' ,
22
+ }
23
+
19
24
export type GroupSearchView = {
20
25
environments : string [ ] ;
21
26
id : string ;
27
+ lastVisited : string | null ;
22
28
name : string ;
23
29
projects : number [ ] ;
24
30
query : string ;
25
31
querySort : IssueSortOptions ;
26
32
timeFilters : PageFilters [ 'datetime' ] ;
33
+ visibility : GroupSearchViewVisibility ;
27
34
} ;
28
35
29
- export interface UpdateGroupSearchViewPayload extends Omit < GroupSearchView , 'id' > {
36
+ export interface UpdateGroupSearchViewPayload
37
+ extends Omit < GroupSearchView , 'id' | 'lastVisited' | 'visibility' > {
30
38
environments : string [ ] ;
31
39
projects : number [ ] ;
32
40
timeFilters : PageFilters [ 'datetime' ] ;
You can’t perform that action at this time.
0 commit comments