-
Notifications
You must be signed in to change notification settings - Fork 14
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
Create common components to represent dashboard activity pages #6291
Conversation
13d2da5
to
1672dd2
Compare
9150c5e
to
7d3abd6
Compare
aa44c92
to
093157c
Compare
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
093157c
to
7442f4f
Compare
7442f4f
to
ed63b68
Compare
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.
This generally looks good. Just some minor comments.
<CardHeader fullWidth> | ||
<CardTitle tagName="h2"> | ||
<span data-testid="title"> | ||
{course.isLoading && 'Loading...'} |
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.
Unrelated to the changes in this PR, when transitioning from a course to an assignment, we already know the assignment title so we could use that as the initial value until we get the "latest" value back from the API.
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.
Yep, we should do that.
I have been lately thinking on how we can better handle transitions between routes, and then combine that with a global loading state/splash screen for the initial load. I'll be creating some POC soon.
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Show resolved
Hide resolved
>((acc, columnName) => { | ||
// All stat columns should be ordered in descending order first | ||
acc[columnName] = | ||
typeof columnName === 'string' && statsColumns.includes(columnName) |
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.
What is the typeof
for here?
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.
columnName
has type keyof T
, which translates into string | number | symbol
.
Without the check for string type, TypeScript complains when passed to Array<string>.includes()
.
This is related to the discussion here https://hypothes-is.slack.com/archives/C1M8NH76X/p1716819580379869, but I skipped this part from the conversation because it was easy to solve.
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/StudentsActivity.tsx
Outdated
Show resolved
Hide resolved
ed63b68
to
0508acc
Compare
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.
LGTM. Just a couple of notes about comments.
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/OrderableActivityTable.tsx
Outdated
Show resolved
Hide resolved
lms/static/scripts/frontend_apps/components/dashboard/test/OrderableActivityTable-test.js
Outdated
Show resolved
Hide resolved
0508acc
to
65f5ea4
Compare
Depends on #6285
Create a common
OrderableActivityTable
component to render activity tables in the dashboard pages. This allows to:Additionally, this PR makes these other changes:
CardHeader
+CardTitle
instead of ah2
inside theCardContent
itself. This title will potentially be removed replaced by a breadcrumb, but that requires a bit of experimentation.