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

Refactor components to use navigation utility hook for student details view #6054

Conversation

Abishekcs
Copy link
Contributor

@Abishekcs Abishekcs commented Dec 8, 2024

closes #6045

What this PR does

This pull request introduces the usage of the useNavigationsUtils hook in multiple components to enable navigation to the student details view. The hook provides the openStudentDetailsView function, which constructs the URL for the single student view page within a course page and navigates to it.

Screenshots

Before:

Before.mp4

After:

2024-12-08.11-42-17.After.mp4

Open questions and concerns

Additionally, the ReviewerLink component, which is supposed to navigate to user profile pages (/users/USERNAME), does not seem to be used anywhere in the codebase (though I’m not 100% sure). However, based on a search through the code, the only place it's mentioned is within the AssignmentsLinks component, where it is currently commented out, as shown below:

// const reviewers = <ReviewerLink key={reviewers-${id}} reviewers={assignment.reviewers} />;

@Abishekcs Abishekcs changed the title Refactor/student view navigation course page Refactor components to use navigation utility hook for student details view Dec 8, 2024
@ragesoss
Copy link
Member

Hmm... looks like you're correct about ReviewerLink. I think the implementation changed as it was being worked on initially, and GroupMembersLink does what that was initially designed to do. Feel free to open a PR removing that commented-out code along with the unused component.

This implementation of the utility hook looks reasonable. I'll test it out soon.

@ragesoss
Copy link
Member

Is it possible to make them behave more like links, with cursor changing upon mouseover, and ideally displaying the target URL as well, like a browser does with conventional links?

@Abishekcs
Copy link
Contributor Author

Is it possible to make them behave more like links, with cursor changing upon mouseover, and ideally displaying the target URL as well, like a browser does with conventional links?

I believe it will be possible, I will give it a try.😄

@Abishekcs
Copy link
Contributor Author

Abishekcs commented Dec 17, 2024

image

test.mp4

I tried this approach as shown in the screenshot by using the href (just to show the link), and it works. However, with the student/editor table, it won't be possible since those are td tags."

Wrapping each child of the td tags (table data) with an anchor tag will work, but that will leave the tr tag (table row) without a clickable link (where as the current implementation has tr as clickable link ).

@ragesoss
Copy link
Member

Okay. I guess this is a broader issue with how we use the td tags.

@ragesoss ragesoss merged commit d0b9ec4 into WikiEducationFoundation:master Dec 17, 2024
1 check passed
@Abishekcs Abishekcs deleted the refactor/student-view-navigation-course-page branch December 17, 2024 17:35
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.

Refactor common logic for navigating to the single-student view within a Course page
2 participants