Skip to content

Commit

Permalink
Merge pull request #852 from bcgov/oleks
Browse files Browse the repository at this point in the history
DSS-1058: FE: Contact Host should be available from the Listings Page
  • Loading branch information
ychung-mot authored Dec 5, 2024
2 parents c6cf68a + f297913 commit 9e8bbfa
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ <h2 class="title">Individual Listings</h2>
Send Takedown Request
</button>
</div>
<div class="actions left-alignment" *ngIf="isCEU">
<button pButton icon="pi pi-envelope" [disabled]="!listingsSelected" id="send_compliance_order_btn"
(click)="onContactHost()">
&nbsp;Contact Host
</button>
</div>
<div class="content">
<p-panel class="listing-table-panel">
<ng-template pTemplate="header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,14 @@
}

.actions {
display: flex;
width: 100%;
padding-bottom: 12px;

&.left-alignment {
justify-content: end;
}

button {
margin-right: 6px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import { RadioButtonModule } from 'primeng/radiobutton';
import { FilterPersistenceService } from '../../../common/services/filter-persistence.service';
import { OrganizationService } from '../../../common/services/organization.service';
import { UrlProtocolPipe } from '../../../common/pipes/url-protocol.pipe';
import { ListingDetails } from '../../../common/models/listing-details';

@Component({
selector: 'app-listings-table',
Expand Down Expand Up @@ -76,6 +77,10 @@ export class ListingsTableComponent implements OnInit {

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

get listingsSelected(): number {
return Object.keys(this.selectedListings).length;
}

constructor(
private listingService: ListingDataService,
private userService: UserDataService,
Expand Down Expand Up @@ -179,6 +184,15 @@ export class ListingsTableComponent implements OnInit {
this.router.navigate(['/bulk-takedown-request'], { queryParams: { returnUrl: this.getUrlFromState() } });
}

onContactHost(): void {
this.searchStateService.selectedListings = Object.values(
this.selectedListings,
) as unknown as Array<ListingDetails>;
this.router.navigate(['/send-compliance-order'], {
queryParams: { returnUrl: this.getUrlFromState() },
});
}

onPageChange(value: any): void {
this.currentPage.pageSize = value.rows;
this.currentPage.pageNumber = value.page + 1;
Expand Down

0 comments on commit 9e8bbfa

Please sign in to comment.