Skip to content

Commit 3deea9c

Browse files
committed
fix: AI code review
1 parent 7220957 commit 3deea9c

15 files changed

Lines changed: 56 additions & 7 deletions

File tree

src/app/devices/device-detail/device-detail.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export class DeviceDetailComponent implements OnInit, OnDestroy {
186186
catchError((err) => {
187187
const msg: string = this.translate.instant('general.errorAMTVersion.value')
188188
this.snackBar.open(msg, undefined, SnackbarDefaults.defaultError)
189-
return throwError(err)
189+
return throwError(() => err)
190190
})
191191
)
192192
})

src/app/devices/ider/ider.component.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,11 +359,12 @@ describe('IderComponent', () => {
359359
})
360360
})
361361

362-
it('should return true when IDER is false even if IDER is connected', (done) => {
362+
it('should return null when IDER is connected even if AMT IDER feature is false', (done) => {
363363
const mockRedirectionStatus = { isKVMConnected: false, isSOLConnected: false, isIDERConnected: true }
364364
component.amtFeatures.set({ ...amtFeaturesResponse, IDER: false })
365365
component.handleRedirectionStatus(mockRedirectionStatus).subscribe((result) => {
366-
expect(result).toBeTrue()
366+
expect(result).toBeNull()
367+
expect(snackBarSpy).toHaveBeenCalled()
367368
done()
368369
})
369370
})

src/app/devices/ider/ider.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ export class IderComponent implements OnInit, OnDestroy {
262262
return this.devicesService.getRedirectionStatus(guid).pipe(
263263
catchError((err) => {
264264
this.isLoading.set(false)
265-
const msg: string = this.translate.instant('kvm.errorRetrieve.value')
265+
const msg: string = this.translate.instant('ider.errorRetrieve.value')
266266
this.displayError(msg)
267267
return throwError(() => err)
268268
})
@@ -271,8 +271,8 @@ export class IderComponent implements OnInit, OnDestroy {
271271

272272
handleRedirectionStatus(redirectionStatus: RedirectionStatus): Observable<any> {
273273
this.redirectionStatus = redirectionStatus
274-
if (this.amtFeatures()?.IDER && this.redirectionStatus.isIDERConnected) {
275-
const msg: string = this.translate.instant('kvm.errorRetrieve.value')
274+
if (this.redirectionStatus.isIDERConnected) {
275+
const msg: string = this.translate.instant('ider.errorRetrieve.value')
276276
this.displayError(msg)
277277
return of(null)
278278
}
@@ -283,7 +283,7 @@ export class IderComponent implements OnInit, OnDestroy {
283283
return this.devicesService.getPowerState(guid).pipe(
284284
catchError((err) => {
285285
this.isLoading.set(false)
286-
const msg: string = this.translate.instant('kvm.errorRetrieve.value')
286+
const msg: string = this.translate.instant('ider.errorRetrieve.value')
287287
this.displayError(msg)
288288
return throwError(() => err)
289289
})

src/assets/i18n/ar.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "تسمية الزر لإرفاق صورة قرص لـ IDER",
16331633
"value": "إرفاق صورة القرص (.iso)"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "خطأ في استرداد حالة إعادة التوجيه",
1637+
"value": "خطأ في استرداد حالة إعادة التوجيه"
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "رسالة الحالة المعروضة أثناء استرداد ميزات AMT",
16371641
"value": "جارٍ استرداد ميزات AMT..."

src/assets/i18n/de.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "Schaltflächenbeschriftung zum Anhängen eines Disk-Images für IDER",
16331633
"value": "Disk-Image (.iso) anhängen"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "Fehler beim Abrufen des Umleitungsstatus",
1637+
"value": "Fehler beim Abrufen des Weiterleitungsstatus"
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "Statusmeldung beim Abrufen der AMT-Funktionen",
16371641
"value": "AMT-Funktionen werden abgerufen..."

src/assets/i18n/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,6 +1659,10 @@
16591659
"description": "Button label to attach a disk image for IDER",
16601660
"value": "Attach Disk Image (.iso)"
16611661
},
1662+
"ider.errorRetrieve": {
1663+
"description": "Error for retrieving redirection status",
1664+
"value": "Error retrieving redirection status"
1665+
},
16621666
"ider.status.checkingAMTFeatures": {
16631667
"description": "Status message shown while retrieving AMT features",
16641668
"value": "Retrieving AMT features..."

src/assets/i18n/es.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "Etiqueta del botón para adjuntar una imagen de disco para IDER.",
16331633
"value": "Adjuntar imagen de disco (.iso)"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "Error al recuperar el estado de redirección.",
1637+
"value": "Error al recuperar el estado de redirección."
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "Mensaje de estado mientras se recuperan las características de AMT",
16371641
"value": "Recuperando características de AMT..."

src/assets/i18n/fi.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "Painikkeen teksti levyn kuvan liittämiseksi IDER:ään",
16331633
"value": "Liitä levykuva (.iso)"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "Virhe uudelleenohjauksen tilan hakemisessa",
1637+
"value": "Virhe uudelleenohjauksen tilan hakemisessa"
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "Tilailmoitus AMT-ominaisuuksia haettaessa",
16371641
"value": "Haetaan AMT-ominaisuuksia..."

src/assets/i18n/fr.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "Étiquette du bouton permettant de joindre une image disque pour IDER",
16331633
"value": "Joindre une image disque (.iso)"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "Erreur lors de la récupération du statut de redirection",
1637+
"value": "Erreur lors de la récupération du statut de redirection"
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "Message d'état lors de la récupération des fonctionnalités AMT",
16371641
"value": "Récupération des fonctionnalités AMT..."

src/assets/i18n/he.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1632,6 +1632,10 @@
16321632
"description": "תווית כפתור כדי לצרף תמונת דיסק עבור ider",
16331633
"value": "צרף תמונת דיסק (.iso)"
16341634
},
1635+
"ider.errorRetrieve": {
1636+
"description": "שגיאה לאחזור סטטוס הפניה מחדש",
1637+
"value": "שגיאה אחזור סטטוס הפניה מחדש"
1638+
},
16351639
"ider.status.checkingAMTFeatures": {
16361640
"description": "הודעת סטאטוס בעת אחזור תכונות AMT",
16371641
"value": "מאחזר תכונות AMT..."

0 commit comments

Comments
 (0)