-
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
Feature/web engine support #274
Conversation
app/view/info/appsStoreView.js
Outdated
@@ -0,0 +1,106 @@ | |||
/* | |||
* Copyright (c) 2019, Ford Motor Company All rights reserved. |
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.
2020 here and in similar places
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.
@mked-luxoft fixed in a72a3d6
app/controller/InfoController.js
Outdated
} | ||
catch (err) { | ||
SDL.PopUp.create().appendTo('body').popupActivate( | ||
"Unable to load manifest file #" + index + ": " + err.message |
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.
i think here and in similar places it's better to use templated string if possible
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.
@mked-luxoft makes sense. Replaced in a72a3d6
app/controller/InfoController.js
Outdated
@@ -44,6 +62,214 @@ SDL.InfoController = Em.Object.create( | |||
event.goToState | |||
); | |||
}, | |||
|
|||
loadManifestFile(input, index) { |
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.
i think function descriptions should be added in this file
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.
@mked-luxoft description has been added to all new functions and elements in this PR. See a72a3d6
* | ||
* @param {Object} | ||
* params | ||
*/ |
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.
i think return
should be added to description
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.
@mked-luxoft fixed in a72a3d6
app/view/sdl/RunWebEngineAppView.js
Outdated
{ | ||
elementId: 'runWebEngineSDLPortInput', | ||
classNames: 'runWebEngineSDLPortInput', | ||
value: '2020' |
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.
maybe this value should be stored in config file?
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.
@mked-luxoft good idea. I moved host, port and transport params to a separate config structure in config file. See a72a3d6
app/view/sdl/RunWebEngineAppView.js
Outdated
{ | ||
elementId: 'runWebEngineSDLHostInput', | ||
classNames: 'runWebEngineSDLHostInput', | ||
value: 'localhost' |
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.
maybe this value should be stored in config file?
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.
@mked-luxoft good idea. I moved host, port and transport params to a separate config structure in config file. See a72a3d6
app/controller/InfoController.js
Outdated
|
||
reader.onload = function() { | ||
var file_content = reader.result; | ||
var json_content; |
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.
@AKalinich-Luxoft do we need this declaration outside of try
?
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.
@mkorniichuk Actually, not :) But anyway that was a dead code which I removed in a72a3d6
@theresalech Ford has approved of this PR. |
Added a new button to apps view to open apps store. Added controls, styles and logic for this new view.
Added a new view where user can set new properties or edit existing one for already installed applications. View is available from Apps Store view.
Implemented logic for get/set web app properties
Added a new view for specifying web app params Also added all required styles and displaying web apps on UI. Also updated styles to highlight with yellow enabled web apps and highlight with green running web apps.
All new files were added to the main HTML file Also was updated popup logic to hide disabled buttons
a72a3d6
to
6f45c9d
Compare
@iCollin, @theresalech all comments were processed, could you please let me know when it’s planned to finish the review of this PR? |
@AStasiuk I gave a more detailed response to your question on the sdl_hmi_integration_guidelines PR but to summarize, we plan to be fully completed by February 26. @AKalinich-Luxoft how did you test these HMI changes? Do you have an example web engine app you would be willing to share with me for testing purposes? |
@iCollin yes, you can use web app from smartdevicelink/sdl_javascript_suite#107 You can also find manual testing guides attached to PR description |
@AKalinich-Luxoft right now, the web engine app is focused when it is opened. I believe the HMI should stay in focus at all times, and the web engine app should just be opened in the background. |
@iCollin nowadays, it's not possible to implement pop under windows in the latest versions of Chrome and similar browsers due to not implemented |
@AKalinich-Luxoft With some research I think that the best approach will be an invisible iframe. |
Hello @AKalinich-Luxoft, The actual downloading of the app package still needs to be implemented in this PR. We have come up with two different ways this could be implemented. In either implementation,
Completely In BrowserIt would be possible to download the app bundle and launch web engine apps completely without the use of a separate component.
If you were to use this approach, when an app is loaded, the 'src' tags in the html wouldn't work as the files are not saved on disk. To circumvent this problem, any element with a src tag would need to have its content inlined. For example, the manifest script that is included in the entry point html file would need to have its content placed between the script tags and the src attribute removed. Python Helper ScriptWith the HMI PTU feature, a separate server (I will call it hmi_server) component was added to the sdl_hmi in order to get around the limitations of the browser. You could just pass the Other Changes
Please reach out if you have any questions! I am happy to help. |
Hello @iCollin I tried "Python helper" way to implement all necessary changes according to your comment above. Looks like HMI JS is not able to read the entrypoint from the manifest file. So we can either:
Please let me know what is the best solution from your point of view |
Implementation were done in a Python way - HMI sends request to Python script to download app bundle, unzip it and get the content of the manifest.js HMI is using entrypoint from manifest to generate path to HTML page to launch. Corresponding input has been replaced with label showing generated path. Python script was updated to support new requests from HMI App Store was updated to filter non API properties and display app icons
@iCollin please check for the updated implementation provided in ce14023 Implementation were done in a Python way - HMI sends request to Python script and request it to download app bundle, unzip it and get the content of the Please let me know if any other updates required |
app/controller/InfoController.js
Outdated
|
||
let on_installation_failed = function() { | ||
SDL.PopUp.create().appendTo('body').popupActivate( | ||
`Can't install ${policyAppID} app from applications store...`, null, false |
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.
Is it possible to display the first nickname in the array (if available) instead of the policy app id?
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.
@JackLivio no problems, fixed in f824da1
app/view/sdl/RunWebEngineAppView.js
Outdated
@@ -42,7 +42,7 @@ SDL.RunWebEngineAppView = Em.ContainerView.create( | |||
childViews: [ | |||
'runWebEngineAppLabel', | |||
'runWebEngineHTMLPathLabel', | |||
'runWebEngineHTMLPathInput', | |||
'runWebEngineEntrypointLabel', |
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.
runWebEngineEntryPointLabel
I think the P in Point should be capitalized for all entry point mentions
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.
@JackLivio renamed in f824da1
app/controller/InfoController.js
Outdated
* @param {String} response string containing server response | ||
*/ | ||
processAppsStoreResponse: function(response) { | ||
var json_content = JSON.parse(response); |
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 lie is throwing an error:
VM314:1 Uncaught SyntaxError: Unexpected token o in JSON at position 1
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.
response is already a json typed object, no need parse again.
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.
@JackLivio yeah, previously server was responding with String so I have to parse it. Now it returns JSON object. Fixed in f824da1
I apologize, I did not realize the PR was not ready for review yet. I wont leave any more comments until it is review ready. |
@JackLivio no worries, I processed your comments anyway :) |
Note that ctrl+c does not kill the script after running the deploy_server.sh script |
In order for Web Engine apps to use |
Python script has been updated to run static file server on start. This allows HMI to start web applications over HTTP protocol instead of file which has more limitations. Also script was updated to handle Ctrl+C signal instead of not obvious Q. Default transport role params has been changed to server
@iCollin static HTTP server has been added to
@JackLivio I also updated script to handle Ctrl+C as expected. Please check 299ff0a and proceed with your review |
Implements SDL-0240
Related to #269
This PR is ready for review.
Testing Plan
Tested manually
Manual check-list can be found here
Summary
PR contains sdl_hmi implementation of [SDL 0240] WebEngine support for SDL JavaScript
PR.
Changelog
CLA