Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Content update for MCF Personal FOIMOD-3463 #353

Merged
merged 2 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 22 additions & 7 deletions api/emailLayout.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,17 @@ function EmailLayout() {

}

this.requestAdditional = function(additionalOptions)
{
let result = this.tableHeader('Additional Records Specified');

additionalOptions.forEach(options =>{
result += this.tableRow(options.name, options.description);
});

return result;
}

this.adoptiveParents = function(data) {
const mother = this.joinBySpace(data.motherFirstName, data.motherLastName);
const father = this.joinBySpace(data.fatherFirstName, data.fatherLastName);
Expand Down Expand Up @@ -382,13 +393,17 @@ function EmailLayout() {
);
}

if(data.requestData.selectAbout.yourself && !data.requestData.selectAbout.child && !data.requestData.selectAbout.another)
{
content += this.requesttopic(data.requestData.selectedtopics,data.requestData.requestType.adoption,
data.requestData.requestType.childprotectionchild,data.requestData.requestType.childprotectionparent,
data.requestData.requestType.fosterparent,data.requestData.requestType.youthincarechild,data.requestData.requestType.youthincareparent
)
}
if(data.requestData.selectAbout.yourself && !data.requestData.selectAbout.child && !data.requestData.selectAbout.another)
{
content += this.requesttopic(data.requestData.selectedtopics,data.requestData.requestType.adoption,
data.requestData.requestType.childprotectionchild,data.requestData.requestType.childprotectionparent,
data.requestData.requestType.fosterparent,data.requestData.requestType.youthincarechild,data.requestData.requestType.youthincareparent
)
}

if(data.requestData.selectedadditionaloptions && data.requestData.selectedadditionaloptions.length > 0) {
content += this.requestAdditional(data.requestData.selectedadditionaloptions);
}

// if we have 'childInformation' then include the block
if (data.requestData.selectAbout.child) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,42 @@ <h2>Ways to get in touch with you</h2>
</div>
<!-- row -->
</div>

<div class="col-lg-12" *ngIf="hasmcfdspecificrecordsrequests">
<div class="row">
<div class="col-lg-12">
<p class="landing-header ">
Delays
</p>
<br/>
<p>
We want to provide fast service, but we are facing some delays.
</p>
<br/>
<p>
Delays can be due to:
</p>
<ul>
<li>The volume of records requested. Requesting many years of records can cause delays and it can slow down processing time.</li>
<li>Many MCFD records, especially older ones, are hard copies and can take some time to digitize.</li>
<li>Content of the records. Some records can be of a sensitive nature and may take some time for an analyst to process them.</li>
</ul>
<br/>
<p>
We recently introduced a new computer system to reduce processing times, but until the system is fully implemented, there may be some delays. Please be as precise as possible to help streamline your request. Analysts are available to help you clarify what information you are looking for.
</p>
<br/>
<p>
We know it is important to meet deadlines. We are currently addressing these issues by:
</p>
<ul>
<li>Using dedicated resources to improve response times.</li>
<li>Modernizing policies, procedures, and software.</li>
</ul>
<br/>
</div>
</div>
</div>
</div>
</form>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export class ContactInfoOptionsComponent implements OnInit {
targetKey: string = 'contactInfoOptions';
isAuthenticated:boolean = false;
tip = ''
hasmcfdspecificrecordsrequests:boolean = false;

constructor(private fb: FormBuilder, private dataService: DataService, private keycloak: KeycloakService) {}

Expand Down Expand Up @@ -45,6 +46,7 @@ export class ContactInfoOptionsComponent implements OnInit {
this.foiRequest.requestData.contactInfoOptions.email = token.email;
}
this.foiForm.patchValue(this.foiRequest.requestData[this.targetKey], {emitEvent: true});
this.hasmcfdspecificrecordsrequests = this.foiRequest.requestData.selectedtopics != undefined && this.foiRequest.requestData.selectedtopics.length > 0;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
<app-alert-info *ngIf="hasmcfdspecificrecordsrequests">
You have previously selected your type of records. Please describe or provide any additional information that would assist the ministry in searching for your requested records on the below description.
</app-alert-info>
<app-alert-warning-white *ngIf="hasmcfdspecificrecordsrequests">
We protect the identities of people who raise child protection concerns and the Freedom of Information and Protection of Privacy Act supports this. If you ask for a reporter's name, we will reply under Section 8 of the Act which means we will not confirm, deny, or provide any information.
</app-alert-warning-white>
<h2>Describe the records you are looking for:</h2>

<div class="form-group">
Expand All @@ -13,11 +16,27 @@ <h2>Describe the records you are looking for:</h2>
>Be as specific as possible. A good description of records will be brief and detailed.<br/><br/>
<b>When possible, please include:</b> Key words, file types, file numbers, previous FOI request numbers, categories of records to exclude, and the purpose records may have been created for.<br/><br/>
<b>When possible, please do not include:</b> Any special characters, including quotation marks or bullet points.<br/><br/>
<b>For example: </b> Briefing notes prepared for the minister on a specific topic.<br/>
(Asking for ‘Any and all records’ can result in a high volume of unnecessary records and may result in additional processing fees.)<br/><br/>
<b>To see examples of other requests: </b>
You can browse the <a href="https://www2.gov.bc.ca/gov/content/governments/about-the-bc-government/open-government/open-information"
target="_blank">Open Information</a>
<div *ngIf="!hasmcfdspecificrecordsrequests">
<b>For example: </b> Briefing notes prepared for the minister on a specific topic.<br/>
(Asking for ‘Any and all records’ can result in a high volume of unnecessary records and may result in additional processing fees.)<br/><br/>
<b>To see examples of other requests: </b>
You can browse the <a href="https://www2.gov.bc.ca/gov/content/governments/about-the-bc-government/open-government/open-information"
target="_blank">Open Information</a>
</div>
<div *ngIf="hasmcfdspecificrecordsrequests">
<b>We want to respond to your request as quickly as possible and so we will remove handwritten notes, receipts, and other family members’ information. You can still request this information by checking the appropriate box below, however this may cause delays in the delivery of your records.</b><br/><br/>
<em>Please note that checking any boxes may cause delays in the delivery of your records.</em><br/><br/>
<div *ngIf="(additionalOptions | async) as opts">
<div class="form-group" *ngFor="let opt of opts">
<label>
<input type="checkbox" [value]="opt" formControlName="requestAdditionalOpt" [checked]="opt.selected"
(change)="selectopt(opt,$event.target.checked)" />
<div class="optiontext" [innerHTML]="opt.name"></div>
</label>
<div class="optiondescription" [innerHTML]="opt.description"></div>
</div>
</div>
</div>
</app-alert-info>

<div class="form-group row" *ngIf="showPublicServiceEmployeeNumber">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
.inline-label {
margin-top: 0;
}

.optiontext{
display: inline;
padding-left: 5px;
}

.optiondescription{
padding-left: 21px;
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { BaseComponent } from "src/app/utils-components/base/base.component";
import { FoiRequest } from "src/app/models/FoiRequest";
import { FormBuilder, Validators, FormGroup } from "@angular/forms";
import { DataService } from "src/app/services/data.service";
import { Observable } from "rxjs";
import { map } from "rxjs/operators";

@Component({
templateUrl: "./description-timeframe.component.html",
Expand All @@ -19,6 +21,10 @@ export class DescriptionTimeframeComponent implements OnInit {
showPublicServiceEmployeeNumber: boolean = false;
showCorrectionalServiceNumber: boolean = false;
hasmcfdspecificrecordsrequests:boolean =false;
// showAdditionOptions: boolean = false;
selectedOptions: Array<any> = [];
additionalOptions: Observable<any>;
delayFactors: Array<string> = [];

constructor(private fb: FormBuilder, private dataService: DataService) {}

Expand All @@ -28,7 +34,8 @@ export class DescriptionTimeframeComponent implements OnInit {
fromDate: [null, Validators.compose([Validators.required, this.base.noFutureValidator])],
toDate: [null, [Validators.required, this.base.noFutureValidator, this.base.toDateValidator]],
correctionalServiceNumber: [null, Validators.maxLength(255)],
publicServiceEmployeeNumber: [null, Validators.maxLength(255)]
publicServiceEmployeeNumber: [null, Validators.maxLength(255)],
requestAdditionalOpt: [null, [Validators.required]],
});

this.foiRequest = this.dataService.getCurrentState(this.targetKey, "requestType", "requestTopic", "ministry");
Expand All @@ -42,9 +49,11 @@ export class DescriptionTimeframeComponent implements OnInit {

this.personalRequest = this.foiRequest.requestData.requestType.requestType === "personal";
if (this.personalRequest) {
this.delayFactors = this.dataService.getDelayFactors();
this.showPublicServiceEmployeeNumber = !!currentMinistries.find(m => m.code === "PSA");
this.showCorrectionalServiceNumber = !!currentMinistries.find(m => m.code === "PSSG");
this.hasmcfdspecificrecordsrequests = this.foiRequest.requestData.selectedtopics != undefined && this.foiRequest.requestData.selectedtopics.length > 0
this.hasmcfdspecificrecordsrequests = this.foiRequest.requestData.selectedtopics != undefined && this.foiRequest.requestData.selectedtopics.length > 0;
// this.showAdditionOptions = this.hasmcfdspecificrecordsrequests && this.hasDelayFactors(this.foiRequest.requestData.selectedtopics, this.delayFactors);
}

let ministryTopic = "General Request";
Expand All @@ -63,6 +72,36 @@ export class DescriptionTimeframeComponent implements OnInit {
this.foiForm.valueChanges.subscribe(() => {
this.base.continueDisabled = !this.foiForm.valid;
});

let selectedAdditionalOptions = this.foiRequest.requestData.selectedadditionaloptions;
this.additionalOptions = this.dataService.getAdditionalOptions().pipe(
map(_options => {
_options.forEach(opt => {
opt.selected = opt.selected || (selectedAdditionalOptions ? !!selectedAdditionalOptions.find(ms => ms.value === opt.value) : false);
})

return _options;
})
);
}

selectopt(item: any, _checked) {
item.selected = !item.selected

var itemindex: number = -1;
if(this.foiRequest.requestData.selectedadditionaloptions !== undefined) {
let current = this.foiRequest.requestData.selectedadditionaloptions.find(st => st.value === item.value)
itemindex = this.foiRequest.requestData.selectedadditionaloptions.indexOf(current)
} else {
this.foiRequest.requestData.selectedadditionaloptions = [];
}

if (!this.foiRequest.requestData.selectedadditionaloptions.includes(item) && itemindex === -1) {
this.foiRequest.requestData.selectedadditionaloptions.push(item)
}
else {
this.foiRequest.requestData.selectedadditionaloptions.splice(itemindex, 1)
}
}

doContinue() {
Expand Down Expand Up @@ -98,4 +137,16 @@ export class DescriptionTimeframeComponent implements OnInit {
inputMaxDate(): string {
return new Date().toISOString().split("T")[0];
}

// hasDelayFactors(selectedTopics: Array<any>, delayFactors: Array<string>) {
// selectedTopics.forEach(
// topic => {
// if(delayFactors.includes(topic.value)) {
// return true;
// }
// }
// );

// return false;
// }
}
13 changes: 13 additions & 0 deletions web/src/app/services/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,19 @@
}


],
"additionaloptions":[
{"value": "handwrittennotes", "name": "Handwritten Notes", "description": "Handwritten Notes are often hard to read. Typed versions of these may be elsewhere in your records."},
{"value": "receipts", "name": "Receipts", "description": "Records often contain copies of receipts for goods and services provided by the ministry. These include clothing, transportation, and other activities. Your records will reflect these purchases, even if we exclude copies of receipts."},
{"value": "otherfamilymembersinfo", "name": "Other Family Members’ Information", "description": "Often, your family’s information is in the same file as yours. When this happens, we must remove that information. Excluding this information can speed up the processing time of your request."}
],
"delayfactors":[
"childprotectionparent",
"childprotectionchild",
"youthincareparent",
"youthincarechild",
"fosterparent",
"adoption"
]
},
"routeTree": [
Expand Down
8 changes: 8 additions & 0 deletions web/src/app/services/data.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,14 @@ export class DataService {
return data.referenceData[topicKey] || [];
}

getAdditionalOptions(): Observable<any[]> {
return of(data.referenceData.additionaloptions);
}

getDelayFactors(): Array<string> {
return data.referenceData.delayfactors;
}

/**
* Dynamically build a topic Key based on truthy keys in the Object provided.
* Valid keys in about include: 'yourself', 'another'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="alert alert-warning d-flex flex-row" role="alert">
<fa-icon class="mr-3 mt-1" size="3x" icon="exclamation-triangle"></fa-icon>
<div>
<ng-content></ng-content>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.alert-warning {
background-color: #ffffff;
line-height: 1.2rem;
margin-top: 2rem;
color: #333;
}
fa-icon {
color: #d6480a;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AlertWarningWhiteComponent } from './alert-warning-white.component';
import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';

describe('AlertWarningWhiteComponent', () => {
let component: AlertWarningWhiteComponent;
let fixture: ComponentFixture<AlertWarningWhiteComponent>;

beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AlertWarningWhiteComponent ],
imports: [FontAwesomeModule]
})
.compileComponents();
}));

beforeEach(() => {
fixture = TestBed.createComponent(AlertWarningWhiteComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Component, OnInit } from '@angular/core';

@Component({
selector: 'app-alert-warning-white',
templateUrl: './alert-warning-white.component.html',
styleUrls: ['./alert-warning-white.component.scss']
})
export class AlertWarningWhiteComponent implements OnInit {

constructor() { }

ngOnInit() {
}

}
3 changes: 3 additions & 0 deletions web/src/app/utils-components/utils-components.module.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AlertInfoComponent } from './alert-info/alert-info.component';
import { AlertWarningComponent } from './alert-warning/alert-warning.component';
import { AlertWarningWhiteComponent } from './alert-warning-white/alert-warning-white.component';
import { BaseComponent } from './base/base.component';
import { CaptchaComponent } from './captcha/captcha.component';
import { FoiFileinputComponent } from './foi-fileinput/foi-fileinput.component';
Expand All @@ -22,6 +23,7 @@ library.add(faInfoCircle, faExclamationTriangle, faCalendar, faSignInAlt, faQues
declarations: [
AlertInfoComponent,
AlertWarningComponent,
AlertWarningWhiteComponent,
BaseComponent,
CaptchaComponent,
FoiFileinputComponent,
Expand All @@ -39,6 +41,7 @@ library.add(faInfoCircle, faExclamationTriangle, faCalendar, faSignInAlt, faQues
exports: [
AlertInfoComponent,
AlertWarningComponent,
AlertWarningWhiteComponent,
BaseComponent,
CaptchaComponent,
FoiFileinputComponent,
Expand Down
Loading