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

Fix: Enable Recent Activity Table Item Redo Functionality #3587

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rumzledz
Copy link
Contributor

@rumzledz rumzledz commented Oct 31, 2024

Description

This PR enables the Dashboard page's Activity Table Item Redo Function and aligns it with Activity page's Activity Table.

Redo action

Testing

Note

I had to fix the following existing master bug and do some refactoring as well. It is unrelated to issue #3551 but you know what, it makes sense to include it in this PR:

@iamsamgibbs "The only reason I'm rejecting is that not all actions should have the redo option"
@rdig "I've tested this with Simple Payments and which work as expected, however, as Sam noted, not all actions require it, so this needs to be enabled on a case by case basis"

I've added a testing section for it 😄

I also had to handle the Redo flow for Reputation-related actions in the Activity Table items so please test that as well.

I'll find a way to refactor the Completed Actions component as well, so we'll have a single source of truth for knowing which actions are not allowed to have a Redo Action. But it will be in a separate future PR if there's capacity 👌

1. Verify that the Redo action button does what it's intended to do

  1. Go to the Dashboard
  2. Make a simple payment
  3. Once it shows up on the Recent Activity table, click its kebab button
  4. Click Redo action
  5. Verify that the Action Form comes up and the details are filled in
  6. Visit the Activity page http://localhost:9091/planex/activity
  7. Look for the same action on the table and redo it
  8. Verify that the result is consistent as step 4

2. Verify that the Redo action is conditionally rendered on a case-by-case basis

  1. Go to the Dashboard
  2. Create a new Team
  3. Add the following cases in useBuildRedoEnabledActionsMap.ts, after line 116:
case ColonyActionType.MoveFunds:
image
  1. Reload the Dashboard
  2. Click the kebab menu for the Create Domain action
  3. Verify that you don't see Redo action in the popup menu
image
  1. Click the kebab menu for any Payment action
  2. Verify that the Redo action is still present

Note

The pagination might reset back to page 1 but this is already being fixed by @mmioana in PR: #3566

  1. Move through the Activity table's pages until you find the Transfer Funds action which is done as part of our create-data script and click its kebab menu
  2. Verify that you don't see Redo action in the popup menu
  3. Please repeat steps 1 - 10 for the Actions Table in the Activity page: http://localhost:9091/{colonyName}/activity

3. Verify that you can redo Reputation actions and that the app doesn't crash in the process

  1. Award 20,000 points for Amy
  2. Redo the action via the UserHub Transactions tab
  3. Verify that the app does not crash and Manage Reputation form shows up
  4. Redo the action via the Activity table
  5. Verify that the app does not crash and Manage Reputation form shows up

Diffs

New stuff

  • I centralised this "Redo action" behaviour for the Actions Table items in a new hook called useRedoAction so it's shared consistently between the Action Tables found with the Dashboard & Activity pages.

Resolves #3551
Resolves #3593

@rumzledz rumzledz self-assigned this Oct 31, 2024
@rumzledz rumzledz marked this pull request as ready for review October 31, 2024 15:46
@rumzledz rumzledz requested review from a team as code owners October 31, 2024 15:46
@rumzledz rumzledz changed the title Fix: Enable Dashboard Activity Table Item Redo Functionality Fix: Enable Dashboard Recent Activity Table Item Redo Functionality Oct 31, 2024
@rumzledz rumzledz changed the title Fix: Enable Dashboard Recent Activity Table Item Redo Functionality Fix: Enable Recent Activity Table Item Redo Functionality Oct 31, 2024
mmioana
mmioana previously approved these changes Nov 1, 2024
Copy link
Contributor

@mmioana mmioana left a comment

Choose a reason for hiding this comment

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

Nice, now we're able to redo an action from both the Recent activity table on Dashboard and from the table on the Activity page @rumzledz 🎉

Screen.Recording.2024-11-01.at.09.12.33.mov
Screen.Recording.2024-11-01.at.09.12.57.mov

Copy link
Contributor

Choose a reason for hiding this comment

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

Really nice 🙌

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Nice job implementing this and creating the new hook, all looks great and works nicely!

The only reason I'm rejecting is that not all actions should have the redo option:

Screenshot 2024-11-01 at 11 33 55 Screenshot 2024-11-01 at 11 34 12

I'm not sure off the top of my head which actions this affects, but removing permissions is definitely one, and I think maybe some of the advanced payment types?

Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

I've tested this with Simple Payments and which work as expected, however, as Sam noted, not all actions require it, so this needs to be enabled on a case by case basis

Screencast.from.2024-11-01.18-31-53.mp4

@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 1, 2024

Hey @rdig @iamsamgibbs all right noted. This seems to be a wider bug since the Colony Actions have had this Redo Action for all actions for the past 2 months and no one noticed. I'll see what actions are allowed to have this Redo button, will amend the logic for both the Dashboard and Activity page's actions table and will update the issue's dev hours field 👌

@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 2, 2024

Hey @iamsamgibbs @rdig I've pushed the required changes. Catch you both on Monday! 👋

@rumzledz rumzledz force-pushed the fix/3551-bring-back-action-table-redo-logic branch 9 times, most recently from 4b5149b to a3b7d19 Compare November 2, 2024 21:12
iamsamgibbs
iamsamgibbs previously approved these changes Nov 4, 2024
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Great job with this!

Screenshot 2024-11-04 at 10 31 17 Screenshot 2024-11-04 at 10 31 24

Nice implementation. I agree with your comments that it would be nice to rework the completed action component so that there is a single source of truth for this. I was actually thinking earlier about how spread out everything to do with actions is, and that we could either benefit with unifying aspects of it (I believe the work Chris is doing will help with this), or at the very least, the next time we add a new action we could document everywhere new code is needed as it is so spread out.

Thanks for adding the new functionality around when to show / not show the redo action, appreciate it was outside of the original scope, but you've got it working very nicely.

bassgeta
bassgeta previously approved these changes Nov 5, 2024
Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Really nice solution with the map, it's much nicer and much more unified this way
Create a new team doesn't have Redo ✔️
image
Transfer funds works ✔️
image
Simple payment ✔️
image
image
Permissions also work ✔️
image
image
Activity feed also works 💯
Nice work with solving this, it's quite a simple hook which does one thing only, super legit 💪

@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 5, 2024

Hey @bassgeta @iamsamgibbs! @rdig has just helped me uncover that the Activity table cannot currently redo Reputation-related actions. So I had to push that which got rid of your reviews 😅

The latest commit also includes a fix for preventing the app from crashing when redoing Reputation-related actions, which is an issue raised in #3593

I thought it made sense to combine these fixes because they intertwine.

I will be updating the test steps shortly so you can verify that the app doesn't crash when redoing a Reputation action 👌

rdig
rdig previously approved these changes Nov 5, 2024
iamsamgibbs
iamsamgibbs previously approved these changes Nov 6, 2024
Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

Nice job! Awarding reputation can be redone:

Screen.Recording.2024-11-06.at.09.50.52.mov

Redo option is being conditionally rendered as expected:

Screenshot 2024-11-06 at 09 52 21

rdig
rdig previously approved these changes Nov 6, 2024
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Nice turnaround of this. Tested and everything works as expected.

Also, nice job in centralizing the redo actions.

Redo simple payment

Screencast.from.2024-11-06.17-23-45.mp4

No redo on a "Create Team" action

Screencast.from.2024-11-06.17-29-07.mp4

Award reputation redo does not crash the app

Screencast.from.2024-11-06.17-33-51.mp4

@rumzledz rumzledz dismissed stale reviews from rdig and iamsamgibbs via 0735bfe November 6, 2024 20:37
@rumzledz rumzledz force-pushed the fix/3551-bring-back-action-table-redo-logic branch from c13ad29 to 0735bfe Compare November 6, 2024 20:37
@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 6, 2024

@iamsamgibbs @rdig @iamsamgibbs apologies guys, I had to resolve some merge conflicts in SetUserRoles.tsx, the reviews got wiped 😅

@rumzledz rumzledz requested review from iamsamgibbs, rdig and a team November 6, 2024 20:42
Copy link
Member

@rdig rdig left a comment

Choose a reason for hiding this comment

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

Reapproved

Copy link
Contributor

@bassgeta bassgeta left a comment

Choose a reason for hiding this comment

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

Reapproving 👍

Copy link
Contributor

@iamsamgibbs iamsamgibbs left a comment

Choose a reason for hiding this comment

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

I just went to test this and make sure redoing Manage Permissions was still working, but it's suffering from the action form not working issue. Can you rebase it @rumzledz ?

@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 7, 2024

I just went to test this and make sure redoing Manage Permissions was still working, but it's suffering from the action form not working issue. Can you rebase it @rumzledz ?

Ah right of course, new fixes were added to master this morning 🥲 Will rebase!

@rumzledz rumzledz force-pushed the fix/3551-bring-back-action-table-redo-logic branch from 0735bfe to 870d8ad Compare November 7, 2024 16:38
@rumzledz
Copy link
Contributor Author

rumzledz commented Nov 7, 2024

@iamsamgibbs rebased! 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants