-
Notifications
You must be signed in to change notification settings - Fork 6
fix: Add dot prefix to event handlers in application templates #142
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
Conversation
- Add dot prefix to 'sayHello' event handlers in both TS and JS templates - Fixes UI5 Linter warning: no-ambiguous-event-handler - Ensures generated apps follow UI5 best practices
|
@akudev As far as I know, using the heading dot is possible since the early days of UI5 and therefore also supported with older UI5 releases. With 1.136 the global lookup support was deprecated and therefore removed from legacy free versions |
|
Global lookup was deprecated with UI5/openui5@915d7eb |
|
@Yarloy037 could you please adjust also the view in the TS template https://github.com/UI5/mcp-server/blob/main/resources/template-ts/webapp/view/Main.view.xml? |
@flovogt Thank you so much for your review and feedback! 🙏 I'd like to confirm that the TypeScript template ( Changes made:
You can verify these changes in the "Files changed" tab of this PR. All four occurrences of Please let me know if there's anything else I should address or if any clarification is needed. Thanks again for taking the time to review! 😊 |
|
@Yarloy037 Sorry I missed the second file. Thanks a lot for your contribution. I will follow-up with the team on this PR and do a review |
|
@Yarloy037 tests are failing. Could you please adjust them too? |
|
Yes, this test totally makes sense, thanks. Just needs the test adapted. Try running the |
|
I've updated the test expectation. Thank you @Yarloy037 for this contribution! |
Description
This PR fixes the event handler syntax in both TypeScript and JavaScript application templates to comply with UI5 best practices and UI5 Linter requirements.
Problem
Generated applications contain event handlers without the required dot prefix:
press="sayHello"❌This triggers UI5 Linter warning:
no-ambiguous-event-handlerSolution
Added dot prefix to all controller method event handlers:
press=".sayHello"✅Changes
resources/template-ts/webapp/view/Main.view.xmlresources/template-js/webapp/view/Main.view.xmlReferences
no-ambiguous-event-handler