-
Notifications
You must be signed in to change notification settings - Fork 129
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(dialog): open dynamic component in dialog #180
Conversation
I think this is an awesome improvement for the current Dialog! I do want to make sure we are still able to have multiple dialogs open at the same time. Can you add a test for that? Also, let's continue to support the |
Thanks for your review! Yes, continuing support for On a similar note - should the |
Let's do it! Thanks for working on this! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really improves the way dialogs and popovers can be used.
added just some small notes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good, I think we just need to update the popover e2e tests along with some of the other feedback and I would say this is probably good.
0dcbfe4
to
6d1ffb4
Compare
refactor(dialog): working on new dialog approach refactor(dialog): refactor dialog component to use global dialog service refactor(dialog): remove provider function for BrnDialog feat(dialog): add HlmDialogService for opening components in a dialog dynamically chore: add dynamic dialog component section to docs chore: add note about injectDialogContext refactor(dialog): dialog overlay class names and dialog options as reusable defaults chore: add story for dialog dynamic components refactor(dialog): make HlmDialogService options optional (defaults are provided) refactor(dialog): continue support for injectBrnDialogCtx (deprecated) refactor(dialog): move (click) handlers back into metadata host refactor(dialog): prefer early returns refactor(dialog): injectDialogContext -> injectBrnDialogContext chore: add nested dialog stories and e2e tests refactor(dialog): use input function in brnDialogTrigger refactor(dialog): use optional chaining in dialog component refactor(dialog): _id() renamed to id(), use in inheriting classes refactor(popover): change ariaDescribedBy, ariaLabelledBy to empty string so not assigned defaults refactor(dialog): use correct member names after merge
6d1ffb4
to
a515543
Compare
Changed the popover component's |
PR Checklist
Please check if your PR fulfills the following requirements:
guidelines: https://github.com/goetzrobin/spartan/blob/main/CONTRIBUTING.md#-commit-message-guidelines
PR Type
What kind of change does this PR introduce?
Which package are you modifying?
What is the current behavior?
Closes #35
Dialogs can currently only be created and opened from a component's template. Opening a dialog from a service is possible (using a subject in the service), but requires the dialog to exist in the template of an already existing component.
What is the new behavior?
Dialogs can now be opened from anywhere where the
HlmDialogService
can be injected.Most dialog-related components relied on the
BrnDialogComponent
existing for the dialog's open/closed state. SinceBrnDialogComponent
did not exist in the context of dynamically created dialogs, those reliant components had to be slightly reworked. These were just internal changes - the public APIs are the same.BrnDialogService
is now provided in root.HlmDialogService
is a new service which has a method for opening a component in a styled dialog, from a component or service.Does this PR introduce a breaking change?
injectDialogCtx
has been renamed toinjectDialogContext
.provideBrnDialog()
is no longer necessary (BrnDialogService
is provided in root)Other information
An example section in the dialog documentation has been added to demonstrate this new feature. A matching story in the storybook has also been added.