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

feat: adding cancel and remind actions to the budget assignment table #1070

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

alex-sheehan-edx
Copy link
Contributor

@alex-sheehan-edx alex-sheehan-edx commented Oct 26, 2023

Assigned selected:
image

Assigned and not assigned selected:
image

Not assigned selected:
image

https://2u-internal.atlassian.net/browse/ENT-7813

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

@alex-sheehan-edx alex-sheehan-edx marked this pull request as draft October 26, 2023 20:59
@codecov
Copy link

codecov bot commented Oct 26, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (1224e74) 84.14% compared to head (d77fd10) 84.15%.

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              
Files Coverage Δ
...earner-credit-management/AssignmentTableCancel.jsx 100.00% <100.00%> (ø)
...arner-credit-management/BudgetAssignmentsTable.jsx 100.00% <ø> (ø)
...earner-credit-management/AssignmentTableRemind.jsx 88.88% <88.88%> (ø)
...credit-management/AssignmentRowActionTableCell.jsx 75.00% <75.00%> (ø)

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-7813-cancel-remind-actions branch from 113805d to 6cf5b62 Compare October 30, 2023 17:19
@alex-sheehan-edx alex-sheehan-edx marked this pull request as ready for review October 30, 2023 17:25
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-7813-cancel-remind-actions branch 2 times, most recently from a43d361 to 6571bc7 Compare October 30, 2023 17:54
@@ -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', () => {
Copy link
Member

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.

Copy link
Contributor Author

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})`}
Copy link
Member

@adamstankiewicz adamstankiewicz Oct 30, 2023

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:

image

image

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Member

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.

image

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.

@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-7813-cancel-remind-actions branch 5 times, most recently from 9d7fd32 to b7d9aa0 Compare October 30, 2023 21:44
@alex-sheehan-edx alex-sheehan-edx force-pushed the asheehan-edx/ENT-7813-cancel-remind-actions branch from b7d9aa0 to c5bea6d Compare October 31, 2023 15:56
@kiram15 kiram15 merged commit 6da44f2 into master Nov 1, 2023
5 checks passed
@kiram15 kiram15 deleted the asheehan-edx/ENT-7813-cancel-remind-actions branch November 1, 2023 14:36
@@ -701,4 +701,117 @@ describe('<BudgetDetailPage />', () => {

expect(screen.getByText('loading budget activity overview')).toBeInTheDocument();
});

it('displays remind row and bulk actions when allocated', async () => {
Copy link
Member

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();
Copy link
Member

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();
Copy link
Member

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.

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.

3 participants