-
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 dashboard organization home page #6325
Conversation
a6a05a9
to
3d3cf1b
Compare
const { organizationPublicId } = useParams<{ | ||
organizationPublicId: string; | ||
}>(); |
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.
useParams()
does not return matching params from parent routes when used inside a nested route, so we need to call this here to get the organization ID, and then pass it down as a regular prop to <OrganizationActivity />
.
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.
Maybe the parent route should just be /dashboard
, and we should add the /organizations/:organizationPublicId
in all routes here, but I think we can delay that decision for now..
3d3cf1b
to
92e7a4e
Compare
@@ -47,11 +52,11 @@ export default function AssignmentActivity() { | |||
/> | |||
</div> | |||
)} | |||
<h2 data-testid="title" className="text-lg text-brand font-semibold"> | |||
<CardTitle tagName="h2" data-testid="title"> |
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.
I moved away from CardTitle
on a previous PR, but it was actually not needed, so going back to it to have implicit styles.
f4b3df5
to
3499120
Compare
@@ -32,7 +30,7 @@ const descendingOrderColumns: readonly string[] = [ | |||
* Annotation activity table for dashboard views. Includes built-in support for | |||
* sorting columns. | |||
*/ | |||
export default function OrderableActivityTable<T extends BaseDashboardStats>({ |
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.
There was actually no reason for this restriction. Removing it allows for more flexibility when rendering orderable tables.
3499120
to
dd1e748
Compare
dd1e748
to
c6cf4f7
Compare
c6cf4f7
to
62a225e
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, with a recommendation regarding table headers. I suspect there will be opportunities to factor out more parts of the different views into shared components, but the best place to draw the line will become clearer when this app is developed a bit further.
import OrderableActivityTable from './OrderableActivityTable'; | ||
|
||
export type OrganizationActivityProps = { | ||
organizationPublicId: string; |
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 we ever receive anything other than the "public" ID for an organization in the frontend? If not, we could use the term organizationId
and make it always refer to the "public" ID.
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, I thought about that, but since the terminology is going to change to organization_public_id
in the backend to make sure it's not confused with the primary-key id, I thought it would be more clear to use the same terminology in the FE.
I don't have a strong opinion on this though. I think it will be clear enough regardless.
lms/static/scripts/frontend_apps/components/dashboard/OrganizationActivity.tsx
Outdated
Show resolved
Hide resolved
62a225e
to
c8a012b
Compare
Add an organization home page where we list the courses that belong to the organization.
Note
The BE does not currently return the amount of assignments per course. We'll add that in a follow-up PR.
Additionally, I took the opportunity to update to the latest frontend-shared patch release, which includes a fix to allow interacting with links inside
DataTable
s via Enter key.dashboard-home-2024-06-04_10.48.17.mp4
Testing steps