-
Notifications
You must be signed in to change notification settings - Fork 250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Peer Review] Review Panel UI Polish #1539
base: master
Are you sure you want to change the base?
Conversation
# Add reviewer as viewer | ||
QueryExecutionViewer.create( | ||
fields={ | ||
"query_execution_id": query_execution_id, | ||
"uid": reviewer_id, | ||
"created_by": query_execution.uid, # Original query review creator | ||
}, | ||
commit=False, | ||
session=session, | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check if reviewer has access to the query before assigning them. they might have gotten access if they are already invited to the data doc
50, | ||
'Please provide a detailed justification (minimum 50 characters)' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
10 chars is probably fine?
size={12} | ||
className="mr4" | ||
/> | ||
{review.status.charAt(0).toUpperCase() + review.status.slice(1)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { capitalize } from 'lodash';
const visibleReviewers = review.reviewer_ids.slice(0, 3); | ||
const extraReviewers = Math.max(0, review.reviewer_ids.length - 3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do this inside MetaInfo, these arent passed other places
also useMemo to prevent a new array generated per render cycle
querybook/webapp/components/QueryReviewsNavigator/QueryReviewsNavigator.tsx
Show resolved
Hide resolved
export const selectMyReviewsPage = createSelector( | ||
selectQueryReviewState, | ||
(queryReview) => queryReview.myReviewsPage | ||
); | ||
|
||
export const selectAssignedReviewsPage = createSelector( | ||
selectQueryReviewState, | ||
(queryReview) => queryReview.assignedReviewsPage | ||
); | ||
|
||
export const selectMyReviewsHasMore = createSelector( | ||
selectQueryReviewState, | ||
(queryReview) => queryReview.myReviewsHasMore | ||
); | ||
|
||
export const selectAssignedReviewsHasMore = createSelector( | ||
selectQueryReviewState, | ||
(queryReview) => queryReview.assignedReviewsHasMore | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no point of these selectors given there is no further computation needed. Use state.queryReview.assignedReviewsHasMore directly in code
myReviewsPage: number; | ||
myReviewsHasMore: boolean; | ||
assignedReviewsPage: number; | ||
assignedReviewsHasMore: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure if this scalable, also we are resetting when tabs are changed anyway, its fine we just have page and hasMore
getReviewsCreatedByMe: (limit: number, offset: number) => | ||
ds.fetch<IQueryReview[]>('/query_review/created_by_me/', { | ||
limit, | ||
offset, | ||
}), | ||
|
||
getReviewsAssignedToMe: () => | ||
ds.fetch<IQueryReview[]>('/query_review/assigned_to_me/'), | ||
getReviewsAssignedToMe: (limit: number, offset: number) => | ||
ds.fetch<IQueryReview[]>('/query_review/assigned_to_me/', { | ||
limit, | ||
offset, | ||
}), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have 2 routes that does the same thing? let's use a generic route /query_review/<review_type>/
size={12} | ||
className="mr4" | ||
/> | ||
{capitalize(review.status.charAt(0)) + review.status.slice(1)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
capitalize(review.status)
try { | ||
dispatch({ type: FETCH_MY_REVIEWS_REQUEST }); | ||
const reviews = await QueryReviewResource.getReviewsCreatedByMe(); | ||
const reviews = await QueryReviewResource.getReviews( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need fetchMyReviews and fetchAssignedReviews, it can be the same function with a parameter of ReviewType
|
||
type TabType = 'myReviews' | 'assigned'; | ||
|
||
const NAVIGATOR_TABS = [ | ||
{ | ||
key: 'myReviews' as TabType, | ||
name: 'Pending Reviews', | ||
name: 'Created', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets make the naming more consistent, right now we have myReviews and Created mixed together (ReviewType is using CREATED instead of myReviews), let's just stick to one
type: isMyReviews | ||
? FETCH_MY_REVIEWS_FAILURE | ||
: FETCH_ASSIGNED_REVIEWS_FAILURE, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not forward ReviewType for all of these cases?
Before

After
