File tree 3 files changed +16
-21
lines changed
views/settings/project/projectOwnership
3 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -116,13 +116,6 @@ type CreateOwnershipRuleModalOptions = {
116
116
eventData ?: Event ;
117
117
} ;
118
118
119
- export type EditOwnershipRulesModalOptions = {
120
- onSave : ( text : string | null ) => void ;
121
- organization : Organization ;
122
- ownership : IssueOwnership ;
123
- project : Project ;
124
- } ;
125
-
126
119
/**
127
120
* Open the edit ownership modal within issue details
128
121
*/
@@ -135,6 +128,13 @@ export async function openIssueOwnershipRuleModal(
135
128
openModal ( deps => < Modal { ...deps } { ...options } /> , { modalCss} ) ;
136
129
}
137
130
131
+ export type EditOwnershipRulesModalOptions = {
132
+ onSave : ( ownership : IssueOwnership ) => void ;
133
+ organization : Organization ;
134
+ ownership : IssueOwnership ;
135
+ project : Project ;
136
+ } ;
137
+
138
138
export async function openEditOwnershipRules ( options : EditOwnershipRulesModalOptions ) {
139
139
const mod = await import ( 'sentry/components/modals/editOwnershipRulesModal' ) ;
140
140
const { default : Modal , modalCss} = mod ;
Original file line number Diff line number Diff line change 1
1
import { Fragment } from 'react' ;
2
2
import type { RouteComponentProps } from 'react-router' ;
3
3
4
- import { openEditOwnershipRules , openModal } from 'sentry/actionCreators/modal' ;
4
+ import { closeModal , openEditOwnershipRules , openModal } from 'sentry/actionCreators/modal' ;
5
5
import Access , { hasEveryAccess } from 'sentry/components/acl/access' ;
6
6
import { Button } from 'sentry/components/button' ;
7
7
import ButtonBar from 'sentry/components/buttonBar' ;
@@ -76,17 +76,12 @@ url:http://example.com/settings/* #product
76
76
tags.sku_class:enterprise #enterprise` ;
77
77
}
78
78
79
- handleOwnershipSave = ( text : string | null ) => {
79
+ handleOwnershipSave = ( ownership : IssueOwnership ) => {
80
80
this . setState ( prevState => ( {
81
- ...( prevState . ownership
82
- ? {
83
- ownership : {
84
- ...prevState . ownership ,
85
- raw : text || '' ,
86
- } ,
87
- }
88
- : { } ) ,
81
+ ...prevState ,
82
+ ownership,
89
83
} ) ) ;
84
+ closeModal ( ) ;
90
85
} ;
91
86
92
87
handleCodeOwnerAdded = ( data : CodeOwner ) => {
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import TimeSince from 'sentry/components/timeSince';
13
13
import { t } from 'sentry/locale' ;
14
14
import MemberListStore from 'sentry/stores/memberListStore' ;
15
15
import ProjectsStore from 'sentry/stores/projectsStore' ;
16
- import type { Organization , Project , Team } from 'sentry/types' ;
16
+ import type { IssueOwnership , Organization , Project , Team } from 'sentry/types' ;
17
17
import { defined } from 'sentry/utils' ;
18
18
import { trackIntegrationAnalytics } from 'sentry/utils/integrationUtil' ;
19
19
@@ -33,7 +33,7 @@ type Props = {
33
33
*/
34
34
page : 'issue_details' | 'project_settings' ;
35
35
project : Project ;
36
- onSave ?: ( text : string | null ) => void ;
36
+ onSave ?: ( ownership : IssueOwnership ) => void ;
37
37
} & typeof defaultProps ;
38
38
39
39
type State = {
@@ -82,14 +82,14 @@ class OwnerInput extends Component<Props, State> {
82
82
) ;
83
83
84
84
request
85
- . then ( ( ) => {
85
+ . then ( ownership => {
86
86
addSuccessMessage ( t ( 'Updated issue ownership rules' ) ) ;
87
87
this . setState (
88
88
{
89
89
hasChanges : false ,
90
90
text,
91
91
} ,
92
- ( ) => onSave ?.( text )
92
+ ( ) => onSave ?.( ownership )
93
93
) ;
94
94
trackIntegrationAnalytics ( 'project_ownership.saved' , {
95
95
page,
You can’t perform that action at this time.
0 commit comments