Skip to content

Commit

Permalink
Merge pull request #110 from bcgov/oleksandrbohuslavskyi
Browse files Browse the repository at this point in the history
DSS-255 - Allow Numbers and Letters in "Listing ID" fields on Notice form and Takedown form
  • Loading branch information
ychung-mot authored Apr 9, 2024
2 parents 2119499 + 259a872 commit 52a2080
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/common/models/compliance-notice.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface ComplianceNotice {
platformId: number;
listingId?: number;
listingId?: string;
listingUrl: string;
hostEmail?: string;
hostEmailSent: boolean;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/app/common/models/delisting-request.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export interface DelistingRequest {
lgId: number;
platformId: number;
listingId: number;
listingId: string;
listingUrl: string;
sendCopy: boolean;
ccList: Array<string>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

<div class="form-group-row">
<div class="form-group-row-col">
<label for="listingId">Add Listing ID Number if known (Optional)</label>
<label for="listingId">Add Listing ID if known (Optional)</label>
</div>
<div class="form-group-row-col">
<p-inputNumber inputStyleClass="long-text-field" formControlName="listingId" placeholder="Enter Value..."
inputId="listingId" mode="decimal" [min]="0" [max]="9000000000000000000" [useGrouping]="false">
</p-inputNumber>
<input class="long-text-field" type="text" inputStyleClass="long-text-field" formControlName="listingId"
placeholder="Enter Value..." pInputText formControlName="listingId" [maxlength]="25" id="listingId"
name="listingId" />
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,6 @@ export class ComplianceNoticeComponent implements OnInit {
private prepareFormModel(form: FormGroup): ComplianceNotice {
const model: ComplianceNotice = Object.assign({}, form.value);

model.listingId = Number.parseInt(model.listingId as any);

model.ccList = form.value['ccList'].prototype === Array
? form.value
: (form.value['ccList'] as string).split(',').filter(x => !!x).map(x => x.trim())
Expand All @@ -176,7 +174,7 @@ export class ComplianceNoticeComponent implements OnInit {
private initForm(): void {
this.myForm = this.fb.group({
platformId: [0, Validators.required],
listingId: [null],
listingId: [''],
listingUrl: ['', [Validators.required, validateUrl()]],
hostEmail: ['', [Validators.required, Validators.email]],
hostEmailSent: [false],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@

<div class="form-group-row">
<div class="form-group-row-col">
<label for="listingId">Add Listing ID Number if Known (Optional):</label>
<label for="listingId">Add Listing ID if Known (Optional):</label>
</div>
<div class="form-group-row-col">
<p-inputNumber inputStyleClass="long-text-field" formControlName="listingId" placeholder="Enter Value..."
inputId="listingId" mode="decimal" [min]="0" [max]="9000000000000000000" [useGrouping]="false">
</p-inputNumber>
<input class="long-text-field" type="text" inputStyleClass="long-text-field" formControlName="listingId"
placeholder="Enter Value..." pInputText formControlName="listingId" [maxlength]="25" id="listingId"
name="listingId" />
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class DelistingRequestComponent implements OnInit {
this.myForm = this.fb.group({
lgId: [0, Validators.required],
platformId: [0, Validators.required],
listingId: [null],
listingId: [''],
listingUrl: ['', [Validators.required, validateUrl()]],
sendCopy: [true],
ccList: ['', validateEmailListString()],
Expand Down

0 comments on commit 52a2080

Please sign in to comment.