-
Notifications
You must be signed in to change notification settings - Fork 43
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
Fixed HMI Uncaught SyntaxError after processing SetDisplayLayout #617
Fixed HMI Uncaught SyntaxError after processing SetDisplayLayout #617
Conversation
…ut(displayLayout = DEFAULT) for media and non-media apps
…_set_displaylayout Fixed issue: HMI Uncaught SyntaxError after processing SetDisplayLayout(displayLayout = DEFAULT) for media and non-media apps
Hi @theresalech This is a regression issue and PR is ready for Livio team review |
@ValeriiMalkov I'm not sure that removing "DEFAULT" from the available templates is the best solution. If The reported error is caused by changes made in #590. https://github.com/smartdevicelink/sdl_hmi/blob/release/5.6.0/app/controller/sdl/Abstract/Controller.js#L1656 gets the template capabilities based on the template name ( I think for fix we might have to select the appropriate template name (as done in https://github.com/smartdevicelink/sdl_hmi/blob/release/5.6.0/ffw/UIRPC.js#L517) in the case that |
…ut(displayLayout = DEFAULT) for media and non-media apps
…playLayout(displayLayout = DEFAULT) for media and non-media apps" This reverts commit 1897d6c.
after processing SetDisplayLayout(displayLayout = DEFAULT) for media and non-media apps
…et_displaylayout Review/uncaught syntax error set displaylayout
app/model/sdl/Abstract/Model.js
Outdated
@@ -628,7 +628,6 @@ SDL.SDLModel = Em.Object.extend({ | |||
return model.appType.indexOf('WEB_VIEW') >= 0; | |||
} | |||
case 'NON-MEDIA': |
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.
case 'NON-MEDIA': | |
case 'NON-MEDIA': | |
case 'DEFAULT': |
Since getDisplayCapability
can now handle the "DEFAULT" template, case DEFAULT should be re-added to the code.
If default is not re-added, the HMI will return a REJECTED response for SetDisplayLayout("DEFAULT")
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.
Sorry, my mistake. I forgot to re-add it
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.
Changes in commit 2048ee3
app/model/sdl/Abstract/data.js
Outdated
@@ -1183,7 +1183,7 @@ SDL.SDLModelData = Em.Object.create( | |||
], | |||
"imageTypeSupported": ["STATIC", "DYNAMIC"], | |||
"numCustomPresetsAvailable": 8, | |||
"templatesAvailable": ["MEDIA", "NON-MEDIA", "DEFAULT", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], | |||
"templatesAvailable": ["MEDIA", "NON-MEDIA", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], |
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.
"templatesAvailable": ["MEDIA", "NON-MEDIA", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], | |
"templatesAvailable": ["MEDIA", "NON-MEDIA", "DEFAULT", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], |
Since getDisplayCapability
can now handle the "DEFAULT" template, "DEFAULT" should be re-added to the available templates.
Also removing items from templateAvaible
may impact the mobile libraries (if the managers rely on display capabilities to send SetDisplayLayout requests)
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.
Changes in commit 2048ee3
ffw/UIRPC.js
Outdated
@@ -1087,7 +1087,7 @@ FFW.UI = FFW.RPCObserver.create( | |||
], | |||
'graphicSupported': true, | |||
'imageCapabilities': ['DYNAMIC', 'STATIC'], | |||
'templatesAvailable': ["MEDIA", "NON-MEDIA", "DEFAULT", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], | |||
'templatesAvailable': ["MEDIA", "NON-MEDIA", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], |
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.
'templatesAvailable': ["MEDIA", "NON-MEDIA", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], | |
'templatesAvailable': ["MEDIA", "NON-MEDIA", "DEFAULT", "NAV_FULLSCREEN_MAP", 'WEB_VIEW'], |
Since getDisplayCapability
can now handle the "DEFAULT" template, "DEFAULT should be re-added to the available templates
if(appModel.appType.includes('NAVIGATION')) { | ||
template = 'NAV_FULLSCREEN_MAP'; | ||
} else if(appModel.appType.includes('WEB_VIEW')) { | ||
template = 'WEB_VIEW'; |
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.
if(appModel.appType.includes('NAVIGATION')) { | |
template = 'NAV_FULLSCREEN_MAP'; | |
} else if(appModel.appType.includes('WEB_VIEW')) { | |
template = 'WEB_VIEW'; | |
if(appModel.appType.includes('WEB_VIEW')) { | |
template = 'WEB_VIEW'; | |
} else if(appModel.appType.includes('NAVIGATION') || appModel.appType.includes('PROJECTION')) { | |
template = 'NAV_FULLSCREEN_MAP'; |
I think that WEB_VIEW should take precedence over NAVIGATION to match the behavior in the generic hmi https://github.com/smartdevicelink/generic_hmi/blob/develop/src/js/Controllers/BCController.js#L51
Also NAV_FULLSCREEN_MAP is used for both NAVIGATION and PROJECTION app types
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.
Changes in commit 2048ee3
Fixes #609
This PR is ready for review.
Testing Plan
Manual testing
Summary
A
DEFAULT
available template is removed from the display capabilities because it's not defined on the HMI.The expected result of the issue-609 must be replaced with an error result code.
CLA