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

Consent & GetUserFriendlyMessage #406

Merged
merged 22 commits into from
Jul 6, 2021
Merged

Consent & GetUserFriendlyMessage #406

merged 22 commits into from
Jul 6, 2021

Conversation

iCollin
Copy link
Collaborator

@iCollin iCollin commented Jun 21, 2021

Summary

This PR is ready for review.

This PR adds the following functionality:

  • Consent Prompts
  • App Permissions View
  • Support for GetUserFriendlyMessage RPC
  • Non-intrusive Notifications
  • Imports Bootstrap (used for switches on app permissions view)
  • Support for OnAppPermissionChanged notification
  • App Header Custom JSX Icons

This PR also refactors the TTS controller a bit so that the HMI can easily queue TTS and to prevent TTS conflicts.

To Do

  • Find better icon for Header button that takes you to permissions view
  • Add mechanism to replace %% variables in CFMs, globally where possible

Future Considerations

  • External Consent Status
  • Ability to change HMI Language
  • Burger menu with Permissions and App Store within it (can then be expanded later for other settings)

CLA

});
} else {
if (this.statusMessages[status].tts) { ttsController.queueTTS(this.statusMessages[status].tts); }
toast((_toast) => (<PermissionsPopup _toast={_toast} header={this.statusMessages[status].line1}/>), { duration: 2000 });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
toast((_toast) => (<PermissionsPopup _toast={_toast} header={this.statusMessages[status].line1}/>), { duration: 2000 });
toast((_toast) => (<PermissionsPopup _toast={_toast} header={this.statusMessages[status].line1}/>), { duration: 5000 });

2000 seemed a little too fast

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They're so quick to digest, and often all three come within 2 seconds. Having all three popups covering half of my screen for 3seconds would annoy me, even knowing this won't happen often at all.

I am not opposed to extending the time a bit, but I think 5s is long, that is what I originally used.

@Jack-Byrne
Copy link
Collaborator

Hide menu icon when viewing permissions list. Clicking menu causes error
Screen Shot 2021-06-23 at 5 11 15 PM

@Jack-Byrne
Copy link
Collaborator

I think the data consent prompt for SDL should come before acknowledging the app permissions being requested

@Jack-Byrne
Copy link
Collaborator

Disabling an allowed permission and then pressing save does not save the state. No messages are sent to Core for disallowing the permission

@Jack-Byrne
Copy link
Collaborator

Activating an app for the first time is requiring the user to activate the app twice. The data-consent + app permissions view should be chained together with one click to activate an app.

@Jack-Byrne
Copy link
Collaborator

Experiencing an issue with external policies connected with the sdl server.

After activating an app for the first time i am presented with the consent prompt. I agree and then the PTU takes place. After the PTU is successful I am given the list of permissions to accept or deny. After I hit save the view takes me back to the app list instead of the app in full. I am not able to activate the app at this point, the app list is stuck

@iCollin
Copy link
Collaborator Author

iCollin commented Jun 29, 2021

Experiencing an issue with external policies connected with the sdl server.

After activating an app for the first time i am presented with the consent prompt. I agree and then the PTU takes place. After the PTU is successful I am given the list of permissions to accept or deny. After I hit save the view takes me back to the app list instead of the app in full. I am not able to activate the app at this point, the app list is stuck

I was able to reproduce this scenario but in my tests, after the PTU takes place the HMI receives a ChangeRegistration and an ActivateApp with level=background. Then the OnAppPermissionChanged notification is received, meaning by the time the permissions view is opened, the app is no longer in FULL. Therefore I expect that when you save the permissions you go back to the app list.

In the current state, after saving permissions, I could not find any issues with activating the app.

window.speechSynthesis.pause();
window.speechSynthesis.cancel();
var file = null;
while (file = this.filePlaylist.shift()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is causing a warning when building the app

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fixed warning in d15c407

for (var i=0; i<ttsChunks.length; i++) {
this.filePlaylist.push(ttsChunks[i])
}
this.speakID = rpc.id;
this.listener.send(RpcFactory.TTSStartedNotification());
this.filePlaylist.push({ type: 'REPLY', id: rpc.id });
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add code comments for this reply type since a developer might assume this is a type associated with the hmi api

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

good point, I added a comment in two places in 4c4152a

@iCollin iCollin merged commit d97cbc0 into develop Jul 6, 2021
@iCollin iCollin deleted the feature/consent_and_gufm branch July 6, 2021 21:02
LiliiaShlikhtLuxoft pushed a commit to LuxoftSDL/generic_hmi that referenced this pull request Jul 19, 2021
* add consent prompts, toast notifications, get user friendly message, app permissions view, include bootstrap, handle OnAppPermissionChanged, refactor tts controller so HMI can easily queue tts

* improve applist header icons

* GUFM response.result.messages param may be omitted

* replace consumer friendly message variables with proper values

* minor styling improvements

* remove menu icon from app permissions list

* address review comments: data consent before permissions, chain views, activate app once

* remove activate app when permissions consent

* consumer friendly message tts api parameter is called ttsString

* rename AppPermissionList to PermissionAppList to make it more clear that is the list of apps

* get revoked app name before waiting for GUFM response (while its still in app list)

* reply to TTS Speak correctly even when internal TTS is being used

* fixup! rename AppPermissionList to PermissionAppList to make it more clear that is the list of apps

fix links to renamed page

* handle ActivateApp request parameter level

* address review comment: fix warning

* address review comment: add comment explaining filePlaylist type REPLY

* nullcheck editing permissions app

* fix AppPermissionsRevoked tts

* handle app unregister while editing permissions

* fix AppPermissions prop name typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants