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

Remove SweetAlert #342

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Remove SweetAlert #342

merged 2 commits into from
Sep 10, 2024

Conversation

Soare-Robert-Daniel
Copy link
Contributor

@Soare-Robert-Daniel Soare-Robert-Daniel commented Aug 29, 2024

Summary

  • Remove SweetAlert2 dependencies
    • Replace it with a custom Popup
    • Add typescript support notations for some global variables

Will affect visual aspect of the product

YES

Screenshots

image

image

Test instructions

Test the popup when:

  • Deleting a field group.
  • Deleting input fields when no field is selected.

Check before Pull Request is ready:

Closes #340

@Soare-Robert-Daniel Soare-Robert-Daniel linked an issue Aug 29, 2024 that may be closed by this pull request
@Soare-Robert-Daniel Soare-Robert-Daniel marked this pull request as ready for review August 29, 2024 11:14
@Soare-Robert-Daniel Soare-Robert-Daniel added the pr-checklist-skip Allow this Pull Request to skip checklist. label Aug 29, 2024
@Soare-Robert-Daniel Soare-Robert-Daniel self-assigned this Aug 29, 2024
@pirate-bot pirate-bot added the pr-checklist-complete The Pull Request checklist is complete. (automatic label) label Aug 29, 2024
@pirate-bot
Copy link
Contributor

pirate-bot commented Aug 29, 2024

Plugin build for 98ad7e0 is ready 🛎️!

Copy link
Collaborator

@carlalexander carlalexander left a comment

Choose a reason for hiding this comment

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

I don't have much to say for this PR! Looks fine. I wouldn't use chore for this commit. It's probably a refactor. I also have a few questions.

Why are naming ppomPopup using camel case when everything else uses snake case. Shouldn't we do ppom_popup?

My other question relates to the use of window?.ppomPopup? and window?.ppom_vars?. Is there are reason why we're using the optional chaining? Wouldn't we want to know if ppomPopup or ppom_vars are missing instead of ignoring it?

Finally, any way we can write some e2e test to test the change?

js/admin/ppom-meta-table.js Show resolved Hide resolved
Copy link
Contributor

@abaicus abaicus left a comment

Choose a reason for hiding this comment

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

I agree with @carlalexander here. Is there any chance that ppom_vars or the popup class instance will be undefined? IMO, the i18n.popup key should be there as long as it's used in the script. Without these being defined, the intended behavior will not be working, so instead of using optional chaining, I would rather make sure that those variables are defined.

More than that, the popup should probably be requested as a dependency of both scripts (here it is not).


Regarding the reasoning behind using camelCase combined with snake_case, I think that's how the script was previously localized, so it would mean changing that reference everywhere. I personally prefer using camelCase in JS usually, but I understand the difference in this specific case.

I think we should strive for one or the other in the future.

@carlalexander
Copy link
Collaborator

Regarding the reasoning behind using camelCase combined with snake_case, I think that's how the script was previously localized, so it would mean changing that reference everywhere. I personally prefer using camelCase in JS usually, but I understand the difference in this specific case.

I think we should strive for one or the other in the future.

Yeah, that was my main question. I just want to standardize on one type. 👍

Copy link
Collaborator

@carlalexander carlalexander left a comment

Choose a reason for hiding this comment

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

Don't have much else to add besides my existing questions. If @abaicus feels everything is good, we're good 😃

@selul selul merged commit 16d196b into development Sep 10, 2024
2 checks passed
@selul selul deleted the fix/remove-sweetalert-popup branch September 10, 2024 09:49
@pirate-bot
Copy link
Contributor

🎉 This PR is included in version 33.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pirate-bot pirate-bot added the released Indicate that an issue has been resolved and released in a particular version of the product. label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-checklist-complete The Pull Request checklist is complete. (automatic label) pr-checklist-skip Allow this Pull Request to skip checklist. released Indicate that an issue has been resolved and released in a particular version of the product.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DEV] Remove Sweetalert2 deps
5 participants