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

Use identifiers on modal triggers and modal component instead of integral trigger #3541

Conversation

TwistMeister
Copy link
Contributor

Use identifiers on modal triggers and modal component, instead of having the trigger as integral part of the modal component.

Changes

Removed the trigger slot and added some logic to assign identifiers to both triggers and modals. This way we are free to place our triggers and modals separately, providing more flexibility when implementing. Needed for #3379, for example.

Issue link

Enabler for #3379

Demo

N/a: the changes aren't visible.

QA notes

Verify that implementing the component in a HTML template by following the README will result in a working trigger-modal pair


Code Checklist

  • All the commits in this PR are properly PGP-signed and verified.
  • This PR only contains functionality relevant to the issue.
  • I have written unit tests for the changes or fixes I made.
  • I have checked the documentation and made changes where necessary.
  • I have performed a self-review of my code and refactored it to the best of my abilities.
  • Tickets have been created for newly discovered issues.
  • For any non-trivial functionality, I have added integration and/or end-to-end tests.
  • I have informed others of any required .env changes files if required and changed the .env-dist accordingly.
  • I have included comments in the code to elaborate on what is not self-evident from the code itself, including references to issues and discussions online, or implicit behavior of an interface.

Checklist for code reviewers:

Copy-paste the checklist from the docs/source/templates folder into your comment.


Checklist for QA:

Copy-paste the checklist from the docs/source/templates folder into your comment.

…components instead of having the trigger as integral part of the modal component
Copy link
Contributor

@ammar92 ammar92 left a comment

Choose a reason for hiding this comment

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

Looks good to me, don't have much to add 👍

rocky/components/modal/README.md Outdated Show resolved Hide resolved
rocky/components/modal/README.md Outdated Show resolved Hide resolved
@ppvg
Copy link
Member

ppvg commented Sep 19, 2024

Re: making the dialog generic: it's currently responsible for managing form elements that are rendered inside of it. It might be better to leave that responsibility to the content itself, e.g. the JS for a specific form, e.g. via some sort of onDialogClose handler.

@TwistMeister TwistMeister marked this pull request as draft September 19, 2024 12:27
@TwistMeister
Copy link
Contributor Author

FYI: Marked as "Draft" because the current implementation on the plugin tile still needs refactoring.

@TwistMeister TwistMeister marked this pull request as ready for review September 25, 2024 11:57
ppvg
ppvg previously approved these changes Sep 30, 2024
Copy link
Member

@ppvg ppvg left a comment

Choose a reason for hiding this comment

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

Stray console.log but other than that LGTM!

rocky/components/modal/script.js Outdated Show resolved Hide resolved
@stephanie0x00
Copy link
Contributor

Checklist for QA:

  • I have checked out this branch, and successfully ran a fresh make reset.
  • I confirmed that there are no unintended functional regressions in this branch:
    • I have managed to pass the onboarding flow
    • Objects and Findings are created properly
    • Tasks are created and completed properly
  • I confirmed that the PR's advertised feature or hotfix works as intended.
  • I checked the logs for errors and/or warnings and made issues where necessary

What works:

There do not appear to be any unexpected side effects. Can be merged.

What doesn't work:

n/a

Bug or feature?:

n/a

@underdarknl underdarknl merged commit b3b052a into main Oct 1, 2024
10 checks passed
@underdarknl underdarknl deleted the feat/update-modal-component-by-removing-trigger-from-component-structure branch October 1, 2024 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants