Skip to content

Commit e189ecb

Browse files
authored
Merge pull request #544 from smartdevicelink/bugfix/softbuttonreplaceoperation-logs
Fix log reporting and update package version
2 parents 58f0d18 + 51a8c37 commit e189ecb

File tree

3 files changed

+29
-29
lines changed

3 files changed

+29
-29
lines changed

lib/js/src/manager/screen/_SoftButtonReplaceOperation.js

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class _SoftButtonReplaceOperation extends _Task {
4949
* @param {Boolean} isDynamicGraphicSupported - Whether dynamic graphics are supported
5050
*/
5151
constructor (lifecycleManager, fileManager = null, softButtonCapabilities = null, softButtonObjects = null, currentMainField1 = null, isDynamicGraphicSupported) {
52-
super('SoftButtonTransitionOperation');
52+
super('SoftButtonReplaceOperation');
5353
this._lifecycleManager = lifecycleManager;
5454
this._fileManager = fileManager;
5555
this._softButtonCapabilities = softButtonCapabilities;
@@ -80,17 +80,17 @@ class _SoftButtonReplaceOperation extends _Task {
8080
// Check the state of our images
8181
if (!this._supportsSoftButtonImages()) {
8282
// We don't support images at all
83-
console.warn('SoftButtonTransitionOperation - Soft button images are not supported. Attempting to send text-only soft buttons. If any button does not contain text, no buttons will be sent.');
83+
console.warn('SoftButtonReplaceOperation - Soft button images are not supported. Attempting to send text-only soft buttons. If any button does not contain text, no buttons will be sent.');
8484
// Send text buttons if all the soft buttons have text
8585
const success = await this._sendCurrentStateTextOnlySoftButtons();
8686
if (!success) {
87-
console.error('SoftButtonTransitionOperation - Head unit does not support images and some of the soft buttons do not have text, so none of the buttons will be sent.');
87+
console.error('SoftButtonReplaceOperation - Head unit does not support images and some of the soft buttons do not have text, so none of the buttons will be sent.');
8888
}
8989
} else if (!this._supportsDynamicSoftButtonImages()) {
90-
console.info('SoftButtonTransitionOperation - Soft button images are not supported. Attempting to send text and static image only soft buttons. If any button does not contain text and/or a static image, no buttons will be sent.');
90+
console.info('SoftButtonReplaceOperation - Soft button images are not supported. Attempting to send text and static image only soft buttons. If any button does not contain text and/or a static image, no buttons will be sent.');
9191
const success = await this._sendCurrentStateStaticImageOnlySoftButtons();
9292
if (!success) {
93-
console.error('SoftButtonTransitionOperation - Buttons will not be sent because the module does not support dynamic images and some of the buttons do not have text or static images.');
93+
console.error('SoftButtonReplaceOperation - Buttons will not be sent because the module does not support dynamic images and some of the buttons do not have text or static images.');
9494
}
9595
} else if (this._currentStateHasImages() && !this._allCurrentStateImagesAreUploaded()) {
9696
// If there are images that aren't uploaded
@@ -125,13 +125,13 @@ class _SoftButtonReplaceOperation extends _Task {
125125
return false;
126126
}
127127

128-
console.log('SoftButtonTransitionOperation - Preparing to send text-only soft buttons');
128+
console.log('SoftButtonReplaceOperation - Preparing to send text-only soft buttons');
129129
const textButtons = [];
130130

131131
for (const softButtonObject of this._softButtonObjects) {
132132
const softButton = softButtonObject.getCurrentStateSoftButton();
133133
if (softButton.getText() === null || softButton.getText() === undefined) {
134-
console.warn('SoftButtonTransitionOperation - Attempted to create text buttons, but some buttons don\'t support text, so no text-only soft buttons will be sent');
134+
console.warn('SoftButtonReplaceOperation - Attempted to create text buttons, but some buttons don\'t support text, so no text-only soft buttons will be sent');
135135
return false;
136136
}
137137
// We should create a new softButtonObject rather than modifying the original one
@@ -146,7 +146,7 @@ class _SoftButtonReplaceOperation extends _Task {
146146
}
147147

148148
if (this._lifecycleManager === null) {
149-
console.error('SoftButtonTransitionOperation: LifecycleManager is null');
149+
console.error('SoftButtonReplaceOperation: LifecycleManager is null');
150150
return false;
151151
}
152152

@@ -156,9 +156,9 @@ class _SoftButtonReplaceOperation extends _Task {
156156

157157
const response = await this._lifecycleManager.sendRpcResolve(show);
158158
if (response.getSuccess()) {
159-
console.log('SoftButtonTransitionOperation - Finished sending text only soft buttons');
159+
console.log('SoftButtonReplaceOperation - Finished sending text only soft buttons');
160160
} else {
161-
console.warn('SoftButtonTransitionOperation - Failed to update soft buttons with text buttons');
161+
console.warn('SoftButtonReplaceOperation - Failed to update soft buttons with text buttons');
162162
}
163163
return response.getSuccess();
164164
}
@@ -173,13 +173,13 @@ class _SoftButtonReplaceOperation extends _Task {
173173
return false;
174174
}
175175

176-
console.log('SoftButtonTransitionOperation - Preparing to send text and static image only soft buttons.');
176+
console.log('SoftButtonReplaceOperation - Preparing to send text and static image only soft buttons.');
177177
const textButtons = [];
178178

179179
for (const softButtonObject of this._softButtonObjects) {
180180
const softButton = softButtonObject.getCurrentStateSoftButton();
181181
if (softButton.getText() === null && softButton.getImage() !== null && softButton.getImage().getImageType() === ImageType.DYNAMIC) {
182-
console.warn('SoftButtonTransitionOperation - Attempted to create text and static image only buttons, but some buttons don\'t support text and have dynamic images, so no soft buttons will be sent.');
182+
console.warn('SoftButtonReplaceOperation - Attempted to create text and static image only buttons, but some buttons don\'t support text and have dynamic images, so no soft buttons will be sent.');
183183
return false;
184184
}
185185

@@ -199,7 +199,7 @@ class _SoftButtonReplaceOperation extends _Task {
199199
}
200200

201201
if (this._lifecycleManager === null) {
202-
console.error('SoftButtonTransitionOperation: LifecycleManager is null');
202+
console.error('SoftButtonReplaceOperation: LifecycleManager is null');
203203
return false;
204204
}
205205

@@ -209,9 +209,9 @@ class _SoftButtonReplaceOperation extends _Task {
209209

210210
const response = await this._lifecycleManager.sendRpcResolve(show);
211211
if (response.getSuccess()) {
212-
console.log('SoftButtonTransitionOperation - Finished sending text and static image only soft buttons.');
212+
console.log('SoftButtonReplaceOperation - Finished sending text and static image only soft buttons.');
213213
} else {
214-
console.warn('SoftButtonTransitionOperation - Failed to update soft buttons with text and static image only buttons.');
214+
console.warn('SoftButtonReplaceOperation - Failed to update soft buttons with text and static image only buttons.');
215215
}
216216
return response.getSuccess();
217217
}
@@ -225,15 +225,15 @@ class _SoftButtonReplaceOperation extends _Task {
225225
if (this.getState() === _Task.CANCELED) {
226226
return false;
227227
}
228-
console.log('SoftButtonTransitionOperation - Preparing to send full soft buttons');
228+
console.log('SoftButtonReplaceOperation - Preparing to send full soft buttons');
229229
const softButtons = [];
230230

231231
for (const softButtonObject of this._softButtonObjects) {
232232
softButtons.push(softButtonObject.getCurrentStateSoftButton());
233233
}
234234

235235
if (this._lifecycleManager === null) {
236-
console.error('SoftButtonTransitionOperation: LifecycleManager is null');
236+
console.error('SoftButtonReplaceOperation: LifecycleManager is null');
237237
return false;
238238
}
239239

@@ -243,9 +243,9 @@ class _SoftButtonReplaceOperation extends _Task {
243243

244244
const response = await this._lifecycleManager.sendRpcResolve(show);
245245
if (response.getSuccess()) {
246-
console.log('SoftButtonTransitionOperation - Finished sending full soft buttons');
246+
console.log('SoftButtonReplaceOperation - Finished sending full soft buttons');
247247
} else {
248-
console.warn('SoftButtonTransitionOperation - Failed to update soft buttons');
248+
console.warn('SoftButtonReplaceOperation - Failed to update soft buttons');
249249
}
250250
return response.getSuccess();
251251
}
@@ -269,7 +269,7 @@ class _SoftButtonReplaceOperation extends _Task {
269269
}
270270

271271
if (initialStatesToBeUploaded.length === 0) {
272-
console.log('SoftButtonTransitionOperation: No initial state artworks to upload');
272+
console.log('SoftButtonReplaceOperation: No initial state artworks to upload');
273273
return false;
274274
}
275275

@@ -278,16 +278,16 @@ class _SoftButtonReplaceOperation extends _Task {
278278
return false;
279279
}
280280

281-
console.log('SoftButtonTransitionOperation: Uploading soft button initial artworks');
281+
console.log('SoftButtonReplaceOperation: Uploading soft button initial artworks');
282282
if (this._fileManager === null) {
283283
return false;
284284
}
285285

286286
const successes = await this._fileManager.uploadArtworks(initialStatesToBeUploaded);
287287
if (successes.includes(false)) {
288-
console.error('SoftButtonTransitionOperation: Error uploading soft button artworks');
288+
console.error('SoftButtonReplaceOperation: Error uploading soft button artworks');
289289
} else {
290-
console.log('SoftButtonTransitionOperation: Soft button initial state artworks uploaded');
290+
console.log('SoftButtonReplaceOperation: Soft button initial state artworks uploaded');
291291
}
292292

293293
return true;
@@ -313,20 +313,20 @@ class _SoftButtonReplaceOperation extends _Task {
313313
}
314314

315315
if (otherStatesToBeUploaded.length === 0) {
316-
console.log('SoftButtonTransitionOperation: No other state artworks to upload');
316+
console.log('SoftButtonReplaceOperation: No other state artworks to upload');
317317
return false;
318318
}
319319

320-
console.log('SoftButtonTransitionOperation: Uploading soft button other state artworks');
320+
console.log('SoftButtonReplaceOperation: Uploading soft button other state artworks');
321321
if (this._fileManager === null) {
322322
return false;
323323
}
324324

325325
const successes = await this._fileManager.uploadArtworks(otherStatesToBeUploaded);
326326
if (successes.includes(false)) {
327-
console.error('SoftButtonTransitionOperation: Error uploading soft button artworks');
327+
console.error('SoftButtonReplaceOperation: Error uploading soft button artworks');
328328
} else {
329-
console.log('SoftButtonTransitionOperation: Soft button other state artworks uploaded');
329+
console.log('SoftButtonReplaceOperation: Soft button other state artworks uploaded');
330330
}
331331

332332
return true;

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sdl_javascript_suite",
3-
"version": "1.6.0",
3+
"version": "1.7.0",
44
"description": "The official JavaScript SDK for SmartDeviceLink.",
55
"main": "/lib/js/dist/SDL.js",
66
"engines": {

0 commit comments

Comments
 (0)