Skip to content

Commit 4561b99

Browse files
authored
Merge pull request #292 from NREL/issue-291
fix stakeholders bug in system inventory
2 parents d92f41f + cb01334 commit 4561b99

File tree

4 files changed

+17
-8
lines changed

4 files changed

+17
-8
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.success{
2+
color: green;
3+
}

src/app/shared/contact-modal/contact-modal.component.html

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
*ngFor="let contact of contacts; let index = index;" (click)="toggleContactActive(index)">
1212
<div class="d-flex justify-content-between w-100">
1313
<div class="p-0">
14-
<ng-template
15-
[ngIf]="(contextGuid | includesContact:contactContext: contact)">
16-
<fa-icon [icon]="faCircleCheck"></fa-icon>
14+
<ng-template [ngIf]="(contextGuid | includesContact:contactContext: contact)"
15+
[ngIfElse]="notSelectedBlock">
16+
<fa-icon class="success" [icon]="faCircleCheck"></fa-icon>
17+
</ng-template>
18+
<ng-template #notSelectedBlock>
19+
<fa-icon [icon]="faCircle"></fa-icon>
1720
</ng-template>
1821
{{contact | contactNameDisplay}}
1922
</div>
@@ -41,9 +44,8 @@
4144
Stakeholder
4245
</th>
4346
<th>
44-
<ng-template
45-
[ngIf]="(contextGuid | includesContact:contactContext: selectedContact)">
46-
<fa-icon [icon]="faCircleCheck"></fa-icon>
47+
<ng-template [ngIf]="(contextGuid | includesContact:contactContext: selectedContact)">
48+
<fa-icon class="success" [icon]="faCircleCheck"></fa-icon>
4749
</ng-template>
4850
{{selectedContact | contactNameDisplay}}
4951
</th>
@@ -97,6 +99,7 @@
9799
</div>
98100
<div class="popup-footer d-flex justify-content-end">
99101
<button class="btn btn-secondary me-2 btn-sm" (click)="closeModal()">Cancel</button>
100-
<button class="btn btn-success btn-sm" (click)="saveChanges()"><fa-icon [icon]="faSave"></fa-icon> Set Stakeholders</button>
102+
<button class="btn btn-success btn-sm" (click)="saveChanges()"><fa-icon [icon]="faSave"></fa-icon> Set
103+
Stakeholders</button>
101104
</div>
102105
</div>

src/app/shared/contact-modal/contact-modal.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';
2-
import { IconDefinition, faChevronLeft, faCircleCheck, faContactBook, faSave, faUser } from '@fortawesome/free-solid-svg-icons';
2+
import { IconDefinition, faChevronLeft, faCircle, faCircleCheck, faContactBook, faSave, faUser } from '@fortawesome/free-solid-svg-icons';
33
import { firstValueFrom } from 'rxjs';
44
import { ContactIdbService } from 'src/app/indexed-db/contact-idb.service';
55
import { ContactContext, IdbContact } from 'src/app/models/contact';
@@ -28,6 +28,7 @@ export class ContactModalComponent implements OnInit {
2828
faChevronLeft: IconDefinition = faChevronLeft;
2929
faUser: IconDefinition = faUser;
3030
faContactBook: IconDefinition = faContactBook;
31+
faCircle: IconDefinition = faCircle;
3132
constructor(
3233
private contactIdbService: ContactIdbService
3334
) {

src/app/shared/helper-pipes/associated-contacts.pipe.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ export class AssociatedContactsPipe implements PipeTransform {
2222
_contacts.push(_contact);
2323
} else if (context == 'nonEnergyBenefit' && _contact.nonEnergyBenefitIds.includes(guid)) {
2424
_contacts.push(_contact);
25+
} else if (context == 'energyEquipment' && _contact.energyEquipmentIds.includes(guid)) {
26+
_contacts.push(_contact);
2527
}
2628
});
2729
if (_contacts.length > 0) {

0 commit comments

Comments
 (0)