mirror of
https://github.com/harness/drone.git
synced 2025-05-05 15:32:56 +00:00
fix: [CODE-3363] backfill author data in filter on reload and navigating back to PR listing page (#3595)
* fix: [CODE-3363] lint * fix: [CODE-3363] use identifer to re-render * fix: [CODE-3363] backfill author data in filter on reload and navigating back to PR listing page
This commit is contained in:
parent
d79d292d87
commit
1ffe29d15a
@ -504,10 +504,10 @@ repoEmptyMarkdownExisting: |
|
|||||||
webhookEmpty: There are no webhooks in your repo. Click the button below to create a webhook.
|
webhookEmpty: There are no webhooks in your repo. Click the button below to create a webhook.
|
||||||
compareEmptyDiffTitle: There isn't anything to compare
|
compareEmptyDiffTitle: There isn't anything to compare
|
||||||
compareEmptyDiffMessage: Two branches are identical.
|
compareEmptyDiffMessage: Two branches are identical.
|
||||||
noCommits: There is no commits
|
noCommits: There are no commits
|
||||||
noCommitsMessage: This repository does not have any commits yet.
|
noCommitsMessage: This repository does not have any commits yet.
|
||||||
noCommitsPR: This Pull Request does not have commit history.
|
noCommitsPR: This Pull Request does not have commit history.
|
||||||
noChanges: There is no changes
|
noChanges: There are no changes
|
||||||
noChangesPR: This Pull Request does not have any changes.
|
noChangesPR: This Pull Request does not have any changes.
|
||||||
noChangesCompare: Source and target are identical.
|
noChangesCompare: Source and target are identical.
|
||||||
pageLoading: Loading, please wait...
|
pageLoading: Loading, please wait...
|
||||||
|
@ -96,7 +96,15 @@ export function PRAuthorFilter({
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
const authors = [...fetchedAuthors, ...(activePullRequestAuthorObj ? [activePullRequestAuthorObj] : [])]
|
const authors = [...fetchedAuthors]
|
||||||
|
if (activePullRequestAuthorObj?.id) {
|
||||||
|
// Only add activePullRequestAuthorObj if it exists and isn't already in the list
|
||||||
|
const isDuplicate = fetchedAuthors.some(author => author.id === activePullRequestAuthorObj.id)
|
||||||
|
|
||||||
|
if (!isDuplicate) {
|
||||||
|
authors.push(activePullRequestAuthorObj)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const authorsList = await moveCurrentUserToTop(authors, currentUser, query)
|
const authorsList = await moveCurrentUserToTop(authors, currentUser, query)
|
||||||
|
|
||||||
@ -118,6 +126,7 @@ export function PRAuthorFilter({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<DropDown
|
<DropDown
|
||||||
|
key={activePullRequestAuthorObj?.id}
|
||||||
value={authorFilterOption}
|
value={authorFilterOption}
|
||||||
items={() => getAuthorsPromise()}
|
items={() => getAuthorsPromise()}
|
||||||
disabled={loadingAuthors}
|
disabled={loadingAuthors}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user