Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/yj' into feature/dss-700-listing…
Browse files Browse the repository at this point in the history
…s-page-accessibility
  • Loading branch information
lisa-forsyth committed Dec 2, 2024
2 parents cb9827f + f10fbd8 commit e9f6335
Show file tree
Hide file tree
Showing 14 changed files with 91 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/zap-api-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ jobs:
format: openapi
target: ${{ github.event.inputs.spec_url }}
rules_file_name: '.zap/rules.tsv'
cmd_options: '-a'
cmd_options: '-O https://uat.strdata.gov.bc.ca'
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ Scaffolding.txt
/Test/UITest/Configuration/AppSettings.dev.json
/Test/UITest/Configuration/AppSettings.test.json
/Test/UITest/Configuration/AppSettings.uat.json
zap-results
10 changes: 8 additions & 2 deletions frontend/nginx.local.conf
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ http {

# See http://nginx.org/en/docs/http/ngx_http_core_module.html#server_tokens
server_tokens off;

# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Allow
# add_header Allow "GET, HEAD" always;
if ( $request_method !~ ^(GET|HEAD)$ ) {
return 405;
}
# See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Strict-Transport-Security
add_header strict-transport-security 'max-age=15768000; includeSubDomains; preload';

Expand Down Expand Up @@ -80,7 +84,9 @@ http {
include /nginx/nginx.conf;

location / {
root /nginx/html;
limit_except GET POST {
deny all;
} root /nginx/html;
index index.html index.htm;

sub_filter '</head>' '<meta name="csp-nonce" content="$cspNonce"></head>';
Expand Down
4 changes: 4 additions & 0 deletions frontend/src/app/common/models/jurisdiction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ export interface Jurisdiction {
shapeFileId: string;
isPrincipalResidenceRequired: boolean;
isStrProhibited: boolean;
isStraaExempt: boolean;
isBusinessLicenceRequired: boolean;
economicRegionDsc: string;
managingOrganizationId: number;
updDtm: string;
isActive: boolean;
}

export interface JurisdictionUpdate {
organizationId: number;
managingOrganizationId: number;
isPrincipalResidenceRequired: boolean;
isStrProhibited: boolean;
isStraaExempt: boolean;
isBusinessLicenceRequired: boolean;
economicRegionDsc: string;
updDtm: string;
isActive: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,29 +116,19 @@ <h4>Takedown Requests for each platform are aggregated into a CSV file and sent

<div class="form-group-row">
<div class="form-group-row-col">
<label for="customDetailTxt">Provide details of the request
<strong>{{isWithStandardDetailControl.value?' (Optional)':''}}</strong></label>
<label for="customDetailTxt">Provide details of the request</label>
</div>
<div class="form-group-row-col">
<p-editor (onTextChange)="onEditorChanged($event)" appendTo="body" #textarea id="customDetailTxt"
name="customDetailTxt" formControlName="customDetailTxt" [style]="{ height: '320px' }">
<ng-template pTemplate="header">
<span class="ql-formats">
<button type="button" class="ql-bold" aria-label="Bold"></button>
<button type="button" class="ql-italic" aria-label="Italic"></button>
<button type="button" class="ql-underline" aria-label="Underline"></button>
<button type="button" class="ql-link" aria-label="Link"></button>
<button class="ql-list" value="ordered" aria-label="List Ordered"></button>
<button class="ql-list" value="bullet" aria-label="List Bullet"></button>
</span>
</ng-template>
</p-editor>
<span class="limit-text" [class.almost-limit-text]="(commentControl.getRawValue() || '').length > 1950"
[class.limited-text]="(commentControl.getRawValue() || '').length > 1999">{{(commentControl.getRawValue()
|| '').length}}/2000</span>
<textarea #textarea rows="5" cols="30" maxlength="2000" class="wide custom-details"
formControlName="customDetailTxt"
placeholder="{{isWithStandardDetailControl.value?'Optional':'Required'}}" pInputTextarea
id="customDetailTxt" name="customDetailTxt"></textarea>
<span class="limit-text" [class.almost-limit-text]="textarea.value.length > 1950"
[class.limited-text]="textarea.value.length > 1999">{{textarea.value.length}}/2000</span>
</div>
<div class="form-group-row-col validation-errors" *ngIf="!commentControl.pristine && commentControl.errors">
<small id="customDetailTxtError" *ngIf="commentControl.errors?.['required']">Details of the
<div class="form-group-row-col validation-errors"
*ngIf="!customDetailTxtControl.pristine && customDetailTxtControl.errors">
<small id="customDetailTxtError" *ngIf="customDetailTxtControl.errors?.['required']">Details of the
request
are required</small>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { validateEmailListString } from '../../../common/consts/validators.const
import { ErrorHandlingService } from '../../../common/services/error-handling.service';
import { GlobalLoaderService } from '../../../common/services/global-loader.service';
import { ListingTableRow } from '../../../common/models/listing-table-row';
import { EditorModule, EditorTextChangeEvent } from 'primeng/editor';

@Component({
selector: 'app-bulk-takedown-request',
Expand All @@ -34,7 +33,6 @@ import { EditorModule, EditorTextChangeEvent } from 'primeng/editor';
DialogModule,
ChipsModule,
ReactiveFormsModule,
EditorModule,
],
templateUrl: './bulk-takedown-request.component.html',
styleUrl: './bulk-takedown-request.component.scss'
Expand Down Expand Up @@ -64,7 +62,7 @@ export class BulkTakedownRequestComponent implements OnInit {
public get isWithStandardDetailControl(): AbstractControl {
return this.myForm.controls['isWithStandardDetail'];
}
public get commentControl(): AbstractControl {
public get customDetailTxtControl(): AbstractControl {
return this.myForm.controls['customDetailTxt'];
}

Expand Down Expand Up @@ -95,10 +93,6 @@ export class BulkTakedownRequestComponent implements OnInit {
});
}

onEditorChanged(_: EditorTextChangeEvent): void {
this.commentControl.updateValueAndValidity();
}

onSort(property: keyof ListingDetails): void {
if (this.sort) {
if (this.sort.prop === property) {
Expand Down Expand Up @@ -155,11 +149,11 @@ export class BulkTakedownRequestComponent implements OnInit {

onWithStandardDetailChanged(value: CheckboxChangeEvent): void {
if (value.checked)
this.commentControl.removeValidators([Validators.required]);
this.customDetailTxtControl.removeValidators([Validators.required]);
else
this.commentControl.addValidators([Validators.required]);
this.customDetailTxtControl.addValidators([Validators.required]);

this.commentControl.updateValueAndValidity();
this.customDetailTxtControl.updateValueAndValidity();
this.myForm.updateValueAndValidity();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,28 +85,15 @@ <h4>Add Details of your request</h4>

<div class="form-group-row">
<div class="form-group-row-col">
<label for="customDetailTxt">Provide details of the request
<strong>{{isWithStandardDetailControl.value?'(Optional)':''}}</strong></label>
<label for="customDetailTxt">Provide details of the request</label>
</div>
<div class="form-group-row-col">
<p-editor (onTextChange)="onEditorChanged($event)" appendTo="body" id="comment" name="comment"
placeholder="Enter Additional Comment Here..." formControlName="customDetailTxt"
[style]="{ height: '320px' }">
<ng-template pTemplate="header">
<span class="ql-formats">
<button type="button" class="ql-bold" aria-label="Bold"></button>
<button type="button" class="ql-italic" aria-label="Italic"></button>
<button type="button" class="ql-underline" aria-label="Underline"></button>
<button type="button" class="ql-link" aria-label="Link"></button>
<button class="ql-list" value="ordered" aria-label="List Ordered"></button>
<button class="ql-list" value="bullet" aria-label="List Bullet"></button>
</span>
</ng-template>
</p-editor>
<span class="limit-text"
[class.almost-limit-text]="(customDetailTxtControl.getRawValue() || '').length > 1950"
[class.limited-text]="(customDetailTxtControl.getRawValue() || '').length > 1999">{{(customDetailTxtControl.getRawValue()
|| '').length}}/2000</span>
<textarea #textarea rows="5" cols="30" maxlength="2000" class="customDetail-txa"
formControlName="customDetailTxt"
placeholder="{{isWithStandardDetailControl.value?'Optional':'Required'}}" pInputTextarea
id="customDetailTxt" name="customDetailTxt"></textarea>
<span class="limit-text" [class.almost-limit-text]="textarea.value.length > 1950"
[class.limited-text]="textarea.value.length > 1999">{{textarea.value.length}}/2000</span>
</div>
<div class="form-group-row-col validation-errors"
*ngIf="!customDetailTxtControl.pristine && customDetailTxtControl.errors">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import { InputNumberModule } from 'primeng/inputnumber';
import { GlobalLoaderService } from '../../../common/services/global-loader.service';
import { forkJoin } from 'rxjs';
import { ErrorHandlingService } from '../../../common/services/error-handling.service';
import { EditorModule, EditorTextChangeEvent } from 'primeng/editor';

@Component({
selector: 'app-delisting-request',
Expand All @@ -41,7 +40,6 @@ import { EditorModule, EditorTextChangeEvent } from 'primeng/editor';
TooltipModule,
ButtonModule,
ToastModule,
EditorModule,
],
templateUrl: './delisting-request.component.html',
styleUrl: './delisting-request.component.scss'
Expand Down Expand Up @@ -153,10 +151,6 @@ export class DelistingRequestComponent implements OnInit {
}
}

onEditorChanged(_: EditorTextChangeEvent): void {
this.customDetailTxtControl.updateValueAndValidity();
}

onPreviewClose(): void {
this.isPreviewVisible = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ <h2>Manage Jurisdictions</h2>
</th>
<th class="sortable-header" id="isPrincipalResidenceRequired_header"
[class.sorted]="this.sortSub && this.sortSub.prop === 'isPrincipalResidenceRequired'"
(click)="onSortSub('isPrincipalResidenceRequired')">Principle Residence Requirement?
(click)="onSortSub('isPrincipalResidenceRequired')">PR Requirement
<i class="pi pi-angle-down"
*ngIf="this.sortSub && this.sortSub.prop === 'isPrincipalResidenceRequired' && this.sortSub.dir === 'desc'"></i>
<i class="pi pi-angle-up"
Expand All @@ -100,15 +100,23 @@ <h2>Manage Jurisdictions</h2>

<th class="sortable-header" id="isStrProhibited_header"
[class.sorted]="this.sortSub && this.sortSub.prop === 'isStrProhibited'"
(click)="onSortSub('isStrProhibited')">STR Prohibited?
(click)="onSortSub('isStrProhibited')">STR Prohibited
<i class="pi pi-angle-down"
*ngIf="this.sortSub && this.sortSub.prop === 'isStrProhibited' && this.sortSub.dir === 'desc'"></i>
<i class="pi pi-angle-up"
*ngIf="this.sortSub && this.sortSub.prop === 'isStrProhibited' && this.sortSub.dir === 'asc'"></i>
</th>
<th class="sortable-header" id="isStraaExempt_header"
[class.sorted]="this.sortSub && this.sortSub.prop === 'isStraaExempt'"
(click)="onSortSub('isStraaExempt')">STRAA Exempt
<i class="pi pi-angle-down"
*ngIf="this.sortSub && this.sortSub.prop === 'isStraaExempt' && this.sortSub.dir === 'desc'"></i>
<i class="pi pi-angle-up"
*ngIf="this.sortSub && this.sortSub.prop === 'isStraaExempt' && this.sortSub.dir === 'asc'"></i>
</th>
<th class="sortable-header" id="isBusinessLicenceRequired_header"
[class.sorted]="this.sortSub && this.sortSub.prop === 'isBusinessLicenceRequired'"
(click)="onSortSub('isBusinessLicenceRequired')"> BL Requirement?
(click)="onSortSub('isBusinessLicenceRequired')"> BL Requirement
<i class="pi pi-angle-down"
*ngIf="this.sortSub && this.sortSub.prop === 'isBusinessLicenceRequired' && this.sortSub.dir === 'desc'"></i>
<i class="pi pi-angle-up"
Expand All @@ -124,6 +132,7 @@ <h2>Manage Jurisdictions</h2>
<td>{{jurisdiction.shapeFileId || '-'}}</td>
<td>{{jurisdiction.isPrincipalResidenceRequired?'Yes':'No'}} </td>
<td>{{jurisdiction.isStrProhibited?'Yes':'No'}} </td>
<td>{{jurisdiction.isStraaExempt?'Yes':'No'}} </td>
<td>{{jurisdiction.isBusinessLicenceRequired?'Yes':'No'}} </td>
<td *ngIf="canEdit" style="text-align: center">
<a id="jurisdiction-edit-{{index}}-icon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h2>Update Jurisdiction Information</h2>
<div class="col">
<div class="form-group-row">
<div class="form-group-row-col">
<label for="isPrincipalResidenceRequired">Principle Residence Requirement Applies?</label>
<label for="isPrincipalResidenceRequired">Principal Residence Requirement Applies?</label>
</div>
<div class="form-group-row-col radios">
<p-radioButton name="isPrincipalResidenceRequired" id="isPrincipalResidenceRequired-true"
Expand All @@ -89,6 +89,21 @@ <h2>Update Jurisdiction Information</h2>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group-row">
<div class="form-group-row-col">
<label for="isStraaExempt">STRAA Exempt?</label>
</div>
<div class="form-group-row-col radios">
<p-radioButton name="isStraaExempt" id="isStraaExempt-true" [value]="true" label="Yes"
formControlName="isStraaExempt"></p-radioButton> &nbsp;
<p-radioButton name="isStraaExempt" id="isStraaExempt-false" [value]="false" label="No"
formControlName="isStraaExempt"></p-radioButton>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group-row">
Expand All @@ -105,7 +120,21 @@ <h2>Update Jurisdiction Information</h2>
</div>
</div>
</div>

<div class="row">
<div class="col">
<div class="form-group-row">
<div class="form-group-row-col">
<label for="isActive">Is Active?</label>
</div>
<div class="form-group-row-col radios">
<p-radioButton name="isActive" id="isActive-true" [value]="true" label="Yes"
formControlName="isActive"></p-radioButton> &nbsp;
<p-radioButton name="isActive" id="isActive-false" [value]="false" label="No"
formControlName="isActive"></p-radioButton>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col">
<div class="form-group-row">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ export class UpdateJurisdictionInformationComponent implements OnInit {
managingOrganizationId: number;
isPrincipalResidenceRequired: boolean;
isStrProhibited: boolean;
isStraaExempt: boolean;
isBusinessLicenceRequired: boolean;
economicRegionDsc: string;
isActive: boolean;
} = this.myForm.getRawValue();

const jurisdictionUpdate: JurisdictionUpdate = {
Expand All @@ -87,8 +89,10 @@ export class UpdateJurisdictionInformationComponent implements OnInit {
isBusinessLicenceRequired: formValue.isBusinessLicenceRequired,
isPrincipalResidenceRequired: formValue.isPrincipalResidenceRequired,
isStrProhibited: formValue.isStrProhibited,
isStraaExempt: formValue.isStraaExempt,
managingOrganizationId: formValue.managingOrganizationId,
updDtm: this.jurisdiction.updDtm,
isActive: formValue.isActive,
};

this.loaderService.loadingStart();
Expand Down Expand Up @@ -138,8 +142,10 @@ export class UpdateJurisdictionInformationComponent implements OnInit {
managingOrganizationId: [this.jurisdiction.managingOrganizationId, [Validators.required]],
isPrincipalResidenceRequired: [this.jurisdiction.isPrincipalResidenceRequired || false, [Validators.required]],
isStrProhibited: [this.jurisdiction.isStrProhibited || false, [Validators.required]],
isStraaExempt: [this.jurisdiction.isStraaExempt || false, [Validators.required]],
isBusinessLicenceRequired: [this.jurisdiction.isBusinessLicenceRequired || false, [Validators.required]],
economicRegionDsc: [this.jurisdiction.economicRegionDsc, [Validators.required]],
isActive: [this.jurisdiction.isActive || false, [Validators.required]],
});

this.cd.detectChanges();
Expand Down
3 changes: 2 additions & 1 deletion server/StrDss.Api/Controllers/RentalListingsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,8 @@ public async Task<ActionResult> ConfirmAddress(long rentalListingId)
[ApiAuthorize]
[HttpGet("addresses/candidates")]
public async Task<ActionResult<List<AddressDto>>> GetAddressCandidates(string addressString)
{
{
CommonUtils.SanitizeObject(addressString);
var addresses = await _listingService.GetAddressCandidatesAsync(addressString, 3);
return Ok(addresses);
}
Expand Down
Loading

0 comments on commit e9f6335

Please sign in to comment.