Skip to content
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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

zhangvi7
Copy link
Contributor

@zhangvi7 zhangvi7 commented Feb 13, 2025

  • Add execution access to all reviewers
  • Request reason min length
  • Reviewers list is now avatar list
  • Updated styling to be more compact
  • Added review pagination

Before
Screenshot 2025-02-13 at 9 11 14 PM

After
image

@zhangvi7 zhangvi7 marked this pull request as ready for review February 14, 2025 02:08
@zhangvi7 zhangvi7 changed the title [Peer Review] UI Polish [Peer Review] Review Panel UI Polish Feb 14, 2025
Comment on lines 36 to 45
# 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,
)
Copy link
Collaborator

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

Comment on lines 78 to 79
50,
'Please provide a detailed justification (minimum 50 characters)'
Copy link
Collaborator

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)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

import { capitalize } from 'lodash';

Comment on lines 138 to 139
const visibleReviewers = review.reviewer_ids.slice(0, 3);
const extraReviewers = Math.max(0, review.reviewer_ids.length - 3);
Copy link
Collaborator

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

Comment on lines 46 to 64
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
);
Copy link
Collaborator

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

Comment on lines 33 to 36
myReviewsPage: number;
myReviewsHasMore: boolean;
assignedReviewsPage: number;
assignedReviewsHasMore: boolean;
Copy link
Collaborator

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

Comment on lines 5 to 15
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,
}),
Copy link
Collaborator

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>/

@zhangvi7 zhangvi7 requested a review from czgu February 18, 2025 22:01
size={12}
className="mr4"
/>
{capitalize(review.status.charAt(0)) + review.status.slice(1)}
Copy link
Collaborator

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(
Copy link
Collaborator

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',
Copy link
Collaborator

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

Comment on lines +51 to +53
type: isMyReviews
? FETCH_MY_REVIEWS_FAILURE
: FETCH_ASSIGNED_REVIEWS_FAILURE,
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants