Skip to content

Commit ef4756b

Browse files
chinesedfanmachour
authored andcommitted
fix(issue): Fix requested review to a team (#722)
1 parent d0fc33c commit ef4756b

File tree

2 files changed

+32
-44
lines changed

2 files changed

+32
-44
lines changed

src/components/issue-event-list-item.component.js

Lines changed: 22 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ const BoldText = styled.Text`
8585

8686
export class IssueEventListItem extends Component {
8787
props: {
88+
repository: Object,
8889
event: Object,
8990
navigation: Object,
9091
};
@@ -94,7 +95,7 @@ export class IssueEventListItem extends Component {
9495
};
9596

9697
render() {
97-
const { event } = this.props;
98+
const { repository, event } = this.props;
9899

99100
switch (event.event) {
100101
case 'review_requested':
@@ -108,10 +109,17 @@ export class IssueEventListItem extends Component {
108109
onPress={this.onPressUser}
109110
/>{' '}
110111
requested review from{' '}
111-
<ActorLink
112-
actor={event.requested_reviewer}
113-
onPress={this.onPressUser}
114-
/>
112+
{!!event.requested_reviewer && (
113+
<ActorLink
114+
actor={event.requested_reviewer}
115+
onPress={this.onPressUser}
116+
/>
117+
)}
118+
{!!event.requested_team && (
119+
<BoldText>
120+
{repository.owner.login}/{event.requested_team.name}
121+
</BoldText>
122+
)}
115123
</Text>
116124
}
117125
createdAt={event.created_at}
@@ -145,10 +153,7 @@ export class IssueEventListItem extends Component {
145153
iconBackgroundColor={colors.darkerRed}
146154
text={
147155
<Text>
148-
<ActorLink
149-
actor={event.actor}
150-
onPress={this.onPressUser}
151-
/>{' '}
156+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
152157
closed this
153158
</Text>
154159
}
@@ -163,10 +168,7 @@ export class IssueEventListItem extends Component {
163168
iconColor={colors.white}
164169
text={
165170
<Text>
166-
<ActorLink
167-
actor={event.actor}
168-
onPress={this.onPressUser}
169-
/>{' '}
171+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
170172
reopened this
171173
</Text>
172174
}
@@ -181,10 +183,7 @@ export class IssueEventListItem extends Component {
181183
iconBackgroundColor={colors.purple}
182184
text={
183185
<Text>
184-
<ActorLink
185-
actor={event.actor}
186-
onPress={this.onPressUser}
187-
/>{' '}
186+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
188187
merged <Bold>{event.commit_id.slice(0, 7)}</Bold>
189188
</Text>
190189
}
@@ -198,10 +197,7 @@ export class IssueEventListItem extends Component {
198197
iconName="pencil"
199198
text={
200199
<Text>
201-
<ActorLink
202-
actor={event.actor}
203-
onPress={this.onPressUser}
204-
/>{' '}
200+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
205201
changed the title from <Bold>{event.rename.from.trim()}</Bold>{' '}
206202
to <Bold>{event.rename.to.trim()}</Bold>
207203
</Text>
@@ -216,10 +212,7 @@ export class IssueEventListItem extends Component {
216212
iconName="person"
217213
text={
218214
<Text>
219-
<ActorLink
220-
actor={event.assigner}
221-
onPress={this.onPressUser}
222-
/>{' '}
215+
<ActorLink actor={event.assigner} onPress={this.onPressUser} />{' '}
223216
{event.event}{' '}
224217
<ActorLink actor={event.assignee} onPress={this.onPressUser} />
225218
</Text>
@@ -241,10 +234,7 @@ export class IssueEventListItem extends Component {
241234
iconName="milestone"
242235
text={
243236
<Text>
244-
<ActorLink
245-
actor={event.actor}
246-
onPress={this.onPressUser}
247-
/>{' '}
237+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
248238
{milestoneAction} the <Bold>{event.milestone.title}</Bold>{' '}
249239
milestone
250240
</Text>
@@ -262,10 +252,7 @@ export class IssueEventListItem extends Component {
262252
iconBackgroundColor="black"
263253
text={
264254
<Text>
265-
<ActorLink
266-
actor={event.actor}
267-
onPress={this.onPressUser}
268-
/>{' '}
255+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
269256
{event.event} this conversation
270257
</Text>
271258
}
@@ -284,10 +271,7 @@ export class IssueEventListItem extends Component {
284271
iconBackgroundColor={isRestored ? undefined : colors.greyBlue}
285272
text={
286273
<Text>
287-
<ActorLink
288-
actor={event.actor}
289-
onPress={this.onPressUser}
290-
/>{' '}
274+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
291275
{headRefAction} this branch
292276
</Text>
293277
}
@@ -304,10 +288,7 @@ export class IssueEventListItem extends Component {
304288
iconBackgroundColor={colors.greyBlue}
305289
text={
306290
<Text>
307-
<ActorLink
308-
actor={event.actor}
309-
onPress={this.onPressUser}
310-
/>{' '}
291+
<ActorLink actor={event.actor} onPress={this.onPressUser} />{' '}
311292
marked this as{' '}
312293
{event.event === 'unmarked_as_duplicate' ? 'not ' : ''}a
313294
duplicate

src/issue/screens/issue.screen.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ class Issue extends Component {
9393
navigate('IssueSettings', {
9494
title: translate('issue.settings.title', state.params.locale),
9595
issue: state.params.issue,
96-
})}
96+
})
97+
}
9798
/>
9899
);
99100
}
@@ -314,14 +315,20 @@ class Issue extends Component {
314315
};
315316

316317
renderItem = ({ item }) => {
317-
const { locale, navigation } = this.props;
318+
const { repository, locale, navigation } = this.props;
318319

319320
if (item.header) {
320321
return this.renderHeader();
321322
}
322323

323324
if (item.event) {
324-
return <IssueEventListItem event={item} navigation={navigation} />;
325+
return (
326+
<IssueEventListItem
327+
repository={repository}
328+
event={item}
329+
navigation={navigation}
330+
/>
331+
);
325332
}
326333

327334
return (

0 commit comments

Comments
 (0)