Skip to content

Commit cf2f46d

Browse files
authored
Merge pull request #730 from bcgov/oleks
Emails for SubPlatforms, minor fixes.
2 parents 4815601 + 136ad32 commit cf2f46d

File tree

10 files changed

+241
-11
lines changed

10 files changed

+241
-11
lines changed

frontend/src/app/common/models/platform.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export interface Platform {
1717
secondaryTakedownRequestContactEmail: string;
1818
subsidiaries: Array<SubPlatform>;
1919
platformType: string;
20+
updUserDisplayNm: string;
2021
}
2122

2223
export interface UpdatePlatform {
@@ -35,6 +36,10 @@ export interface UpdateSubPlatform {
3536
updDtm: string;
3637
isActive: boolean;
3738
managingOrganizationId: number;
39+
primaryNoticeOfTakedownContactEmail: string;
40+
primaryTakedownRequestContactEmail: string;
41+
secondaryNoticeOfTakedownContactEmail: string;
42+
secondaryTakedownRequestContactEmail: string;
3843
}
3944

4045
export interface SubPlatform {
@@ -43,10 +48,15 @@ export interface SubPlatform {
4348
organizationType: string;
4449
organizationCd: string;
4550
organizationNm: string;
51+
primaryNoticeOfTakedownContactEmail: string;
52+
primaryTakedownRequestContactEmail: string;
53+
secondaryNoticeOfTakedownContactEmail: string;
54+
secondaryTakedownRequestContactEmail: string;
4655
updDtm: string;
4756
isActive: boolean;
4857
updUserGuid: string;
4958
managingOrganizationId: number;
59+
updUserDisplayNm: string;
5060
}
5161

5262
export interface PlatformCreate {
@@ -66,4 +76,8 @@ export interface SubPlatformCreate {
6676
managingOrganizationId: number;
6777
isActive: boolean;
6878
updDtm: string;
79+
primaryNoticeOfTakedownContactEmail: string;
80+
primaryTakedownRequestContactEmail: string;
81+
secondaryNoticeOfTakedownContactEmail: string;
82+
secondaryTakedownRequestContactEmail: string;
6983
}

frontend/src/app/features/components/platform-management/add-new-platform/add-new-platform.component.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { GlobalLoaderService } from '../../../../common/services/global-loader.s
99
import { OrganizationService } from '../../../../common/services/organization.service';
1010
import { DropdownOption } from '../../../../common/models/dropdown-option';
1111
import { RadioButtonModule } from 'primeng/radiobutton';
12+
import { Router } from '@angular/router';
1213

1314
@Component({
1415
selector: 'app-add-new-platform',
@@ -33,6 +34,7 @@ export class AddNewPlatformComponent implements OnInit {
3334
private fb: FormBuilder,
3435
private messageHandlerService: ErrorHandlingService,
3536
private loaderService: GlobalLoaderService,
37+
private router: Router,
3638
private orgService: OrganizationService,
3739
) { }
3840

@@ -68,6 +70,7 @@ export class AddNewPlatformComponent implements OnInit {
6870
onCancel(): void {
6971
this.myForm.reset();
7072
this.platformStatusControl.setValue(true);
73+
this.router.navigateByUrl(`/platform-management`);
7174
}
7275

7376
public get organizationNmControl(): AbstractControl {

frontend/src/app/features/components/platform-management/add-sub-platform/add-sub-platform.component.html

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,88 @@ <h2>Add New Platform</h2>
4242
</div>
4343
</div>
4444
</div>
45+
<div class="row">
46+
<div class="col">
47+
<div class="form-group-row">
48+
<div class="form-group-row-col">
49+
<label for="organizationCd">Email for Non-Compliance Notices</label>
50+
</div>
51+
<div class="form-group-row-col">
52+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
53+
type="text" pInputText formControlName="primaryNoticeOfTakedownContactEmail"
54+
id="primaryNoticeOfTakedownContactEmail" name="primaryNoticeOfTakedownContactEmail" />
55+
</div>
56+
<div class="validation-errors" *ngIf="!primaryNoticeOfTakedownContactEmailControl.pristine">
57+
58+
<small id="requiredPrimaryNoticeOfTakedownContactEmail"
59+
*ngIf="primaryNoticeOfTakedownContactEmailControl.errors?.['required']">
60+
Email is Required
61+
</small>
62+
</div>
63+
</div>
64+
</div>
65+
<div class="col">
66+
<div class="form-group-row">
67+
<div class="form-group-row-col">
68+
<label for="secondaryNoticeOfTakedownContactEmail">Secondary Email for Non-Compliance
69+
Notices (optional)</label>
70+
</div>
71+
<div class="form-group-row-col">
72+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
73+
type="text" pInputText formControlName="secondaryNoticeOfTakedownContactEmail"
74+
id="secondaryNoticeOfTakedownContactEmail" name="secondaryNoticeOfTakedownContactEmail" />
75+
</div>
76+
<div class="validation-errors" *ngIf="!secondaryNoticeOfTakedownContactEmailControl.pristine">
77+
78+
<small id="requiredSecondaryNoticeOfTakedownContactEmail"
79+
*ngIf="secondaryNoticeOfTakedownContactEmailControl.errors?.['required']">
80+
Email is Required
81+
</small>
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
<div class="row">
87+
<div class="col">
88+
<div class="form-group-row">
89+
<div class="form-group-row-col">
90+
<label for="primaryTakedownRequestContactEmail">Email for Takedown Request Letters</label>
91+
</div>
92+
<div class="form-group-row-col">
93+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
94+
type="text" pInputText formControlName="primaryTakedownRequestContactEmail"
95+
id="primaryTakedownRequestContactEmail" name="primaryTakedownRequestContactEmail" />
96+
</div>
97+
<div class="validation-errors" *ngIf="!primaryTakedownRequestContactEmailControl.pristine">
98+
99+
<small id="requiredPrimaryTakedownRequestContactEmail"
100+
*ngIf="primaryTakedownRequestContactEmailControl.errors?.['required']">
101+
Email is Required
102+
</small>
103+
</div>
104+
</div>
105+
</div>
106+
<div class="col">
107+
<div class="form-group-row">
108+
<div class="form-group-row-col">
109+
<label for="secondaryTakedownRequestContactEmail">Secondary Email for Takedown Request
110+
Letters (optional)</label>
111+
</div>
112+
<div class="form-group-row-col">
113+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
114+
type="text" pInputText formControlName="secondaryTakedownRequestContactEmail"
115+
id="secondaryTakedownRequestContactEmail" name="secondaryTakedownRequestContactEmail" />
116+
</div>
117+
<div class="validation-errors" *ngIf="!secondaryTakedownRequestContactEmailControl.pristine">
118+
119+
<small id="requiredSecondaryTakedownRequestContactEmail"
120+
*ngIf="secondaryTakedownRequestContactEmailControl.errors?.['required']">
121+
Email is Required
122+
</small>
123+
</div>
124+
</div>
125+
</div>
126+
</div>
45127
</form>
46128
</div>
47129

frontend/src/app/features/components/platform-management/add-sub-platform/add-sub-platform.component.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,27 @@ export class AddSubPlatformComponent implements OnInit {
7474
public get platformStatusControl(): AbstractControl {
7575
return this.myForm.controls['status'];
7676
}
77+
public get primaryNoticeOfTakedownContactEmailControl(): AbstractControl {
78+
return this.myForm.controls['primaryNoticeOfTakedownContactEmail'];
79+
}
80+
public get primaryTakedownRequestContactEmailControl(): AbstractControl {
81+
return this.myForm.controls['primaryTakedownRequestContactEmail'];
82+
}
83+
public get secondaryNoticeOfTakedownContactEmailControl(): AbstractControl {
84+
return this.myForm.controls['secondaryNoticeOfTakedownContactEmail'];
85+
}
86+
public get secondaryTakedownRequestContactEmailControl(): AbstractControl {
87+
return this.myForm.controls['secondaryTakedownRequestContactEmail'];
88+
}
7789

7890
private initForm(): void {
7991
this.myForm = this.fb.group({
8092
organizationNm: ['', [Validators.required]],
8193
organizationCd: ['', [Validators.required]],
94+
primaryNoticeOfTakedownContactEmail: ['', [Validators.required, Validators.email]],
95+
primaryTakedownRequestContactEmail: ['', [Validators.required, Validators.email]],
96+
secondaryNoticeOfTakedownContactEmail: ['', [Validators.email]],
97+
secondaryTakedownRequestContactEmail: ['', [Validators.email]],
8298
status: [{ value: true, disabled: true }, []],
8399
});
84100
}

frontend/src/app/features/components/platform-management/edit-platform/edit-platform.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ <h2>Edit Platform</h2>
148148
<div class="col">
149149
<div class="form-group-row">
150150
<div class="form-group-row-col">
151-
<label for="platformType">Platform Type</label>
151+
<label for="platformType">Platform Status</label>
152152
</div>
153153
<div class="form-group-row-col">
154154
<p-radioButton name="isActive" id="isActive-true" [value]="true" label="Active"

frontend/src/app/features/components/platform-management/edit-platform/edit-platform.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit } from '@angular/core';
1+
import { ChangeDetectorRef, Component, OnInit } from '@angular/core';
22
import { AbstractControl, FormBuilder, FormGroup, FormsModule, ReactiveFormsModule, Validators } from '@angular/forms';
33
import { DropdownOption } from '../../../../common/models/dropdown-option';
44
import { ErrorHandlingService } from '../../../../common/services/error-handling.service';
@@ -40,6 +40,7 @@ export class EditPlatformComponent implements OnInit {
4040
private route: ActivatedRoute,
4141
private router: Router,
4242
private orgService: OrganizationService,
43+
private cd: ChangeDetectorRef,
4344
) { }
4445

4546
ngOnInit(): void {
@@ -130,7 +131,9 @@ export class EditPlatformComponent implements OnInit {
130131
secondaryNoticeOfTakedownContactEmail: [this.platform.secondaryNoticeOfTakedownContactEmail, [Validators.email]],
131132
secondaryTakedownRequestContactEmail: [this.platform.secondaryTakedownRequestContactEmail, [Validators.email]],
132133
platformType: [this.platform.platformType, [Validators.required]],
133-
isActive: [!!this.platform.isActive, [Validators.required]],
134+
isActive: [{ value: !!this.platform.isActive, disabled: true }, [Validators.required]],
134135
});
136+
137+
this.cd.detectChanges();
135138
}
136139
}

frontend/src/app/features/components/platform-management/edit-sub-platform/edit-sub-platform.component.html

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,89 @@ <h2>Edit Subsidiary Platform</h2>
4646
<div class="col">
4747
<div class="form-group-row">
4848
<div class="form-group-row-col">
49-
<label for="platformType">Platform Type</label>
49+
<label for="organizationCd">Email for Non-Compliance Notices</label>
50+
</div>
51+
<div class="form-group-row-col">
52+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
53+
type="text" pInputText formControlName="primaryNoticeOfTakedownContactEmail"
54+
id="primaryNoticeOfTakedownContactEmail" name="primaryNoticeOfTakedownContactEmail" />
55+
</div>
56+
<div class="validation-errors" *ngIf="!primaryNoticeOfTakedownContactEmailControl.pristine">
57+
58+
<small id="requiredPrimaryNoticeOfTakedownContactEmail"
59+
*ngIf="primaryNoticeOfTakedownContactEmailControl.errors?.['required']">
60+
Email is Required
61+
</small>
62+
</div>
63+
</div>
64+
</div>
65+
<div class="col">
66+
<div class="form-group-row">
67+
<div class="form-group-row-col">
68+
<label for="secondaryNoticeOfTakedownContactEmail">Secondary Email for Non-Compliance
69+
Notices (optional)</label>
70+
</div>
71+
<div class="form-group-row-col">
72+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
73+
type="text" pInputText formControlName="secondaryNoticeOfTakedownContactEmail"
74+
id="secondaryNoticeOfTakedownContactEmail" name="secondaryNoticeOfTakedownContactEmail" />
75+
</div>
76+
<div class="validation-errors" *ngIf="!secondaryNoticeOfTakedownContactEmailControl.pristine">
77+
78+
<small id="requiredSecondaryNoticeOfTakedownContactEmail"
79+
*ngIf="secondaryNoticeOfTakedownContactEmailControl.errors?.['required']">
80+
Email is Required
81+
</small>
82+
</div>
83+
</div>
84+
</div>
85+
</div>
86+
<div class="row">
87+
<div class="col">
88+
<div class="form-group-row">
89+
<div class="form-group-row-col">
90+
<label for="primaryTakedownRequestContactEmail">Email for Takedown Request Letters</label>
91+
</div>
92+
<div class="form-group-row-col">
93+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
94+
type="text" pInputText formControlName="primaryTakedownRequestContactEmail"
95+
id="primaryTakedownRequestContactEmail" name="primaryTakedownRequestContactEmail" />
96+
</div>
97+
<div class="validation-errors" *ngIf="!primaryTakedownRequestContactEmailControl.pristine">
98+
99+
<small id="requiredPrimaryTakedownRequestContactEmail"
100+
*ngIf="primaryTakedownRequestContactEmailControl.errors?.['required']">
101+
Email is Required
102+
</small>
103+
</div>
104+
</div>
105+
</div>
106+
<div class="col">
107+
<div class="form-group-row">
108+
<div class="form-group-row-col">
109+
<label for="secondaryTakedownRequestContactEmail">Secondary Email for Takedown Request
110+
Letters (optional)</label>
111+
</div>
112+
<div class="form-group-row-col">
113+
<input placeholder="Enter Platform’s Email Contact" [ngClass]="'full-width-text-field'"
114+
type="text" pInputText formControlName="secondaryTakedownRequestContactEmail"
115+
id="secondaryTakedownRequestContactEmail" name="secondaryTakedownRequestContactEmail" />
116+
</div>
117+
<div class="validation-errors" *ngIf="!secondaryTakedownRequestContactEmailControl.pristine">
118+
119+
<small id="requiredSecondaryTakedownRequestContactEmail"
120+
*ngIf="secondaryTakedownRequestContactEmailControl.errors?.['required']">
121+
Email is Required
122+
</small>
123+
</div>
124+
</div>
125+
</div>
126+
</div>
127+
<div class="row">
128+
<div class="col">
129+
<div class="form-group-row">
130+
<div class="form-group-row-col">
131+
<label for="platformType">Platform Status</label>
50132
</div>
51133
<div class="form-group-row-col">
52134
<p-radioButton name="isActive" id="isActive-true" [value]="true" label="Active"

frontend/src/app/features/components/platform-management/edit-sub-platform/edit-sub-platform.component.ts

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ export class EditSubPlatformComponent implements OnInit {
5252
isActive: platformRaw.isActive,
5353
organizationNm: platformRaw.organizationNm,
5454
managingOrganizationId: this.platform.managingOrganizationId,
55+
primaryNoticeOfTakedownContactEmail: platformRaw.primaryNoticeOfTakedownContactEmail,
56+
primaryTakedownRequestContactEmail: platformRaw.primaryTakedownRequestContactEmail,
57+
secondaryNoticeOfTakedownContactEmail: platformRaw.secondaryNoticeOfTakedownContactEmail,
58+
secondaryTakedownRequestContactEmail: platformRaw.secondaryTakedownRequestContactEmail,
5559
updDtm: this.platform.updDtm,
5660
};
5761

@@ -78,6 +82,18 @@ export class EditSubPlatformComponent implements OnInit {
7882
public get organizationCdControl(): AbstractControl {
7983
return this.myForm.controls['organizationCd'];
8084
}
85+
public get primaryNoticeOfTakedownContactEmailControl(): AbstractControl {
86+
return this.myForm.controls['primaryNoticeOfTakedownContactEmail'];
87+
}
88+
public get primaryTakedownRequestContactEmailControl(): AbstractControl {
89+
return this.myForm.controls['primaryTakedownRequestContactEmail'];
90+
}
91+
public get secondaryNoticeOfTakedownContactEmailControl(): AbstractControl {
92+
return this.myForm.controls['secondaryNoticeOfTakedownContactEmail'];
93+
}
94+
public get secondaryTakedownRequestContactEmailControl(): AbstractControl {
95+
return this.myForm.controls['secondaryTakedownRequestContactEmail'];
96+
}
8197
public get platformStatusControl(): AbstractControl {
8298
return this.myForm.controls['isActive'];
8399
}
@@ -100,7 +116,11 @@ export class EditSubPlatformComponent implements OnInit {
100116
this.myForm = this.fb.group({
101117
organizationNm: [this.platform.organizationNm, [Validators.required]],
102118
organizationCd: [{ value: this.platform.organizationCd, disabled: true }, [Validators.required]],
103-
isActive: [!!this.platform.isActive, [Validators.required]],
119+
primaryNoticeOfTakedownContactEmail: [this.platform.primaryNoticeOfTakedownContactEmail, [Validators.required, Validators.email]],
120+
primaryTakedownRequestContactEmail: [this.platform.primaryTakedownRequestContactEmail, [Validators.required, Validators.email]],
121+
secondaryNoticeOfTakedownContactEmail: [this.platform.secondaryNoticeOfTakedownContactEmail, [Validators.email]],
122+
secondaryTakedownRequestContactEmail: [this.platform.secondaryTakedownRequestContactEmail, [Validators.email]],
123+
isActive: [{ value: !!this.platform.isActive, disabled: true }, [Validators.required]],
104124
});
105125

106126
this.cd.detectChanges();

frontend/src/app/features/components/platform-management/platform-management.component.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ <h2>Manage Platforms</h2>
112112
<i class="pi pi-angle-up"
113113
*ngIf="this.sortSub && this.sortSub.prop === 'organizationCd' && this.sortSub.dir === 'asc'"></i>
114114
</th>
115-
<th>Platform Type</th>
116115
<th class="sortable-header" id="primaryNoticeOfTakedownContactEmail_header"
117116
[class.sorted]="this.sortSub && this.sortSub.prop === 'primaryNoticeOfTakedownContactEmail'"
118117
(click)="onSortSub('primaryNoticeOfTakedownContactEmail')">Notice of Non-compliance Email
@@ -153,10 +152,9 @@ <h2>Manage Platforms</h2>
153152
<tr>
154153
<td>{{subPlatform.organizationNm || '-'}}</td>
155154
<td>{{subPlatform.organizationCd || '-'}}</td>
156-
<td>{{platform.platformType || '-'}}</td>
157-
<td>{{platform.primaryNoticeOfTakedownContactEmail || '-'}}
155+
<td>{{subPlatform.primaryNoticeOfTakedownContactEmail || '-'}}
158156
</td>
159-
<td>{{platform.primaryTakedownRequestContactEmail || '-'}}
157+
<td>{{subPlatform.primaryTakedownRequestContactEmail || '-'}}
160158
</td>
161159
<td class="status" [class.active]="!!subPlatform.isActive">
162160
{{subPlatform.isActive?'Active':'Disabled'}}</td>

0 commit comments

Comments
 (0)