Skip to content

Commit

Permalink
Merge pull request #2126 from PaladinCloud/fix/UIUX-612/exemption-but…
Browse files Browse the repository at this point in the history
…ton-disable-closed-violations

fix:[UIUX-612] disable exemption for closed violation
  • Loading branch information
go-jay authored Mar 4, 2024
2 parents a513d36 + 99651c8 commit af7849c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ <h6 class="page-title">Violation Details -</h6>
Additional Actions
</header>
<div class="btn-wrapper-additional-actions">
<app-button-icon [class.isDisabled]="issueAssetGroup=='redhat'" (onClickInner)="showOtherDiv()" *ngIf="!exceptionAdded && exemptionDetails.status != 'requested'"> {{addExemption}}
<app-button-icon [disabled]="disableExemption" [class.isDisabled]="disableExemption" (onClickInner)="showOtherDiv()" *ngIf="!exceptionAdded && exemptionDetails.status != 'requested'"> {{addExemption}}
</app-button-icon>
<app-button-icon [class.isDisabled]="issueAssetGroup=='redhat'" (onClickInner)="showOtherDivRevoke();revokeException()"
<app-button-icon [disabled]="disableExemption" [class.isDisabled]="disableExemption" (onClickInner)="showOtherDivRevoke();revokeException()"
*ngIf="(exceptionAdded && adminAccess) || (!adminAccess && exemptionDetails.status == 'requested' && hasCurrentUserRequested)"> {{revokeExemption}}
</app-button-icon>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ export class IssueDetailsComponent implements OnInit, OnDestroy {
sortColName: any;
violationModifiedDate: any;
hasCurrentUserRequested: boolean;
disableExemption: boolean = false;

@HostListener('document:click', ['$event']) handleClick(event) {
try {
Expand Down Expand Up @@ -430,6 +431,7 @@ export class IssueDetailsComponent implements OnInit, OnDestroy {
footer: this.issueBlocks.status,
img: statusIcon
};
this.disableExemptionOnCloseStatus(this.issueBlocks?.status);
this.issueTopblocks.push(obj);
}
this.violationReason = this.issueBlocks.violationReason;
Expand Down Expand Up @@ -1366,6 +1368,11 @@ export class IssueDetailsComponent implements OnInit, OnDestroy {
this.direction = event.direction;
}

private disableExemptionOnCloseStatus(status:string){
if(status === 'closed') this.disableExemption =true;
}


ngOnDestroy() {
try {
// pushes the current url to datastore
Expand Down

0 comments on commit af7849c

Please sign in to comment.