Skip to content
Snippets Groups Projects
Commit 894e2a46 authored by Mihail Hagiu's avatar Mihail Hagiu
Browse files

fix: ReviewersTableVersions

Using lodash get function for isLatestVersion
parent a8c2a373
No related branches found
No related tags found
2 merge requests!136Sprint 22 features (updates),!127Hin 1082
...@@ -104,14 +104,15 @@ const ReviewerDetails = ({ ...@@ -104,14 +104,15 @@ const ReviewerDetails = ({
/> />
</Fragment> </Fragment>
)} )}
{selectedTab === 2 && ( {selectedTab === 2 &&
<PublonsTable isLatestVersion && (
onInvite={onInvitePublonReviewer} <PublonsTable
publonsError={fetchingError} onInvite={onInvitePublonReviewer}
publonsFetching={isFetching} publonsError={fetchingError}
reviewers={publonReviewers} publonsFetching={isFetching}
/> reviewers={publonReviewers}
)} />
)}
{selectedTab === 1 && ( {selectedTab === 1 && (
<Fragment> <Fragment>
{reports.length === 0 && ( {reports.length === 0 && (
......
...@@ -96,8 +96,11 @@ export const parseVersionOptions = (fragments = []) => ...@@ -96,8 +96,11 @@ export const parseVersionOptions = (fragments = []) =>
})) }))
.reverse() .reverse()
export const isLatestVersion = (collection, fragment) => export const isLatestVersion = (collection, fragment) => {
collection.fragments.indexOf(fragment.id) === collection.fragments.length - 1 const fragments = get(collection, 'fragments', [])
const id = get(fragment, 'id', '')
return fragments.indexOf(id) === fragments.length - 1
}
const alreadyAnswered = `You have already answered this invitation.` const alreadyAnswered = `You have already answered this invitation.`
export const redirectToError = redirectFn => err => { export const redirectToError = redirectFn => err => {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment