-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat: adding cancel and remind actions to the budget assignment table #1070
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1070 +/- ##
==========================================
+ Coverage 84.14% 84.15% +0.01%
==========================================
Files 455 458 +3
Lines 9560 9581 +21
Branches 1992 1996 +4
==========================================
+ Hits 8044 8063 +19
- Misses 1474 1476 +2
Partials 42 42
☔ View full report in Codecov by Sentry. |
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
113805d
to
6cf5b62
Compare
a43d361
to
6571bc7
Compare
src/components/learner-credit-management/AssignmentRowActionTableCell.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/tests/BudgetDetailPage.test.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/tests/BudgetDetailPage.test.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/tests/BudgetDetailPage.test.jsx
Outdated
Show resolved
Hide resolved
@@ -701,4 +701,69 @@ describe('<BudgetDetailPage />', () => { | |||
|
|||
expect(screen.getByText('loading budget activity overview')).toBeInTheDocument(); | |||
}); | |||
|
|||
it('displays bulk actions with remind when row selected and state allocated', () => { |
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.
[clarification] What is the intent of this test case? Based on the title, I would expect this test to trigger a row to be selected, and assert that the bulk action CTAs to remind / cancel appear only after selection.
As is, though, I believe this test is asserting that the row-level remind/cancel IconButtons
and associated tooltips are visible in the table row, which is not quite related to bulk actions as the test case's title would indicate.
If you're trying to test the bulk actions themselves in a test case(s), you'd need to trigger a user event to select a row.
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.
It's about the hiding and showing of the remind action. I've updated the wording, let me know if it makes works for you
const RemindAction = ({ selectedFlatRows, ...rest }) => ( | ||
// eslint-disable-next-line no-console | ||
<Button onClick={() => console.log('Remind', selectedFlatRows, rest)}> | ||
{`Remind (${selectedFlatRows.length})`} |
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.
[clarification] Should we be assuming all selected rows can be reminded? For example, if an admin selects a row with the "Status" column depicting "Notifying learner", "Failed: Bad email", etc., I'm figuring we wouldn't want to allow reminders on those rows.
Related, I see these annotations in the Figma:
Is this something that intends to be addressed as part of this PR or are there plans around the conditional logic for these bulk actions as follow-up work?
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.
you're totally right in that we should not allow the reminding of assignments that aren't pending, however current UX is to hide the button, not disable
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've added the behavior according to the AC on the ticket
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.
Just a heads up, this behavior as implemented may need to be revisited after hearing from Mike Brown from UX about the intended bulk action behavior.
The Figma mocks above allude that the "Assigned" table bulk actions should largely have parity with subscription management's bulk actions. However, the behavior as spec'd/implemented (hiding the bulk action when non-actionable rows are selected) is not parity with subscription bulk actions.
There are possible usability concerns with hiding the bulk action (e.g., possible lack of discoverability of the bulk action, forcing admins to manually unselect one or more rows for the bulk action to re-appear). These were mitigated in subscriptions bulk actions by keeping the bulk action visible but exclude non-actionable rows. If there are no actionable rows, the bulk action becomes disabled.
Mike/UX is revisiting this interaction now. We may need to update this behavior in code once a final decision is made.
src/components/learner-credit-management/BudgetAssignmentsTable.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/AssignmentRowActionTableCell.jsx
Outdated
Show resolved
Hide resolved
src/components/learner-credit-management/AssignmentRowActionTableCell.jsx
Outdated
Show resolved
Hide resolved
9d7fd32
to
b7d9aa0
Compare
b7d9aa0
to
c5bea6d
Compare
@@ -701,4 +701,117 @@ describe('<BudgetDetailPage />', () => { | |||
|
|||
expect(screen.getByText('loading budget activity overview')).toBeInTheDocument(); | |||
}); | |||
|
|||
it('displays remind row and bulk actions when allocated', async () => { |
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.
nit: it also asserts that the row-level Cancel
CTA is there as well.
expect(screen.getByText('Remind (1)')).toBeInTheDocument(); | ||
}); | ||
await waitFor(() => { | ||
expect(screen.getByText('Cancel (1)')).toBeInTheDocument(); |
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.
nit: likely could group both of these assertions under the single waitFor
. Alternatively, could also rely on await screen.findByText('Cancel (1)')
as well:
expect(await screen.findByText('Remind (1)')).toBeInTheDocument();
expect(await screen.findByText('Cancel (1)')).toBeInTheDocument();
expect(screen.queryByTestId('remind-assignment-test-uuid')).not.toBeInTheDocument(); | ||
const checkBox = screen.getByTestId('datatable-select-column-checkbox-cell'); | ||
userEvent.click(checkBox); | ||
expect(screen.queryByText('Remind (1)')).not.toBeInTheDocument(); |
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.
[clarification] Will the "Cancel" CTA also not show in this test case? Might be good to be explicit about whether the "Cancel" CTA is present or not here as well.
Assigned selected:
Assigned and not assigned selected:
Not assigned selected:
https://2u-internal.atlassian.net/browse/ENT-7813
For all changes
Only if submitting a visual change