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

Feature: add "Make as default" action to the forms list view #7606

Merged

Conversation

glaubersilva
Copy link
Contributor

@glaubersilva glaubersilva commented Nov 5, 2024

Resolves GIVE-1333

Description

This PR adds a "Make as default" action in the forms list table which lives on the forms tab from the campaigns details page.

Affects

The forms list table.

Visuals

image

Testing Instructions

  1. Go to the "Forms" tab from the Campaigns details page;
  2. Make sure to have more than one form;
  3. Use the "Make as default" action and make sure everything works as expected.

Pre-review Checklist

  • Acceptance criteria satisfied and marked in related issue
  • Relevant @unreleased tags included in DocBlocks
  • Includes unit tests
  • Reviewed by the designer (if follows a design)
  • Self Review of code and UX completed

@glaubersilva glaubersilva self-assigned this Nov 5, 2024
@glaubersilva glaubersilva changed the title Feature: add default form action to list view Feature: add "Make as default" action to the forms list view Nov 5, 2024
@glaubersilva glaubersilva marked this pull request as ready for review November 5, 2024 21:03
src/Campaigns/Routes/UpdateDefaultCampaignForm.php Outdated Show resolved Hide resolved
Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

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

I accidentally approved this PR. I mean, it looks good, but I would like to see this a bit more organized. See my previous comment.

Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

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

@glaubersilva after testing this, it looks like setting the default form doesn't work. After clicking on the link, I get the option to set the default form for all forms in the list table.

@glaubersilva
Copy link
Contributor Author

@alaca Make sure to run the npm run dev instead of the npm run dev:v3 and it should work as expected. Here is a demo video showing the feature in action: https://www.loom.com/share/6be837ce4af7412184a1b167680aca65?sid=6ac3df5d-f122-427c-b5bf-31b16e59e93f

Let me know if you were able to make it work and if there is anything else to change.

@alaca
Copy link
Member

alaca commented Nov 6, 2024

@glaubersilva it looks like it is related to V2 forms.

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

@glaubersilva
Copy link
Contributor Author

glaubersilva commented Nov 6, 2024

@alaca Nice catch! The problem was that the defaultForm() method was looking only for V3 forms, so it never found the default form when it was a V2 form. I resolved it here: b9492c9

Copy link
Member

@alaca alaca left a comment

Choose a reason for hiding this comment

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

Hey @glaubersilva nice job, man. There are some things that I would like to do differently and would like to hear what you think.

Copy link
Member

@alaca alaca 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, man! 👍
I'll do some refactoring on the forms and defaultForm methods in separate PR.

Just resolve the failing tests before merging.

@glaubersilva glaubersilva merged commit 1bbd809 into epic/campaigns Nov 8, 2024
20 checks passed
@glaubersilva glaubersilva deleted the feature/list-view-change-default-form-GIVE-1333 branch November 8, 2024 14:58
@alaca
Copy link
Member

alaca commented Nov 8, 2024

@glaubersilva hey man, where is the route that makes form default? 😅

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