From ced32f5e7d11fc37785a9584132598659bb2cf3d Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Wed, 17 Apr 2024 19:45:15 -0700 Subject: [PATCH 01/10] adding mentions to sidebar --- webapp/src/components/sidebar_buttons/index.js | 1 + .../sidebar_buttons/sidebar_buttons.jsx | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/webapp/src/components/sidebar_buttons/index.js b/webapp/src/components/sidebar_buttons/index.js index 6ecc4aebb..88dc774d6 100644 --- a/webapp/src/components/sidebar_buttons/index.js +++ b/webapp/src/components/sidebar_buttons/index.js @@ -15,6 +15,7 @@ function mapStateToProps(state) { return { connected: state[`plugins-${pluginId}`].connected, clientId: state[`plugins-${pluginId}`].clientId, + mentions: state[`plugins-${pluginId}`].sidebarContent.mentions, reviews: state[`plugins-${pluginId}`].sidebarContent.reviews, yourPrs: state[`plugins-${pluginId}`].sidebarContent.prs, yourAssignments: state[`plugins-${pluginId}`].sidebarContent.assignments, diff --git a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx index 63d1d5c8b..04282fcef 100644 --- a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx +++ b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx @@ -14,6 +14,7 @@ export default class SidebarButtons extends React.PureComponent { connected: PropTypes.bool, clientId: PropTypes.string, enterpriseURL: PropTypes.string, + mentions: PropTypes.arrayOf(PropTypes.object), reviews: PropTypes.arrayOf(PropTypes.object), unreads: PropTypes.arrayOf(PropTypes.object), yourPrs: PropTypes.arrayOf(PropTypes.object), @@ -117,6 +118,7 @@ export default class SidebarButtons extends React.PureComponent { return null; } + const mentions = this.props.mentions || []; const reviews = this.props.reviews || []; const yourPrs = this.props.yourPrs || []; const unreads = this.props.unreads || []; @@ -152,6 +154,21 @@ export default class SidebarButtons extends React.PureComponent { {' ' + yourPrs.length} + + {'Mentions on Pull Requests'}} + > + this.openRHS(RHSStates.MENTIONS)} + style={button} + > + + {' ' + mentions.length} + + + Date: Thu, 2 May 2024 17:19:14 -0700 Subject: [PATCH 02/10] added mentions to sidebar --- server/plugin/api.go | 14 ++++++--- server/plugin/graphql/lhs_query.go | 9 ++++++ server/plugin/graphql/lhs_request.go | 31 +++++++++++++++---- webapp/src/components/sidebar_right/index.jsx | 3 +- .../sidebar_right/sidebar_right.jsx | 10 +++++- webapp/src/constants/index.js | 1 + webapp/src/reducers/index.js | 1 + webapp/src/selectors.js | 3 +- 8 files changed, 58 insertions(+), 14 deletions(-) diff --git a/server/plugin/api.go b/server/plugin/api.go index 36222f23a..bf4553ef1 100644 --- a/server/plugin/api.go +++ b/server/plugin/api.go @@ -66,6 +66,7 @@ type SidebarContent struct { PRs []*github.Issue `json:"prs"` Reviews []*github.Issue `json:"reviews"` Assignments []*github.Issue `json:"assignments"` + Mentions []*github.Issue `json:"mentions"` Unreads []*FilteredNotification `json:"unreads"` } @@ -938,27 +939,30 @@ func (p *Plugin) createIssueComment(c *UserContext, w http.ResponseWriter, r *ht p.writeJSON(w, result) } -func (p *Plugin) getLHSData(c *UserContext) (reviewResp []*github.Issue, assignmentResp []*github.Issue, openPRResp []*github.Issue, err error) { +func (p *Plugin) getLHSData(c *UserContext) (reviewResp []*github.Issue, assignmentResp []*github.Issue, openPRResp []*github.Issue, mentionsResp []*github.Issue, err error) { graphQLClient := p.graphQLConnect(c.GHInfo) - reviewResp, assignmentResp, openPRResp, err = graphQLClient.GetLHSData(c.Context.Ctx) + reviewResp, assignmentResp, openPRResp, mentionsResp, err = graphQLClient.GetLHSData(c.Context.Ctx) if err != nil { - return []*github.Issue{}, []*github.Issue{}, []*github.Issue{}, err + return []*github.Issue{}, []*github.Issue{}, []*github.Issue{}, []*github.Issue{}, err } - return reviewResp, assignmentResp, openPRResp, nil + return reviewResp, assignmentResp, openPRResp, mentionsResp, nil } func (p *Plugin) getSidebarData(c *UserContext) (*SidebarContent, error) { - reviewResp, assignmentResp, openPRResp, err := p.getLHSData(c) + reviewResp, assignmentResp, openPRResp, mentionsResp, err := p.getLHSData(c) if err != nil { return nil, err } + fmt.Println(len(mentionsResp)) + return &SidebarContent{ PRs: openPRResp, Assignments: assignmentResp, Reviews: reviewResp, + Mentions: mentionsResp, Unreads: p.getUnreadsData(c), }, nil } diff --git a/server/plugin/graphql/lhs_query.go b/server/plugin/graphql/lhs_query.go index 3de215e0a..7b6f06f86 100644 --- a/server/plugin/graphql/lhs_query.go +++ b/server/plugin/graphql/lhs_query.go @@ -111,4 +111,13 @@ var mainQuery struct { HasNextPage bool } } `graphql:"graphql: search(first:100, after:$openPrsCursor, query: $prOpenQueryArg, type: ISSUE)"` + + Mentions struct { + IssueCount int + Nodes []prSearchNodes + PageInfo struct { + EndCursor githubv4.String + HasNextPage bool + } + } `graphql:"mentions: search(first:100, after:$mentionsCursor, query: $prMentionsQueryArg, type: ISSUE)"` } diff --git a/server/plugin/graphql/lhs_request.go b/server/plugin/graphql/lhs_request.go index 286098609..2c9e688d6 100644 --- a/server/plugin/graphql/lhs_request.go +++ b/server/plugin/graphql/lhs_request.go @@ -13,38 +13,57 @@ const ( queryParamReviewsCursor = "reviewsCursor" queryParamAssignmentsCursor = "assignmentsCursor" queryParamOpenPRsCursor = "openPrsCursor" + queryParamMentionsCursor = "mentionsCursor" queryParamOpenPRQueryArg = "prOpenQueryArg" queryParamReviewPRQueryArg = "prReviewQueryArg" queryParamAssigneeQueryArg = "assigneeQueryArg" + queryParamMentionsQueryArg = "prMentionsQueryArg" ) -func (c *Client) GetLHSData(ctx context.Context) ([]*github.Issue, []*github.Issue, []*github.Issue, error) { +func (c *Client) GetLHSData(ctx context.Context) ([]*github.Issue, []*github.Issue, []*github.Issue, []*github.Issue, error) { params := map[string]interface{}{ queryParamOpenPRQueryArg: githubv4.String(fmt.Sprintf("author:%s is:pr is:%s archived:false", c.username, githubv4.PullRequestStateOpen)), queryParamReviewPRQueryArg: githubv4.String(fmt.Sprintf("review-requested:%s is:pr is:%s archived:false", c.username, githubv4.PullRequestStateOpen)), queryParamAssigneeQueryArg: githubv4.String(fmt.Sprintf("assignee:%s is:%s archived:false", c.username, githubv4.PullRequestStateOpen)), + queryParamMentionsQueryArg: githubv4.String(fmt.Sprintf("mentions:%s is:%s is:pr archived:false", c.username, githubv4.PullRequestStateOpen)), queryParamReviewsCursor: (*githubv4.String)(nil), queryParamAssignmentsCursor: (*githubv4.String)(nil), queryParamOpenPRsCursor: (*githubv4.String)(nil), + queryParamMentionsCursor: (*githubv4.String)(nil), } if c.org != "" { params[queryParamOpenPRQueryArg] = githubv4.String(fmt.Sprintf("org:%s %s", c.org, params[queryParamOpenPRQueryArg])) params[queryParamReviewPRQueryArg] = githubv4.String(fmt.Sprintf("org:%s %s", c.org, params[queryParamReviewPRQueryArg])) params[queryParamAssigneeQueryArg] = githubv4.String(fmt.Sprintf("org:%s %s", c.org, params[queryParamAssigneeQueryArg])) + params[queryParamMentionsQueryArg] = githubv4.String(fmt.Sprintf("org:%s %s", c.org, params[queryParamMentionsQueryArg])) } - var resultReview, resultAssignee, resultOpenPR []*github.Issue - allReviewRequestsFetched, allAssignmentsFetched, allOpenPRsFetched := false, false, false + var resultReview, resultAssignee, resultOpenPR, resultMentions []*github.Issue + allReviewRequestsFetched, allAssignmentsFetched, allOpenPRsFetched, allMentionsFetched := false, false, false, false for { - if allReviewRequestsFetched && allAssignmentsFetched && allOpenPRsFetched { + if allReviewRequestsFetched && allAssignmentsFetched && allOpenPRsFetched && allMentionsFetched { break } if err := c.executeQuery(ctx, &mainQuery, params); err != nil { - return nil, nil, nil, errors.Wrap(err, "Not able to excute the query") + return nil, nil, nil, nil, errors.Wrap(err, "Not able to excute the query") + } + + if !allMentionsFetched { + for i := range mainQuery.Mentions.Nodes { + resp := mainQuery.Mentions.Nodes[i] + pr := getPR(&resp) + resultMentions = append(resultMentions, pr) + } + + if !mainQuery.Mentions.PageInfo.HasNextPage { + allMentionsFetched = true + } + + params[queryParamMentionsCursor] = githubv4.NewString(mainQuery.Mentions.PageInfo.EndCursor) } if !allReviewRequestsFetched { @@ -90,7 +109,7 @@ func (c *Client) GetLHSData(ctx context.Context) ([]*github.Issue, []*github.Iss } } - return resultReview, resultAssignee, resultOpenPR, nil + return resultReview, resultAssignee, resultOpenPR, resultMentions, nil } func getPR(prResp *prSearchNodes) *github.Issue { diff --git a/webapp/src/components/sidebar_right/index.jsx b/webapp/src/components/sidebar_right/index.jsx index f96a08a02..069421d34 100644 --- a/webapp/src/components/sidebar_right/index.jsx +++ b/webapp/src/components/sidebar_right/index.jsx @@ -11,11 +11,12 @@ import {getSidebarData} from 'src/selectors'; import SidebarRight from './sidebar_right.jsx'; function mapStateToProps(state) { - const {username, reviews, yourPrs, yourAssignments, unreads, enterpriseURL, org, rhsState} = getSidebarData(state); + const {username, mentions, reviews, yourPrs, yourAssignments, unreads, enterpriseURL, org, rhsState} = getSidebarData(state); return { username, reviews, yourPrs, + mentions, yourAssignments, unreads, enterpriseURL, diff --git a/webapp/src/components/sidebar_right/sidebar_right.jsx b/webapp/src/components/sidebar_right/sidebar_right.jsx index 71bb12191..5dcd54266 100644 --- a/webapp/src/components/sidebar_right/sidebar_right.jsx +++ b/webapp/src/components/sidebar_right/sidebar_right.jsx @@ -68,6 +68,7 @@ export default class SidebarRight extends React.PureComponent { username: PropTypes.string, org: PropTypes.string, enterpriseURL: PropTypes.string, + mentions: PropTypes.arrayOf(PropTypes.object), reviews: PropTypes.arrayOf(PropTypes.object), unreads: PropTypes.arrayOf(PropTypes.object), yourPrs: PropTypes.arrayOf(PropTypes.object), @@ -103,7 +104,7 @@ export default class SidebarRight extends React.PureComponent { render() { const baseURL = this.props.enterpriseURL ? this.props.enterpriseURL : 'https://github.com'; const orgQuery = this.props.org ? '+org%3A' + this.props.org : ''; - const {yourPrs, reviews, unreads, yourAssignments, username, rhsState} = this.props; + const {yourPrs, mentions, reviews, unreads, yourAssignments, username, rhsState} = this.props; let title = ''; let githubItems = []; @@ -116,6 +117,13 @@ export default class SidebarRight extends React.PureComponent { title = 'Your Open Pull Requests'; listUrl = baseURL + '/pulls?q=is%3Aopen+is%3Apr+author%3A' + username + '+archived%3Afalse' + orgQuery; + break; + case RHSStates.MENTIONS: + + githubItems = mentions; + title = 'Your mentions'; + listUrl = baseURL + '/pulls?q=is%3Aopen+is%3Apr+mentions%3A' + username + '+archived%3Afalse' + orgQuery; + break; case RHSStates.REVIEWS: diff --git a/webapp/src/constants/index.js b/webapp/src/constants/index.js index c51ee9128..8c3890d90 100644 --- a/webapp/src/constants/index.js +++ b/webapp/src/constants/index.js @@ -10,4 +10,5 @@ export const RHSStates = { REVIEWS: 'reviews', UNREADS: 'unreads', ASSIGNMENTS: 'assignments', + MENTIONS: 'mentions', }; diff --git a/webapp/src/reducers/index.js b/webapp/src/reducers/index.js index 39f8f29fa..21082c70f 100644 --- a/webapp/src/reducers/index.js +++ b/webapp/src/reducers/index.js @@ -91,6 +91,7 @@ const defaultSidebarContent = { prs: [], assignments: [], unreads: [], + mentions: [], }; function sidebarContent(state = defaultSidebarContent, action) { diff --git a/webapp/src/selectors.js b/webapp/src/selectors.js index d51e83987..4d2155b46 100644 --- a/webapp/src/selectors.js +++ b/webapp/src/selectors.js @@ -52,9 +52,10 @@ function mapPrsToDetails(prs, details) { export const getSidebarData = createSelector( getPluginState, (pluginState) => { - const {username, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; + const {username, mentionsDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; return { username, + mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionsDetails), reviews: mapPrsToDetails(sidebarContent.reviews || emptyArray, reviewDetails), yourPrs: mapPrsToDetails(sidebarContent.prs || emptyArray, yourPrDetails), yourAssignments: sidebarContent.assignments || emptyArray, From bb4668d50244cbdf236334e9f61b7cfdda381c0b Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Thu, 2 May 2024 17:33:08 -0700 Subject: [PATCH 03/10] fa icon change --- webapp/src/components/sidebar_buttons/sidebar_buttons.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx index 04282fcef..00292cae1 100644 --- a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx +++ b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx @@ -164,7 +164,7 @@ export default class SidebarButtons extends React.PureComponent { onClick={() => this.openRHS(RHSStates.MENTIONS)} style={button} > - + {' ' + mentions.length} From 65a7f6db1cd727b02a70b83e1533daedf318b6e8 Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Thu, 2 May 2024 17:55:06 -0700 Subject: [PATCH 04/10] remove some logging accidently left in --- server/plugin/api.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/server/plugin/api.go b/server/plugin/api.go index bf4553ef1..9b3723c1b 100644 --- a/server/plugin/api.go +++ b/server/plugin/api.go @@ -956,8 +956,6 @@ func (p *Plugin) getSidebarData(c *UserContext) (*SidebarContent, error) { return nil, err } - fmt.Println(len(mentionsResp)) - return &SidebarContent{ PRs: openPRResp, Assignments: assignmentResp, From d1d58cc38c8c053cfefc1e2e591e9256bbe5f5d4 Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Tue, 7 May 2024 18:39:12 -0700 Subject: [PATCH 05/10] remving mentions length and reordering icon --- .../sidebar_buttons/sidebar_buttons.jsx | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx index 00292cae1..1df9a3cc4 100644 --- a/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx +++ b/webapp/src/components/sidebar_buttons/sidebar_buttons.jsx @@ -118,7 +118,6 @@ export default class SidebarButtons extends React.PureComponent { return null; } - const mentions = this.props.mentions || []; const reviews = this.props.reviews || []; const yourPrs = this.props.yourPrs || []; const unreads = this.props.unreads || []; @@ -154,21 +153,6 @@ export default class SidebarButtons extends React.PureComponent { {' ' + yourPrs.length} - - {'Mentions on Pull Requests'}} - > - this.openRHS(RHSStates.MENTIONS)} - style={button} - > - - {' ' + mentions.length} - - - + {'Mentions on Pull Requests'}} + > + this.openRHS(RHSStates.MENTIONS)} + style={button} + > + + + Date: Wed, 8 May 2024 12:29:24 -0700 Subject: [PATCH 06/10] Update server/plugin/api.go Co-authored-by: Ayush Thakur <100013900+ayusht2810@users.noreply.github.com> --- server/plugin/api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/plugin/api.go b/server/plugin/api.go index 799857ec0..02b53c7ba 100644 --- a/server/plugin/api.go +++ b/server/plugin/api.go @@ -939,7 +939,7 @@ func (p *Plugin) createIssueComment(c *UserContext, w http.ResponseWriter, r *ht p.writeJSON(w, result) } -func (p *Plugin) getLHSData(c *UserContext) (reviewResp []*github.Issue, assignmentResp []*github.Issue, openPRResp []*github.Issue, mentionsResp []*github.Issue, err error) { +func (p *Plugin) getLHSData(c *UserContext) (reviewResp []*github.Issue, assignmentResp []*github.Issue, openPRResp []*github.Issue, mentionResp []*github.Issue, err error) { graphQLClient := p.graphQLConnect(c.GHInfo) reviewResp, assignmentResp, openPRResp, mentionsResp, err = graphQLClient.GetLHSData(c.Context.Ctx) From c76f1af212d3d7295b057bd3bac1d2038a7cab7f Mon Sep 17 00:00:00 2001 From: Cyrus <32754336+cyrusjc@users.noreply.github.com> Date: Wed, 8 May 2024 12:29:50 -0700 Subject: [PATCH 07/10] Update webapp/src/selectors.js consistency renaming Co-authored-by: Ayush Thakur <100013900+ayusht2810@users.noreply.github.com> --- webapp/src/selectors.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/src/selectors.js b/webapp/src/selectors.js index 4d2155b46..9fb12d0e3 100644 --- a/webapp/src/selectors.js +++ b/webapp/src/selectors.js @@ -52,7 +52,7 @@ function mapPrsToDetails(prs, details) { export const getSidebarData = createSelector( getPluginState, (pluginState) => { - const {username, mentionsDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; + const {username, mentionDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; return { username, mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionsDetails), From cf37212520b347eb6450f2847d176bbaa493fd98 Mon Sep 17 00:00:00 2001 From: Cyrus <32754336+cyrusjc@users.noreply.github.com> Date: Wed, 8 May 2024 12:30:03 -0700 Subject: [PATCH 08/10] Update server/plugin/graphql/lhs_request.go consistency renaming Co-authored-by: Ayush Thakur <100013900+ayusht2810@users.noreply.github.com> --- server/plugin/graphql/lhs_request.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/plugin/graphql/lhs_request.go b/server/plugin/graphql/lhs_request.go index 4d7844168..e137c03e9 100644 --- a/server/plugin/graphql/lhs_request.go +++ b/server/plugin/graphql/lhs_request.go @@ -40,7 +40,7 @@ func (c *Client) GetLHSData(ctx context.Context) ([]*github.Issue, []*github.Iss params[queryParamMentionsQueryArg] = githubv4.String(fmt.Sprintf("org:%s %s", c.org, params[queryParamMentionsQueryArg])) } - var resultReview, resultAssignee, resultOpenPR, resultMentions []*github.Issue + var resultReview, resultAssignee, resultOpenPR, resultMention []*github.Issue allReviewRequestsFetched, allAssignmentsFetched, allOpenPRsFetched, allMentionsFetched := false, false, false, false for { From dca28e6c18e700f64dd18e57fdacd941188c1f4b Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Tue, 14 May 2024 23:18:05 -0700 Subject: [PATCH 09/10] typescriptifying old changes --- webapp/src/reducers/index.ts | 10 ++++++++++ webapp/src/selectors.ts | 2 +- webapp/src/types/github_types.ts | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/webapp/src/reducers/index.ts b/webapp/src/reducers/index.ts index 6da684928..79a237c77 100644 --- a/webapp/src/reducers/index.ts +++ b/webapp/src/reducers/index.ts @@ -107,6 +107,15 @@ function sidebarContent(state = { } } +function mentionDetails(state: PrsDetailsData[] = [], action: {type: string, data: PrsDetailsData[]}) { + switch (action.type) { + case ActionTypes.RECEIVED_YOUR_PRS_DETAILS: + return action.data; + default: + return state; + } +} + function yourRepos(state: YourReposData[] = [], action: {type: string, data: YourReposData[]}) { switch (action.type) { case ActionTypes.RECEIVED_REPOSITORIES: @@ -224,6 +233,7 @@ export default combineReducers({ configuration, clientId, reviewDetails, + mentionDetails, yourRepos, yourPrDetails, mentions, diff --git a/webapp/src/selectors.ts b/webapp/src/selectors.ts index c7abab0f3..44b76d0df 100644 --- a/webapp/src/selectors.ts +++ b/webapp/src/selectors.ts @@ -55,7 +55,7 @@ export const getSidebarData = createSelector( const {username, mentionDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; return { username, - mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionsDetails), + mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionDetails), reviews: mapPrsToDetails(sidebarContent.reviews || emptyArray, reviewDetails), yourPrs: mapPrsToDetails(sidebarContent.prs || emptyArray, yourPrDetails), yourAssignments: sidebarContent.assignments || emptyArray, diff --git a/webapp/src/types/github_types.ts b/webapp/src/types/github_types.ts index 27aeb4941..52bcb0876 100644 --- a/webapp/src/types/github_types.ts +++ b/webapp/src/types/github_types.ts @@ -93,6 +93,7 @@ export type UnreadsData = { } export type SidebarContentData = { + mentions: GithubIssueData[]; prs: GithubIssueData[]; reviews: GithubIssueData[]; assignments: GithubIssueData[]; @@ -132,6 +133,7 @@ export type APIError = { export type SidebarData = { username: string; + mentions: GithubIssueData[]; reviews: GithubIssueData[]; yourPrs: GithubIssueData[]; yourAssignments: GithubIssueData[], From 64ffb6d3f6f6488afebe485d5796081f680c3752 Mon Sep 17 00:00:00 2001 From: Cyrus Cheung Date: Fri, 24 May 2024 01:53:09 -0700 Subject: [PATCH 10/10] removed reducer/selector for mentions --- webapp/src/reducers/index.ts | 10 ---------- webapp/src/selectors.ts | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/webapp/src/reducers/index.ts b/webapp/src/reducers/index.ts index 79a237c77..6da684928 100644 --- a/webapp/src/reducers/index.ts +++ b/webapp/src/reducers/index.ts @@ -107,15 +107,6 @@ function sidebarContent(state = { } } -function mentionDetails(state: PrsDetailsData[] = [], action: {type: string, data: PrsDetailsData[]}) { - switch (action.type) { - case ActionTypes.RECEIVED_YOUR_PRS_DETAILS: - return action.data; - default: - return state; - } -} - function yourRepos(state: YourReposData[] = [], action: {type: string, data: YourReposData[]}) { switch (action.type) { case ActionTypes.RECEIVED_REPOSITORIES: @@ -233,7 +224,6 @@ export default combineReducers({ configuration, clientId, reviewDetails, - mentionDetails, yourRepos, yourPrDetails, mentions, diff --git a/webapp/src/selectors.ts b/webapp/src/selectors.ts index 44b76d0df..7861709d8 100644 --- a/webapp/src/selectors.ts +++ b/webapp/src/selectors.ts @@ -52,10 +52,10 @@ export const getSidebarData = createSelector( getPluginState, (pluginState): SidebarData => { - const {username, mentionDetails, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; + const {username, sidebarContent, reviewDetails, yourPrDetails, organization, rhsState} = pluginState; return { username, - mentions: mapPrsToDetails(sidebarContent.mentions || emptyArray, mentionDetails), + mentions: sidebarContent.mentions || emptyArray, reviews: mapPrsToDetails(sidebarContent.reviews || emptyArray, reviewDetails), yourPrs: mapPrsToDetails(sidebarContent.prs || emptyArray, yourPrDetails), yourAssignments: sidebarContent.assignments || emptyArray,