Skip to content

Commit dca28e6

Browse files
committed
typescriptifying old changes
1 parent f285bc9 commit dca28e6

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

webapp/src/reducers/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ function sidebarContent(state = {
107107
}
108108
}
109109

110+
function mentionDetails(state: PrsDetailsData[] = [], action: {type: string, data: PrsDetailsData[]}) {
111+
switch (action.type) {
112+
case ActionTypes.RECEIVED_YOUR_PRS_DETAILS:
113+
return action.data;
114+
default:
115+
return state;
116+
}
117+
}
118+
110119
function yourRepos(state: YourReposData[] = [], action: {type: string, data: YourReposData[]}) {
111120
switch (action.type) {
112121
case ActionTypes.RECEIVED_REPOSITORIES:
@@ -224,6 +233,7 @@ export default combineReducers({
224233
configuration,
225234
clientId,
226235
reviewDetails,
236+
mentionDetails,
227237
yourRepos,
228238
yourPrDetails,
229239
mentions,

webapp/src/selectors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export const getSidebarData = createSelector(
5555
const {username, mentionDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState;
5656
return {
5757
username,
58-
mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionsDetails),
58+
mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionDetails),
5959
reviews: mapPrsToDetails(sidebarContent.reviews || emptyArray, reviewDetails),
6060
yourPrs: mapPrsToDetails(sidebarContent.prs || emptyArray, yourPrDetails),
6161
yourAssignments: sidebarContent.assignments || emptyArray,

webapp/src/types/github_types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export type UnreadsData = {
9393
}
9494

9595
export type SidebarContentData = {
96+
mentions: GithubIssueData[];
9697
prs: GithubIssueData[];
9798
reviews: GithubIssueData[];
9899
assignments: GithubIssueData[];
@@ -132,6 +133,7 @@ export type APIError = {
132133

133134
export type SidebarData = {
134135
username: string;
136+
mentions: GithubIssueData[];
135137
reviews: GithubIssueData[];
136138
yourPrs: GithubIssueData[];
137139
yourAssignments: GithubIssueData[],

0 commit comments

Comments
 (0)