From 9c8498cea745b05219c5220d593576ddc0c7bcfc Mon Sep 17 00:00:00 2001 From: Jason Kulatunga Date: Thu, 2 Jun 2022 12:20:50 -0700 Subject: [PATCH] disable and re-enable bitwise operations --- .../app/modules/detail/detail.component.ts | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/webapp/frontend/src/app/modules/detail/detail.component.ts b/webapp/frontend/src/app/modules/detail/detail.component.ts index 4eb57b5..6e7a47b 100644 --- a/webapp/frontend/src/app/modules/detail/detail.component.ts +++ b/webapp/frontend/src/app/modules/detail/detail.component.ts @@ -121,21 +121,25 @@ export class DetailComponent implements OnInit, AfterViewInit, OnDestroy { // ----------------------------------------------------------------------------------------------------- // @ Private methods // ----------------------------------------------------------------------------------------------------- - getAttributeStatusName(attribute_status){ - //from Constants.go + getAttributeStatusName(attributeStatus: number){ + // tslint:disable:no-bitwise + + // from Constants.go // AttributeStatusPassed AttributeStatus = 0 // AttributeStatusFailedSmart AttributeStatus = 1 // AttributeStatusWarningScrutiny AttributeStatus = 2 // AttributeStatusFailedScrutiny AttributeStatus = 4 - if(attribute_status === 0){ - return "passed" - } else if (attribute_status & 1 != 0 || attribute_status & 4 != 0 ){ - return "failed" - } else if (attribute_status & 2 != 0){ - return "warn" + if(attributeStatus === 0){ + return 'passed' + + } else if ((attributeStatus & 1) !== 0 || (attributeStatus & 4) !== 0 ){ + return 'failed' + } else if ((attributeStatus & 2) !== 0){ + return 'warn' } return + // tslint:enable:no-bitwise } getAttributeName(attribute_data){