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

feat(modal): handle Observable values for modal/sidepanel labels #1855

Merged
merged 2 commits into from
Sep 21, 2022

Conversation

GuillaumeNury
Copy link
Contributor

Description

Components opened with LuModal/LuSidepanel can provide an Observable value for title / submitLabel / cancelLabel.


@GuillaumeNury GuillaumeNury added 👥 Front Requires Angular skills 🔖✨ Feature New feature (even a very small one) labels Sep 14, 2022
@GuillaumeNury GuillaumeNury requested review from a team as code owners September 14, 2022 15:33
@LuccaIntegration
Copy link

@LuccaIntegration
Copy link

shajz
shajz previously approved these changes Sep 14, 2022
@@ -13,7 +12,7 @@ import { LU_MODAL_CONFIG, LU_MODAL_REF_FACTORY, LU_MODAL_TRANSLATIONS } from './
import { luModalTranslations } from './modal.translate';

@NgModule({
imports: [OverlayModule, PortalModule, CommonModule, A11yModule, LuTooltipModule],
Copy link
Contributor

Choose a reason for hiding this comment

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

1 de moins ! 🎉

let fixture: ComponentFixture<ModalOpenerComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm y a spectator sur lf normalement si tu veux moins t'embêter (cc @mathieu-bellange). Y a d'autres specs pour avoir des exemples d'utilisation


function openModal<T>(type: Type<T>): T {
spectator.component.modal.open(type);
return spectator.debugElement.parent.query(By.directive(type)).componentInstance as T;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mathieu-bellange In a perfect world, I would have done:

spectator.query(type, { root: true })

But the root option only exists for string selectors.

Copy link
Contributor Author

@GuillaumeNury GuillaumeNury Sep 19, 2022

Choose a reason for hiding this comment

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

Waiting for a release of Spectator with this PR 😃

@LuccaIntegration
Copy link

@GuillaumeNury GuillaumeNury merged commit a828029 into master Sep 21, 2022
@GuillaumeNury GuillaumeNury deleted the modal.observable.content branch September 21, 2022 15:20
@jeremie-lucca jeremie-lucca mentioned this pull request Oct 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔖✨ Feature New feature (even a very small one) 👥 Front Requires Angular skills
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants