Skip to content

Commit 9e8bbfa

Browse files
authored
Merge pull request #852 from bcgov/oleks
DSS-1058: FE: Contact Host should be available from the Listings Page
2 parents c6cf68a + f297913 commit 9e8bbfa

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

frontend/src/app/features/components/listings-table/listings-table.component.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ <h2 class="title">Individual Listings</h2>
3636
Send Takedown Request
3737
</button>
3838
</div>
39+
<div class="actions left-alignment" *ngIf="isCEU">
40+
<button pButton icon="pi pi-envelope" [disabled]="!listingsSelected" id="send_compliance_order_btn"
41+
(click)="onContactHost()">
42+
&nbsp;Contact Host
43+
</button>
44+
</div>
3945
<div class="content">
4046
<p-panel class="listing-table-panel">
4147
<ng-template pTemplate="header">

frontend/src/app/features/components/listings-table/listings-table.component.scss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,14 @@
112112
}
113113

114114
.actions {
115+
display: flex;
116+
width: 100%;
115117
padding-bottom: 12px;
116118

119+
&.left-alignment {
120+
justify-content: end;
121+
}
122+
117123
button {
118124
margin-right: 6px;
119125
}

frontend/src/app/features/components/listings-table/listings-table.component.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
2929
import { FilterPersistenceService } from '../../../common/services/filter-persistence.service';
3030
import { OrganizationService } from '../../../common/services/organization.service';
3131
import { UrlProtocolPipe } from '../../../common/pipes/url-protocol.pipe';
32+
import { ListingDetails } from '../../../common/models/listing-details';
3233

3334
@Component({
3435
selector: 'app-listings-table',
@@ -76,6 +77,10 @@ export class ListingsTableComponent implements OnInit {
7677

7778
readonly addressLowScore = Number.parseInt(environment.ADDRESS_SCORE);
7879

80+
get listingsSelected(): number {
81+
return Object.keys(this.selectedListings).length;
82+
}
83+
7984
constructor(
8085
private listingService: ListingDataService,
8186
private userService: UserDataService,
@@ -179,6 +184,15 @@ export class ListingsTableComponent implements OnInit {
179184
this.router.navigate(['/bulk-takedown-request'], { queryParams: { returnUrl: this.getUrlFromState() } });
180185
}
181186

187+
onContactHost(): void {
188+
this.searchStateService.selectedListings = Object.values(
189+
this.selectedListings,
190+
) as unknown as Array<ListingDetails>;
191+
this.router.navigate(['/send-compliance-order'], {
192+
queryParams: { returnUrl: this.getUrlFromState() },
193+
});
194+
}
195+
182196
onPageChange(value: any): void {
183197
this.currentPage.pageSize = value.rows;
184198
this.currentPage.pageNumber = value.page + 1;

0 commit comments

Comments
 (0)