Skip to content

Commit d233da1

Browse files
authored
Merge pull request #560 from smartdevicelink/bugfix/template-configuration-update
Update T&G current screen data with template config
2 parents d71a8b4 + e3c265e commit d233da1

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

lib/js/src/manager/screen/_TextAndGraphicUpdateOperation.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,9 @@ class _TextAndGraphicUpdateOperation extends _Task {
665665
if (show.getSecondaryGraphic() !== null && show.getSecondaryGraphic() !== undefined) {
666666
this._currentScreenData.setSecondaryGraphic(this._updatedState.getSecondaryGraphic());
667667
}
668+
if (show.getTemplateConfiguration() !== null && show.getTemplateConfiguration() !== undefined) {
669+
this._currentScreenData.setTemplateConfiguration(this._updatedState.getTemplateConfiguration());
670+
}
668671
if (typeof this._currentScreenDataUpdateListener === 'function') {
669672
this._currentScreenDataUpdateListener(async () => {
670673
return this._currentScreenData;

tests/managers/screen/TextAndGraphicUpdateOperationTests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ module.exports = function (appClient) {
2929
let textField4Type;
3030
let textAlignment;
3131
let configuration;
32+
let configurationOld;
3233
let currentScreenData;
3334
let currentScreenDataUpdatedListener;
3435
let defaultMainWindowCapability;
@@ -56,14 +57,15 @@ module.exports = function (appClient) {
5657
textField4Type = SDL.rpc.enums.MetadataType.MEDIA_TITLE;
5758
textAlignment = SDL.rpc.enums.TextAlignment.CENTERED;
5859
configuration = new SDL.rpc.structs.TemplateConfiguration().setTemplate(SDL.rpc.enums.PredefinedLayout.GRAPHIC_WITH_TEXT);
60+
configurationOld = new SDL.rpc.structs.TemplateConfiguration().setTemplate(SDL.rpc.enums.PredefinedLayout.TEXT_WITH_GRAPHIC);
5961
currentScreenData = new SDL.manager.screen._TextAndGraphicState();
6062
currentScreenData.setTextField1('Old');
6163
currentScreenData.setTextField2('Text');
6264
currentScreenData.setTextField3('Not');
6365
currentScreenData.setTextField4('Important');
6466
currentScreenData.setPrimaryGraphic(testArtwork1);
6567
currentScreenData.setSecondaryGraphic(testArtwork2);
66-
currentScreenData.setTemplateConfiguration(configuration);
68+
currentScreenData.setTemplateConfiguration(configurationOld);
6769
currentScreenDataUpdatedListener = (asyncListener) => {
6870
asyncListener().then(() => {}).catch(() => {});
6971
};
@@ -925,7 +927,6 @@ module.exports = function (appClient) {
925927
mediaTrackField, title, testArtwork1, testArtwork2, textAlignment, textField1Type, textField2Type, textField3Type, textField4Type, configuration);
926928
textAndGraphicUpdateOperation = new SDL.manager.screen._TextAndGraphicUpdateOperation(lifecycleManager, fileManager, defaultMainWindowCapability, currentScreenData, textsAndGraphicsState, listener, currentScreenDataUpdatedListener);
927929
await textAndGraphicUpdateOperation._start();
928-
Validator.assertEquals(textAndGraphicUpdateOperation._getCurrentScreenData().getTemplateConfiguration().getParameters(), configuration.getParameters());
929930

930931
// Verifies that uploadArtworks does not get called because a sendShow failed with text and layout change
931932
Validator.assertTrue(!wasUploadArtworksCalled);

0 commit comments

Comments
 (0)