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

WIP: feat: Conditionally filter the budget enrollments #1028

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zamanafzal
Copy link
Member

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

Thanks for starting to tackle the routing! Left just 1 minor suggestion for now.

<Button
data-testid="view-budget"
onClick={() => navigateToBudgetRedemptions(budgetType)}
onClick={() => navigateToBudgetRedemptions(id)}
Copy link
Member

Choose a reason for hiding this comment

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

[suggestion] I would recommend treating this Button as a browser hyperlink with the react-router's Link component rather than relying on a JavaScript-only history.push. Users might want to open the budget details page in a new tab (e.g., right click and "Open in new tab", or Cmd + click on the button).

<Button
  data-testid="view-budget"
  as={Link}
  to={`/${enterpriseSlug}/admin/${ROUTE_NAMES.learnerCredit}/${id}`}
>
  View budget
</Button>

@@ -105,6 +106,11 @@ const EnterpriseAppRoutes = ({
/>
)}

<Route
exact
path={`${baseUrl}/admin/${ROUTE_NAMES.learnerCredit}/:id`}
Copy link
Member

Choose a reason for hiding this comment

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

nit: perhaps :budgetId to be slightly more explicit?

@@ -105,6 +106,11 @@ const EnterpriseAppRoutes = ({
/>
)}

<Route
Copy link
Member

Choose a reason for hiding this comment

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

[suggestion] Given this Route and the above Route both relate to the same Learner Credit Management (LCM) feature, I'm wondering if this component should be defining a single parent route for the overall LCM feature, and then the component passed to the parent route has its owned rendered sub-routes for the LCM-specific routes. That way, EnterpriseAppRoutes, doesn't really need any knowledge of the detail route.

Related, as is, this LCM detail page route would be available even when the LCM overview page route (defined above) is not since it isn't relying on the canManageLearnerCredit variable. If the overview page route isn't available; neither should the detail page route.

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