@csmart/ngc-smart-victim 1.18.6 → 1.18.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +6 -22
  4. package/src/lib/caseNote/caseNote.component.css +20 -0
  5. package/src/lib/caseNote/caseNote.component.html +188 -0
  6. package/src/lib/caseNote/caseNote.component.ts +265 -0
  7. package/src/lib/common-dialog/common-dialog.component.css +10 -0
  8. package/src/lib/common-dialog/common-dialog.component.html +23 -0
  9. package/src/lib/common-dialog/common-dialog.component.spec.ts +25 -0
  10. package/src/lib/common-dialog/common-dialog.component.ts +21 -0
  11. package/src/lib/common-dialog/common-dialog.module.ts +22 -0
  12. package/src/lib/common-dialog/common-dialog.service.ts +35 -0
  13. package/src/lib/contact/contact.component.css +20 -0
  14. package/src/lib/contact/contact.component.html +124 -0
  15. package/src/lib/contact/contact.component.ts +176 -0
  16. package/src/lib/email-notification.service.ts +42 -0
  17. package/src/lib/email.services.ts +51 -0
  18. package/src/lib/http.service.ts +34 -0
  19. package/src/lib/intake.service.ts +82 -0
  20. package/src/lib/loader.service.ts +11 -0
  21. package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
  22. package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
  23. package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
  24. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
  25. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
  26. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
  27. package/src/lib/shared/app.shared.module.ts +111 -0
  28. package/src/lib/shared/validators/date.validator.ts +73 -0
  29. package/src/lib/shared/validators/index.ts +1 -0
  30. package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
  31. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
  32. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +869 -0
  33. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
  34. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1384 -0
  35. package/src/lib/smart-victim.component.css +192 -0
  36. package/src/lib/smart-victim.component.html +138 -0
  37. package/src/lib/smart-victim.component.spec.ts +25 -0
  38. package/src/lib/smart-victim.component.ts +329 -0
  39. package/src/lib/smart-victim.model.ts +301 -0
  40. package/src/lib/smart-victim.module.ts +110 -0
  41. package/src/lib/smart-victim.service.spec.ts +12 -0
  42. package/src/lib/smart-victim.service.ts +557 -0
  43. package/src/lib/victim-routing.module.ts +35 -0
  44. package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +9 -7
  45. package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
  46. package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
  47. package/{public-api.d.ts → src/public-api.ts} +12 -7
  48. package/src/test.ts +22 -0
  49. package/tsconfig.lib.json +37 -0
  50. package/tsconfig.spec.json +17 -0
  51. package/tslint.json +17 -0
  52. package/esm2022/csmart-ngc-smart-victim.mjs +0 -5
  53. package/esm2022/lib/caseNote/caseNote.component.mjs +0 -194
  54. package/esm2022/lib/common-dialog/common-dialog.component.mjs +0 -23
  55. package/esm2022/lib/common-dialog/common-dialog.module.mjs +0 -34
  56. package/esm2022/lib/common-dialog/common-dialog.service.mjs +0 -33
  57. package/esm2022/lib/contact/contact.component.mjs +0 -140
  58. package/esm2022/lib/email.services.mjs +0 -42
  59. package/esm2022/lib/intake.service.mjs +0 -57
  60. package/esm2022/lib/safetyPlan/serviceProvider.component.mjs +0 -99
  61. package/esm2022/lib/safetyPlan/victimSafetyPlan.component.mjs +0 -116
  62. package/esm2022/lib/safetyPlan/victimSafetyPlanDetail.component.mjs +0 -340
  63. package/esm2022/lib/shared/app.shared.module.mjs +0 -215
  64. package/esm2022/lib/shared/validators/date.validator.mjs +0 -59
  65. package/esm2022/lib/shared/validators/index.mjs +0 -2
  66. package/esm2022/lib/smart-victim-delete-confirm.component.mjs +0 -44
  67. package/esm2022/lib/smart-victim-detail/smart-victim-detail.component.mjs +0 -1104
  68. package/esm2022/lib/smart-victim.component.mjs +0 -316
  69. package/esm2022/lib/smart-victim.model.mjs +0 -133
  70. package/esm2022/lib/smart-victim.module.mjs +0 -128
  71. package/esm2022/lib/smart-victim.service.mjs +0 -352
  72. package/esm2022/lib/victim-routing.module.mjs +0 -41
  73. package/esm2022/lib/victimSearch/VictimSearchFilter.mjs +0 -3
  74. package/esm2022/lib/victimSearch/victimSearchForm.component.mjs +0 -38
  75. package/esm2022/public-api.mjs +0 -11
  76. package/fesm2022/csmart-ngc-smart-victim.mjs +0 -3263
  77. package/fesm2022/csmart-ngc-smart-victim.mjs.map +0 -1
  78. package/index.d.ts +0 -5
  79. package/lib/caseNote/caseNote.component.d.ts +0 -51
  80. package/lib/common-dialog/common-dialog.component.d.ts +0 -14
  81. package/lib/common-dialog/common-dialog.module.d.ts +0 -8
  82. package/lib/common-dialog/common-dialog.service.d.ts +0 -11
  83. package/lib/contact/contact.component.d.ts +0 -40
  84. package/lib/email.services.d.ts +0 -11
  85. package/lib/intake.service.d.ts +0 -57
  86. package/lib/safetyPlan/serviceProvider.component.d.ts +0 -19
  87. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -54
  88. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -62
  89. package/lib/shared/app.shared.module.d.ts +0 -33
  90. package/lib/shared/validators/date.validator.d.ts +0 -9
  91. package/lib/shared/validators/index.d.ts +0 -1
  92. package/lib/smart-victim-delete-confirm.component.d.ts +0 -12
  93. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -129
  94. package/lib/smart-victim.component.d.ts +0 -69
  95. package/lib/smart-victim.model.d.ts +0 -205
  96. package/lib/smart-victim.module.d.ts +0 -49
  97. package/lib/smart-victim.service.d.ts +0 -71
  98. package/lib/victim-routing.module.d.ts +0 -7
  99. package/lib/victimSearch/victimSearchForm.component.d.ts +0 -14
@@ -1,3263 +0,0 @@
1
- import * as i1 from '@angular/common/http';
2
- import { HttpHeaders } from '@angular/common/http';
3
- import * as i0 from '@angular/core';
4
- import { InjectionToken, Injectable, Inject, Component, EventEmitter, Input, Output, ViewChild, ViewEncapsulation, NgModule } from '@angular/core';
5
- import { throwError } from 'rxjs';
6
- import { map, catchError } from 'rxjs/operators';
7
- import * as i2 from 'apollo-angular';
8
- import { ApolloModule } from 'apollo-angular';
9
- import * as i8$1 from '@angular/common';
10
- import { DatePipe, DOCUMENT, CommonModule } from '@angular/common';
11
- import * as i5 from '@angular/router';
12
- import { RouterModule } from '@angular/router';
13
- import * as i11$1 from '@angular/material/table';
14
- import { MatTableDataSource, MatTableModule } from '@angular/material/table';
15
- import { MatSort, MatSortModule } from '@angular/material/sort';
16
- import * as i1$1 from '@angular/material/dialog';
17
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
18
- import * as i6 from '@csmart/ngc-smart-core';
19
- import { AccessType, LoginStaffResolverService, SelectedOffenderResolverService, SmartErrorComponent, NgcSmartCoreModule } from '@csmart/ngc-smart-core';
20
- import * as i10$1 from '@angular/material/paginator';
21
- import { MatPaginator, MatPaginatorModule } from '@angular/material/paginator';
22
- import * as i4 from '@angular/material/snack-bar';
23
- import { MatSnackBarModule } from '@angular/material/snack-bar';
24
- import * as i2$1 from '@angular/material/button';
25
- import { MatButtonModule } from '@angular/material/button';
26
- import * as i8 from '@angular/material/card';
27
- import { MatCardModule } from '@angular/material/card';
28
- import * as i9$1 from '@angular/material/icon';
29
- import { MatIconModule } from '@angular/material/icon';
30
- import * as i1$2 from '@angular/forms';
31
- import { UntypedFormControl, Validators, UntypedFormGroup, ReactiveFormsModule, FormsModule } from '@angular/forms';
32
- import * as i10 from '@angular/material/radio';
33
- import { MatRadioGroup, MatRadioModule } from '@angular/material/radio';
34
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
35
- import * as i20 from '@csmart/ngc-smart-address';
36
- import { SmartAddressModule } from '@csmart/ngc-smart-address';
37
- import * as i14 from '@angular/material/input';
38
- import { MatInput, MatInputModule } from '@angular/material/input';
39
- import * as i17 from '@angular/material/select';
40
- import { MatSelect, MatSelectModule } from '@angular/material/select';
41
- import * as i9 from '@angular/material/checkbox';
42
- import { MatCheckboxModule } from '@angular/material/checkbox';
43
- import * as i11 from '@angular/material/slider';
44
- import { MatSliderModule } from '@angular/material/slider';
45
- import * as i13 from '@angular/material/tabs';
46
- import { MatTabsModule } from '@angular/material/tabs';
47
- import * as i15 from '@angular/material/form-field';
48
- import * as i16 from '@angular/material/datepicker';
49
- import { MatDatepickerModule } from '@angular/material/datepicker';
50
- import * as i18 from '@angular/material/core';
51
- import { MatNativeDateModule, MatRippleModule } from '@angular/material/core';
52
- import * as i21 from '@csmart/smart-ui';
53
- import { SmartUiModule } from '@csmart/smart-ui';
54
- import * as i3 from '@angular/material/expansion';
55
- import { MatExpansionModule } from '@angular/material/expansion';
56
- import * as i12 from '@angular/material/list';
57
- import { MatListModule } from '@angular/material/list';
58
- import { MatButtonToggleModule } from '@angular/material/button-toggle';
59
- import * as i11$2 from '@angular/material/toolbar';
60
- import { MatToolbarModule } from '@angular/material/toolbar';
61
- import { MatSlideToggleModule } from '@angular/material/slide-toggle';
62
- import { MatGridListModule } from '@angular/material/grid-list';
63
- import { CdkTableModule } from '@angular/cdk/table';
64
- import { LayoutModule } from '@angular/cdk/layout';
65
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
66
- import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
67
- import { MatSidenavModule } from '@angular/material/sidenav';
68
- import { MatStepperModule } from '@angular/material/stepper';
69
- import { MatChipsModule } from '@angular/material/chips';
70
- import { MsalGuard } from '@azure/msal-angular';
71
- import gql from 'graphql-tag';
72
- import * as i14$1 from '@angular/cdk/text-field';
73
- import { MatMenuModule } from '@angular/material/menu';
74
- import { MatProgressBarModule } from '@angular/material/progress-bar';
75
-
76
- const SMART_OFFENDER_SERVICE_URL = new InjectionToken('smart offender service url');
77
- const SMART_LOOKUP_SERVICE_URL = new InjectionToken('smart lookup service url');
78
- const SMART_VICTIM_SERVICE_URL = new InjectionToken('smart victim service url');
79
- const SMART_WARRANT_URL = new InjectionToken('smart warrant web url');
80
- let VictimListFilter$1 = class VictimListFilter {
81
- };
82
- class VictimAdvocate {
83
- constructor(victimAdvocateId, lastName, firstName, prefixId, suffixId, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
84
- this.victimAdvocateId = victimAdvocateId;
85
- this.lastName = lastName;
86
- this.firstName = firstName;
87
- this.prefixId = prefixId;
88
- this.suffixId = suffixId;
89
- this.addressId = addressId;
90
- this.noPhoneFlag = noPhoneFlag;
91
- this.homePhone = homePhone;
92
- this.workPhone = workPhone;
93
- this.cellPhone = cellPhone;
94
- this.email = email;
95
- this.modifiedBy = modifiedBy;
96
- }
97
- }
98
- class VictimWeaponUse {
99
- constructor(
100
- // public victimWeaponUseId: number,
101
- victimId, weaponTypeId, otherWeapon, modifiedBy) {
102
- this.victimId = victimId;
103
- this.weaponTypeId = weaponTypeId;
104
- this.otherWeapon = otherWeapon;
105
- this.modifiedBy = modifiedBy;
106
- }
107
- }
108
- class VictimDrugUse {
109
- constructor(
110
- //public victimDrugUseId: number,
111
- victimId, drugTypeId, otherDrug, modifiedBy) {
112
- this.victimId = victimId;
113
- this.drugTypeId = drugTypeId;
114
- this.otherDrug = otherDrug;
115
- this.modifiedBy = modifiedBy;
116
- }
117
- }
118
- class VictimSupport {
119
- constructor(
120
- // public victimSupportId: number,
121
- victimId, victimSupportTypeId, modifiedBy) {
122
- this.victimId = victimId;
123
- this.victimSupportTypeId = victimSupportTypeId;
124
- this.modifiedBy = modifiedBy;
125
- }
126
- }
127
- class VictimGuardian {
128
- constructor(victimGuardianId, lastName, firstName, prefixId, suffixId, birthDate, addressId, noPhoneFlag, homePhone, workPhone, cellPhone, email, modifiedBy) {
129
- this.victimGuardianId = victimGuardianId;
130
- this.lastName = lastName;
131
- this.firstName = firstName;
132
- this.prefixId = prefixId;
133
- this.suffixId = suffixId;
134
- this.birthDate = birthDate;
135
- this.addressId = addressId;
136
- this.noPhoneFlag = noPhoneFlag;
137
- this.homePhone = homePhone;
138
- this.workPhone = workPhone;
139
- this.cellPhone = cellPhone;
140
- this.email = email;
141
- this.modifiedBy = modifiedBy;
142
- }
143
- }
144
- class Victim {
145
- constructor(victimId, offenderId, underSupervisionFlag, victimOffenderRelationshipTypeId, lastName, firstName, middleName, prefixId, suffixId, birthDate, genderCode, homePhone, workPhone, cellPhone, email, addressId, minorFlag, victimAdvocateFlag, guardianFirstName, guardianLastName, guardianPrefixId, guardianSuffixId, guardianNoPhoneFlag, guardianHomePhone, guardianWorkPhone, guardianCellPhone, guardianEmail, guardianAddressId, guardianBirthDate, advocateFirstName, advocateLastName, advocatePrefixId, advocateSuffixId, advocateNoPhoneFlag, advocateHomePhone, advocateWorkPhone, advocateCellPhone, advocateEmail, advocateAddressId, emergencyContact, emergencyContactPhone, commonChildrenFlag, commonChildrenNumber, cpoExpirationFlag, cpoExpirationDate, supportInPlaceFlag, weaponInvolvedFlag, drugUseFlag, alcoholUseFlag, accessRisk, modifiedBy, relationship, vVictimAdvocate, vVictimGuardian, victimSupports, victimWeaponUses, victimDrugUses, allowCsosaContactFlag, liveWithOffenderFlag) {
146
- this.victimId = victimId;
147
- this.offenderId = offenderId;
148
- this.underSupervisionFlag = underSupervisionFlag;
149
- this.victimOffenderRelationshipTypeId = victimOffenderRelationshipTypeId;
150
- this.lastName = lastName;
151
- this.firstName = firstName;
152
- this.middleName = middleName;
153
- this.prefixId = prefixId;
154
- this.suffixId = suffixId;
155
- this.birthDate = birthDate;
156
- this.genderCode = genderCode;
157
- this.homePhone = homePhone;
158
- this.workPhone = workPhone;
159
- this.cellPhone = cellPhone;
160
- this.email = email;
161
- this.addressId = addressId;
162
- this.minorFlag = minorFlag;
163
- this.victimAdvocateFlag = victimAdvocateFlag;
164
- this.guardianFirstName = guardianFirstName;
165
- this.guardianLastName = guardianLastName;
166
- this.guardianPrefixId = guardianPrefixId;
167
- this.guardianSuffixId = guardianSuffixId;
168
- this.guardianNoPhoneFlag = guardianNoPhoneFlag;
169
- this.guardianHomePhone = guardianHomePhone;
170
- this.guardianWorkPhone = guardianWorkPhone;
171
- this.guardianCellPhone = guardianCellPhone;
172
- this.guardianEmail = guardianEmail;
173
- this.guardianAddressId = guardianAddressId;
174
- this.guardianBirthDate = guardianBirthDate;
175
- this.advocateFirstName = advocateFirstName;
176
- this.advocateLastName = advocateLastName;
177
- this.advocatePrefixId = advocatePrefixId;
178
- this.advocateSuffixId = advocateSuffixId;
179
- this.advocateNoPhoneFlag = advocateNoPhoneFlag;
180
- this.advocateHomePhone = advocateHomePhone;
181
- this.advocateWorkPhone = advocateWorkPhone;
182
- this.advocateCellPhone = advocateCellPhone;
183
- this.advocateEmail = advocateEmail;
184
- this.advocateAddressId = advocateAddressId;
185
- this.emergencyContact = emergencyContact;
186
- this.emergencyContactPhone = emergencyContactPhone;
187
- this.commonChildrenFlag = commonChildrenFlag;
188
- this.commonChildrenNumber = commonChildrenNumber;
189
- this.cpoExpirationFlag = cpoExpirationFlag;
190
- this.cpoExpirationDate = cpoExpirationDate;
191
- this.supportInPlaceFlag = supportInPlaceFlag;
192
- this.weaponInvolvedFlag = weaponInvolvedFlag;
193
- this.drugUseFlag = drugUseFlag;
194
- this.alcoholUseFlag = alcoholUseFlag;
195
- this.accessRisk = accessRisk;
196
- this.modifiedBy = modifiedBy;
197
- this.relationship = relationship;
198
- this.vVictimAdvocate = vVictimAdvocate;
199
- this.vVictimGuardian = vVictimGuardian;
200
- this.victimSupports = victimSupports;
201
- this.victimWeaponUses = victimWeaponUses;
202
- this.victimDrugUses = victimDrugUses;
203
- this.allowCsosaContactFlag = allowCsosaContactFlag;
204
- this.liveWithOffenderFlag = liveWithOffenderFlag;
205
- }
206
- }
207
-
208
- const headers$1 = new HttpHeaders({ 'Content-Type': 'application/json' });
209
- const options = { headers: headers$1 };
210
- class NgcSmartVictimService {
211
- constructor(http, smartOffenderServiceUrl, smartLookupServiceUrl, smartVictimServiceUrl, apollo) {
212
- this.http = http;
213
- this.smartOffenderServiceUrl = smartOffenderServiceUrl;
214
- this.smartLookupServiceUrl = smartLookupServiceUrl;
215
- this.smartVictimServiceUrl = smartVictimServiceUrl;
216
- this.apollo = apollo;
217
- this.serviceApiUrl = 'https://smart-service-test.azurewebsites.net/graphql';
218
- }
219
- // getVictimInsurances(offenderId: any) {
220
- // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?offenderId=' + offenderId).pipe();
221
- // }
222
- // getVictimInsurance(id: any) {
223
- // return this.http.get(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
224
- // }
225
- // postVictimInsurance(val: any) {
226
- // return this.http.post(this.smartOffenderServiceUrl + '/VictimInsurances', val).pipe();
227
- // }
228
- // putVictimInsurance(id: any, val: any) {
229
- // return this.http.put(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id, val).pipe();
230
- // }
231
- // deleteVictimInsurance(id: any) {
232
- // return this.http.delete(this.smartOffenderServiceUrl + '/VictimInsurances/?id=' + id).pipe();
233
- // }
234
- // getVictimInsuranceTypes() {
235
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceTypes').pipe();
236
- // }
237
- // getVictimInsurancePolicyHolders() {
238
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsurancePolicyHolders').pipe();
239
- // }
240
- // getVictimInsuranceSwitchReasons() {
241
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceSwitchReasons').pipe();
242
- // }
243
- // getVictimInsuranceProviders() {
244
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProvider').pipe();
245
- // }
246
- // getVictimInsuranceProvider(id) {
247
- // return this.http.get(this.smartLookupServiceUrl + '/VictimInsuranceProviders/' + id).pipe();
248
- // }
249
- // postProviderInformation(val: any) {
250
- // return this.http.post(this.smartLookupServiceUrl + '/VictimInsuranceProviders', val).pipe();
251
- // }
252
- getCurrentHousing(offenderId) {
253
- return this.http
254
- .get(this.smartOffenderServiceUrl + 'Housings/current/' + offenderId)
255
- .pipe();
256
- }
257
- handleError(error) {
258
- console.error(error);
259
- return throwError(error.json().error || 'Server error');
260
- }
261
- getDrugsTypes() {
262
- return this.http.get(this.smartLookupServiceUrl + 'DrugTypes', options).pipe(map(res => res));
263
- }
264
- getDocketList(offenderId) {
265
- const queryString = `
266
- {
267
- findDockets(input: { where: { offenderId:${offenderId} } }) {
268
- totalCount
269
- message
270
- data {
271
- docketId
272
- docketNumber
273
-
274
- }
275
- }
276
- }`;
277
- return this.http.post(this.serviceApiUrl, { query: queryString }).pipe(map(({ data }) => {
278
- console.log('dockets for this offender:', data.findDockets.data);
279
- return data.findDockets.data;
280
- }));
281
- }
282
- getSupportTypes() {
283
- return this.http.get(this.smartLookupServiceUrl + 'VictimSupportTypes', options).pipe(map(res => res));
284
- }
285
- getPrefixes() {
286
- return this.http.get(this.smartLookupServiceUrl + 'Prefixes', options).pipe(map(res => res));
287
- }
288
- getSuffixes() {
289
- return this.http.get(this.smartLookupServiceUrl + 'Suffixes', options).pipe(map(res => res));
290
- }
291
- getRelationshipTypes() {
292
- return this.http.get(this.smartLookupServiceUrl + 'RelationshipTypes', options).pipe(map(res => res));
293
- }
294
- getGenders() {
295
- return this.http.get(this.smartLookupServiceUrl + 'Genders', options).pipe(map(res => res));
296
- }
297
- getWeaponTypes() {
298
- return this.http.get(this.smartLookupServiceUrl + 'WeaponTypes', options).pipe(map(res => res));
299
- }
300
- getFlagOptionYesNoUnknowns() {
301
- return this.http.get(this.smartLookupServiceUrl + 'FlagOptionYesNoUnknowns', options).pipe(map(res => {
302
- return res;
303
- }));
304
- }
305
- getContactTypes() {
306
- return this.http.get(this.smartLookupServiceUrl + 'ContactTypes', options).pipe(map(res => {
307
- return res;
308
- }));
309
- }
310
- getContactMethods() {
311
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactMethods', options).pipe(map(res => {
312
- return res;
313
- }));
314
- }
315
- getContactBys() {
316
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
317
- return res;
318
- }));
319
- }
320
- getVictimContactPurposes() {
321
- return this.http.get(this.smartLookupServiceUrl + 'VictimContactPurposes', options).pipe(map(res => {
322
- return res;
323
- }));
324
- }
325
- getVictimServiceTypes() {
326
- return this.http.get(this.smartLookupServiceUrl + 'VictimServiceTypes', options).pipe(map(res => {
327
- return res;
328
- }));
329
- }
330
- getVictimServiceStatus() {
331
- return this.http.get(this.smartLookupServiceUrl + 'VictimServiceStatus', options).pipe(map(res => {
332
- return res;
333
- }));
334
- }
335
- getvVictimServiceTypeProgramProviders() {
336
- return this.http.get(this.smartLookupServiceUrl + 'vVictimServiceTypeProgramProviders', options).pipe(map(res => {
337
- return res;
338
- }));
339
- }
340
- getVictim(val) {
341
- return this.http.get(this.smartVictimServiceUrl + 'Victims/' + val, options).pipe(map(res => {
342
- console.log('victim return data');
343
- console.log(res);
344
- return res;
345
- }));
346
- }
347
- getVictimAdvocate(val) {
348
- return this.http.get(this.smartVictimServiceUrl + 'VictimAdvocates/' + val, options).pipe(map(res => {
349
- return res;
350
- }));
351
- }
352
- getVictimGuardian(val) {
353
- return this.http.get(this.smartVictimServiceUrl + 'VictimGuardians/' + val, options).pipe(map(res => {
354
- return res;
355
- }));
356
- }
357
- postVictims(val) {
358
- const tempVal = JSON.stringify(val);
359
- return this.http.post(this.smartVictimServiceUrl + 'Victims', tempVal, options).pipe(map(res => { return res; }));
360
- }
361
- putVictims(id, val) {
362
- const tempVal = JSON.stringify(val);
363
- return this.http.put(this.smartVictimServiceUrl + 'Victims/' + id, tempVal, options).pipe(map(res => { return res; }));
364
- }
365
- putVictimAdvocate(id, val) {
366
- let body;
367
- body = JSON.stringify(val);
368
- return this.http.put(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, body, options).pipe(map(res => { return res; }));
369
- }
370
- postVictimAdvocate(id, val) {
371
- const tempVal = JSON.stringify(val);
372
- return this.http.post(this.smartVictimServiceUrl + 'VictimAdvocates/' + id, tempVal, options).pipe(map(res => { return res; }));
373
- }
374
- putVictimGuardian(id, val) {
375
- console.log('update victim guardian');
376
- console.log(val);
377
- const tempVal = JSON.stringify(val);
378
- return this.http.put(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
379
- }
380
- postVictimGuardian(id, val) {
381
- const tempVal = JSON.stringify(val);
382
- return this.http.post(this.smartVictimServiceUrl + 'VictimGuardians/' + id, tempVal, options).pipe(map(res => { return res; }));
383
- }
384
- getVictimDrugUse(val) {
385
- return this.http.get(this.smartVictimServiceUrl + 'VictimDrugUses/' + val, options).pipe(map((res) => {
386
- return res;
387
- }));
388
- }
389
- putVictimDrugUse(id, val) {
390
- const tempVal = JSON.stringify(val);
391
- return this.http.put(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
392
- }
393
- postVictimDrugUse(id, val) {
394
- const tempVal = JSON.stringify(val);
395
- return this.http.post(this.smartVictimServiceUrl + 'VictimDrugUses/' + id, tempVal, options).pipe(map(res => { return res; }));
396
- }
397
- putVictimWeaponUse(id, val) {
398
- const tempVal = JSON.stringify(val);
399
- return this.http.put(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
400
- }
401
- postVictimWeaponUse(id, val) {
402
- const tempVal = JSON.stringify(val);
403
- return this.http.post(this.smartVictimServiceUrl + 'VictimWeaponUses/' + id, tempVal, options).pipe(map(res => { return res; }));
404
- }
405
- putVictimSupport(id, val) {
406
- const tempVal = JSON.stringify(val);
407
- return this.http.put(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
408
- }
409
- postVictimSupport(id, val) {
410
- const tempVal = JSON.stringify(val);
411
- return this.http.post(this.smartVictimServiceUrl + 'VictimSupports/' + id, tempVal, options).pipe(map(res => { return res; }));
412
- }
413
- deleteVictims(val, staffId) {
414
- return this.http.delete(this.smartVictimServiceUrl + 'Victims/' + val + '?staffId=' + staffId, options).pipe(map(res => { return res; }));
415
- }
416
- // //==============Victim Serive===================================
417
- getVictims(offenderId) {
418
- return this.http.get(this.smartVictimServiceUrl + 'Victims/offender/' + offenderId)
419
- .pipe(map((res) => {
420
- return res;
421
- }), catchError(this.handleError));
422
- }
423
- getVictimsByFilter(filter) {
424
- return this.http
425
- .post(this.smartVictimServiceUrl + '/Victims', JSON.stringify(filter), { headers: headers$1 })
426
- .pipe(map((res) => {
427
- return res;
428
- }), catchError(this.handleError));
429
- }
430
- getVictimListByFilter(filter) {
431
- console.log('filer in service');
432
- console.log(filter);
433
- return this.http
434
- .post(this.smartVictimServiceUrl + 'vVictims/Filter', JSON.stringify(filter), options)
435
- .pipe();
436
- }
437
- getCasetNotes(victimId) {
438
- return this.http.get(this.smartVictimServiceUrl + 'VictimCaseNotes/victim/' + victimId)
439
- .pipe(map((res) => {
440
- return res;
441
- }), catchError(this.handleError));
442
- }
443
- addCaseNote(caseNote) {
444
- let body;
445
- body = JSON.stringify(caseNote);
446
- return this.http
447
- .post(this.smartVictimServiceUrl + 'VictimCaseNotes/', body, options);
448
- }
449
- updateCaseNote(caseNote) {
450
- let body;
451
- body = JSON.stringify(caseNote);
452
- return this.http
453
- .put(this.smartVictimServiceUrl + 'VictimCaseNotes/' + caseNote.victimCaseNoteId, body, options);
454
- }
455
- deleteCaseNote(id, staffId) {
456
- return this.http.delete(`${this.smartVictimServiceUrl}VictimCaseNotes/${id}?staffId=${staffId}`);
457
- }
458
- getContacts(victimId) {
459
- return this.http.get(this.smartVictimServiceUrl + 'VictimContacts/victim/' + victimId)
460
- .pipe(map((res) => {
461
- return res;
462
- }), catchError(this.handleError));
463
- }
464
- addContact(contact) {
465
- let body;
466
- body = JSON.stringify(contact);
467
- return this.http
468
- .post(this.smartVictimServiceUrl + 'VictimContacts/', body, options);
469
- }
470
- updateContact(contact) {
471
- let body;
472
- body = JSON.stringify(contact);
473
- return this.http
474
- .put(this.smartVictimServiceUrl + 'VictimContacts/' + contact.victimContactId, body, options);
475
- }
476
- getSafetyPlans(victimId) {
477
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victim/' + victimId)
478
- .pipe(map((res) => {
479
- return res;
480
- }), catchError(this.handleError));
481
- }
482
- getVictimServices(victimServiceId) {
483
- return this.http.get(this.smartVictimServiceUrl + 'vVictimServiceLists/victimServiceId/' + victimServiceId)
484
- .pipe(map((res) => {
485
- return res;
486
- }), catchError(this.handleError));
487
- }
488
- getVictimServiceDetail(victimServiceId) {
489
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceDetails/' + victimServiceId)
490
- .pipe(map((res) => {
491
- return res;
492
- }), catchError(this.handleError));
493
- }
494
- addSafetyPlan(victimSafetyPlan) {
495
- let body;
496
- body = JSON.stringify(victimSafetyPlan);
497
- return this.http
498
- .post(this.smartVictimServiceUrl + 'VictimServices/', body, options)
499
- .pipe();
500
- }
501
- updateSafetyPlan(victimSafetyPlan) {
502
- let body;
503
- body = JSON.stringify(victimSafetyPlan);
504
- return this.http
505
- .put(this.smartVictimServiceUrl + 'VictimServices/' + victimSafetyPlan.victimServiceId, body, options);
506
- }
507
- addVictimServiceStatus(victimServiceStatusHistory) {
508
- let body;
509
- body = JSON.stringify(victimServiceStatusHistory);
510
- return this.http
511
- .post(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/', body, options);
512
- }
513
- getServiceStatusHistories(victimServiceId) {
514
- return this.http.get(this.smartVictimServiceUrl + 'VictimServiceStatusHistories/victimServiceId/' + victimServiceId)
515
- .pipe(map((res) => {
516
- return res;
517
- }), catchError(this.handleError));
518
- }
519
- deleteSafetyPlan(victimServiceId, staffId) {
520
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServices/${victimServiceId}?staffId=${staffId}`);
521
- }
522
- addPlanProvider(victimServiceDetail) {
523
- let body;
524
- body = JSON.stringify(victimServiceDetail);
525
- return this.http
526
- .post(this.smartVictimServiceUrl + 'VictimServiceDetails/', body, options)
527
- .pipe();
528
- }
529
- deleteProvider(victimProgramProviderId, staffId) {
530
- return this.http.delete(`${this.smartVictimServiceUrl}VictimServiceDetails/${victimProgramProviderId}?staffId=${staffId}`);
531
- }
532
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, deps: [{ token: i1.HttpClient }, { token: SMART_OFFENDER_SERVICE_URL }, { token: SMART_LOOKUP_SERVICE_URL }, { token: SMART_VICTIM_SERVICE_URL }, { token: i2.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
533
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, providedIn: 'root' }); }
534
- }
535
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimService, decorators: [{
536
- type: Injectable,
537
- args: [{
538
- providedIn: 'root'
539
- }]
540
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
541
- type: Inject,
542
- args: [SMART_OFFENDER_SERVICE_URL]
543
- }] }, { type: undefined, decorators: [{
544
- type: Inject,
545
- args: [SMART_LOOKUP_SERVICE_URL]
546
- }] }, { type: undefined, decorators: [{
547
- type: Inject,
548
- args: [SMART_VICTIM_SERVICE_URL]
549
- }] }, { type: i2.Apollo }] });
550
-
551
- const headers = new Headers({ 'Content-Type': 'application/json' });
552
- class IntakeServicesComponent {
553
- //serviceData = environment.smartOffenderServiceUrl;
554
- constructor(http, smartOffenderServiceUrl) {
555
- this.http = http;
556
- this.smartOffenderServiceUrl = smartOffenderServiceUrl;
557
- }
558
- getIntakeByOffender(offenderId) {
559
- return this.http
560
- .get(this.smartOffenderServiceUrl + 'IntakeBasic/offender/' + offenderId)
561
- .pipe();
562
- }
563
- updateIntakeSteps(offenderId, intakeStepStatus) {
564
- return this.http.put(this.smartOffenderServiceUrl + '/IntakeStepStatus/' + offenderId, intakeStepStatus);
565
- }
566
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, deps: [{ token: i1.HttpClient }, { token: SMART_OFFENDER_SERVICE_URL }], target: i0.ɵɵFactoryTarget.Injectable }); }
567
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, providedIn: 'root' }); }
568
- }
569
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: IntakeServicesComponent, decorators: [{
570
- type: Injectable,
571
- args: [{
572
- providedIn: 'root'
573
- }]
574
- }], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
575
- type: Inject,
576
- args: [SMART_OFFENDER_SERVICE_URL]
577
- }] }] });
578
- class IntakeStep {
579
- static { this.PhysicalInformation = "PHYSIN"; }
580
- static { this.Photo = "PHOTOS"; }
581
- static { this.HousingInformation = "HOUSE"; }
582
- static { this.DocketInformation = "DOCKET"; }
583
- static { this.Alias = "ALIAS"; }
584
- static { this.IntakeBasicInformation = "INTKBI"; }
585
- static { this.ContactInformation = "CONTCT"; }
586
- static { this.DeceasedInformation = "DEATH"; }
587
- static { this.DriversLicense = "DRVLIC"; }
588
- static { this.EmploymentInformation = "EMPLOY"; }
589
- static { this.GangAffiliation = "GANG"; }
590
- static { this.HealthInsurance = "HLTHINS"; }
591
- static { this.Identification = "IDNTFCTN"; }
592
- static { this.InternetIdentifier = "INTERNETID"; }
593
- static { this.MilitaryService = "MLTSVC"; }
594
- static { this.School = "SCHOOL"; }
595
- static { this.SelectiveService = "SLCTVSVC"; }
596
- static { this.Vehicle = "VEHICLE"; }
597
- static { this.VictimInformation = "VICTIM"; }
598
- static { this.WarrantInformation = "WARRNT"; }
599
- static { this.RunningRecord = "RUNREC"; }
600
- static { this.Signature = "SIGN"; }
601
- }
602
-
603
- class CommonDialogComponent {
604
- constructor(commondialogRef) {
605
- this.commondialogRef = commondialogRef;
606
- this.cmdYesTitle = "Yes";
607
- this.cmdNoTitle = "No";
608
- }
609
- ngOnInit() {
610
- }
611
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogComponent, deps: [{ token: i1$1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component }); }
612
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: CommonDialogComponent, selector: "app-common-dialog", ngImport: i0, template: "\r\n\r\n <mat-card class=\"example-card\">\r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class=\"inner\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\"\r\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\"\r\n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\r\n\r\n </div>\r\n\r\n\r\n </mat-card-content>\r\n </mat-card>\r\n", styles: [".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}\n"], dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
613
- }
614
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogComponent, decorators: [{
615
- type: Component,
616
- args: [{ selector: 'app-common-dialog', template: "\r\n\r\n <mat-card class=\"example-card\">\r\n <mat-card-content>\r\n <p>{{ title }}</p>\r\n <p>{{ message }}</p>\r\n <br>\r\n\r\n <div class=\"inner\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\"\r\n (click)=\"commondialogRef.close(true)\">{{cmdYesTitle}}</button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"cmdYesTitle!=='Ok'\" class=\"inner\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\"\r\n (click)=\"commondialogRef.close()\">{{cmdNoTitle}}</button>\r\n\r\n </div>\r\n\r\n\r\n </mat-card-content>\r\n </mat-card>\r\n", styles: [".md-dialog-container{position:fixed;top:0!important;overflow:hidden}.inner{display:inline-block}\n"] }]
617
- }], ctorParameters: () => [{ type: i1$1.MatDialogRef }] });
618
-
619
- class CommonDialogService {
620
- constructor(dialog) {
621
- this.dialog = dialog;
622
- }
623
- confirm(title, message, cmdYesTitle, cmdNoTitle) {
624
- let dialogRef;
625
- dialogRef = this.dialog.open(CommonDialogComponent);
626
- dialogRef.componentInstance.title = title;
627
- dialogRef.componentInstance.message = message;
628
- dialogRef.componentInstance.cmdYesTitle = cmdYesTitle;
629
- dialogRef.componentInstance.cmdNoTitle = cmdNoTitle;
630
- return dialogRef.afterClosed();
631
- }
632
- warning(title, message, cmdOkTitle) {
633
- let dialogRef;
634
- dialogRef = this.dialog.open(CommonDialogComponent);
635
- dialogRef.componentInstance.title = title;
636
- dialogRef.componentInstance.message = message;
637
- dialogRef.componentInstance.cmdYesTitle = cmdOkTitle;
638
- return dialogRef.afterClosed();
639
- }
640
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService, deps: [{ token: i1$1.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
641
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService }); }
642
- }
643
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogService, decorators: [{
644
- type: Injectable
645
- }], ctorParameters: () => [{ type: i1$1.MatDialog }] });
646
-
647
- function conditionalValidator(predicate, validator, errorNamespace) {
648
- return (formControl => {
649
- if (!formControl.parent) {
650
- return null;
651
- }
652
- let error = null;
653
- if (predicate()) {
654
- error = validator(formControl);
655
- }
656
- if (errorNamespace && error) {
657
- const customError = {};
658
- customError[errorNamespace] = error;
659
- error = customError;
660
- }
661
- return error;
662
- });
663
- }
664
- function stringConditionalValidator(predicate, validator, errorNamespace) {
665
- return (formControl => {
666
- if (!formControl.parent) {
667
- return null;
668
- }
669
- let error = null;
670
- if (predicate() == 'YS') {
671
- error = validator(formControl);
672
- }
673
- if (errorNamespace && error) {
674
- const customError = {};
675
- customError[errorNamespace] = error;
676
- error = customError;
677
- }
678
- return error;
679
- });
680
- }
681
- class SmartVictimDetailComponent {
682
- constructor(location, formBuilder, dialog, route, router, snackBar, commonDialogService, victimService, changeDetectorRefs) {
683
- this.location = location;
684
- this.formBuilder = formBuilder;
685
- this.dialog = dialog;
686
- this.route = route;
687
- this.router = router;
688
- this.snackBar = snackBar;
689
- this.commonDialogService = commonDialogService;
690
- this.victimService = victimService;
691
- this.changeDetectorRefs = changeDetectorRefs;
692
- this.victimDetail = {};
693
- this.onSave = new EventEmitter();
694
- this.onCancel = new EventEmitter();
695
- this.hidden = true;
696
- this.victimAdvocate = {};
697
- this.victimGuardian = {};
698
- this.guardianTabFlag = false;
699
- this.advocateTabFlag = false;
700
- this.commonChildrenDivFlag = false;
701
- this.cpoExpirationDivFlag = false;
702
- this.supportInPlaceDivFlag = false;
703
- this.weaponInvolvedDivFlag = false;
704
- this.drugUseDivFlag = false;
705
- this.showDelete = false;
706
- this.addressId = 0;
707
- this.advocateAddressId = 0;
708
- this.guardianAddressId = 0;
709
- this.datePipe = new DatePipe('en-US');
710
- this.emailPattern = "^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$";
711
- this.phoneNumber = "\\d{10}";
712
- this.editVictim = {};
713
- this.otherWeaponFlag = false;
714
- this.otherDrugFlag = false;
715
- this.contactDataSource = new MatTableDataSource();
716
- this.guardianPhoneExistFlag = false;
717
- this.advocatePhoneExistFlag = false;
718
- this.phoneValidationFlag = false;
719
- this.guaridanNoPhoneChkFlag = true;
720
- this.advocateNoPhoneChkFlag = true;
721
- this.addressValidators = {
722
- street: [],
723
- street2: [],
724
- city: [],
725
- stateCode: [],
726
- zipCode: [],
727
- psaCode: [],
728
- };
729
- this.homePhoneControl = new UntypedFormControl();
730
- this.cellPhoneControl = new UntypedFormControl();
731
- this.workPhoneControl = new UntypedFormControl();
732
- this.guardianHomePhoneControl = new UntypedFormControl();
733
- this.guardianCellPhoneControl = new UntypedFormControl();
734
- this.guardianWorkPhoneControl = new UntypedFormControl();
735
- this.advocateHomePhoneControl = new UntypedFormControl();
736
- this.advocateCellPhoneControl = new UntypedFormControl();
737
- this.advocateWorkPhoneControl = new UntypedFormControl();
738
- this.emergencyContactPhoneControl = new UntypedFormControl();
739
- this.initForm();
740
- }
741
- initForm() {
742
- this.victimForm = this.formBuilder.group({
743
- underSupervisionFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
744
- victimOffenderRelationshipTypeId: new UntypedFormControl('', Validators.compose([Validators.required])),
745
- lastName: new UntypedFormControl('', Validators.compose([Validators.required])),
746
- firstName: new UntypedFormControl('', Validators.compose([Validators.required])),
747
- middleName: new UntypedFormControl(''),
748
- prefixId: new UntypedFormControl(''),
749
- suffixId: new UntypedFormControl(''),
750
- genderCode: new UntypedFormControl(''),
751
- birthDate: new UntypedFormControl(''),
752
- homePhone: new UntypedFormControl(''),
753
- cellPhone: new UntypedFormControl(''),
754
- workPhone: new UntypedFormControl(''),
755
- email: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
756
- minorFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
757
- victimAdvocateFlag: new UntypedFormControl('', Validators.compose([Validators.required])),
758
- guardianLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
759
- guardianFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('minorFlag').value, Validators.required, 'illuminatiError')),
760
- guardianPrefixId: new UntypedFormControl(''),
761
- guardianSuffixId: new UntypedFormControl(''),
762
- //guardianGender:new FormControl('', ),
763
- guardianBirthDate: new UntypedFormControl(''),
764
- guardianNoPhoneFlag: new UntypedFormControl(true),
765
- guardianHomePhone: new UntypedFormControl(''),
766
- guardianCellPhone: new UntypedFormControl(''),
767
- guardianWorkPhone: new UntypedFormControl(''),
768
- guardianEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
769
- advocateNoPhoneFlag: new UntypedFormControl(true),
770
- advocateWorkPhone: new UntypedFormControl(''),
771
- advocateHomePhone: new UntypedFormControl(''),
772
- advocateCellPhone: new UntypedFormControl(''),
773
- advocateSuffixId: new UntypedFormControl(''),
774
- advocatePrefixId: new UntypedFormControl(''),
775
- advocateFirstName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
776
- advocateLastName: new UntypedFormControl('', stringConditionalValidator(() => this.victimForm.get('victimAdvocateFlag').value, Validators.required, 'illuminatiError')),
777
- advocateEmail: new UntypedFormControl('', Validators.compose([Validators.pattern(this.emailPattern)])),
778
- emergencyContact: new UntypedFormControl(''),
779
- emergencyContactPhone: new UntypedFormControl(''),
780
- emergencyChildren: new UntypedFormControl(''),
781
- emergencyCpo: new UntypedFormControl(''),
782
- emergencyDrug: new UntypedFormControl(''),
783
- emergencySupport: new UntypedFormControl(''),
784
- emergencyWeapon: new UntypedFormControl(''),
785
- drug: new UntypedFormControl(''),
786
- weapon: new UntypedFormControl(''),
787
- support: new UntypedFormControl(''),
788
- commonChildrenFlag: new UntypedFormControl(''),
789
- commonChildrenNumber: new UntypedFormControl(''),
790
- cpoExpirationFlag: new UntypedFormControl(''),
791
- cpoExpirationDate: new UntypedFormControl(''),
792
- accessRisk: new UntypedFormControl(''),
793
- drugUseFlag: new UntypedFormControl(''),
794
- supportInPlaceFlag: new UntypedFormControl(''),
795
- weaponInvolvedFlag: new UntypedFormControl(''),
796
- otherWeapon: new UntypedFormControl(''),
797
- otherDrug: new UntypedFormControl(''),
798
- alcoholUseFlag: new UntypedFormControl(''),
799
- victimSupports: new UntypedFormControl(''),
800
- victimWeaponUses: new UntypedFormControl(''),
801
- victimDrugUses: new UntypedFormControl(''),
802
- allowCsosaContactFlag: new UntypedFormControl(''),
803
- liveWithOffenderFlag: new UntypedFormControl(''),
804
- });
805
- this.victimForm.markAsPristine();
806
- this.victimForm.markAsUntouched();
807
- }
808
- _getVictim() {
809
- if (this.victimId === 0) {
810
- return;
811
- }
812
- ;
813
- if (this.editMode == true) {
814
- console.log('find victim id inside getVictim');
815
- console.log(this.victimId);
816
- if (this.victimId === undefined) {
817
- this.sub = this.route.params.subscribe(params => {
818
- this.victimId = params['victimId'];
819
- console.log('my this.victimId');
820
- console.log(this.victimId);
821
- });
822
- }
823
- this.victimService.getVictim(this.victimId)
824
- .subscribe((victim) => {
825
- console.log('victim data 1');
826
- console.log(victim);
827
- this.editVictim = victim;
828
- var supportsData = [];
829
- this.editVictim.victimSupports.forEach(t => { supportsData.push(t.victimSupportTypeId); });
830
- const victimSupportsControl = this.victimForm.get('victimSupports');
831
- victimSupportsControl.setValue(supportsData);
832
- var weaponUsesData = [];
833
- var otherWeapon = "";
834
- this.editVictim.victimWeaponUses.forEach(t => {
835
- weaponUsesData.push(t.weaponTypeId);
836
- if (t.weaponTypeId == "OTHER") {
837
- otherWeapon = t.otherWeapon;
838
- this.otherWeaponFlag = true;
839
- }
840
- });
841
- const victimWeaponUsesControl = this.victimForm.get('victimWeaponUses');
842
- victimWeaponUsesControl.setValue(weaponUsesData);
843
- const otherWeaponControl = this.victimForm.get('otherWeapon');
844
- otherWeaponControl.setValue(otherWeapon);
845
- var drugUseData = [];
846
- var otherDrug = "";
847
- console.log('load this.editVictim.victimDrugUses');
848
- console.log(this.editVictim.victimDrugUses);
849
- this.editVictim.victimDrugUses.forEach(t => {
850
- if (t.drugTypeId === null) {
851
- otherDrug = t.otherDrug;
852
- this.otherDrugFlag = true;
853
- t.drugTypeId = 'OTHER';
854
- }
855
- drugUseData.push(t.drugTypeId);
856
- });
857
- console.log('this.editVictim.victimDrugUses after push');
858
- console.log(drugUseData);
859
- if (drugUseData) {
860
- const victimDrugUsesControl = this.victimForm.get('victimDrugUses');
861
- victimDrugUsesControl.setValue(drugUseData);
862
- }
863
- if (otherDrug) {
864
- const otherDrugControl = this.victimForm.get('otherDrug');
865
- otherDrugControl.setValue(otherDrug);
866
- }
867
- //contact
868
- this.victimService.getContacts(this.victimId).subscribe(contactList => {
869
- console.log('contactList');
870
- console.log(contactList);
871
- this.contactList = contactList;
872
- this.contactDataSource.data = this.contactList;
873
- });
874
- //no phone field
875
- if (this.editVictim.guardianNoPhoneFlag === false) {
876
- this.victimForm.patchValue({ guardianNoPhoneFlag: false });
877
- }
878
- if (this.editVictim.advocateNoPhoneFlag === false) {
879
- this.victimForm.patchValue({ advocateNoPhoneFlag: false });
880
- }
881
- this.homePhoneControl.setValue(!this.editVictim.homePhone ? "" : this.editVictim.homePhone);
882
- this.cellPhoneControl.setValue(!this.editVictim.cellPhone ? "" : this.editVictim.cellPhone);
883
- this.workPhoneControl.setValue(!this.editVictim.workPhone ? "" : this.editVictim.workPhone);
884
- this.guardianHomePhoneControl.setValue(!this.editVictim.guardianHomePhone ? "" : this.editVictim.guardianHomePhone);
885
- this.guardianCellPhoneControl.setValue(!this.editVictim.guardianCellPhone ? "" : this.editVictim.guardianCellPhone);
886
- this.guardianWorkPhoneControl.setValue(!this.editVictim.guardianWorkPhone ? "" : this.editVictim.guardianWorkPhone);
887
- this.advocateHomePhoneControl.setValue(!this.editVictim.advocateHomePhone ? "" : this.editVictim.advocateHomePhone);
888
- this.advocateCellPhoneControl.setValue(!this.editVictim.advocateCellPhone ? "" : this.editVictim.advocateCellPhone);
889
- this.advocateWorkPhoneControl.setValue(!this.editVictim.advocateWorkPhone ? "" : this.editVictim.advocateWorkPhone);
890
- this.emergencyContactPhoneControl.setValue(!this.editVictim.emergencyContactPhone ? "" : this.editVictim.emergencyContactPhone);
891
- }, error => {
892
- this.snackBar.open("Error occured while retriving Victim Information. Please try again.");
893
- });
894
- return;
895
- }
896
- else {
897
- //new
898
- }
899
- }
900
- ngOnChanges() {
901
- }
902
- onClear() {
903
- if (this.addressComponent)
904
- this.addressComponent.reset();
905
- }
906
- showAddress(value) {
907
- if (value.checked) {
908
- this.victimService.getCurrentHousing(this.offenderId).subscribe((item) => {
909
- this.addressId = item.housing.addressId;
910
- this.victimForm.patchValue({ addressId: this.addressId });
911
- });
912
- }
913
- else {
914
- this.addressComponent.reset();
915
- this.editVictim.allowCsosaContactFlag = false;
916
- this.addressId = null;
917
- }
918
- }
919
- onAddressChange(addressId) {
920
- this.victimForm.patchValue({ addressId: addressId });
921
- this.addressId = addressId;
922
- }
923
- onGuardianAddressChange(MyGuardianAddressId) {
924
- this.victimForm.patchValue({ guardianAddressId: MyGuardianAddressId });
925
- this.guardianAddressId = MyGuardianAddressId;
926
- }
927
- onAdvocateAddressChange(MyAdvocateAddressId) {
928
- this.victimForm.patchValue({ advocateAddressId: MyAdvocateAddressId });
929
- this.advocateAddressId = MyAdvocateAddressId;
930
- }
931
- cancel() {
932
- this.victimForm.reset();
933
- }
934
- ngOnInit() {
935
- this.homePhoneControl.valueChanges.subscribe((hpn) => {
936
- const newValue = hpn.replace(/\D/g, '');
937
- this.editVictim.homePhone = newValue;
938
- });
939
- this.cellPhoneControl.valueChanges.subscribe((hpn) => {
940
- const newValue = hpn.replace(/\D/g, '');
941
- this.editVictim.cellPhone = newValue;
942
- });
943
- this.workPhoneControl.valueChanges.subscribe((hpn) => {
944
- const newValue = hpn.replace(/\D/g, '');
945
- this.editVictim.workPhone = newValue;
946
- });
947
- this.guardianHomePhoneControl.valueChanges.subscribe((hpn) => {
948
- const newValue = hpn.replace(/\D/g, '');
949
- this.editVictim.guardianHomePhone = newValue;
950
- });
951
- this.guardianCellPhoneControl.valueChanges.subscribe((hpn) => {
952
- const newValue = hpn.replace(/\D/g, '');
953
- this.editVictim.guardianCellPhone = newValue;
954
- });
955
- this.guardianWorkPhoneControl.valueChanges.subscribe((hpn) => {
956
- const newValue = hpn.replace(/\D/g, '');
957
- this.editVictim.guardianWorkPhone = newValue;
958
- });
959
- this.advocateHomePhoneControl.valueChanges.subscribe((hpn) => {
960
- const newValue = hpn.replace(/\D/g, '');
961
- this.editVictim.advocateHomePhone = newValue;
962
- });
963
- this.advocateCellPhoneControl.valueChanges.subscribe((hpn) => {
964
- const newValue = hpn.replace(/\D/g, '');
965
- this.editVictim.advocateCellPhone = newValue;
966
- });
967
- this.advocateWorkPhoneControl.valueChanges.subscribe((hpn) => {
968
- const newValue = hpn.replace(/\D/g, '');
969
- this.editVictim.advocateWorkPhone = newValue;
970
- });
971
- this.emergencyContactPhoneControl.valueChanges.subscribe((hpn) => {
972
- const newValue = hpn.replace(/\D/g, '');
973
- this.editVictim.emergencyContactPhone = newValue;
974
- });
975
- console.log('show offenderId');
976
- console.log(this.offenderId);
977
- console.log('show staffId');
978
- console.log(this.staffId);
979
- console.log('show isIntake');
980
- console.log(this.isIntake);
981
- //required field
982
- const requiredImplementation = { get: function () {
983
- if (this._required) {
984
- return this._required;
985
- }
986
- if (this.ngControl && this.ngControl.control && this.ngControl.control.validator) {
987
- const emptyValueControl = Object.assign({}, this.ngControl.control);
988
- emptyValueControl.value = null;
989
- return ('required' in (this.ngControl.control.validator(emptyValueControl) || {}));
990
- }
991
- return false;
992
- }, set: function (value) { this._required = coerceBooleanProperty(value); }, };
993
- Object.defineProperty(MatInput.prototype, 'required', requiredImplementation);
994
- Object.defineProperty(MatSelect.prototype, 'required', requiredImplementation);
995
- Object.defineProperty(MatRadioGroup.prototype, 'required', requiredImplementation);
996
- //required field end
997
- if (this.victimDetail != null) {
998
- // edit record
999
- this.editMode = true;
1000
- this.showDelete = true;
1001
- this.victimId = this.victimDetail.victimId;
1002
- this.guardianTabFlag = this.victimDetail.minorFlag;
1003
- if (this.victimDetail.victimAdvocateFlag == 'YS') {
1004
- this.advocateTabFlag = true;
1005
- }
1006
- if (this.otherWeaponFlag == true) {
1007
- const otherWeaponControl = this.victimForm.get('otherWeapon');
1008
- otherWeaponControl.setValidators(Validators.required);
1009
- }
1010
- if (this.otherDrugFlag == true) {
1011
- const otherDrugControl = this.victimForm.get('otherDrug');
1012
- otherDrugControl.setValidators(Validators.required);
1013
- }
1014
- this.cpoExpirationDivFlag = this.victimDetail.cpoExpirationFlag;
1015
- this.commonChildrenDivFlag = this.victimDetail.commonChildrenFlag;
1016
- this.supportInPlaceDivFlag = this.victimDetail.supportInPlaceFlag;
1017
- this.weaponInvolvedDivFlag = this.victimDetail.weaponInvolvedFlag;
1018
- this.drugUseDivFlag = this.victimDetail.drugUseFlag;
1019
- this.addressId = this.victimDetail.addressId;
1020
- this.guardianAddressId = this.victimDetail.guardianAddressId;
1021
- this.advocateAddressId = this.victimDetail.advocateAddressId;
1022
- this._getVictim();
1023
- }
1024
- else {
1025
- //add new record
1026
- this.victimForm.patchValue({ guardianNoPhoneFlag: true });
1027
- this.victimForm.patchValue({ advocateNoPhoneFlag: true });
1028
- }
1029
- this.victimService.getFlagOptionYesNoUnknowns().subscribe((items) => {
1030
- this.flagOption = items;
1031
- });
1032
- this.victimService.getGenders().subscribe((items) => {
1033
- this.genders = items;
1034
- });
1035
- this.victimService.getPrefixes().subscribe((items) => {
1036
- this.prefixes = items;
1037
- });
1038
- this.victimService.getSuffixes().subscribe((items) => {
1039
- this.suffixes = items;
1040
- });
1041
- this.victimService.getRelationshipTypes().subscribe((items) => {
1042
- this.relationshipTypes = items.filter((y) => (y.relationshipCategoryId === 'ST' || y.relationshipCategoryId === 'FM'));
1043
- });
1044
- this.victimService.getSupportTypes().subscribe((items) => {
1045
- this.victimSupportTypes = items;
1046
- });
1047
- this.victimService.getWeaponTypes().subscribe((items) => {
1048
- this.weaponTypes = items;
1049
- });
1050
- this.victimService.getDrugsTypes().subscribe((items) => {
1051
- console.log('drug lookup items');
1052
- console.log(items);
1053
- this.drugs = items;
1054
- this.drugs.push({ drugTypeId: 'OTHER', name: 'Other' });
1055
- console.log(this.drugs);
1056
- });
1057
- // this.victimService.getDocketList(this.offenderId).subscribe(
1058
- // (items: any) => {
1059
- // this.docketlist = items;
1060
- // }
1061
- // );
1062
- this.victimForm.get('minorFlag').valueChanges
1063
- .subscribe(value => {
1064
- this.victimForm.get('guardianFirstName').updateValueAndValidity();
1065
- this.victimForm.get('guardianLastName').updateValueAndValidity();
1066
- this.victimForm.get('guardianWorkPhone').updateValueAndValidity();
1067
- this.victimForm.get('guardianHomePhone').updateValueAndValidity();
1068
- this.victimForm.get('guardianCellPhone').updateValueAndValidity();
1069
- });
1070
- this.victimForm.get('victimAdvocateFlag').valueChanges
1071
- .subscribe(value => {
1072
- this.victimForm.get('advocateFirstName').updateValueAndValidity();
1073
- this.victimForm.get('advocateLastName').updateValueAndValidity();
1074
- this.victimForm.get('advocateWorkPhone').updateValueAndValidity();
1075
- this.victimForm.get('advocateHomePhone').updateValueAndValidity();
1076
- this.victimForm.get('advocateCellPhone').updateValueAndValidity();
1077
- });
1078
- }
1079
- back() {
1080
- //this.onSave.emit(this.victimDetail);
1081
- this.router.navigate(['victimList']);
1082
- }
1083
- deleteVictim() {
1084
- this.commonDialogService
1085
- .confirm('', 'Do you want to delete this Victim?', 'Yes', 'No')
1086
- .subscribe(res => {
1087
- this.result = res;
1088
- if (this.result) {
1089
- this.victimService.deleteVictims(this.victimDetail.victimId, this.staffId)
1090
- .subscribe(result => {
1091
- this.snackBar.open('Delete Successfully!', '', {
1092
- duration: 3000,
1093
- });
1094
- });
1095
- // this.onSave.emit(this.victimDetail);
1096
- // this.router.navigate(['victim']);
1097
- setTimeout(() => {
1098
- window.location.reload();
1099
- }, 1500);
1100
- }
1101
- });
1102
- }
1103
- radioMinorChange($event) {
1104
- if ($event.value === true) {
1105
- this.guardianTabFlag = true;
1106
- }
1107
- else {
1108
- this.guardianTabFlag = false;
1109
- }
1110
- }
1111
- radioAdvocateChange($event) {
1112
- const advocateLastNameControl = this.victimForm.get('advocateLastName');
1113
- const advocateFirstNameControl = this.victimForm.get('advocateFirstName');
1114
- if ($event.value === "YS") {
1115
- this.advocateTabFlag = true;
1116
- advocateLastNameControl.setValidators(Validators.required);
1117
- advocateFirstNameControl.setValidators(Validators.required);
1118
- }
1119
- else {
1120
- this.advocateTabFlag = false;
1121
- advocateLastNameControl.clearValidators();
1122
- advocateFirstNameControl.clearValidators();
1123
- }
1124
- advocateLastNameControl.updateValueAndValidity();
1125
- advocateFirstNameControl.updateValueAndValidity();
1126
- }
1127
- radioCicChange($event) {
1128
- if ($event.value === true) {
1129
- this.commonChildrenDivFlag = true;
1130
- // requrie field
1131
- this.setValidators('commonChildren');
1132
- }
1133
- else {
1134
- this.commonChildrenDivFlag = false;
1135
- }
1136
- }
1137
- setValidators(type) {
1138
- if (type == 'commonChildren') {
1139
- this.victimForm.get('commonChildrenNumber').clearValidators();
1140
- this.victimForm.get('commonChildrenNumber').setValidators(Validators.required);
1141
- }
1142
- else if (type == 'cpo') {
1143
- this.victimForm.get('cpoExpirationDate').clearValidators();
1144
- this.victimForm.get('cpoExpirationDate').setValidators(Validators.required);
1145
- }
1146
- }
1147
- radioSupportChange($event) {
1148
- if ($event.value === true) {
1149
- this.supportInPlaceDivFlag = true;
1150
- }
1151
- else {
1152
- this.supportInPlaceDivFlag = false;
1153
- }
1154
- }
1155
- radioWeaponChange($event) {
1156
- if ($event.value === true) {
1157
- this.weaponInvolvedDivFlag = true;
1158
- }
1159
- else {
1160
- this.weaponInvolvedDivFlag = false;
1161
- }
1162
- }
1163
- radioDrugChange($event) {
1164
- if ($event.value === true) {
1165
- this.drugUseDivFlag = true;
1166
- }
1167
- else {
1168
- this.drugUseDivFlag = false;
1169
- }
1170
- }
1171
- radioCpoChange($event) {
1172
- if ($event.value === true) {
1173
- this.cpoExpirationDivFlag = true;
1174
- this.setValidators('cpo');
1175
- }
1176
- else {
1177
- this.cpoExpirationDivFlag = false;
1178
- }
1179
- }
1180
- handleDOBChange($event) {
1181
- var ageDifMs = Date.now() - $event.value;
1182
- var ageDate = new Date(ageDifMs);
1183
- if (Math.abs(ageDate.getUTCFullYear() - 1970) <= 18) {
1184
- this.snackBar.open('Victim is a Minor. This information is a sensitive and should not be disclosed to any unauthorized parties. Contact the legal guardian.', '', {
1185
- duration: 6000,
1186
- });
1187
- const minorControl = this.victimForm.get('minorFlag');
1188
- minorControl.setValue(true);
1189
- this.guardianTabFlag = true;
1190
- }
1191
- }
1192
- checkOtherWeapon(WeaponUse) {
1193
- const otherWeaponControl = this.victimForm.get('otherWeapon');
1194
- if (WeaponUse.includes("OTHER")) {
1195
- this.otherWeaponFlag = true;
1196
- otherWeaponControl.setValidators(Validators.required);
1197
- }
1198
- else {
1199
- this.otherWeaponFlag = false;
1200
- otherWeaponControl.clearValidators();
1201
- }
1202
- otherWeaponControl.updateValueAndValidity();
1203
- }
1204
- checkOtherDrug(DrugUse) {
1205
- const otherDrugControl = this.victimForm.get('otherDrug');
1206
- if (DrugUse.includes("OTHER")) {
1207
- this.otherDrugFlag = true;
1208
- otherDrugControl.setValidators(Validators.required);
1209
- }
1210
- else {
1211
- this.otherDrugFlag = false;
1212
- otherDrugControl.clearValidators();
1213
- }
1214
- otherDrugControl.updateValueAndValidity();
1215
- }
1216
- //#region "save victim"
1217
- saveVictim() {
1218
- //guardian phone logic
1219
- if (!this.victimForm.value.guardianNoPhoneFlag) {
1220
- if (this.guardianHomePhoneControl.value) {
1221
- if (this.guardianHomePhoneControl.value !== null) {
1222
- if (this.guardianHomePhoneControl.value !== "") {
1223
- this.guardianPhoneExistFlag = true;
1224
- }
1225
- }
1226
- }
1227
- if (this.guardianWorkPhoneControl.value !== undefined) {
1228
- if (this.guardianWorkPhoneControl.value !== null) {
1229
- if (this.guardianWorkPhoneControl.value !== "") {
1230
- this.guardianPhoneExistFlag = true;
1231
- }
1232
- }
1233
- }
1234
- if (this.guardianCellPhoneControl.value) {
1235
- if (this.guardianCellPhoneControl.value !== null) {
1236
- if (this.guardianCellPhoneControl.value !== "") {
1237
- this.guardianPhoneExistFlag = true;
1238
- }
1239
- }
1240
- }
1241
- }
1242
- console.log('this.victimForm.value.guardianNoPhoneFlag');
1243
- console.log(this.victimForm.value.guardianNoPhoneFlag);
1244
- console.log('this.guardianPhoneExistFlag');
1245
- console.log(this.guardianPhoneExistFlag);
1246
- if (this.guardianPhoneExistFlag === false && this.victimForm.value.guardianNoPhoneFlag === false) {
1247
- this.phoneValidationFlag = true;
1248
- this.commonDialogService
1249
- .warning('', 'Please check the guardian phone field. You have to fill one of the three phone fileds.', 'Ok')
1250
- .subscribe(res => {
1251
- this.result = res;
1252
- });
1253
- }
1254
- console.log('this.phoneValidationFlag');
1255
- console.log(this.phoneValidationFlag);
1256
- //advocate phone logic
1257
- if (!this.victimForm.value.advocateNoPhoneFlag) {
1258
- if (this.advocateHomePhoneControl.value) {
1259
- if (this.advocateHomePhoneControl.value !== null) {
1260
- if (this.advocateHomePhoneControl.value !== "") {
1261
- this.advocatePhoneExistFlag = true;
1262
- }
1263
- }
1264
- }
1265
- if (this.advocateWorkPhoneControl.value !== undefined) {
1266
- if (this.advocateWorkPhoneControl.value !== null) {
1267
- if (this.advocateWorkPhoneControl.value !== "") {
1268
- this.advocatePhoneExistFlag = true;
1269
- }
1270
- }
1271
- }
1272
- if (this.advocateCellPhoneControl.value) {
1273
- if (this.advocateCellPhoneControl.value !== null) {
1274
- if (this.advocateCellPhoneControl.value !== "") {
1275
- this.advocatePhoneExistFlag = true;
1276
- }
1277
- }
1278
- }
1279
- }
1280
- console.log('this.victimForm.value.advocateNoPhoneFlag');
1281
- console.log(this.victimForm.value.advocateNoPhoneFlag);
1282
- console.log('this.advocatePhoneExistFlag');
1283
- console.log(this.advocatePhoneExistFlag);
1284
- if (this.advocatePhoneExistFlag === false && this.victimForm.value.advocateNoPhoneFlag === false) {
1285
- this.phoneValidationFlag = true;
1286
- this.commonDialogService
1287
- .warning('', 'Please check the advocate phone field. You have to fill one of the three phone fileds.', 'Ok')
1288
- .subscribe(res => {
1289
- this.result = res;
1290
- });
1291
- }
1292
- if (this.homePhoneControl.value) {
1293
- this.victimForm.value.homePhone = this.homePhoneControl.value.replace(/[()\s-]/g, '');
1294
- }
1295
- else {
1296
- this.victimForm.value.homePhone = null;
1297
- }
1298
- if (this.cellPhoneControl.value) {
1299
- this.victimForm.value.cellPhone = this.cellPhoneControl.value.replace(/[()\s-]/g, '');
1300
- }
1301
- else {
1302
- this.victimForm.value.cellPhone = null;
1303
- }
1304
- if (this.workPhoneControl.value) {
1305
- this.victimForm.value.workPhone = this.workPhoneControl.value.replace(/[()\s-]/g, '');
1306
- }
1307
- else {
1308
- this.victimForm.value.workPhone = null;
1309
- }
1310
- if (this.guardianHomePhoneControl.value) {
1311
- this.victimForm.value.guardianHomePhone = this.guardianHomePhoneControl.value.replace(/[()\s-]/g, '');
1312
- }
1313
- else {
1314
- this.victimForm.value.guardianHomePhone = null;
1315
- }
1316
- if (this.guardianCellPhoneControl.value) {
1317
- this.victimForm.value.guardianCellPhone = this.guardianCellPhoneControl.value.replace(/[()\s-]/g, '');
1318
- }
1319
- else {
1320
- this.victimForm.value.guardianCellPhone = null;
1321
- }
1322
- if (this.guardianWorkPhoneControl.value) {
1323
- this.victimForm.value.guardianWorkPhone = this.guardianWorkPhoneControl.value.replace(/[()\s-]/g, '');
1324
- }
1325
- else {
1326
- this.victimForm.value.guardianWorkPhone = null;
1327
- }
1328
- if (this.advocateHomePhoneControl.value) {
1329
- this.victimForm.value.advocateHomePhone = this.advocateHomePhoneControl.value.replace(/[()\s-]/g, '');
1330
- }
1331
- else {
1332
- this.victimForm.value.advocateHomePhone = null;
1333
- }
1334
- if (this.advocateCellPhoneControl.value) {
1335
- this.victimForm.value.advocateCellPhone = this.advocateCellPhoneControl.value.replace(/[()\s-]/g, '');
1336
- }
1337
- else {
1338
- this.victimForm.value.advocateCellPhone = null;
1339
- }
1340
- if (this.advocateWorkPhoneControl.value) {
1341
- this.victimForm.value.advocateWorkPhone = this.advocateWorkPhoneControl.value.replace(/[()\s-]/g, '');
1342
- }
1343
- else {
1344
- this.victimForm.value.advocateWorkPhone = null;
1345
- }
1346
- if (this.emergencyContactPhoneControl.value) {
1347
- this.victimForm.value.emergencyContactPhone = this.emergencyContactPhoneControl.value.replace(/[()\s-]/g, '');
1348
- }
1349
- else {
1350
- this.victimForm.value.emergencyContactPhone = null;
1351
- }
1352
- //data process
1353
- console.log('this.phoneValidationFlag 1');
1354
- console.log(this.phoneValidationFlag);
1355
- if (this.phoneValidationFlag === false) {
1356
- if (this.victimDetail === null) {
1357
- //insert new victim
1358
- var myVictimSupports = [];
1359
- if (this.victimForm.value.victimSupports) {
1360
- this.victimForm.value.victimSupports.forEach(element => {
1361
- const victimSupport = {};
1362
- victimSupport.victimId = this.victimForm.value.victimId;
1363
- victimSupport.victimSupportTypeId = element;
1364
- victimSupport.modifiedBy = this.staffId;
1365
- myVictimSupports.push(victimSupport);
1366
- });
1367
- }
1368
- var myVictimDrugUses = [];
1369
- console.log('this.victimForm.value.victimDrugUses during save');
1370
- console.log(this.victimForm.value.victimDrugUses);
1371
- if (this.victimForm.value.victimDrugUses) {
1372
- this.victimForm.value.victimDrugUses.forEach(element => {
1373
- const victimDrugUse = {};
1374
- victimDrugUse.drugTypeId = element;
1375
- if (element === "OTHER" || element === "" || element === null) {
1376
- victimDrugUse.drugTypeId = null;
1377
- victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1378
- }
1379
- else {
1380
- victimDrugUse.drugTypeId = element;
1381
- victimDrugUse.otherDrug = null;
1382
- }
1383
- victimDrugUse.modifiedBy = this.staffId;
1384
- victimDrugUse.victimId = this.victimForm.value.victimId;
1385
- myVictimDrugUses.push(victimDrugUse);
1386
- });
1387
- }
1388
- console.log('this.victimForm.value.victimDrugUses during save 1');
1389
- console.log(this.victimForm.value.victimDrugUses);
1390
- var myVictimWeaponUses = [];
1391
- if (this.victimForm.value.victimWeaponUses) {
1392
- this.victimForm.value.victimWeaponUses.forEach(element => {
1393
- const victimWeaponUse = {};
1394
- victimWeaponUse.victimId = this.victimForm.value.victimId;
1395
- victimWeaponUse.weaponTypeId = element;
1396
- if (element == "OTHER") {
1397
- victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1398
- }
1399
- else {
1400
- victimWeaponUse.otherWeapon = null;
1401
- }
1402
- victimWeaponUse.modifiedBy = this.staffId;
1403
- myVictimWeaponUses.push(victimWeaponUse);
1404
- });
1405
- }
1406
- const newVictim = {
1407
- victimId: 0,
1408
- offenderId: this.offenderId,
1409
- victimOffenderRelationshipTypeId: this.victimForm.value.victimOffenderRelationshipTypeId,
1410
- lastName: this.victimForm.value.lastName,
1411
- firstName: this.victimForm.value.firstName,
1412
- middleName: this.victimForm.value.middleName
1413
- ? this.victimForm.value.middleName
1414
- : null,
1415
- prefixId: this.victimForm.value.prefixId
1416
- ? this.victimForm.value.prefixId
1417
- : null,
1418
- suffixId: this.victimForm.value.suffixId
1419
- ? this.victimForm.value.suffixId
1420
- : null,
1421
- birthDate: this.victimForm.value.birthDate
1422
- ? this.victimForm.value.birthDate
1423
- : null,
1424
- genderCode: this.victimForm.value.genderCode
1425
- ? this.victimForm.value.genderCode
1426
- : null,
1427
- underSupervisionFlag: this.victimForm.value.underSupervisionFlag,
1428
- minorFlag: this.victimForm.value.minorFlag,
1429
- victimAdvocateFlag: this.victimForm.value.victimAdvocateFlag,
1430
- homePhone: this.victimForm.value.homePhone,
1431
- workPhone: this.victimForm.value.workPhone,
1432
- cellPhone: this.victimForm.value.cellPhone,
1433
- email: this.victimForm.value.email ? this.victimForm.value.email : null,
1434
- addressId: this.victimForm.value.addressId
1435
- ? this.victimForm.value.addressId
1436
- : 1,
1437
- emergencyContact: this.victimForm.value.emergencyContact
1438
- ? this.victimForm.value.emergencyContact
1439
- : null,
1440
- emergencyContactPhone: this.victimForm.value.emergencyContactPhone,
1441
- commonChildrenFlag: this.victimForm.value.commonChildrenFlag,
1442
- commonChildrenNumber: this.victimForm.value.commonChildrenNumber,
1443
- cpoExpirationFlag: this.victimForm.value.cpoExpirationFlag,
1444
- cpoExpirationDate: this.victimForm.value.cpoExpirationDate
1445
- ? this.datePipe.transform(this.victimForm.value.cpoExpirationDate, "short")
1446
- : null,
1447
- supportInPlaceFlag: this.victimForm.value.supportInPlaceFlag,
1448
- weaponInvolvedFlag: this.victimForm.value.weaponInvolvedFlag,
1449
- drugUseFlag: this.victimForm.value.drugUseFlag,
1450
- alcoholUseFlag: this.victimForm.value.alcoholUseFlag,
1451
- accessRisk: this.victimForm.value.accessRisk,
1452
- modifiedBy: this.staffId,
1453
- vVictimAdvocate: null,
1454
- vVictimGuardian: null,
1455
- victimDrugUses: myVictimDrugUses,
1456
- victimSupports: myVictimSupports,
1457
- victimWeaponUses: myVictimWeaponUses,
1458
- advocateFirstName: null,
1459
- advocateLastName: null,
1460
- advocateEmail: null,
1461
- advocatePrefixId: null,
1462
- advocateSuffixId: null,
1463
- advocateNoPhoneFlag: null,
1464
- advocateHomePhone: null,
1465
- advocateWorkPhone: null,
1466
- advocateCellPhone: null,
1467
- advocateAddressId: null,
1468
- guardianFirstName: null,
1469
- guardianLastName: null,
1470
- guardianEmail: null,
1471
- guardianPrefixId: null,
1472
- guardianSuffixId: null,
1473
- guardianNoPhoneFlag: null,
1474
- guardianHomePhone: null,
1475
- guardianWorkPhone: null,
1476
- guardianCellPhone: null,
1477
- guardianAddressId: null,
1478
- guardianBirthDate: null,
1479
- relationship: null,
1480
- //relationship: this.victimForm.value.victimOffenderRelationshipTypeId? this.victimForm.value.victimOffenderRelationshipTypeId : null,
1481
- allowCsosaContactFlag: this.victimForm.value.allowCsosaContactFlag
1482
- ? this.victimForm.value.allowCsosaContactFlag
1483
- : null,
1484
- liveWithOffenderFlag: this.victimForm.value.liveWithOffenderFlag
1485
- ? this.victimForm.value.liveWithOffenderFlag
1486
- : null,
1487
- };
1488
- if (this.addressId == 0) {
1489
- newVictim.addressId = null;
1490
- }
1491
- else {
1492
- newVictim.addressId = this.addressId;
1493
- }
1494
- newVictim.advocateAddressId = this.advocateAddressId;
1495
- newVictim.guardianAddressId = this.guardianAddressId;
1496
- console.log('newVictim');
1497
- console.log(newVictim);
1498
- this.victimService.postVictims(newVictim).subscribe((items) => {
1499
- const id = items ? items.victimId : '';
1500
- if (this.victimForm.value.victimAdvocateFlag == "YS") {
1501
- console.log('add advocate');
1502
- const victimAdvocate = {
1503
- victimAdvocateId: id,
1504
- lastName: this.victimForm.value.advocateLastName,
1505
- firstName: this.victimForm.value.advocateFirstName,
1506
- prefixId: this.victimForm.value.advocatePrefixId,
1507
- suffixId: this.victimForm.value.advocateSuffixId,
1508
- addressId: this.advocateAddressId ? this.advocateAddressId : null,
1509
- noPhoneFlag: this.victimForm.value.advocateNoPhoneFlag ? this.victimForm.value.advocateNoPhoneFlag : null,
1510
- homePhone: this.victimForm.value.advocateHomePhone,
1511
- workPhone: this.victimForm.value.advocateWorkPhone,
1512
- cellPhone: this.victimForm.value.advocateCellPhone,
1513
- email: this.victimForm.value.advocateEmail,
1514
- modifiedBy: this.staffId
1515
- };
1516
- this.victimService.postVictimAdvocate(id, victimAdvocate).subscribe();
1517
- }
1518
- if (this.victimForm.value.minorFlag == true) {
1519
- const victimGuardian = {
1520
- victimGuardianId: id,
1521
- lastName: this.victimForm.value.guardianLastName,
1522
- firstName: this.victimForm.value.guardianFirstName,
1523
- prefixId: this.victimForm.value.guardianPrefixId,
1524
- suffixId: this.victimForm.value.guardianSuffixId,
1525
- birthDate: this.victimForm.value.guardianBirthDate,
1526
- addressId: this.guardianAddressId ? this.guardianAddressId : null,
1527
- noPhoneFlag: this.victimForm.value.guardianNoPhoneFlag ? this.victimForm.value.guardianNoPhoneFlag : null,
1528
- homePhone: this.victimForm.value.guardianHomePhone,
1529
- workPhone: this.victimForm.value.guardianWorkPhone,
1530
- cellPhone: this.victimForm.value.guardianCellPhone,
1531
- email: this.victimForm.value.guardianEmail,
1532
- modifiedBy: this.staffId
1533
- };
1534
- this.victimService.postVictimGuardian(id, victimGuardian).subscribe();
1535
- }
1536
- this.snackBar.open('Add Victim Successfully!', '', {
1537
- duration: 3000,
1538
- });
1539
- //insert new
1540
- if (this.isIntake === true) {
1541
- this.router.navigate(['victimHome']);
1542
- }
1543
- else {
1544
- this.router.navigate(['victimList']);
1545
- }
1546
- //this.onSave.emit(this.victimDetail);
1547
- });
1548
- }
1549
- else {
1550
- //update victim
1551
- this.victimDetail.underSupervisionFlag = this.victimForm.value.underSupervisionFlag;
1552
- this.victimDetail.victimOffenderRelationshipTypeId = this.victimForm.value.victimOffenderRelationshipTypeId;
1553
- this.victimDetail.lastName = this.victimForm.value.lastName;
1554
- this.victimDetail.firstName = this.victimForm.value.firstName;
1555
- this.victimDetail.middleName = this.victimForm.value.middleName;
1556
- this.victimDetail.prefixId = this.victimForm.value.prefixId ? this.victimForm.value.prefixId : null;
1557
- this.victimDetail.suffixId = this.victimForm.value.suffixId ? this.victimForm.value.suffixId : null;
1558
- this.victimDetail.birthDate = this.victimForm.value.birthDate;
1559
- this.victimDetail.genderCode = this.victimForm.value.genderCode;
1560
- this.victimDetail.minorFlag = this.victimForm.value.minorFlag;
1561
- this.victimDetail.homePhone = this.victimForm.value.homePhone;
1562
- this.victimDetail.workPhone = this.victimForm.value.workPhone;
1563
- this.victimDetail.cellPhone = this.victimForm.value.cellPhone;
1564
- this.victimDetail.email = this.victimForm.value.email;
1565
- this.victimDetail.victimAdvocateFlag = this.victimForm.value.victimAdvocateFlag;
1566
- this.victimDetail.emergencyContact = this.victimForm.value.emergencyContact;
1567
- this.victimDetail.emergencyContactPhone = this.victimForm.value.emergencyContactPhone;
1568
- this.victimDetail.commonChildrenFlag = this.victimForm.value.commonChildrenFlag;
1569
- this.victimDetail.commonChildrenNumber = this.victimForm.value.commonChildrenNumber;
1570
- this.victimDetail.cpoExpirationDate = this.victimForm.value.cpoExpirationDate;
1571
- this.victimDetail.cpoExpirationFlag = this.victimForm.value.cpoExpirationFlag;
1572
- this.victimDetail.supportInPlaceFlag = this.victimForm.value.supportInPlaceFlag;
1573
- this.victimDetail.weaponInvolvedFlag = this.victimForm.value.weaponInvolvedFlag;
1574
- this.victimDetail.drugUseFlag = this.victimForm.value.drugUseFlag;
1575
- this.victimDetail.alcoholUseFlag = this.victimForm.value.alcoholUseFlag;
1576
- this.victimDetail.accessRisk = this.victimForm.value.accessRisk;
1577
- this.victimDetail.addressId = this.addressId;
1578
- this.victimDetail.allowCsosaContactFlag = this.victimForm.value.allowCsosaContactFlag;
1579
- this.victimDetail.liveWithOffenderFlag = this.victimForm.value.liveWithOffenderFlag;
1580
- this.victimDetail.victimSupports = [];
1581
- this.victimForm.value.victimSupports.forEach(element => {
1582
- const victimSupport = {};
1583
- victimSupport.victimId = this.victimDetail.victimId;
1584
- victimSupport.victimSupportTypeId = element;
1585
- victimSupport.modifiedBy = this.staffId;
1586
- this.victimDetail.victimSupports.push(victimSupport);
1587
- });
1588
- this.victimDetail.victimDrugUses = [];
1589
- this.victimForm.value.victimDrugUses.forEach(element => {
1590
- const victimDrugUse = {};
1591
- victimDrugUse.drugTypeId = element;
1592
- console.log('this.victimForm.value.victimDrugUses before');
1593
- console.log(this.victimForm.value.victimDrugUses);
1594
- if (element === "OTHER" || element === "") {
1595
- victimDrugUse.drugTypeId = null;
1596
- victimDrugUse.otherDrug = this.victimForm.value.otherDrug;
1597
- }
1598
- else {
1599
- victimDrugUse.drugTypeId = element;
1600
- victimDrugUse.otherDrug = null;
1601
- }
1602
- victimDrugUse.modifiedBy = this.staffId;
1603
- victimDrugUse.victimId = this.victimDetail.victimId;
1604
- this.victimDetail.victimDrugUses.push(victimDrugUse);
1605
- });
1606
- this.victimForm.value.victimDrugUses.filter(word => (!(word.drugTypeId === null && word.otherDrug === null)));
1607
- this.victimDetail.victimWeaponUses = [];
1608
- this.victimForm.value.victimWeaponUses.forEach(element => {
1609
- const victimWeaponUse = {};
1610
- victimWeaponUse.victimId = this.victimDetail.victimId;
1611
- victimWeaponUse.weaponTypeId = element;
1612
- if (element == "OTHER") {
1613
- victimWeaponUse.otherWeapon = this.victimForm.value.otherWeapon;
1614
- }
1615
- else {
1616
- victimWeaponUse.otherWeapon = null;
1617
- }
1618
- victimWeaponUse.modifiedBy = this.staffId;
1619
- this.victimDetail.victimWeaponUses.push(victimWeaponUse);
1620
- });
1621
- console.log('this.victimDetail before emit');
1622
- console.log(this.victimDetail);
1623
- this.victimService.putVictims(this.victimDetail.victimId, this.victimDetail).subscribe((items) => {
1624
- this.snackBar.open('Update Successfully!', '', {
1625
- duration: 3000,
1626
- });
1627
- //Advocate section
1628
- this.victimAdvocate.victimAdvocateId = this.victimDetail.victimId;
1629
- this.victimAdvocate.lastName = this.victimForm.value.advocateLastName;
1630
- this.victimAdvocate.firstName = this.victimForm.value.advocateFirstName;
1631
- this.victimAdvocate.prefixId = this.victimForm.value.advocatePrefixId ? this.victimForm.value.advocatePrefixId : null;
1632
- this.victimAdvocate.suffixId = this.victimForm.value.advocateSuffixId ? this.victimForm.value.advocateSuffixId : null;
1633
- this.victimAdvocate.addressId = this.advocateAddressId ? this.advocateAddressId : null;
1634
- this.victimAdvocate.noPhoneFlag = this.victimForm.value.advocateNoPhoneFlag ? true : false;
1635
- this.victimAdvocate.homePhone = this.victimForm.value.advocateHomePhone;
1636
- this.victimAdvocate.workPhone = this.victimForm.value.advocateWorkPhone;
1637
- this.victimAdvocate.cellPhone = this.victimForm.value.advocateCellPhone;
1638
- this.victimAdvocate.email = this.victimForm.value.advocateEmail ? this.victimForm.value.advocateEmail : null;
1639
- this.victimAdvocate.modifiedBy = this.staffId;
1640
- console.log('work on advocate part');
1641
- if (this.victimDetail.victimAdvocateFlag == 'YS') {
1642
- console.log('work on advocate flag is YS ');
1643
- if (this.victimDetail.advocateFirstName != null) {
1644
- console.log('check advocate fisrt name ');
1645
- console.log(this.victimDetail.advocateFirstName);
1646
- this.victimService.putVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe(resp => { });
1647
- }
1648
- else {
1649
- console.log('add advocate');
1650
- console.log(this.victimAdvocate);
1651
- this.victimService.postVictimAdvocate(this.victimDetail.victimId, this.victimAdvocate).subscribe();
1652
- }
1653
- }
1654
- // guardian section
1655
- this.victimGuardian.victimGuardianId = this.victimDetail.victimId;
1656
- this.victimGuardian.lastName = this.victimForm.value.guardianLastName;
1657
- this.victimGuardian.firstName = this.victimForm.value.guardianFirstName;
1658
- this.victimGuardian.prefixId = this.victimForm.value.guardianPrefixId ? this.victimForm.value.guardianPrefixId : null;
1659
- this.victimGuardian.suffixId = this.victimForm.value.guardianSuffixId ? this.victimForm.value.guardianSuffixId : null;
1660
- this.victimGuardian.addressId = this.guardianAddressId ? this.guardianAddressId : null;
1661
- this.victimGuardian.noPhoneFlag = this.victimForm.value.guardianNoPhoneFlag ? true : false;
1662
- this.victimGuardian.homePhone = this.victimForm.value.guardianHomePhone;
1663
- this.victimGuardian.workPhone = this.victimForm.value.guardianWorkPhone;
1664
- this.victimGuardian.cellPhone = this.victimForm.value.guardianCellPhone;
1665
- this.victimGuardian.email = this.victimForm.value.guardianEmail ? this.victimForm.value.guardianEmail : null;
1666
- this.victimGuardian.modifiedBy = this.staffId;
1667
- if (this.victimDetail.minorFlag == true) {
1668
- if (this.victimDetail.guardianFirstName != null)
1669
- this.victimService.putVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe(resp => {
1670
- });
1671
- else {
1672
- console.log('add gurdian');
1673
- console.log(this.victimGuardian);
1674
- this.victimService.postVictimGuardian(this.victimDetail.victimId, this.victimGuardian).subscribe();
1675
- }
1676
- }
1677
- });
1678
- }
1679
- } //end of this.phoneValidationFlag = false
1680
- console.log('this.victimDetail');
1681
- console.log(this.victimDetail);
1682
- this.onSave.emit(this.victimDetail);
1683
- }
1684
- //#endregion "save victim"
1685
- addContact() {
1686
- this.router.navigate(['victimContact', this.victimId]);
1687
- }
1688
- formatLabel(value) {
1689
- return value;
1690
- }
1691
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDetailComponent, deps: [{ token: i8$1.Location }, { token: i1$2.UntypedFormBuilder }, { token: i1$1.MatDialog }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i4.MatSnackBar }, { token: CommonDialogService }, { token: NgcSmartVictimService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
1692
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SmartVictimDetailComponent, selector: "csmart-victim-detail", inputs: { victimDetail: "victimDetail", staffId: "staffId", offenderId: "offenderId", isIntake: "isIntake" }, outputs: { onSave: "onSave", onCancel: "onCancel" }, providers: [CommonDialogService], viewQueries: [{ propertyName: "addressComponent", first: true, predicate: ["addressComponent"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]=\"victimForm\">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label=\"Victim Detail\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\r\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\r\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\r\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Gender:</mat-label>\r\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"victimBirthRef\"\r\n formControlName=\"birthDate\"\r\n [(ngModel)]=\"editVictim.birthDate\"\r\n (click)=\"victimBirthRef.open()\"\r\n (dateChange)=\"handleDOBChange($event)\"\r\n >\r\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.homePhone\"\r\n [phoneControl]=\"homePhoneControl\"\r\n [formControl]=\"homePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\r\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input\r\n id=\"tel1\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.cellPhone\"\r\n [phoneControl]=\"cellPhoneControl\"\r\n [formControl]=\"cellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\r\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input\r\n id=\"tel2\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.workPhone\"\r\n [phoneControl]=\"workPhoneControl\"\r\n [formControl]=\"workPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\r\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\r\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <app-smart-address\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"addressId\"\r\n [outline]=\"true\"\r\n [showPsa]=\"true\"\r\n [addressValidators]=\"addressValidators\"\r\n [readonly]=\"false\"\r\n (addressIdChange)=\"onAddressChange($event)\"\r\n #addressComponent >\r\n\r\n </app-smart-address>\r\n\r\n\r\n <!-- Docket:\r\n <div>\r\n <div *ngFor=\"let docket of docketlist; let i=index\">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> -->\r\n <div>\r\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\r\n <br>\r\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\r\n </div>\r\n\r\n </div>\r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"commonChildrenDivFlag\">\r\n\r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"cpoExpirationDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput\r\n [matDatepicker]=\"cpoDateRef\"\r\n formControlName=\"cpoExpirationDate\"\r\n (click)=\"cpoDateRef.open()\"\r\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\r\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"supportInPlaceDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\r\n <div (mouseleave)=\"supportSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n\r\n <div *ngIf=\"weaponInvolvedDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\r\n <div (mouseleave)=\"weaponSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf=\"otherWeaponFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName=\"otherWeapon\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"drugUseDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\r\n <div (mouseleave)=\"drugSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div *ngIf=\"otherDrugFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName=\"otherDrug\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n\r\n <mat-slider\r\n formControlName=\"accessRisk\"\r\n thumbLabel=\"true\"\r\n [displayWith]=\"formatLabel\"\r\n min=\"1\"\r\n max=\"10\"\r\n [(ngModel)]=\"editVictim.accessRisk\"\r\n ><input matSliderThumb /></mat-slider>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\r\n <div class='container'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <!-- <mat-form-field>\r\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> -->\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"guardianDateRef\"\r\n formControlName=\"guardianBirthDate\"\r\n [(ngModel)]=\"editVictim.guardianBirthDate\"\r\n (click)=\"guardianDateRef.open()\"\r\n >\r\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"guardianNoPhoneFlag\">\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianHomePhone\"\r\n [phoneControl]=\"guardianHomePhoneControl\"\r\n [formControl]=\"guardianHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\r\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input\r\n id=\"tel4\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianCellPhone\"\r\n [phoneControl]=\"guardianCellPhoneControl\"\r\n [formControl]=\"guardianCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\r\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n\r\n <input\r\n id=\"tel5\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianWorkPhone\"\r\n [phoneControl]=\"guardianWorkPhoneControl\"\r\n [formControl]=\"guardianWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\r\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\r\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n <div>\r\n <app-smart-address\r\n\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"guardianAddressId\"\r\n (addressIdChange)=\"onGuardianAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <!--advocate-->\r\n\r\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"advocateNoPhoneFlag\"\r\n\r\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateHomePhone\"\r\n [phoneControl]=\"advocateHomePhoneControl\"\r\n [formControl]=\"advocateHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\r\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input\r\n id=\"tel7\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateCellPhone\"\r\n [phoneControl]=\"advocateCellPhoneControl\"\r\n [formControl]=\"advocateCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\r\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input\r\n id=\"tel8\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateWorkPhone\"\r\n [phoneControl]=\"advocateWorkPhoneControl\"\r\n [formControl]=\"advocateWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\r\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\r\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n\r\n <div >\r\n <app-smart-address\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"advocateAddressId\"\r\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n\r\n <mat-tab label=\"Emergency Contact\">\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.emergencyContactPhone\"\r\n [phoneControl]=\"emergencyContactPhoneControl\"\r\n [formControl]=\"emergencyContactPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\r\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n </mat-tab-group>\r\n <div class='outer'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\r\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\r\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\r\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\r\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf=\"showDelete\" class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"cancel()\">Clear </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align=\"right\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"contactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimContactMethod\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"nextContactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"staff\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"contactId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:100%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width: 1120px){.container{display:grid;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width: 675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i1$2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "directive", type: i10.MatRadioGroup, selector: "mat-radio-group", inputs: ["color", "name", "labelPosition", "value", "selected", "disabled", "required"], outputs: ["change"], exportAs: ["matRadioGroup"] }, { kind: "component", type: i10.MatRadioButton, selector: "mat-radio-button", inputs: ["id", "name", "aria-label", "aria-labelledby", "aria-describedby", "disableRipple", "tabIndex", "checked", "value", "labelPosition", "disabled", "required", "color"], outputs: ["change"], exportAs: ["matRadioButton"] }, { kind: "component", type: i11.MatSlider, selector: "mat-slider", inputs: ["disabled", "discrete", "showTickMarks", "min", "color", "disableRipple", "max", "step", "displayWith"], exportAs: ["matSlider"] }, { kind: "directive", type: i11.MatSliderThumb, selector: "input[matSliderThumb]", inputs: ["value"], outputs: ["valueChange", "dragStart", "dragEnd"], exportAs: ["matSliderThumb"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i13.MatTab, selector: "mat-tab", inputs: ["disabled", "label", "aria-label", "aria-labelledby", "labelClass", "bodyClass"], exportAs: ["matTab"] }, { kind: "component", type: i13.MatTabGroup, selector: "mat-tab-group", inputs: ["color", "fitInkBarToContent", "mat-stretch-tabs", "dynamicHeight", "selectedIndex", "headerPosition", "animationDuration", "contentTabIndex", "disablePagination", "disableRipple", "preserveContent", "backgroundColor"], outputs: ["selectedIndexChange", "focusChange", "animationDone", "selectedTabChange"], exportAs: ["matTabGroup"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "component", type: i20.SmartAddressComponent, selector: "app-smart-address", inputs: ["showPsa", "housingTypeId", "modifiedBy", "rowHeight", "id", "outline", "readonly", "addressValidators"], outputs: ["isValid", "addressIdChange"] }, { kind: "directive", type: i21.PhoneMaskDirective, selector: "[phoneMask]", inputs: ["phoneControl", "preValue"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] }); }
1693
- }
1694
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDetailComponent, decorators: [{
1695
- type: Component,
1696
- args: [{ selector: 'csmart-victim-detail', providers: [CommonDialogService], template: "<mat-card>\r\n <mat-card-content>\r\n\r\n <div [formGroup]=\"victimForm\">\r\n\r\n <mat-tab-group dynamicHeight mat-stretch-tabs>\r\n <mat-tab label=\"Victim Detail\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Is victim a minor?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"minorFlag\" (change)=\"radioMinorChange($event)\" [(ngModel)]=\"editVictim.minorFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Does the Victim have a Victim Advocate or Social Worker with <br>whom CSOSA should maintain contact?<font color=\"red\">* </font></mat-label>\r\n <br>\r\n <br>\r\n <mat-radio-group class = \"tp-radio-group\" formControlName=\"victimAdvocateFlag\" (change)=\"radioAdvocateChange($event)\" [(ngModel)]=\"editVictim.victimAdvocateFlag\">\r\n <mat-radio-button color=\"primary\" *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\">{{item.name}} </mat-radio-button>&nbsp;\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Currently Under Supervision:</mat-label>\r\n <mat-select formControlName=\"underSupervisionFlag\" name=\"supervision\" [(ngModel)]=\"editVictim.underSupervisionFlag\" >\r\n <mat-option *ngFor=\"let item of flagOption\" [value]=\"item.flagOptionYesNoUnknownId\" >\r\n {{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Relationship to Offender:</mat-label>\r\n <mat-select formControlName=\"victimOffenderRelationshipTypeId\" [(ngModel)]=\"editVictim.victimOffenderRelationshipTypeId\" >\r\n <mat-option *ngFor=\"let item of relationshipTypes\" [value]=\"item.relationshipTypeId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>relationship is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Last Name:</mat-label>\r\n <input matInput formControlName=\"lastName\" [(ngModel)]=\"editVictim.lastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim First Name: </mat-label>\r\n <input matInput formControlName=\"firstName\" [(ngModel)]=\"editVictim.firstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Middle Name:</mat-label>\r\n <input matInput formControlName=\"middleName\" [(ngModel)]=\"editVictim.middleName\">\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Prefix:</mat-label>\r\n <mat-select formControlName=\"prefixId\" [(ngModel)]=\"editVictim.prefixId\">\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Suffix:</mat-label>\r\n <mat-select formControlName=\"suffixId\" [(ngModel)]=\"editVictim.suffixId\">\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Gender:</mat-label>\r\n <mat-select formControlName=\"genderCode\" [(ngModel)]=\"editVictim.genderCode\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"victimBirthRef\"\r\n formControlName=\"birthDate\"\r\n [(ngModel)]=\"editVictim.birthDate\"\r\n (click)=\"victimBirthRef.open()\"\r\n (dateChange)=\"handleDOBChange($event)\"\r\n >\r\n <mat-datepicker-toggle [for]=\"victimBirthRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #victimBirthRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.homePhone\"\r\n [phoneControl]=\"homePhoneControl\"\r\n [formControl]=\"homePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('homePhone').errors\r\n && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)\">\r\n <mat-error><strong>Home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Cell Phone:</mat-label>\r\n <input\r\n id=\"tel1\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.cellPhone\"\r\n [phoneControl]=\"cellPhoneControl\"\r\n [formControl]=\"cellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('cellPhone').errors\r\n && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)\">\r\n <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Work Phone:</mat-label>\r\n <input\r\n id=\"tel2\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.workPhone\"\r\n [phoneControl]=\"workPhoneControl\"\r\n [formControl]=\"workPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('workPhone').errors\r\n && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)\">\r\n <mat-error><strong>Work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Victim Email:</mat-label>\r\n <input matInput formControlName=\"email\" [(ngModel)]=\"editVictim.email\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('email').errors\r\n && (victimForm.get('email').dirty || victimForm.get('email').touched)\">\r\n <mat-error><strong>victim email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <app-smart-address\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"addressId\"\r\n [outline]=\"true\"\r\n [showPsa]=\"true\"\r\n [addressValidators]=\"addressValidators\"\r\n [readonly]=\"false\"\r\n (addressIdChange)=\"onAddressChange($event)\"\r\n #addressComponent >\r\n\r\n </app-smart-address>\r\n\r\n\r\n <!-- Docket:\r\n <div>\r\n <div *ngFor=\"let docket of docketlist; let i=index\">\r\n <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>\r\n </div>\r\n </div> -->\r\n <div>\r\n <mat-checkbox color=\"primary\" formControlName=\"liveWithOffenderFlag\" name=\"liveWithOffenderFlag\" [(ngModel)]=\"editVictim.liveWithOffenderFlag\" (change)=\"showAddress($event)\" >victim live with offender</mat-checkbox>\r\n <br>\r\n <mat-checkbox color=\"primary\" formControlName=\"allowCsosaContactFlag\" name=\"allowCsosaContactFlag\" [(ngModel)]=\"editVictim.allowCsosaContactFlag\">victim wants to be contacted by CSOSA</mat-checkbox>\r\n </div>\r\n\r\n </div>\r\n\r\n <mat-card>\r\n <mat-form-field>\r\n <mat-label> Children in Common</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"commonChildrenFlag\" [(ngModel)]=\"editVictim.commonChildrenFlag\" (change)=\"radioCicChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"commonChildrenDivFlag\">\r\n\r\n <mat-form-field >\r\n <mat-label>\r\n Children number\r\n </mat-label>\r\n <input matInput formControlName=\"commonChildrenNumber\" [(ngModel)]=\"editVictim.commonChildrenNumber\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <mat-form-field>\r\n <mat-label>CPO: </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"cpoExpirationFlag\" [(ngModel)]=\"editVictim.cpoExpirationFlag\" (change)=\"radioCpoChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"cpoExpirationDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Expiration Date: </mat-label>\r\n <input matInput\r\n [matDatepicker]=\"cpoDateRef\"\r\n formControlName=\"cpoExpirationDate\"\r\n (click)=\"cpoDateRef.open()\"\r\n [(ngModel)]=\"editVictim.cpoExpirationDate\" >\r\n <mat-datepicker-toggle [for]=\"cpoDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #cpoDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Victim has a Support System in Place? </mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"supportInPlaceFlag\" [(ngModel)]=\"editVictim.supportInPlaceFlag\" (change)=\"radioSupportChange($event)\">\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"supportInPlaceDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Support type? </mat-label>\r\n <mat-select #supportSel formControlName=\"victimSupports\" [(ngModel)]=\"editVictim.victimSupports\" multiple>\r\n <div (mouseleave)=\"supportSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of victimSupportTypes\" [value]=\"item.victimSupportTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Weapons Involved?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"weaponInvolvedFlag\" (change)=\"radioWeaponChange($event)\" [(ngModel)]=\"editVictim.weaponInvolvedFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n\r\n <div *ngIf=\"weaponInvolvedDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Weapon Type</mat-label>\r\n <mat-select #weaponSel formControlName=\"victimWeaponUses\" multiple [(ngModel)]=\"editVictim.victimWeaponUses\" (selectionChange)=\"checkOtherWeapon($event.value)\" >\r\n <div (mouseleave)=\"weaponSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of weaponTypes\" [value]=\"item.weaponTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n </div>\r\n\r\n <div *ngIf=\"otherWeaponFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Weapon:* </mat-label>\r\n <input matInput formControlName=\"otherWeapon\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error><strong>Other weapon is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"alcoholUseFlag\" [(ngModel)]=\"editVictim.alcoholUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <br>\r\n <br>\r\n\r\n <mat-form-field>\r\n <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>\r\n <br>\r\n <mat-radio-group formControlName=\"drugUseFlag\" (change)=\"radioDrugChange($event)\" [(ngModel)]=\"editVictim.drugUseFlag\" >\r\n <mat-radio-button color=\"primary\" [value]=\"true\">Yes</mat-radio-button>&nbsp;\r\n <mat-radio-button color=\"primary\" [value]=\"false\">No</mat-radio-button>\r\n </mat-radio-group>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n <div *ngIf=\"drugUseDivFlag\">\r\n <mat-form-field>\r\n <mat-label>Drug:</mat-label>\r\n <mat-select #drugSel formControlName=\"victimDrugUses\" multiple (selectionChange)=\"checkOtherDrug($event.value)\" >\r\n <div (mouseleave)=\"drugSel.close()\">\r\n <mat-option color=\"primary\" *ngFor=\"let item of drugs\" [value]=\"item.drugTypeId\">\r\n {{item.name}}\r\n </mat-option>\r\n\r\n </div>\r\n </mat-select>\r\n <input matInput placeholder=\"\" style=\"display: none\">\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div *ngIf=\"otherDrugFlag\">\r\n <mat-form-field>\r\n <mat-label>Other Drug:* </mat-label>\r\n <input matInput formControlName=\"otherDrug\" >\r\n </mat-form-field>\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error><strong>Other drug is required.</strong></mat-error>\r\n </div>\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div>\r\n <div>\r\n <mat-label>\r\n Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>\r\n </mat-label>\r\n </div>\r\n <div>\r\n\r\n <mat-slider\r\n formControlName=\"accessRisk\"\r\n thumbLabel=\"true\"\r\n [displayWith]=\"formatLabel\"\r\n min=\"1\"\r\n max=\"10\"\r\n [(ngModel)]=\"editVictim.accessRisk\"\r\n ><input matSliderThumb /></mat-slider>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-card>\r\n\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <mat-tab *ngIf=\"guardianTabFlag\" label=\"Legal Guardian\">\r\n <div class='container'>\r\n <mat-form-field>\r\n <mat-label>Guardian Last Name:</mat-label>\r\n <input matInput formControlName=\"guardianLastName\" [(ngModel)]=\"editVictim.guardianLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors \">\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian First Name:</mat-label>\r\n <input matInput formControlName=\"guardianFirstName\" [(ngModel)]=\"editVictim.guardianFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors \">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Prefix:</mat-label>\r\n <mat-select formControlName=\"guardianPrefixId\" [(ngModel)]=\"editVictim.guardianPrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Suffix:</mat-label>\r\n <mat-select formControlName=\"guardianSuffixId\" [(ngModel)]=\"editVictim.guardianSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <!-- <mat-form-field>\r\n <mat-select placeholder=\"Choose\" formControlName=\"guardianGender\" [(ngModel)]=\"editVictim.guardianGender\">\r\n <mat-option *ngFor=\"let item of genders\" [value]=\"item.genderCode\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field> -->\r\n\r\n\r\n <mat-form-field>\r\n <mat-label>Date of Birth:</mat-label>\r\n <input matInput\r\n [matDatepicker]=\"guardianDateRef\"\r\n formControlName=\"guardianBirthDate\"\r\n [(ngModel)]=\"editVictim.guardianBirthDate\"\r\n (click)=\"guardianDateRef.open()\"\r\n >\r\n <mat-datepicker-toggle [for]=\"guardianDateRef\" matSuffix></mat-datepicker-toggle>\r\n <mat-datepicker #guardianDateRef></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-form-field >\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"guardianNoPhoneFlag\">\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Guardian Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianHomePhone\"\r\n [phoneControl]=\"guardianHomePhoneControl\"\r\n [formControl]=\"guardianHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianHomePhone').errors\r\n && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)\">\r\n <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Cell Phone:</mat-label>\r\n <input\r\n id=\"tel4\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianCellPhone\"\r\n [phoneControl]=\"guardianCellPhoneControl\"\r\n [formControl]=\"guardianCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianCellPhone').errors\r\n && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)\">\r\n <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field >\r\n <mat-label>Guardian Work Phone:</mat-label>\r\n\r\n <input\r\n id=\"tel5\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.guardianWorkPhone\"\r\n [phoneControl]=\"guardianWorkPhoneControl\"\r\n [formControl]=\"guardianWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianWorkPhone').errors\r\n && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)\">\r\n <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Guardian Email:</mat-label>\r\n <input matInput formControlName=\"guardianEmail\" [(ngModel)]=\"editVictim.guardianEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianEmail').errors\r\n && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)\">\r\n <mat-error><strong>Guardian email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n <div>\r\n <app-smart-address\r\n\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"guardianAddressId\"\r\n (addressIdChange)=\"onGuardianAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #guardianAddressComponent\r\n >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n <!--advocate-->\r\n\r\n <mat-tab *ngIf=\"advocateTabFlag\" label=\"Advocate\" >\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Last Name:</mat-label>\r\n <input matInput formControlName=\"advocateLastName\" [(ngModel)]=\"editVictim.advocateLastName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors \">\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate First Name:</mat-label>\r\n <input matInput formControlName=\"advocateFirstName\" [(ngModel)]=\"editVictim.advocateFirstName\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors \">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Prefix:</mat-label>\r\n <mat-select formControlName=\"advocatePrefixId\" [(ngModel)]=\"editVictim.advocatePrefixId\" >\r\n <mat-option *ngFor=\"let item of prefixes\" [value]=\"item.prefixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Suffix:</mat-label>\r\n <mat-select formControlName=\"advocateSuffixId\" [(ngModel)]=\"editVictim.advocateSuffixId\" >\r\n <mat-option *ngFor=\"let item of suffixes\" [value]=\"item.suffixId\">{{item.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n\r\n <mat-form-field>\r\n <mat-checkbox\r\n color = \"primary\"\r\n formControlName=\"advocateNoPhoneFlag\"\r\n\r\n [(ngModel)]=\"editVictim.advocateNoPhoneFlag\" >\r\n No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>\r\n <input matInput placeholder=\"\" style=\"display: none;\">\r\n </mat-form-field>\r\n\r\n <div></div>\r\n <mat-card>\r\n <mat-form-field >\r\n <mat-label>Advocate Home Phone:</mat-label>\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateHomePhone\"\r\n [phoneControl]=\"advocateHomePhoneControl\"\r\n [formControl]=\"advocateHomePhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateHomePhone').errors\r\n && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)\">\r\n <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Cell Phone:</mat-label>\r\n <input\r\n id=\"tel7\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateCellPhone\"\r\n [phoneControl]=\"advocateCellPhoneControl\"\r\n [formControl]=\"advocateCellPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateCellPhone').errors\r\n && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)\">\r\n <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Work Phone:</mat-label>\r\n <input\r\n id=\"tel8\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.advocateWorkPhone\"\r\n [phoneControl]=\"advocateWorkPhoneControl\"\r\n [formControl]=\"advocateWorkPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateWorkPhone').errors\r\n && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)\">\r\n <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </mat-card>\r\n\r\n <div></div>\r\n\r\n <mat-form-field>\r\n <mat-label>Advocate Email:</mat-label>\r\n <input matInput formControlName=\"advocateEmail\" [(ngModel)]=\"editVictim.advocateEmail\" >\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateEmail').errors\r\n && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)\">\r\n <mat-error><strong>Advocate email format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n <div></div>\r\n\r\n\r\n <div >\r\n <app-smart-address\r\n [showPsa]=\"true\"\r\n [modifiedBy]=\"staffId\"\r\n [id]=\"advocateAddressId\"\r\n (addressIdChange)=\"onAdvocateAddressChange($event)\"\r\n [outline]=\"true\"\r\n readonly=\"false\"\r\n [rowHeight]=\"80\"\r\n (isValid)=\"false\"\r\n [addressValidators]=\"addressValidators\"\r\n #advocateAddressComponent >\r\n </app-smart-address>\r\n </div>\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n\r\n <mat-tab label=\"Emergency Contact\">\r\n <div class='container'>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Contact Name:</mat-label>\r\n <input matInput formControlName=\"emergencyContact\" [(ngModel)]=\"editVictim.emergencyContact\" >\r\n </mat-form-field>\r\n\r\n <mat-form-field>\r\n <mat-label>Emergency Phone Number:</mat-label>\r\n\r\n <input\r\n id=\"tel\"\r\n matInput\r\n phoneMask\r\n [preValue]=\"editVictim.emergencyContactPhone\"\r\n [phoneControl]=\"emergencyContactPhoneControl\"\r\n [formControl]=\"emergencyContactPhoneControl\"\r\n maxlength=\"14\"/>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('emergencyContactPhone').errors\r\n && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)\">\r\n <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n\r\n </div>\r\n <br><br><br>\r\n </mat-tab>\r\n\r\n </mat-tab-group>\r\n <div class='outer'>\r\n <div>\r\n All buttons apply to all tabs. If save button is grey, please check each tab to make sure the required field is filled.<br><br>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('minorFlag').errors\r\n && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)\">\r\n <mat-error>If victim a minor field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimAdvocateFlag').errors\r\n && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)\">\r\n <mat-error>If victim has advocate field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('underSupervisionFlag').errors\r\n && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)\">\r\n <mat-error>Under supervision field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('victimOffenderRelationshipTypeId').errors\r\n && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)\">\r\n <mat-error>Relationship is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('lastName').errors\r\n && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)\">\r\n <mat-error>Victim last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('firstName').errors\r\n && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)\">\r\n <mat-error>victim first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianFirstName').errors\r\n && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)\">\r\n <mat-error>Guardian first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('guardianLastName').errors\r\n && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)\" >\r\n <mat-error>Guardian last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateLastName').errors\r\n && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)\" >\r\n <mat-error>Advocate last name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('advocateFirstName').errors\r\n && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)\">\r\n <mat-error>Advocate first name is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherWeapon').errors\r\n && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)\">\r\n <mat-error>Other weapon field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\" *ngIf=\"victimForm.get('otherDrug').errors\r\n && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)\">\r\n <mat-error>Other drug field is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n\r\n </div>\r\n\r\n <div class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveVictim()\" [disabled]=\"!victimForm.valid\" >Save </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div *ngIf=\"showDelete\" class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"deleteVictim()\">Delete </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <div class=\"inner\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"cancel()\">Clear </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n <button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n\r\n </div>\r\n\r\n </div>\r\n <br>\r\n <br>\r\n\r\n <div align=\"right\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"addContact()\" >Add victim contact</button>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-table #table [dataSource]=\"contactDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"contactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimContactMethod\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Method</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimContactMethod}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"nextContactDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Next Contact Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.nextContactDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"staff\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact By</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.staff}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"contactId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n </div>\r\n\r\n </mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:100%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}@media only screen and (max-width: 1120px){.container{display:grid;grid-template-columns:1fr 1fr;grid-row-gap:15px}}@media only screen and (max-width: 675px){.container{display:flex;flex-direction:column}}#outer{width:100%;text-align:center}.inner{display:inline-block}.tp-radio-group{display:flex;justify-content:space-between}\n"] }]
1697
- }], ctorParameters: () => [{ type: i8$1.Location }, { type: i1$2.UntypedFormBuilder }, { type: i1$1.MatDialog }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.MatSnackBar }, { type: CommonDialogService }, { type: NgcSmartVictimService }, { type: i0.ChangeDetectorRef }], propDecorators: { victimDetail: [{
1698
- type: Input
1699
- }], staffId: [{
1700
- type: Input
1701
- }], offenderId: [{
1702
- type: Input
1703
- }], isIntake: [{
1704
- type: Input
1705
- }], onSave: [{
1706
- type: Output
1707
- }], onCancel: [{
1708
- type: Output
1709
- }], addressComponent: [{
1710
- type: ViewChild,
1711
- args: ["addressComponent"]
1712
- }] } });
1713
-
1714
- class VictimListFilter {
1715
- }
1716
-
1717
- class VictimSearchFormComponent {
1718
- constructor() {
1719
- this.onSearch = new EventEmitter();
1720
- this.change = new EventEmitter();
1721
- this.filter = new VictimListFilter();
1722
- }
1723
- ngOnInit() {
1724
- }
1725
- ngAfterViewInit() {
1726
- // var element = <HTMLInputElement> document.getElementById("victimSearchButton");
1727
- // element.disabled = true;
1728
- // setTimeout(function() {
1729
- // element.disabled = false;
1730
- // }, 10000);
1731
- }
1732
- onChange() {
1733
- console.log('this.filter in serach form.');
1734
- console.log(this.filter);
1735
- this.onSearch.emit(this.filter);
1736
- }
1737
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSearchFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
1738
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSearchFormComponent, selector: "app-victim-search-form", outputs: { onSearch: "onSearch" }, ngImport: i0, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\r\n<mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"victimSearch\">\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\r\n </mat-form-field>\r\n\r\n\r\n <section>\r\n <button id=\"victimSearchButton\" mat-stroked-button color=\"primary\" (click)=\"onChange()\">Search</button>\r\n <span style=\"padding-right: 5px;\"></span>\r\n <button mat-stroked-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px;flex-direction:column}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.smart-card{background-color:var(--mdc-elevated-card-container-color);border:1px solid #ccc;border-radius:8px;box-shadow:0 4px 8px #0000001a;padding:16px 0 16px 2px;width:100%}.smart-card-header{display:flex;flex-direction:column;align-items:start}.smart-label{font-size:16px!important}.smart-card-table{margin:16px 0}.smart-flex-container{display:flex!important;justify-content:space-between;flex-wrap:wrap}.smart-action-content{display:flex;justify-content:flex-end;margin:12px}.smart-button{margin:0 4px}.smart-add-button{margin:0 4px;font-size:1.25em!important}.material-icons{vertical-align:baseline!important}.smart-paginator{display:flex!important}\n"], dependencies: [{ kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i3.MatExpansionPanel, selector: "mat-expansion-panel", inputs: ["hideToggle", "togglePosition"], outputs: ["afterExpand", "afterCollapse"], exportAs: ["matExpansionPanel"] }, { kind: "component", type: i3.MatExpansionPanelHeader, selector: "mat-expansion-panel-header", inputs: ["expandedHeight", "collapsedHeight", "tabIndex"] }, { kind: "directive", type: i3.MatExpansionPanelTitle, selector: "mat-panel-title" }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i1$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i1$2.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }], encapsulation: i0.ViewEncapsulation.None }); }
1739
- }
1740
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSearchFormComponent, decorators: [{
1741
- type: Component,
1742
- args: [{ selector: 'app-victim-search-form', encapsulation: ViewEncapsulation.None, template: "<form name=\"victimSearchFrom\" #From=\"ngForm\">\r\n<mat-expansion-panel [expanded]=\"true\">\r\n <mat-expansion-panel-header>\r\n <mat-panel-title>\r\n Search for Victims\r\n </mat-panel-title>\r\n </mat-expansion-panel-header>\r\n <div class=\"victimSearch\">\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Last Name\" [(ngModel)]=\"filter.lastName\" name=\"lastName\" id=\"lastName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim First Name\" [(ngModel)]=\"filter.firstName\" name=\"firstName\" id=\"firstName\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Victim Date of Birth\" type=\"date\" [(ngModel)]=\"filter.birthDate\" name=\"birthDate\" id=\"birthDate\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender PDID\" [(ngModel)]=\"filter.pdid\" name=\"pdid\" id=\"pdid\">\r\n </mat-form-field>\r\n <mat-form-field>\r\n <input matInput placeholder=\"Offender CSOSA #\"[(ngModel)]=\"filter.offenderId\" name=\"offenderId\" id=\"offenderId\">\r\n </mat-form-field>\r\n\r\n\r\n <section>\r\n <button id=\"victimSearchButton\" mat-stroked-button color=\"primary\" (click)=\"onChange()\">Search</button>\r\n <span style=\"padding-right: 5px;\"></span>\r\n <button mat-stroked-button color=\"primary\" type=\"reset\" value=\"Reset\">Clear Changes</button>\r\n </section>\r\n </div>\r\n </mat-expansion-panel>\r\n</form>\r\n\r\n\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px;flex-direction:column}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.smart-card{background-color:var(--mdc-elevated-card-container-color);border:1px solid #ccc;border-radius:8px;box-shadow:0 4px 8px #0000001a;padding:16px 0 16px 2px;width:100%}.smart-card-header{display:flex;flex-direction:column;align-items:start}.smart-label{font-size:16px!important}.smart-card-table{margin:16px 0}.smart-flex-container{display:flex!important;justify-content:space-between;flex-wrap:wrap}.smart-action-content{display:flex;justify-content:flex-end;margin:12px}.smart-button{margin:0 4px}.smart-add-button{margin:0 4px;font-size:1.25em!important}.material-icons{vertical-align:baseline!important}.smart-paginator{display:flex!important}\n"] }]
1743
- }], ctorParameters: () => [], propDecorators: { onSearch: [{
1744
- type: Output
1745
- }] } });
1746
-
1747
- class NgcSmartVictimComponent {
1748
- constructor(dialog, victimService, router, route, snackBar, intakeService, smartWarrantUrl, document) {
1749
- this.dialog = dialog;
1750
- this.victimService = victimService;
1751
- this.router = router;
1752
- this.route = route;
1753
- this.snackBar = snackBar;
1754
- this.intakeService = intakeService;
1755
- this.smartWarrantUrl = smartWarrantUrl;
1756
- this.document = document;
1757
- this.appModuleId = '';
1758
- this.activatedRoute = null;
1759
- this.victims = [];
1760
- this.victimDetail = {};
1761
- this.showDetail = false;
1762
- this.victimListFilter = new VictimListFilter$1();
1763
- this.victimListDataSource = new MatTableDataSource();
1764
- this.doSpin = false;
1765
- this.showListFlag = false;
1766
- this.msg = "";
1767
- this.isIntake = false;
1768
- }
1769
- // private onChange(filter: VictimListFilter) {
1770
- // console.log('filter in onchange');
1771
- // console.log(filter);
1772
- // this.getVictimList(filter);
1773
- // }
1774
- applyFilter(filterValue) {
1775
- this.victimListDataSource.filter = filterValue.trim().toLowerCase();
1776
- }
1777
- addRecord() {
1778
- this.showDetail = true;
1779
- this.showAdd = false;
1780
- this.victimDetail = null;
1781
- this.showListFlag = false;
1782
- }
1783
- editVictimDetail(record) {
1784
- console.log("victim edit record");
1785
- console.log(record);
1786
- console.log(record.victimId);
1787
- this.victimDetail = record;
1788
- this.showDetail = true;
1789
- this.showAdd = false;
1790
- this.showListFlag = false;
1791
- }
1792
- save(detail) {
1793
- this.showDetail = false;
1794
- this.showAdd = true;
1795
- this.showListFlag = true;
1796
- }
1797
- cancel() {
1798
- this.showDetail = false;
1799
- this.victimDetail = {};
1800
- }
1801
- ngAfterViewInit() {
1802
- this.victimListDataSource.paginator = this.paginator;
1803
- this.victimListDataSource.sort = this.sort;
1804
- }
1805
- ngOnChanges() {
1806
- this.updateAccessControlConfig = {
1807
- accessType: AccessType.UPDATE,
1808
- appModuleId: this.appModuleId,
1809
- roleId: null,
1810
- route: this.activatedRoute.snapshot,
1811
- };
1812
- this.createAccessControlConfig = {
1813
- accessType: AccessType.CREATE,
1814
- appModuleId: this.appModuleId,
1815
- roleId: null,
1816
- route: this.activatedRoute.snapshot,
1817
- };
1818
- this.deleteAccessControlConfig = {
1819
- accessType: AccessType.DELETE,
1820
- appModuleId: this.appModuleId,
1821
- roleId: null,
1822
- route: this.activatedRoute.snapshot,
1823
- };
1824
- }
1825
- ngOnInit() {
1826
- const queryParams = this.route.snapshot.queryParams;
1827
- if (queryParams['routeTo']) {
1828
- this.router.navigate([queryParams['routeTo']]);
1829
- }
1830
- const selData = this.route.snapshot.data;
1831
- this.selectedOffender = selData['selectedOffender'];
1832
- var myPath = this.router.url.slice(-10);
1833
- console.log("offender id at smart-victim");
1834
- console.log(this.offenderId);
1835
- console.log("staff id at smart-victim");
1836
- console.log(this.staffId);
1837
- console.log("insakeFlag at smart-victim");
1838
- console.log(this.intakeFlag);
1839
- console.log("smart-victim ngOnInit");
1840
- console.log(this.intakeFlag);
1841
- console.log(myPath);
1842
- // if (this.intakeFlag == "true") {
1843
- // this.isIntake = true;
1844
- // }
1845
- this.isIntake = this.selectedOffender.intakeFlag;
1846
- this.displayedColumns = ["lastName", "firstName"];
1847
- if (this.showRelationshipColumn == true ||
1848
- myPath == "victimList" ||
1849
- myPath == "victimHome") {
1850
- this.displayedColumns.push("relationship");
1851
- }
1852
- if (this.showOffenderNameColumn == true) {
1853
- this.displayedColumns.push("offenderName");
1854
- }
1855
- if (this.showOffenderPhoneColumn == true ||
1856
- myPath == "victimList" ||
1857
- myPath == "victimHome") {
1858
- this.displayedColumns.push("homePhone");
1859
- }
1860
- this.displayedColumns.push("victimId");
1861
- if (this.showSearchForm == true) {
1862
- this.showListFlag = false;
1863
- }
1864
- console.log("this.showSearchForm");
1865
- console.log(this.showSearchForm);
1866
- console.log("myPath");
1867
- console.log(myPath);
1868
- if (this.showSearchForm == false ||
1869
- myPath == "victimList" ||
1870
- myPath == "victimHome") {
1871
- var myOffenderId;
1872
- if (this.offenderId) {
1873
- myOffenderId = this.offenderId;
1874
- }
1875
- else {
1876
- console.log("back from previous page");
1877
- this.showAdd = true;
1878
- this.showRelationshipColumn = true;
1879
- //this.displayedColumns.push("relationship");
1880
- this.showOffenderPhoneColumn = true;
1881
- // this.displayedColumns.push("homePhone");
1882
- this.accessByModule = "true";
1883
- this.showEdit = "true";
1884
- this.showCaseNote = "true";
1885
- this.showSafetyPlan = "true";
1886
- myOffenderId = selData.selectedOffender.offenderId;
1887
- }
1888
- const victimListFilter = {
1889
- offenderId: myOffenderId,
1890
- lastName: null,
1891
- firstName: null,
1892
- pdid: null,
1893
- birthDate: null,
1894
- };
1895
- console.log("victimListFilter in smar-victim componenet");
1896
- console.log(victimListFilter);
1897
- this.victimService
1898
- .getVictimListByFilter(victimListFilter)
1899
- .subscribe((data) => {
1900
- this.victims = data;
1901
- this.victimListDataSource.data = data;
1902
- console.log("victim data at line 245");
1903
- console.log(this.victims);
1904
- console.log("showListFlag");
1905
- console.log(this.showListFlag);
1906
- this.showListFlag = true;
1907
- if (data.length == 0) {
1908
- this.msg = "No Record Found!";
1909
- }
1910
- });
1911
- }
1912
- else {
1913
- console.log("find filter");
1914
- console.log(this.victimListFilter);
1915
- if (this.showListFlag === true) {
1916
- if (this.victimListFilter != null) {
1917
- this.victimService
1918
- .getVictimListByFilter(this.victimListFilter)
1919
- .subscribe((data) => {
1920
- this.victims = data;
1921
- this.victimListDataSource.data = data;
1922
- console.log("victim data at line 279");
1923
- console.log(data);
1924
- });
1925
- }
1926
- }
1927
- }
1928
- }
1929
- // phone number format on the victim list
1930
- formatPhoneNumber(phoneNumberString) {
1931
- if (!phoneNumberString)
1932
- return "";
1933
- var cleaned = ("" + phoneNumberString).replace(/\D/g, "");
1934
- var match = cleaned.match(/^(\d{3})(\d{3})(\d{4})$/);
1935
- if (match) {
1936
- return "(" + match[1] + ") " + match[2] + "-" + match[3];
1937
- }
1938
- return "";
1939
- }
1940
- saveIntake() {
1941
- if (!this.isIntake) {
1942
- return;
1943
- }
1944
- const intakeStep = {
1945
- intakeStepId: IntakeStep.VictimInformation,
1946
- offenderId: this.offenderId,
1947
- modifiedBy: this.staffId,
1948
- };
1949
- this.intakeService
1950
- .updateIntakeSteps(this.offenderId, intakeStep)
1951
- .subscribe((res) => {
1952
- console.log("save intake step.");
1953
- this.snackBar.open("Status Saved.", "", {
1954
- duration: 3000,
1955
- });
1956
- //this.router.navigate(['/warrant '], { queryParams: { intake: 1 } });
1957
- this.document.location.href =
1958
- `${this.smartWarrantUrl}/?offenderId=${this.offenderId}&intakeFlag=${this.isIntake}&routeTo=warrant`;
1959
- });
1960
- }
1961
- goToCaseNote(victimId) {
1962
- this.router.navigate(["casenote", victimId, this.offenderId]);
1963
- }
1964
- goToSaftyPlan(victimId) {
1965
- this.router.navigate(["saftyPlan", victimId]);
1966
- }
1967
- getVictimList(filter) {
1968
- this.victimListFilter = filter;
1969
- console.log("this.victimListFilter inside getVictimList");
1970
- console.log(this.victimListFilter);
1971
- this.doSpin = true;
1972
- this.victimService.getVictimListByFilter(filter).subscribe((data) => {
1973
- this.doSpin = !this.doSpin;
1974
- if (data.length > 0) {
1975
- this.showListFlag = true;
1976
- this.victimListDataSource.data = data;
1977
- }
1978
- else {
1979
- this.msg = "No record found!";
1980
- }
1981
- }, (err) => {
1982
- this.doSpin = !this.doSpin;
1983
- });
1984
- }
1985
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimComponent, deps: [{ token: i1$1.MatDialog }, { token: NgcSmartVictimService }, { token: i5.Router }, { token: i5.ActivatedRoute }, { token: i4.MatSnackBar }, { token: IntakeServicesComponent }, { token: SMART_WARRANT_URL }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Component }); }
1986
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: NgcSmartVictimComponent, selector: "csmart-victim", inputs: { offenderId: "offenderId", staffId: "staffId", staffRole: "staffRole", showCaseNote: "showCaseNote", showSafetyPlan: "showSafetyPlan", showAdd: "showAdd", showEdit: "showEdit", showRelationshipColumn: "showRelationshipColumn", showOffenderNameColumn: "showOffenderNameColumn", showOffenderPhoneColumn: "showOffenderPhoneColumn", showSearchForm: "showSearchForm", accessByModule: "accessByModule", intakeFlag: "intakeFlag", appModuleId: "appModuleId", activatedRoute: "activatedRoute" }, viewQueries: [{ propertyName: "paginator", first: true, predicate: MatPaginator, descendants: true }, { propertyName: "sort", first: true, predicate: MatSort, descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"showSearchForm\">\r\n <app-victim-search-form\r\n (onSearch)=\"getVictimList($event)\">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf=\"showDetail\">\r\n <csmart-victim-detail [victimDetail]=\"victimDetail\"\r\n [staffId]=\"staffId\"\r\n [offenderId] =\"offenderId\"\r\n [isIntake]=\"isIntake\"\r\n (onSave)=\"save($event)\"\r\n (onCancel)=\"cancel()\" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class=\"main-container\">\r\n <mat-card id=\"divVictim\" class=\"smart-card-table\">\r\n <div class=\"smart-action-content\">\r\n <button mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"createAccessControlConfig\"\r\n *ngIf=\"showAdd\"\r\n class=\"smart-add-button\"\r\n (click)=\"addRecord()\">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n <button\r\n mat-stroked-button\r\n class=\"smart-add-button\"\r\n *ngIf=\"isIntake\"\r\n color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"saveIntake()\">\r\n Continue\r\n </button>\r\n </div>\r\n <div *ngIf=\"victimListDataSource.data.length > 0\">\r\n <mat-table #table [dataSource]=\"victimListDataSource\" >\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n\r\n <div *ngIf=\"showRelationshipColumn\">\r\n <ng-container matColumnDef=\"relationship\">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderPhoneColumn\">\r\n <ng-container matColumnDef=\"homePhone\">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n Home phone: {{formatPhoneNumber(row.homePhone)}}<br>\r\n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\r\n Work Phone: {{formatPhoneNumber(row.workPhone)}}\r\n\r\n </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderNameColumn\">\r\n <ng-container matColumnDef=\"offenderName\">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container matColumnDef=\"victimId\">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n\r\n <!-- <div *ngIf=\"accessByModule\">\r\n <mat-checkbox></mat-checkbox>\r\n </div> -->\r\n\r\n <div *ngIf=\"showEdit\">\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"editVictimDetail(row)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"showCaseNote\">\r\n <button type=\"button\" matTooltip=\"CaseNote\" mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"goToCaseNote(row.victimId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"showSafetyPlan\">\r\n <button type=\"button\" matTooltip=\"safety plan\" mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"goToSaftyPlan(row.victimId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator>\r\n </div>\r\n </mat-card>\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px;flex-direction:column}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.smart-card{background-color:var(--mdc-elevated-card-container-color);border:1px solid #ccc;border-radius:8px;box-shadow:0 4px 8px #0000001a;padding:16px 0 16px 2px;width:100%}.smart-card-header{display:flex;flex-direction:column;align-items:start}.smart-label{font-size:16px!important}.smart-card-table{margin:16px 0}.smart-flex-container{display:flex!important;justify-content:space-between;flex-wrap:wrap}.smart-action-content{display:flex;justify-content:flex-end;margin:12px}.smart-button{margin:0 4px}.smart-add-button{margin:0 4px;font-size:1.25em!important}.material-icons{vertical-align:baseline!important}.smart-paginator{display:flex!important}\n"], dependencies: [{ kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "component", type: i9$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i10$1.MatPaginator, selector: "mat-paginator", inputs: ["color", "pageIndex", "length", "pageSize", "pageSizeOptions", "hidePageSize", "showFirstLastButtons", "selectConfig", "disabled"], outputs: ["page"], exportAs: ["matPaginator"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "directive", type: i6.SmartAccessControlDirective, selector: "[accessControl]", inputs: ["accessControlConfig"] }, { kind: "component", type: SmartVictimDetailComponent, selector: "csmart-victim-detail", inputs: ["victimDetail", "staffId", "offenderId", "isIntake"], outputs: ["onSave", "onCancel"] }, { kind: "component", type: VictimSearchFormComponent, selector: "app-victim-search-form", outputs: ["onSearch"] }] }); }
1987
- }
1988
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimComponent, decorators: [{
1989
- type: Component,
1990
- args: [{ selector: "csmart-victim", template: "<div *ngIf=\"showSearchForm\">\r\n <app-victim-search-form\r\n (onSearch)=\"getVictimList($event)\">\r\n </app-victim-search-form>\r\n</div>\r\n\r\n<div *ngIf=\"showDetail\">\r\n <csmart-victim-detail [victimDetail]=\"victimDetail\"\r\n [staffId]=\"staffId\"\r\n [offenderId] =\"offenderId\"\r\n [isIntake]=\"isIntake\"\r\n (onSave)=\"save($event)\"\r\n (onCancel)=\"cancel()\" >\r\n</csmart-victim-detail>\r\n</div>\r\n<div class=\"main-container\">\r\n <mat-card id=\"divVictim\" class=\"smart-card-table\">\r\n <div class=\"smart-action-content\">\r\n <button mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"createAccessControlConfig\"\r\n *ngIf=\"showAdd\"\r\n class=\"smart-add-button\"\r\n (click)=\"addRecord()\">\r\n <mat-icon>add</mat-icon>\r\n Add Victim\r\n </button>\r\n <button\r\n mat-stroked-button\r\n class=\"smart-add-button\"\r\n *ngIf=\"isIntake\"\r\n color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"saveIntake()\">\r\n Continue\r\n </button>\r\n </div>\r\n <div *ngIf=\"victimListDataSource.data.length > 0\">\r\n <mat-table #table [dataSource]=\"victimListDataSource\" >\r\n\r\n <ng-container matColumnDef=\"lastName\">\r\n <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.lastName}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"firstName\">\r\n <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.firstName}} </mat-cell>\r\n </ng-container>\r\n\r\n <div *ngIf=\"showRelationshipColumn\">\r\n <ng-container matColumnDef=\"relationship\">\r\n <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.relationship}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderPhoneColumn\">\r\n <ng-container matColumnDef=\"homePhone\">\r\n <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n Home phone: {{formatPhoneNumber(row.homePhone)}}<br>\r\n Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>\r\n Work Phone: {{formatPhoneNumber(row.workPhone)}}\r\n\r\n </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <div *ngIf=\"showOffenderNameColumn\">\r\n <ng-container matColumnDef=\"offenderName\">\r\n <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" > {{row.offenderName}} </mat-cell>\r\n </ng-container>\r\n </div>\r\n\r\n <ng-container matColumnDef=\"victimId\">\r\n <mat-header-cell *matHeaderCellDef ></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" >\r\n\r\n <!-- <div *ngIf=\"accessByModule\">\r\n <mat-checkbox></mat-checkbox>\r\n </div> -->\r\n\r\n <div *ngIf=\"showEdit\">\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"View/Edit Victim\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"editVictimDetail(row)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n </div>\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"showCaseNote\">\r\n <button type=\"button\" matTooltip=\"CaseNote\" mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"goToCaseNote(row.victimId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Case Note\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n <div *ngIf=\"showSafetyPlan\">\r\n <button type=\"button\" matTooltip=\"safety plan\" mat-stroked-button color=\"primary\"\r\n accessControl\r\n [accessControlConfig]=\"updateAccessControlConfig\"\r\n (click)=\"goToSaftyPlan(row.victimId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;Safety Plan\r\n </button>\r\n </div>\r\n &nbsp;&nbsp;\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"displayedColumns\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns: displayedColumns\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n <mat-paginator #paginator [pageSize]=\"10\" [pageSizeOptions]=\"[5, 10, 25, 100]\"></mat-paginator>\r\n </div>\r\n </mat-card>\r\n <div>\r\n <b>{{msg}}</b>\r\n </div>\r\n</div>\r\n", styles: ["div.services{max-width:500px;margin:auto;border:3px solid #73AD21}.rTable{display:block;width:100%}.rTableHeading,.rTableBody,.rTableFoot,.rTableRow{clear:both}.rTableHead,.rTableFoot{background-color:#ddd;font-weight:700}.rTableCell,.rTableHead{border:0px;float:left;padding:1px;width:28%}.rTable:after{visibility:hidden;display:block;font-size:0;content:\" \";clear:both;height:0}.victimSearch{display:grid;grid-template-columns:1fr 1fr 1fr;grid-column-gap:10px}.edit-btn{margin-right:4px}.main-container{display:flex;margin-top:8px;flex-direction:column}.add-action{display:flex;justify-content:flex-end;margin-bottom:8px}.example-headers-align .mat-expansion-panel-header-title,.example-headers-align .mat-expansion-panel-header-description{flex-basis:0}.example-headers-align .mat-expansion-panel-header-description{justify-content:space-between;align-items:center}mat-form-field{margin-right:12px}.actions{display:flex;justify-content:space-around}.Row{display:table;width:100%;table-layout:fixed}.Column{display:table-cell}.sp-form textarea{float:left;margin-top:20px;margin-bottom:10px;width:462px;height:70px;overflow:auto;box-sizing:border-box}.mat-column-lastName,.mat-column-firstName,.mat-column-relationship,.mat-column-homePhone,.mat-column-offenderName{word-wrap:break-word!important;white-space:unset!important;flex:0 0 15%!important;width:15%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.mat-column-victimId{word-wrap:break-word!important;white-space:unset!important;flex:0 0 25%!important;width:25%!important;overflow-wrap:break-word;word-wrap:break-word;word-break:break-word;-ms-hyphens:auto;-moz-hyphens:auto;-webkit-hyphens:auto;hyphens:auto}.smart-card{background-color:var(--mdc-elevated-card-container-color);border:1px solid #ccc;border-radius:8px;box-shadow:0 4px 8px #0000001a;padding:16px 0 16px 2px;width:100%}.smart-card-header{display:flex;flex-direction:column;align-items:start}.smart-label{font-size:16px!important}.smart-card-table{margin:16px 0}.smart-flex-container{display:flex!important;justify-content:space-between;flex-wrap:wrap}.smart-action-content{display:flex;justify-content:flex-end;margin:12px}.smart-button{margin:0 4px}.smart-add-button{margin:0 4px;font-size:1.25em!important}.material-icons{vertical-align:baseline!important}.smart-paginator{display:flex!important}\n"] }]
1991
- }], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i5.Router }, { type: i5.ActivatedRoute }, { type: i4.MatSnackBar }, { type: IntakeServicesComponent }, { type: undefined, decorators: [{
1992
- type: Inject,
1993
- args: [SMART_WARRANT_URL]
1994
- }] }, { type: undefined, decorators: [{
1995
- type: Inject,
1996
- args: [DOCUMENT]
1997
- }] }], propDecorators: { offenderId: [{
1998
- type: Input
1999
- }], staffId: [{
2000
- type: Input
2001
- }], staffRole: [{
2002
- type: Input
2003
- }], showCaseNote: [{
2004
- type: Input
2005
- }], showSafetyPlan: [{
2006
- type: Input
2007
- }], showAdd: [{
2008
- type: Input
2009
- }], showEdit: [{
2010
- type: Input
2011
- }], showRelationshipColumn: [{
2012
- type: Input
2013
- }], showOffenderNameColumn: [{
2014
- type: Input
2015
- }], showOffenderPhoneColumn: [{
2016
- type: Input
2017
- }], showSearchForm: [{
2018
- type: Input
2019
- }], accessByModule: [{
2020
- type: Input
2021
- }], intakeFlag: [{
2022
- type: Input
2023
- }], appModuleId: [{
2024
- type: Input
2025
- }], activatedRoute: [{
2026
- type: Input
2027
- }], paginator: [{
2028
- type: ViewChild,
2029
- args: [MatPaginator]
2030
- }], sort: [{
2031
- type: ViewChild,
2032
- args: [MatSort]
2033
- }] } });
2034
-
2035
- class SmartVictimDeleteConfirmComponent {
2036
- constructor(dialogRef, data) {
2037
- this.dialogRef = dialogRef;
2038
- this.data = data;
2039
- }
2040
- onNoClick() {
2041
- this.dialogRef.close();
2042
- }
2043
- ngOnInit() {
2044
- }
2045
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, deps: [{ token: i1$1.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
2046
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SmartVictimDeleteConfirmComponent, selector: "csmart-victim-delete-confirm", ngImport: i0, template: `
2047
- <h1 mat-dialog-title>Delete Confirmation</h1>
2048
- <div mat-dialog-content>
2049
- <p>Are you sure you want to delete this item?</p>
2050
- </div>
2051
- <div mat-dialog-actions class="actions">
2052
- <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2053
- <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2054
- </div>
2055
- `, isInline: true, styles: [".actions{display:flex;justify-content:space-between}\n"], dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] }); }
2056
- }
2057
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SmartVictimDeleteConfirmComponent, decorators: [{
2058
- type: Component,
2059
- args: [{ selector: 'csmart-victim-delete-confirm', template: `
2060
- <h1 mat-dialog-title>Delete Confirmation</h1>
2061
- <div mat-dialog-content>
2062
- <p>Are you sure you want to delete this item?</p>
2063
- </div>
2064
- <div mat-dialog-actions class="actions">
2065
- <button mat-flat-button color="primary" (click)="onNoClick()">No</button>
2066
- <button mat-flat-button color="warn" [mat-dialog-close]='"YES"' cdkFocusInitial>Yes</button>
2067
- </div>
2068
- `, styles: [".actions{display:flex;justify-content:space-between}\n"] }]
2069
- }], ctorParameters: () => [{ type: i1$1.MatDialogRef }, { type: undefined, decorators: [{
2070
- type: Inject,
2071
- args: [MAT_DIALOG_DATA]
2072
- }] }] });
2073
-
2074
- class SharedModule {
2075
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2076
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2077
- MatCardModule,
2078
- MatCheckboxModule,
2079
- MatToolbarModule,
2080
- MatSelectModule,
2081
- MatDatepickerModule,
2082
- MatNativeDateModule,
2083
- MatDialogModule,
2084
- MatTabsModule,
2085
- MatListModule,
2086
- MatInputModule,
2087
- MatStepperModule,
2088
- BrowserAnimationsModule,
2089
- MatGridListModule,
2090
- MatProgressSpinnerModule,
2091
- MatTableModule,
2092
- MatSidenavModule,
2093
- MatRadioModule,
2094
- MatIconModule,
2095
- MatSliderModule,
2096
- MatChipsModule,
2097
- MatSnackBarModule,
2098
- CdkTableModule,
2099
- MatSortModule,
2100
- MatPaginatorModule,
2101
- MatExpansionModule,
2102
- MatRippleModule,
2103
- SmartUiModule], exports: [MatButtonModule,
2104
- MatCardModule,
2105
- MatCheckboxModule,
2106
- MatToolbarModule,
2107
- MatSelectModule,
2108
- MatDatepickerModule,
2109
- MatNativeDateModule,
2110
- MatDialogModule,
2111
- MatTabsModule,
2112
- MatListModule,
2113
- MatInputModule,
2114
- MatStepperModule,
2115
- BrowserAnimationsModule,
2116
- MatGridListModule,
2117
- MatProgressSpinnerModule,
2118
- MatTableModule,
2119
- MatSidenavModule,
2120
- MatRadioModule,
2121
- MatIconModule,
2122
- MatSliderModule,
2123
- MatChipsModule,
2124
- MatSnackBarModule,
2125
- CdkTableModule,
2126
- MatSortModule,
2127
- MatPaginatorModule,
2128
- MatExpansionModule,
2129
- MatRippleModule,
2130
- SmartUiModule] }); }
2131
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, imports: [MatButtonModule,
2132
- MatCardModule,
2133
- MatCheckboxModule,
2134
- MatToolbarModule,
2135
- MatSelectModule,
2136
- MatDatepickerModule,
2137
- MatNativeDateModule,
2138
- MatDialogModule,
2139
- MatTabsModule,
2140
- MatListModule,
2141
- MatInputModule,
2142
- MatStepperModule,
2143
- BrowserAnimationsModule,
2144
- MatGridListModule,
2145
- MatProgressSpinnerModule,
2146
- MatTableModule,
2147
- MatSidenavModule,
2148
- MatRadioModule,
2149
- MatIconModule,
2150
- MatSliderModule,
2151
- MatChipsModule,
2152
- MatSnackBarModule,
2153
- CdkTableModule,
2154
- MatSortModule,
2155
- MatPaginatorModule,
2156
- MatExpansionModule,
2157
- MatRippleModule,
2158
- SmartUiModule, MatButtonModule,
2159
- MatCardModule,
2160
- MatCheckboxModule,
2161
- MatToolbarModule,
2162
- MatSelectModule,
2163
- MatDatepickerModule,
2164
- MatNativeDateModule,
2165
- MatDialogModule,
2166
- MatTabsModule,
2167
- MatListModule,
2168
- MatInputModule,
2169
- MatStepperModule,
2170
- BrowserAnimationsModule,
2171
- MatGridListModule,
2172
- MatProgressSpinnerModule,
2173
- MatTableModule,
2174
- MatSidenavModule,
2175
- MatRadioModule,
2176
- MatIconModule,
2177
- MatSliderModule,
2178
- MatChipsModule,
2179
- MatSnackBarModule,
2180
- CdkTableModule,
2181
- MatSortModule,
2182
- MatPaginatorModule,
2183
- MatExpansionModule,
2184
- MatRippleModule,
2185
- SmartUiModule] }); }
2186
- }
2187
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SharedModule, decorators: [{
2188
- type: NgModule,
2189
- args: [{
2190
- imports: [
2191
- MatButtonModule,
2192
- MatCardModule,
2193
- MatCheckboxModule,
2194
- MatToolbarModule,
2195
- MatSelectModule,
2196
- MatDatepickerModule,
2197
- MatNativeDateModule,
2198
- MatDialogModule,
2199
- MatTabsModule,
2200
- MatListModule,
2201
- MatInputModule,
2202
- MatStepperModule,
2203
- BrowserAnimationsModule,
2204
- MatGridListModule,
2205
- MatProgressSpinnerModule,
2206
- MatTableModule,
2207
- MatSidenavModule,
2208
- MatRadioModule,
2209
- MatIconModule,
2210
- MatSliderModule,
2211
- MatChipsModule,
2212
- MatSnackBarModule,
2213
- CdkTableModule,
2214
- MatSortModule,
2215
- MatPaginatorModule,
2216
- MatExpansionModule,
2217
- MatRippleModule,
2218
- SmartUiModule
2219
- ],
2220
- exports: [
2221
- MatButtonModule,
2222
- MatCardModule,
2223
- MatCheckboxModule,
2224
- MatToolbarModule,
2225
- MatSelectModule,
2226
- MatDatepickerModule,
2227
- MatNativeDateModule,
2228
- MatDialogModule,
2229
- MatTabsModule,
2230
- MatListModule,
2231
- MatInputModule,
2232
- MatStepperModule,
2233
- BrowserAnimationsModule,
2234
- MatGridListModule,
2235
- MatProgressSpinnerModule,
2236
- MatTableModule,
2237
- MatSidenavModule,
2238
- MatRadioModule,
2239
- MatIconModule,
2240
- MatSliderModule,
2241
- MatChipsModule,
2242
- MatSnackBarModule,
2243
- CdkTableModule,
2244
- MatSortModule,
2245
- MatPaginatorModule,
2246
- MatExpansionModule,
2247
- MatRippleModule,
2248
- SmartUiModule
2249
- ]
2250
- }]
2251
- }] });
2252
-
2253
- class CommonDialogModule {
2254
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
2255
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, declarations: [CommonDialogComponent], imports: [
2256
- // MaterialModule.forRoot(),
2257
- SharedModule], exports: [CommonDialogComponent] }); }
2258
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, providers: [
2259
- CommonDialogComponent,
2260
- ], imports: [
2261
- // MaterialModule.forRoot(),
2262
- SharedModule] }); }
2263
- }
2264
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CommonDialogModule, decorators: [{
2265
- type: NgModule,
2266
- args: [{
2267
- imports: [
2268
- // MaterialModule.forRoot(),
2269
- SharedModule
2270
- ],
2271
- exports: [
2272
- CommonDialogComponent,
2273
- ],
2274
- declarations: [
2275
- CommonDialogComponent,
2276
- ],
2277
- providers: [
2278
- CommonDialogComponent,
2279
- ]
2280
- }]
2281
- }] });
2282
-
2283
- function dateValidator() {
2284
- return (control) => {
2285
- const dateStr = control.value;
2286
- const invalidObj = { 'date': 'future Date is Not Allowed' };
2287
- const date = new Date(dateStr);
2288
- if (date > new Date()) {
2289
- return invalidObj;
2290
- }
2291
- return null;
2292
- };
2293
- }
2294
- function passDateValidator() {
2295
- return (control) => {
2296
- const dateStr = control.value;
2297
- const invalidObj = { 'date': 'Pass Date is Not Allowed' };
2298
- const date = new Date(dateStr);
2299
- if (date < new Date()) {
2300
- return invalidObj;
2301
- }
2302
- return null;
2303
- };
2304
- }
2305
- function dateLessThan(dateField1, dateField2, validatorField) {
2306
- return (c) => {
2307
- const date1 = c.get(dateField1).value;
2308
- const date2 = c.get(dateField2).value;
2309
- console.log('date1');
2310
- console.log(date1);
2311
- console.log('date2');
2312
- console.log(date2);
2313
- //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2314
- if ((date1 !== null && date2 !== null) && date1 > date2) {
2315
- console.log(validatorField);
2316
- return validatorField;
2317
- //return invalidObj;
2318
- }
2319
- console.log('return null');
2320
- return null;
2321
- };
2322
- }
2323
- function greaterLessThan(dateField1, dateField2, validatorField) {
2324
- return (c) => {
2325
- const date1 = c.get(dateField1).value;
2326
- const date2 = c.get(dateField2).value;
2327
- console.log('end date');
2328
- console.log(date1);
2329
- console.log('ver date');
2330
- console.log(date2);
2331
- //const invalidObj = { 'dateRule': 'date is Not Allowed' };
2332
- if ((date1 !== null && date2 !== null) && date1 < date2) {
2333
- console.log(validatorField);
2334
- return validatorField;
2335
- //return invalidObj;
2336
- }
2337
- console.log('return null');
2338
- return null;
2339
- };
2340
- }
2341
-
2342
- class EmailService {
2343
- constructor(apollo) {
2344
- this.apollo = apollo;
2345
- }
2346
- createCaseNoteEmail(templateId, offenderId, modifiedBy) {
2347
- return this.createEmail(templateId, `{\\"offenderId\\": ${offenderId}}`, modifiedBy);
2348
- }
2349
- createEmail(emailTemplateId, parameters, modifiedBy) {
2350
- const mutation = `mutation {
2351
- createEmail(input: {
2352
- emailTemplateId: "${emailTemplateId}"
2353
- parameters: "${parameters}"
2354
- modifiedBy: ${modifiedBy}
2355
- }) {
2356
- message
2357
- data {
2358
- emailQueueId
2359
- }
2360
- }
2361
- }`;
2362
- console.log(mutation);
2363
- return this.apollo.mutate({
2364
- mutation: gql `
2365
- ${mutation}
2366
- `,
2367
- });
2368
- }
2369
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, deps: [{ token: i2.Apollo }], target: i0.ɵɵFactoryTarget.Injectable }); }
2370
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, providedIn: 'root' }); }
2371
- }
2372
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: EmailService, decorators: [{
2373
- type: Injectable,
2374
- args: [{
2375
- providedIn: 'root',
2376
- }]
2377
- }], ctorParameters: () => [{ type: i2.Apollo }] });
2378
-
2379
- class CaseNoteComponent {
2380
- constructor(formBuilder, _victimServicesComponent, commonDialogService, snackBar, route, router, smartAuthService, emailService) {
2381
- this.formBuilder = formBuilder;
2382
- this._victimServicesComponent = _victimServicesComponent;
2383
- this.commonDialogService = commonDialogService;
2384
- this.snackBar = snackBar;
2385
- this.route = route;
2386
- this.router = router;
2387
- this.smartAuthService = smartAuthService;
2388
- this.emailService = emailService;
2389
- this.editCaseNote = {};
2390
- this.caseNoteDataSource = new MatTableDataSource();
2391
- this.initForm();
2392
- }
2393
- initForm() {
2394
- this.caseNoteForm = this.formBuilder.group({
2395
- caseNoteDate: new UntypedFormControl('', Validators.compose([
2396
- Validators.required, dateValidator()
2397
- ])),
2398
- contactType: new UntypedFormControl('', Validators.required),
2399
- contactPurpose: new UntypedFormControl('', Validators.required),
2400
- comment: new UntypedFormControl('', Validators.required)
2401
- });
2402
- this.caseNoteForm.markAsPristine();
2403
- this.caseNoteForm.markAsUntouched();
2404
- }
2405
- ngAfterViewInit() {
2406
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2407
- }
2408
- ngOnInit() {
2409
- var data = this.route.snapshot.data;
2410
- this.loginStaff = data.loginStaff;
2411
- this.staffId = this.loginStaff.staffId;
2412
- this.sub = this.route.params.subscribe(params => {
2413
- this.victimId = params['victimId'];
2414
- this.offenderId = params['offenderId'];
2415
- });
2416
- this.addDisableFlag = false;
2417
- this.hiddenDetailFlag = true;
2418
- this.hiddenAddNewFlag = false;
2419
- this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
2420
- this.victimName = items.firstName + ', ' + items.lastName;
2421
- });
2422
- this._victimServicesComponent.getContactTypes().subscribe((items) => {
2423
- this.contactTypes = items;
2424
- });
2425
- this._victimServicesComponent.getVictimContactPurposes().subscribe((items) => {
2426
- this.contactPurposes = items;
2427
- });
2428
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2429
- console.log('caseNoteList');
2430
- console.log(caseNoteList);
2431
- this.caseNoteList = caseNoteList;
2432
- this.caseNoteDataSource.data = this.caseNoteList;
2433
- });
2434
- // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2435
- // (itms: any) => {
2436
- // const ELEMENT_DATA: Element[] = itms;
2437
- // this.caseNoteDataSource.data = ELEMENT_DATA;
2438
- // })
2439
- }
2440
- onEditCaseNote(victimCaseNoteId) {
2441
- this.hiddenDetailFlag = false;
2442
- this.hiddenAddNewFlag = true;
2443
- this.addDisableFlag = true;
2444
- this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2445
- }
2446
- onDeleteCaseNote(victimCaseNoteId) {
2447
- this.commonDialogService
2448
- .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2449
- .subscribe(res => {
2450
- this.result = res;
2451
- if (this.result) {
2452
- this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2453
- .subscribe(result => {
2454
- this.snackBar.open('delete Successfully !', '', { duration: 3000, });
2455
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2456
- this.caseNoteList = caseNoteList;
2457
- this.caseNoteDataSource.data = this.caseNoteList;
2458
- });
2459
- });
2460
- }
2461
- });
2462
- }
2463
- onAddNew() {
2464
- this.hiddenDetailFlag = false;
2465
- this.editCaseNote.victimCaseNoteId = 0;
2466
- const caseNoteDateControl = this.caseNoteForm.get('caseNoteDate');
2467
- caseNoteDateControl.setValue(null);
2468
- caseNoteDateControl.setErrors(null);
2469
- caseNoteDateControl.markAsPristine();
2470
- caseNoteDateControl.markAsPristine();
2471
- const contactTypeControl = this.caseNoteForm.get('contactType');
2472
- contactTypeControl.setValue(null);
2473
- contactTypeControl.setErrors(null);
2474
- contactTypeControl.markAsPristine();
2475
- contactTypeControl.markAsUntouched();
2476
- const contactPurposeControl = this.caseNoteForm.get('contactPurpose');
2477
- contactPurposeControl.setValue(null);
2478
- contactPurposeControl.setErrors(null);
2479
- contactPurposeControl.markAsPristine();
2480
- contactPurposeControl.markAsUntouched();
2481
- const commentControl = this.caseNoteForm.get('comment');
2482
- commentControl.setValue(null);
2483
- commentControl.setErrors(null);
2484
- commentControl.markAsPristine();
2485
- commentControl.markAsUntouched();
2486
- }
2487
- back() {
2488
- this.router.navigate(['victimHome']);
2489
- }
2490
- saveCaseNote() {
2491
- this.emailService
2492
- .createCaseNoteEmail("VictimCaseNoteReminders", this.offenderId, this.staffId)
2493
- .subscribe();
2494
- if (this.editCaseNote.victimCaseNoteId === undefined || this.editCaseNote.victimCaseNoteId === 0) {
2495
- const castNote = {
2496
- victimId: this.victimId,
2497
- victimCaseNoteId: 0,
2498
- caseNoteDate: this.editCaseNote.caseNoteDate,
2499
- contactTypeId: this.editCaseNote.contactTypeId,
2500
- contactType: null,
2501
- victimContactPurposeId: this.editCaseNote.victimContactPurposeId,
2502
- victimContactPurpose: null,
2503
- comment: this.editCaseNote.comment,
2504
- modifiedBy: this.staffId,
2505
- victimFirstName: null,
2506
- victimLastName: null
2507
- };
2508
- this._victimServicesComponent.addCaseNote(castNote).subscribe(result => {
2509
- this.snackBar.open('Saved Successfully !', '', {
2510
- duration: 3000,
2511
- });
2512
- // this._victimServicesComponent.sendEmail('', {referralId: 0, offenderId: this.offenderId }, this.loginStaff.staffId);
2513
- this.hiddenDetailFlag = true;
2514
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2515
- this.caseNoteList = caseNoteList;
2516
- this.caseNoteDataSource.data = this.caseNoteList;
2517
- });
2518
- });
2519
- }
2520
- else {
2521
- this._victimServicesComponent.updateCaseNote(this.editCaseNote).subscribe(result => {
2522
- this.snackBar.open('Update Successfully !', '', {
2523
- duration: 3000,
2524
- });
2525
- this.hiddenDetailFlag = true;
2526
- this.hiddenAddNewFlag = false;
2527
- this.addDisableFlag = false;
2528
- this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(caseNoteList => {
2529
- this.caseNoteList = caseNoteList;
2530
- this.caseNoteDataSource.data = this.caseNoteList;
2531
- });
2532
- });
2533
- }
2534
- //email
2535
- }
2536
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CaseNoteComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: NgcSmartVictimService }, { token: CommonDialogService }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i6.SmartAuthService }, { token: EmailService }], target: i0.ɵɵFactoryTarget.Component }); }
2537
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: CaseNoteComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class=\"row\" >\r\n <div [hidden]=\"hiddenAddNewFlag\">\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]=\"hiddenDetailFlag\" >\r\n <mat-card>\r\n <div class='container'>\r\n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\r\n\r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}}\r\n </div>\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName=\"caseNoteDate\"\r\n (click)=\"caseNoteDate.open()\"\r\n [matDatepicker]=\"caseNoteDate\"\r\n placeholder=\"Choose a start date\"\r\n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors\r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\"\r\n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date')\r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\r\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors\r\n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors\r\n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea\r\n class=\"textarea-content\"\r\n matInput\r\n placeholder=\"\"\r\n required formControlName=\"comment\"\r\n [(ngModel)]=\"editCaseNote.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors\r\n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n\r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"caseNoteDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactType\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactPurpose\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimCaseNoteId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n <button\r\n class=\"sac-cso-read sac-vsp-read\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit Case Note\"\r\n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n\r\n\r\n\r\n <button\r\n class=\"sac-vsp-read\"\r\n matTooltip=\"Delete Case Note\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: [".container{width:800px;margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] }); }
2538
- }
2539
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: CaseNoteComponent, decorators: [{
2540
- type: Component,
2541
- args: [{ providers: [CommonDialogService], template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Case Note</h4>\r\n </mat-toolbar>\r\n <br>\r\n <div class=\"row\" >\r\n <div [hidden]=\"hiddenAddNewFlag\">\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"onAddNew()\" [disabled]=\"addDisableFlag\">Add Case Note</button>\r\n\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <div [hidden]=\"hiddenDetailFlag\" >\r\n <mat-card>\r\n <div class='container'>\r\n <form [formGroup]=\"caseNoteForm\" #caseNoteDetailForm=\"ngForm\" >\r\n\r\n <div>\r\n <mat-label>Victim Name:</mat-label>\r\n {{victimName}}\r\n </div>\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Date of Case Note: </mat-label>\r\n <input matInput formControlName=\"caseNoteDate\"\r\n (click)=\"caseNoteDate.open()\"\r\n [matDatepicker]=\"caseNoteDate\"\r\n placeholder=\"Choose a start date\"\r\n [(ngModel)]=\"editCaseNote.caseNoteDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"caseNoteDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #caseNoteDate></mat-datepicker>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('caseNoteDate').errors\r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>case note date is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n <div class=\"help-block\"\r\n *ngIf=\"caseNoteForm.get('caseNoteDate').hasError('date')\r\n && (caseNoteForm.get('caseNoteDate').dirty || caseNoteForm.get('caseNoteDate').touched)\">\r\n <mat-error>future case note Date is <strong>not allowed</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Type:</mat-label>\r\n <mat-select placeholder=\"contactType\" formControlName=\"contactType\" required [(ngModel)]=\"editCaseNote.contactTypeId\">\r\n <mat-option *ngFor=\" let contactType of contactTypes\" [value]=\"contactType.contactTypeId\" >{{contactType.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactType').errors\r\n && (caseNoteForm.get('contactType').dirty || caseNoteForm.get('contactType').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact Purpose:</mat-label>\r\n <mat-select formControlName=\"contactPurpose\" required [(ngModel)]=\"editCaseNote.victimContactPurposeId\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let contactPurpose of contactPurposes\" [value]=\"contactPurpose.victimContactPurposeId\" >{{contactPurpose.name}}</mat-option>\r\n </mat-select>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('contactPurpose').errors\r\n && (caseNoteForm.get('contactPurpose').dirty || caseNoteForm.get('contactPurpose').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea\r\n class=\"textarea-content\"\r\n matInput\r\n placeholder=\"\"\r\n required formControlName=\"comment\"\r\n [(ngModel)]=\"editCaseNote.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea>\r\n\r\n <div class=\"help-block\" *ngIf=\"caseNoteForm.get('comment').errors\r\n && (caseNoteForm.get('comment').dirty || caseNoteForm.get('comment').touched)\">\r\n <mat-error>comment is <strong>required</strong></mat-error>\r\n </div>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveCaseNote()\" [disabled]=\"!caseNoteDetailForm.form.valid\" >Save</button>\r\n\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"hiddenDetailFlag = true;addDisableFlag = false; this.hiddenAddNewFlag = false;\">Cancel</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n\r\n </div>\r\n <br>\r\n <mat-table #table [dataSource]=\"caseNoteDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"caseNoteDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Case Note Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.caseNoteDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactType\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Type</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactType}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"contactPurpose\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Contact Purpose</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.contactPurpose}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimCaseNoteId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n\r\n <button\r\n class=\"sac-cso-read sac-vsp-read\"\r\n mat-icon-button\r\n color=\"primary\"\r\n matTooltip=\"Edit Case Note\"\r\n (click)=\"onEditCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n\r\n\r\n\r\n <button\r\n class=\"sac-vsp-read\"\r\n matTooltip=\"Delete Case Note\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteCaseNote(row.victimCaseNoteId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['caseNoteDate', 'contactType', 'contactPurpose', 'comment', 'victimCaseNoteId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: [".container{width:800px;margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}.textarea-content{width:500px}\n"] }]
2542
- }], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }, { type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }, { type: EmailService }] });
2543
-
2544
- class ContactComponent {
2545
- constructor(_victimServicesComponent,
2546
- //private commonDialogService: CommonDialogService,
2547
- snackBar, route, router, smartAuthService) {
2548
- this._victimServicesComponent = _victimServicesComponent;
2549
- this.snackBar = snackBar;
2550
- this.route = route;
2551
- this.router = router;
2552
- this.smartAuthService = smartAuthService;
2553
- this.editContact = {};
2554
- this.staff = {};
2555
- this.contactForm = new UntypedFormGroup({
2556
- //contactDate: new FormControl(),
2557
- contactDate: new UntypedFormControl('', Validators.compose([
2558
- dateValidator()
2559
- ])),
2560
- contactMethod: new UntypedFormControl(),
2561
- contactBy: new UntypedFormControl(),
2562
- comment: new UntypedFormControl(),
2563
- nextContactDate: new UntypedFormControl()
2564
- });
2565
- }
2566
- ngAfterViewInit() {
2567
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2568
- }
2569
- ngOnInit() {
2570
- var data = this.route.snapshot.data;
2571
- this.loginStaff = data.loginStaff;
2572
- this.staffId = this.loginStaff.staffId;
2573
- this.staff = [
2574
- {
2575
- staffId: this.loginStaff.staffId,
2576
- fullName: this.loginStaff.firstName + ' ' + this.loginStaff.lastName,
2577
- },
2578
- ];
2579
- this.sub = this.route.params.subscribe(params => {
2580
- this.victimId = params['victimId'];
2581
- console.log('my this.victimId');
2582
- console.log(this.victimId);
2583
- });
2584
- this._victimServicesComponent.getContactMethods().subscribe((items) => {
2585
- this.contactMethods = items;
2586
- console.log('this.contactMethods');
2587
- console.log(this.contactMethods);
2588
- });
2589
- // this._victimServicesComponent.getContactBys().subscribe(
2590
- // (items: any) => {
2591
- // this.contactBy= items;
2592
- // }
2593
- // );
2594
- // this._victimServicesComponent.getContacts(this.victimId).subscribe(
2595
- // caseNoteList => {
2596
- // this.caseNoteList = caseNoteList;
2597
- // }
2598
- // );
2599
- }
2600
- onEditContact(victimContactId) {
2601
- // this.hiddenDetailFlag =false;
2602
- // this.hiddenAddNewFlag = true;
2603
- // this.addDisableFlag = true;
2604
- // this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
2605
- }
2606
- // onDeleteCaseNote(victimCaseNoteId: number){
2607
- // this.commonDialogService
2608
- // .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
2609
- // .subscribe(res => {this.result = res;
2610
- // if (this.result) {
2611
- // this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
2612
- // .subscribe(result => {
2613
- // this.snackBar.open('delete Successfully !', '', { duration: 3000,});
2614
- // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
2615
- // caseNoteList => {
2616
- // this.caseNoteList = caseNoteList;
2617
- // }
2618
- // );
2619
- // }
2620
- // );
2621
- // }
2622
- // });
2623
- // }
2624
- onAddNew() {
2625
- // this.editCas.caseNoteDate = null;
2626
- // this.editCaseNote.contactTypeId = null;
2627
- // this.editCaseNote.victimContactPurposeId = null;
2628
- // this.editCaseNote.comment = null;
2629
- }
2630
- back() {
2631
- this.router.navigate(['victimDetail', this.victimId]);
2632
- }
2633
- saveContact() {
2634
- const contact = {
2635
- victimId: this.victimId,
2636
- victimContactId: 0,
2637
- contactDate: this.editContact.contactDate,
2638
- victimContactMethodId: this.editContact.victimContactMethodId,
2639
- contactMethod: null,
2640
- contactedByName: null,
2641
- contactedBy: this.editContact.contactedBy,
2642
- comment: this.editContact.comment,
2643
- nextContactDate: this.editContact.nextContactDate,
2644
- modifiedBy: this.staffId,
2645
- };
2646
- this._victimServicesComponent.addContact(contact).subscribe(result => {
2647
- this.snackBar.open('Saved Successfully !', '', {
2648
- duration: 3000,
2649
- });
2650
- this.router.navigate(['victimDetail', this.victimId]);
2651
- });
2652
- }
2653
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ContactComponent, deps: [{ token: NgcSmartVictimService }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i6.SmartAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
2654
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: ContactComponent, selector: "ng-component", ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n\r\n\r\n\r\n <mat-card>\r\n <div class='container'>\r\n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName=\"contactDate\"\r\n (click)=\"contactDate.open()\"\r\n [matDatepicker]=\"contactDate\"\r\n placeholder=\"Choose a contact date\"\r\n [(ngModel)]=\"editContact.contactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div class=\"validation-errors\">\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm\r\n .get('contactDate')\r\n .hasError('required') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error>Contact date is\r\n <strong>required</strong></mat-error>\r\n </div>\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm.get('contactDate').hasError('date') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\r\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea\r\n matInput\r\n placeholder=\"\"\r\n required formControlName=\"comment\"\r\n [(ngModel)]=\"editContact.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n cdkAutosizeMaxRows=\"5\">\r\n </textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName=\"nextContactDate\"\r\n (click)=\"nextContactDate.open()\"\r\n [matDatepicker]=\"nextContactDate\"\r\n placeholder=\"Choose a next contact date\"\r\n [(ngModel)]=\"editContact.nextContactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <!-- <button mat-stroked-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n\r\n\r\n <br>\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:50%}.container{margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] }); }
2655
- }
2656
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: ContactComponent, decorators: [{
2657
- type: Component,
2658
- args: [{ template: "\r\n <mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" >Contact detail</h4>\r\n </mat-toolbar>\r\n <br>\r\n\r\n\r\n\r\n <mat-card>\r\n <div class='container'>\r\n <form [formGroup]=\"contactForm\" #contactDetailForm=\"ngForm\" >\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Date:</mat-label>\r\n <input matInput formControlName=\"contactDate\"\r\n (click)=\"contactDate.open()\"\r\n [matDatepicker]=\"contactDate\"\r\n placeholder=\"Choose a contact date\"\r\n [(ngModel)]=\"editContact.contactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"contactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #contactDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n <div class=\"validation-errors\">\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm\r\n .get('contactDate')\r\n .hasError('required') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error>Contact date is\r\n <strong>required</strong></mat-error>\r\n </div>\r\n <div\r\n class=\"help-block\"\r\n *ngIf=\"\r\n contactForm.get('contactDate').hasError('date') &&\r\n (contactForm.get('contactDate').dirty ||\r\n contactForm.get('contactDate').touched)\">\r\n <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Contact Method:</mat-label>\r\n <mat-select placeholder=\"contactMethod\" formControlName=\"contactMethod\" required [(ngModel)]=\"editContact.victimContactMethodId\">\r\n <mat-option *ngFor=\" let contactMethod of contactMethods\" [value]=\"contactMethod.victimContactMethodId\" >{{contactMethod.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field class=\"mat-select-content\">\r\n <mat-label>Contact By:</mat-label>\r\n <mat-select formControlName=\"contactBy\" required [(ngModel)]=\"editContact.contactedBy\" class=\"mat-select-inner\">\r\n <mat-option *ngFor=\" let item of staff\" [value]=\"item.staffId\" >{{ item.fullName}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n\r\n <mat-form-field>\r\n <mat-label>Comments </mat-label>\r\n <textarea\r\n matInput\r\n placeholder=\"\"\r\n required formControlName=\"comment\"\r\n [(ngModel)]=\"editContact.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"1\"\r\n cdkAutosizeMaxRows=\"5\">\r\n </textarea>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <mat-form-field>\r\n <mat-label>Next Contact Date: </mat-label>\r\n <input matInput formControlName=\"nextContactDate\"\r\n (click)=\"nextContactDate.open()\"\r\n [matDatepicker]=\"nextContactDate\"\r\n placeholder=\"Choose a next contact date\"\r\n [(ngModel)]=\"editContact.nextContactDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"nextContactDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #nextContactDate></mat-datepicker>\r\n </mat-form-field>\r\n </div>\r\n\r\n <div>\r\n <!-- <button mat-stroked-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.form.valid\" >Save</button> -->\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveContact()\" [disabled]=\"!contactForm.valid\" >Save</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" >Cancel</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\" >Back</button>\r\n </div>\r\n\r\n </form>\r\n </div>\r\n </mat-card>\r\n\r\n\r\n <br>\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: ["mat-form-field{width:50%}.container{margin:16px;display:grid;grid-template-columns:repeat(1,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.mat-select-content{width:300px}.mat-select-inner{width:290px}\n"] }]
2659
- }], ctorParameters: () => [{ type: NgcSmartVictimService }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i6.SmartAuthService }] });
2660
-
2661
- class VictimSafetyPlanComponent {
2662
- constructor(_victimServicesComponent, commonDialogService, http, dialog, route, router, snackBar, smartAuthService) {
2663
- this._victimServicesComponent = _victimServicesComponent;
2664
- this.commonDialogService = commonDialogService;
2665
- this.http = http;
2666
- this.dialog = dialog;
2667
- this.route = route;
2668
- this.router = router;
2669
- this.snackBar = snackBar;
2670
- this.smartAuthService = smartAuthService;
2671
- this.editSafetyPlan = {};
2672
- this.safetyPlanDataSource = new MatTableDataSource();
2673
- }
2674
- ngAfterViewInit() {
2675
- this.smartAuthService.setPermission('Victim', this.route.snapshot);
2676
- }
2677
- ngOnInit() {
2678
- var data = this.route.snapshot.data;
2679
- this.loginStaff = data.loginStaff;
2680
- this.staffId = this.loginStaff.staffId;
2681
- this.sub = this.route.params.subscribe(params => {
2682
- this.victimId = params['victimId'];
2683
- });
2684
- this.hiddenAddNewFlag = false;
2685
- this.victimName = this.victimName;
2686
- this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2687
- this.victimSafetyPlans = victimSafetyPlans;
2688
- this.safetyPlanDataSource.data = this.victimSafetyPlans;
2689
- console.log('this.victimSafetyPlans');
2690
- console.log(this.victimSafetyPlans);
2691
- });
2692
- // this.myVictimServiceId =1;
2693
- // this._victimServicesComponent.getVictimServiceDetail(this.myVictimServiceId).subscribe(
2694
- // victimServiceDetail => {
2695
- // this.victimServiceDetail = victimServiceDetail;
2696
- // console.log('service detail');
2697
- // console.log(this.victimServiceDetail);
2698
- // }
2699
- // );
2700
- this._victimServicesComponent.getServiceStatusHistories(1).subscribe(victimServiceStatusHistories => {
2701
- // this.victimServiceStatusHistories = victimServiceStatusHistories;
2702
- });
2703
- }
2704
- //---------------graphQL--------------------------------------
2705
- // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
2706
- // const queryString = `
2707
- // {
2708
- // findVictimServiceTypeProgramProviders {
2709
- // data {
2710
- // victimServiceTypeProgramProviderId
2711
- // victimServiceType
2712
- // victimProgramProvider
2713
- // }
2714
- // }
2715
- // }`;
2716
- // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
2717
- // .map(result => {
2718
- // return result.data.findVictimServiceTypeProgramProviders.data;
2719
- // });
2720
- // }
2721
- goToSafetyPlanDetail(victimServiceId) {
2722
- this.router.navigate(['saftyPlanDetail', victimServiceId, this.victimId]);
2723
- }
2724
- onAddNew() {
2725
- this.hiddenDetailFlag = false;
2726
- }
2727
- onDeleteSafetyPlan(victimServiceId) {
2728
- this.commonDialogService
2729
- .confirm('', 'Do you want to delete this safety plan?', 'Yes', 'No')
2730
- .subscribe(res => {
2731
- this.result = res;
2732
- if (this.result) {
2733
- this._victimServicesComponent.deleteSafetyPlan(victimServiceId, this.staffId)
2734
- .subscribe(result => {
2735
- this.snackBar.open('delete safety plan Successfully !', '', { duration: 3000, });
2736
- this._victimServicesComponent.getSafetyPlans(this.victimId).subscribe(victimSafetyPlans => {
2737
- this.victimSafetyPlans = victimSafetyPlans;
2738
- this.safetyPlanDataSource.data = this.victimSafetyPlans;
2739
- });
2740
- });
2741
- }
2742
- });
2743
- }
2744
- back() {
2745
- this.router.navigate(['victimHome']);
2746
- }
2747
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanComponent, deps: [{ token: NgcSmartVictimService }, { token: CommonDialogService }, { token: i1.HttpClient }, { token: i1$1.MatDialog }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: i4.MatSnackBar }, { token: i6.SmartAuthService }], target: i0.ɵɵFactoryTarget.Component }); }
2748
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSafetyPlanComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-stroked-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"goal\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"victimServiceStatus\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimServiceId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type=\"button\" mat-stroked-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\">\r\n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\r\n </button>\r\n </mat-cell> -->\r\n\r\n <mat-cell *matCellDef=\"let element\">\r\n\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n\r\n <button\r\n class=\"delete-btn\"\r\n matTooltip=\"Delete Safety Plan\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n\r\n\r\n\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", dependencies: [{ kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i2$1.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] }); }
2749
- }
2750
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanComponent, decorators: [{
2751
- type: Component,
2752
- args: [{ providers: [CommonDialogService], template: "\r\n <mat-card>\r\n <mat-card-header>\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n <br>\r\n <button mat-stroked-button color=\"primary\" (click)=\"goToSafetyPlanDetail(0)\" >Add Goal</button>\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n <br>\r\n <br>\r\n <mat-table #table [dataSource]=\"safetyPlanDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"goal\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Goal</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.goal }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"victimServiceStatus\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatus }} </mat-cell>\r\n </ng-container>\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment }} </mat-cell>\r\n </ng-container>\r\n\r\n <ng-container matColumnDef=\"victimServiceId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\"></mat-header-cell>\r\n <!-- <mat-cell *matCellDef=\"let row\" class=\"example-cell\">\r\n <button type=\"button\" mat-stroked-button color=\"primary\" (click)=\"goToSafetyPlanDetail(row.victimServiceId)\">\r\n <span class=\"glyphicon glyphicon-pencil\" ></span>&nbsp;\r\n <mat-icon>edit</mat-icon>\r\n </button>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n &nbsp;&nbsp;\r\n <button type=\"button\" mat-stroked-button color=\"primary\" (click)=\"onDeleteSafetyPlan(row.victimServiceId)\">\r\n <span class=\"glyphicon glyphicon-trash\" ></span>&nbsp;Delete\r\n </button>\r\n </mat-cell> -->\r\n\r\n <mat-cell *matCellDef=\"let element\">\r\n\r\n <button class=\"edit-btn\" mat-icon-button color=\"primary\" matTooltip=\"Edit Safety Plan\" (click)=\"goToSafetyPlanDetail(element.victimServiceId)\">\r\n <i class=\"material-icons\">mode_edit</i>\r\n </button>\r\n\r\n &nbsp;&nbsp;\r\n\r\n <button\r\n class=\"delete-btn\"\r\n matTooltip=\"Delete Safety Plan\"\r\n mat-icon-button\r\n color=\"primary\"\r\n (click)=\"onDeleteSafetyPlan(element.victimServiceId)\">\r\n <i class=\"material-icons\">delete</i>\r\n </button>\r\n\r\n\r\n\r\n\r\n\r\n </mat-cell>\r\n\r\n\r\n\r\n </ng-container>\r\n\r\n <mat-header-row *matHeaderRowDef=\"['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n" }]
2753
- }], ctorParameters: () => [{ type: NgcSmartVictimService }, { type: CommonDialogService }, { type: i1.HttpClient }, { type: i1$1.MatDialog }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: i4.MatSnackBar }, { type: i6.SmartAuthService }] });
2754
-
2755
- class SeriveProviderComponent {
2756
- constructor(formBuilder, dialogRef, _victimServicesComponent, data) {
2757
- this.formBuilder = formBuilder;
2758
- this.dialogRef = dialogRef;
2759
- this._victimServicesComponent = _victimServicesComponent;
2760
- this.data = data;
2761
- this.spForm = this.formBuilder.group({
2762
- voteeProviderId: [''],
2763
- });
2764
- }
2765
- cancel() {
2766
- this.dialogRef.close();
2767
- }
2768
- ngOnInit() {
2769
- console.log('data.providerCollections');
2770
- console.log(this.data);
2771
- console.log(this.data.serviceTypeId);
2772
- this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe((items) => {
2773
- this.programProviders = items.filter((y) => (y.victimServiceTypeId === this.data.serviceTypeId));
2774
- console.log('this.programProviders');
2775
- console.log(this.programProviders);
2776
- });
2777
- this.spForm.get('voteeProviderId').valueChanges.subscribe(voteeProviderId => {
2778
- console.log('voteeProviderId in service provider component.');
2779
- console.log(voteeProviderId);
2780
- });
2781
- }
2782
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SeriveProviderComponent, deps: [{ token: i1$2.UntypedFormBuilder }, { token: i1$1.MatDialogRef }, { token: NgcSmartVictimService }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
2783
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: SeriveProviderComponent, selector: "app-service-provider", ngImport: i0, template: `
2784
- <h1 mat-dialog-title> {{data.serviceType}}</h1>
2785
- <div mat-dialog-content class="main" [formGroup]="spForm">
2786
- <mat-form-field>
2787
- <mat-label>service provider</mat-label>
2788
-
2789
- <mat-select formControlName="voteeProviderId">
2790
- <mat-option
2791
- *ngFor="let providerOption of programProviders"
2792
- [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
2793
- </mat-option>
2794
- </mat-select>
2795
-
2796
- </mat-form-field>
2797
-
2798
- </div>
2799
- <div mat-dialog-actions class="actions">
2800
- <button mat-stroked-button color="primary" (click)="cancel()" cdkFocusInitial>
2801
- Cancel Change
2802
- </button>
2803
- <button mat-stroked-button color="primary" [mat-dialog-close]="spForm.value" >
2804
- Save Change
2805
- </button>
2806
- </div>
2807
- `, isInline: true, styles: [".main{width:100%;display:flex;flex-direction:column}.actions{display:flex}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i1$1.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }] }); }
2808
- }
2809
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: SeriveProviderComponent, decorators: [{
2810
- type: Component,
2811
- args: [{ selector: 'app-service-provider', template: `
2812
- <h1 mat-dialog-title> {{data.serviceType}}</h1>
2813
- <div mat-dialog-content class="main" [formGroup]="spForm">
2814
- <mat-form-field>
2815
- <mat-label>service provider</mat-label>
2816
-
2817
- <mat-select formControlName="voteeProviderId">
2818
- <mat-option
2819
- *ngFor="let providerOption of programProviders"
2820
- [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
2821
- </mat-option>
2822
- </mat-select>
2823
-
2824
- </mat-form-field>
2825
-
2826
- </div>
2827
- <div mat-dialog-actions class="actions">
2828
- <button mat-stroked-button color="primary" (click)="cancel()" cdkFocusInitial>
2829
- Cancel Change
2830
- </button>
2831
- <button mat-stroked-button color="primary" [mat-dialog-close]="spForm.value" >
2832
- Save Change
2833
- </button>
2834
- </div>
2835
- `, styles: [".main{width:100%;display:flex;flex-direction:column}.actions{display:flex}\n"] }]
2836
- }], ctorParameters: () => [{ type: i1$2.UntypedFormBuilder }, { type: i1$1.MatDialogRef }, { type: NgcSmartVictimService }, { type: undefined, decorators: [{
2837
- type: Inject,
2838
- args: [MAT_DIALOG_DATA]
2839
- }] }] });
2840
-
2841
- class VictimSafetyPlanDetailComponent {
2842
- constructor(dialog, _victimServicesComponent, http, snackBar, route, router, commonDialogService, formBuilder) {
2843
- this.dialog = dialog;
2844
- this._victimServicesComponent = _victimServicesComponent;
2845
- this.http = http;
2846
- this.snackBar = snackBar;
2847
- this.route = route;
2848
- this.router = router;
2849
- this.commonDialogService = commonDialogService;
2850
- this.formBuilder = formBuilder;
2851
- this.editSafetyPlan = {};
2852
- this.providerListCollection = [];
2853
- this.serviceCheck = [];
2854
- this.victimServiceStatusHistoriesDataSource = new MatTableDataSource();
2855
- this.initForm();
2856
- }
2857
- initForm() {
2858
- this.spForm = this.formBuilder.group({
2859
- serviceGoal: new UntypedFormControl('', Validators.compose([
2860
- Validators.required
2861
- ])),
2862
- goalStatus: new UntypedFormControl('', Validators.compose([
2863
- Validators.required
2864
- ])),
2865
- goalStatusDate: new UntypedFormControl('', Validators.compose([
2866
- Validators.required, dateValidator()
2867
- ])),
2868
- comment: new UntypedFormControl('', Validators.required)
2869
- });
2870
- this.spForm.markAsPristine();
2871
- this.spForm.markAsUntouched();
2872
- }
2873
- ngOnInit() {
2874
- var data = this.route.snapshot.data;
2875
- this.loginStaff = data.loginStaff;
2876
- this.staffId = this.loginStaff.staffId;
2877
- this.sub = this.route.params.subscribe(params => {
2878
- this.victimServiceId = params['victimServiceId'];
2879
- this.victimId = params['victimId'];
2880
- });
2881
- this.hiddenAddNewFlag = false;
2882
- this.isDisplay = false;
2883
- this._victimServicesComponent.getVictimServiceTypes().subscribe((items) => {
2884
- this.victimServiceTypes = items;
2885
- });
2886
- this._victimServicesComponent.getVictimServiceStatus().subscribe((items) => {
2887
- this.victimServiceStatus = items;
2888
- });
2889
- this._victimServicesComponent.getVictim(this.victimId).subscribe((items) => {
2890
- this.victimName = items.firstName + ', ' + items.lastName;
2891
- });
2892
- //---------------graphQL--------------------------------------
2893
- // this.getVictimServiceTypeProgramProviders().subscribe(result => {
2894
- // this.providerList = result;
2895
- // });
2896
- // console.log('this.victimServiceId');
2897
- // console.log(this.victimServiceId);
2898
- if (this.victimServiceId != 0) {
2899
- this._victimServicesComponent.getVictimServices(this.victimServiceId).subscribe(victimSafetyPlans => {
2900
- console.log('victimSafetyPlans');
2901
- console.log(victimSafetyPlans);
2902
- this.editSafetyPlan = victimSafetyPlans[0];
2903
- this.victimId = victimSafetyPlans[0].victimId;
2904
- console.log('this.editSafetyPlan');
2905
- console.log(this.editSafetyPlan);
2906
- // console.log('this.editSafetyPlan.goal');
2907
- // console.log(this.editSafetyPlan.goal);
2908
- // console.log('this.editSafetyPlan[0].goal');
2909
- // console.log(this.editSafetyPlan[0].goal);
2910
- });
2911
- this._victimServicesComponent.getServiceStatusHistories(this.victimServiceId).subscribe(victimServiceStatusHistories => {
2912
- // this.victimServiceStatusHistories = victimServiceStatusHistories;
2913
- this.victimServiceStatusHistoriesDataSource.data = victimServiceStatusHistories;
2914
- });
2915
- }
2916
- this.loadProvider();
2917
- }
2918
- //pass in id
2919
- isInArray(providerListCollectionKey, serviceTypeName, event) {
2920
- console.log('providerListCollectionKey');
2921
- console.log(providerListCollectionKey);
2922
- console.log('serviceTypeName');
2923
- console.log(serviceTypeName);
2924
- console.log('event.source.value');
2925
- console.log(event.checked);
2926
- if (event.checked == true) {
2927
- for (let j = 0; j < this.providerListCollection.length; j++) {
2928
- if (providerListCollectionKey == this.providerListCollection[j].groupId) {
2929
- this.providerListCollection[j].isDisplay = !this.providerListCollection[j].isDisplay;
2930
- const dialogRef = this.dialog.open(SeriveProviderComponent, {
2931
- width: '500px',
2932
- data: {
2933
- serviceType: serviceTypeName,
2934
- serviceTypeId: providerListCollectionKey,
2935
- providerCollections: [...this.providerListCollection],
2936
- },
2937
- panelClass: 'formFieldWidth480',
2938
- });
2939
- dialogRef.afterClosed().subscribe((result) => {
2940
- console.log('The dialog was closed');
2941
- console.log(result);
2942
- if (result) {
2943
- console.log('The dialog was closed, inside result');
2944
- this.savePlanProvider(providerListCollectionKey, result.voteeProviderId);
2945
- }
2946
- });
2947
- // return;
2948
- }
2949
- }
2950
- } //if event.checked == true
2951
- //this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId ]);
2952
- }
2953
- loadProvider() {
2954
- this.providerListCollection = [];
2955
- this._victimServicesComponent.getvVictimServiceTypeProgramProviders()
2956
- .subscribe((providerList) => {
2957
- if (providerList) {
2958
- let providers = Object.create(null);
2959
- for (let i = 0; i < providerList.length; i++) {
2960
- if (!providers[providerList[i].victimServiceTypeId]) {
2961
- providers[providerList[i].victimServiceTypeId] = [];
2962
- if (this.editSafetyPlan.vVictimServiceDetails != null) {
2963
- for (let j = 0; j < this.editSafetyPlan.vVictimServiceDetails.length; j++) {
2964
- if (providerList[i].victimServiceTypeId == this.editSafetyPlan.vVictimServiceDetails[j].victimServiceId.toString()) {
2965
- this.isDisplay = true;
2966
- }
2967
- }
2968
- }
2969
- this.providerListCollection.push({ groupId: providerList[i].victimServiceTypeId, isDisplay: this.isDisplay, collection: providers[providerList[i].victimServiceTypeId] });
2970
- }
2971
- providers[providerList[i].victimServiceTypeId].push(providerList[i]);
2972
- }
2973
- }
2974
- });
2975
- }
2976
- //---------------graphQL--------------------------------------
2977
- // getVictimServiceTypeProgramProviders(): Observable<VictimServiceTypeProgramProviderModel[]> {
2978
- // const queryString = `
2979
- // {
2980
- // findVictimServiceTypeProgramProviders {
2981
- // data {
2982
- // victimServiceTypeProgramProviderId
2983
- // victimServiceType
2984
- // victimProgramProvider
2985
- // }
2986
- // }
2987
- // }`;
2988
- // return this.http.post<any>(environment.smartApiUrl, { query: queryString })
2989
- // .map(result => {
2990
- // return result.data.findVictimServiceTypeProgramProviders.data;
2991
- // });
2992
- // }
2993
- evaluateSelection(victimServiceTypeId) {
2994
- if (this.editSafetyPlan.vVictimServiceDetails) {
2995
- return this.editSafetyPlan.vVictimServiceDetails.findIndex(r => r.victimServiceTypeId === victimServiceTypeId) >= 0;
2996
- }
2997
- }
2998
- savePlanProvider(victimServiceTypeId, victimProgramProviderId) {
2999
- console.log('savePlanProvider');
3000
- console.log(victimServiceTypeId);
3001
- console.log(victimProgramProviderId);
3002
- if (victimProgramProviderId === "" || victimProgramProviderId === null || victimProgramProviderId === undefined) {
3003
- this.snackBar.open('Please pick a program on the drop down list !', '', { duration: 120, });
3004
- // alert('Please pick a program on the drop down list !');
3005
- }
3006
- else {
3007
- if (this.victimServiceId == 0) {
3008
- //insert
3009
- console.log('insert new plan');
3010
- const safetyPlan = {
3011
- victimId: this.victimId,
3012
- fullName: null,
3013
- victimServiceId: 0,
3014
- goal: this.editSafetyPlan.goal,
3015
- comment: this.editSafetyPlan.comment,
3016
- modifiedBy: this.staffId,
3017
- victimServiceStatusId: null,
3018
- status: null,
3019
- startDate: null,
3020
- vVictimServiceDetails: null,
3021
- victimName: null
3022
- };
3023
- this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3024
- const victimServiceStatus = {
3025
- victimServiceStatusHistoryId: 0,
3026
- victimServiceId: itms.victimServiceId,
3027
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3028
- startDate: this.editSafetyPlan.startDate,
3029
- modifiedBy: this.staffId,
3030
- comment: 'test add safety plan'
3031
- };
3032
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(() => {
3033
- console.log('check itms.victimServiceId iniside add victim serive status');
3034
- console.log(itms.victimServiceId);
3035
- const victimServiceDetail = {
3036
- victimServiceId: itms.victimServiceId,
3037
- victimServiceDetailId: 0,
3038
- victimServiceTypeId: victimServiceTypeId,
3039
- victimProgramProviderId: victimProgramProviderId,
3040
- modifiedBy: this.staffId,
3041
- victimProgramProvider: null
3042
- };
3043
- console.log('add plan provider here at insert');
3044
- this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3045
- this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3046
- });
3047
- });
3048
- });
3049
- }
3050
- else //update
3051
- {
3052
- const victimServiceDetail = {
3053
- victimServiceId: this.victimServiceId,
3054
- victimServiceDetailId: 0,
3055
- victimServiceTypeId: victimServiceTypeId,
3056
- victimProgramProviderId: victimProgramProviderId,
3057
- modifiedBy: this.staffId,
3058
- victimProgramProvider: null
3059
- };
3060
- console.log('add plan provider here at update');
3061
- this._victimServicesComponent.addPlanProvider(victimServiceDetail).subscribe(() => {
3062
- this.router.navigate(['saftyPlanDetail', this.victimServiceId, this.victimId]);
3063
- });
3064
- }
3065
- }
3066
- }
3067
- deleteProvider(victimProgramProviderId) {
3068
- this.commonDialogService
3069
- .confirm('', 'Do you want to delete this provider?', 'Yes', 'No')
3070
- .subscribe(res => {
3071
- this.result = res;
3072
- if (this.result) {
3073
- this._victimServicesComponent.deleteProvider(victimProgramProviderId, this.staffId)
3074
- .subscribe(result => {
3075
- this.snackBar.open('delete provider Successfully !', '', {
3076
- duration: 3000,
3077
- });
3078
- location.reload();
3079
- });
3080
- }
3081
- });
3082
- // location.reload();
3083
- }
3084
- saveSafetyPlan() {
3085
- if (this.editSafetyPlan.victimServiceId === undefined) {
3086
- const safetyPlan = {
3087
- victimId: this.victimId,
3088
- fullName: null,
3089
- victimServiceId: 0,
3090
- goal: this.editSafetyPlan.goal,
3091
- comment: this.editSafetyPlan.comment,
3092
- modifiedBy: this.staffId,
3093
- victimServiceStatusId: null,
3094
- status: null,
3095
- startDate: null,
3096
- vVictimServiceDetails: null,
3097
- victimName: null
3098
- };
3099
- this._victimServicesComponent.addSafetyPlan(safetyPlan).subscribe((itms) => {
3100
- const victimServiceStatus = {
3101
- victimServiceStatusHistoryId: 0,
3102
- victimServiceId: itms.victimServiceId,
3103
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3104
- startDate: this.editSafetyPlan.startDate,
3105
- modifiedBy: this.staffId,
3106
- comment: 'test add safety Plan'
3107
- };
3108
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe(resp => {
3109
- this.snackBar.open('Insert status successfully!', '', {
3110
- duration: 3000,
3111
- });
3112
- });
3113
- this.router.navigate(['saftyPlanDetail', itms.victimServiceId, this.victimId]);
3114
- });
3115
- }
3116
- else {
3117
- // this.editSafetyPlan.modifiedBy=this.loginStaff.staffId;
3118
- this.editSafetyPlan.modifiedBy = this.staffId;
3119
- this._victimServicesComponent.updateSafetyPlan(this.editSafetyPlan).subscribe(resp => {
3120
- // this.snackBar.open('update Successfully!', '', {
3121
- // duration: 3000,
3122
- // });
3123
- const victimServiceStatus = {
3124
- victimServiceStatusHistoryId: 0,
3125
- victimServiceId: this.editSafetyPlan.victimServiceId.toString(),
3126
- victimServiceStatusId: this.editSafetyPlan.victimServiceStatusId,
3127
- startDate: this.editSafetyPlan.startDate,
3128
- modifiedBy: this.staffId,
3129
- comment: 'test update safety Plan'
3130
- };
3131
- this._victimServicesComponent.addVictimServiceStatus(victimServiceStatus).subscribe();
3132
- this.router.navigate(['saftyPlanDetail', this.editSafetyPlan.victimServiceId, this.victimId]);
3133
- });
3134
- }
3135
- }
3136
- back() {
3137
- console.log('this.victimId');
3138
- console.log(this.victimId);
3139
- this.router.navigate(['saftyPlan', this.victimId]);
3140
- }
3141
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanDetailComponent, deps: [{ token: i1$1.MatDialog }, { token: NgcSmartVictimService }, { token: i1.HttpClient }, { token: i4.MatSnackBar }, { token: i5.ActivatedRoute }, { token: i5.Router }, { token: CommonDialogService }, { token: i1$2.UntypedFormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
3142
- /** @nocollapse */ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.1.0", type: VictimSafetyPlanDetailComponent, selector: "ng-component", providers: [CommonDialogService], ngImport: i0, template: "<mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n\r\n\r\n <div class='container'>\r\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\r\n\r\n\r\n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\r\n\r\n\r\n <div class=\"row\" >\r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div class=\"row\">\r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n\r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput\r\n formControlName=\"goalStatusDate\"\r\n [matDatepicker]=\"goalStatusDate\"\r\n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\"\r\n (click)=\"goalStatusDate.open()\"\r\n >\r\n\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n\r\n <div class=\"help-block\"\r\n *ngIf=\"spForm.get('goalStatusDate').hasError('date')\r\n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\" >\r\n <!-- <mat-form-field style=\"width: 200px;\"> -->\r\n <!-- <mat-label>Comment:</mat-label>\r\n <textarea mdInput\r\n class=\"textarea-content\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n formControlName=\"comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\"\r\n >\r\n </textarea> -->\r\n <!-- </mat-form-field> -->\r\n\r\n\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea\r\n class=\"textarea-content\"\r\n matInput\r\n placeholder=\"\"\r\n formControlName=\"comment\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea>\r\n\r\n\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div><!--end form-->\r\n\r\n\r\n <br>\r\n\r\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\r\n <mat-checkbox class=\"example-margin\" name=\"victimService\" color =\"primary\" [checked]=\"evaluateSelection(serviceType.victimServiceTypeId)\" (change)=\"isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);\" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\r\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\r\n\r\n <div class=\"serviceSelect\"> -->\r\n <!-- <mat-form-field> -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" >\r\n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> -->\r\n <!-- </mat-form-field> -->\r\n\r\n <!-- </div>\r\n\r\n <div class=\"serviceButton\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\r\n </div>\r\n </div> -->\r\n </div>\r\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\r\n\r\n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\r\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-stroked-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\r\n <div class=\"serviceSelect\" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class=\"serviceButton\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-list-item>\r\n\r\n </mat-list>\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class='col-md-7'>\r\n\r\n </div>\r\n </div> -->\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <mat-form-field >\r\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\r\n <div class='col-md-7'>\r\n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea>\r\n </div>\r\n </div> -->\r\n\r\n\r\n <div class='row' >\r\n <div class='col-md-12 text-center'>\r\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\r\n <!-- &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <!--status hisotry-->\r\n\r\n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimServiceStatusId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: ["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-mdc-list-item{height:auto}.textarea-content{width:500px}\n"], dependencies: [{ kind: "directive", type: i8$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i8$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: i2$1.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i9.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i8.MatCard, selector: "mat-card", inputs: ["appearance"], exportAs: ["matCard"] }, { kind: "directive", type: i8.MatCardContent, selector: "mat-card-content" }, { kind: "component", type: i8.MatCardHeader, selector: "mat-card-header" }, { kind: "component", type: i12.MatList, selector: "mat-list", exportAs: ["matList"] }, { kind: "component", type: i12.MatListItem, selector: "mat-list-item, a[mat-list-item], button[mat-list-item]", inputs: ["activated"], exportAs: ["matListItem"] }, { kind: "component", type: i11$2.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i14.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i15.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i15.MatLabel, selector: "mat-label" }, { kind: "directive", type: i15.MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: i15.MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "directive", type: i14$1.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "component", type: i16.MatDatepicker, selector: "mat-datepicker", exportAs: ["matDatepicker"] }, { kind: "directive", type: i16.MatDatepickerInput, selector: "input[matDatepicker]", inputs: ["matDatepicker", "min", "max", "matDatepickerFilter"], exportAs: ["matDatepickerInput"] }, { kind: "component", type: i16.MatDatepickerToggle, selector: "mat-datepicker-toggle", inputs: ["for", "tabIndex", "aria-label", "disabled", "disableRipple"], exportAs: ["matDatepickerToggle"] }, { kind: "component", type: i17.MatSelect, selector: "mat-select", inputs: ["aria-describedby", "panelClass", "disabled", "disableRipple", "tabIndex", "hideSingleSelectionIndicator", "placeholder", "required", "multiple", "disableOptionCentering", "compareWith", "value", "aria-label", "aria-labelledby", "errorStateMatcher", "typeaheadDebounceInterval", "sortComparator", "id", "panelWidth"], outputs: ["openedChange", "opened", "closed", "selectionChange", "valueChange"], exportAs: ["matSelect"] }, { kind: "component", type: i18.MatOption, selector: "mat-option", inputs: ["value", "id", "disabled"], outputs: ["onSelectionChange"], exportAs: ["matOption"] }, { kind: "component", type: i11$1.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i11$1.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i11$1.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i11$1.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i11$1.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i11$1.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i11$1.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i11$1.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i11$1.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i11$1.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i8$1.DatePipe, name: "date" }] }); }
3143
- }
3144
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimSafetyPlanDetailComponent, decorators: [{
3145
- type: Component,
3146
- args: [{ providers: [CommonDialogService], template: "<mat-card>\r\n <mat-card-header>\r\n\r\n </mat-card-header>\r\n <mat-card-content>\r\n <mat-toolbar color=\"primary\">\r\n <h4 class=\"card-header\" style=\"display: inline-block;\">Safety Plan</h4>\r\n </mat-toolbar>\r\n\r\n\r\n <div class='container'>\r\n <form [formGroup]=\"spForm\" #spDetailForm=\"ngForm\" >\r\n\r\n\r\n <div class=\"row\" ><b>Victim Name:</b> {{victimName}} </div>\r\n\r\n\r\n <div class=\"row\" >\r\n <mat-form-field >\r\n <mat-label>Goal:</mat-label>\r\n <input matInput formControlName=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" >\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n <div class=\"row\">\r\n <mat-form-field>\r\n <mat-label>Goal Status:</mat-label>\r\n <mat-select formControlName=\"goalStatus\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" >\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n\r\n <mat-form-field>\r\n <mat-label>Goal Status Date:</mat-label>\r\n <input matInput\r\n formControlName=\"goalStatusDate\"\r\n [matDatepicker]=\"goalStatusDate\"\r\n placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\"\r\n (click)=\"goalStatusDate.open()\"\r\n >\r\n\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker>\r\n </mat-form-field>\r\n\r\n\r\n <div class=\"help-block\"\r\n *ngIf=\"spForm.get('goalStatusDate').hasError('date')\r\n && (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)\">\r\n <mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\" >\r\n <!-- <mat-form-field style=\"width: 200px;\"> -->\r\n <!-- <mat-label>Comment:</mat-label>\r\n <textarea mdInput\r\n class=\"textarea-content\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n formControlName=\"comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\"\r\n >\r\n </textarea> -->\r\n <!-- </mat-form-field> -->\r\n\r\n\r\n\r\n <mat-form-field style=\"width: 400px;\">\r\n <mat-label>Comment:</mat-label>\r\n <textarea\r\n class=\"textarea-content\"\r\n matInput\r\n placeholder=\"\"\r\n formControlName=\"comment\"\r\n [(ngModel)]=\"editSafetyPlan.comment\"\r\n cdkTextareaAutosize\r\n #autosize=\"cdkTextareaAutosize\"\r\n cdkAutosizeMinRows=\"8\"\r\n cdkAutosizeMaxRows=\"12\">\r\n </textarea>\r\n\r\n\r\n </mat-form-field>\r\n\r\n </div>\r\n\r\n </form>\r\n </div><!--end form-->\r\n\r\n\r\n <br>\r\n\r\n <div class=\"row\"><b>Need and provider:</b><br> (click on a check box to select provider information)\r\n\r\n <mat-list>\r\n <mat-list-item *ngFor=\"let serviceType of victimServiceTypes; let i=index\" >\r\n <mat-checkbox class=\"example-margin\" name=\"victimService\" color =\"primary\" [checked]=\"evaluateSelection(serviceType.victimServiceTypeId)\" (change)=\"isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);\" > {{serviceType.name}}</mat-checkbox>\r\n <div> &nbsp;&nbsp;</div>\r\n <div *ngFor=\"let provider of providerListCollection; let pi = index\" >\r\n <!-- <div *ngIf=\"provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId \" class=\"Row\">\r\n\r\n <div class=\"serviceSelect\"> -->\r\n <!-- <mat-form-field> -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(ngModel)]=\"providerId\" > -->\r\n <!-- <mat-select name=\"provider\" id=\"provider.groupId\" [(value)]=\"providerId\" >\r\n <mat-option *ngFor=\" let providerOption of provider.collection\" [value]=\"providerOption.victimProgramProviderId\" >{{providerOption.victimProgramProvider}}</mat-option>\r\n </mat-select> -->\r\n <!-- </mat-form-field> -->\r\n\r\n <!-- </div>\r\n\r\n <div class=\"serviceButton\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"savePlanProvider(serviceType.victimServiceTypeId ,providerId)\">Add Provider</button>\r\n </div>\r\n </div> -->\r\n </div>\r\n <div *ngFor=\" let serviceprovider of editSafetyPlan.vVictimServiceDetails\" >\r\n\r\n <div *ngIf=\"serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId\" class=\"Row\" >\r\n <!-- . {{ serviceprovider.victimProgramProvider}}<button mat-stroked-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button> <br> -->\r\n <div class=\"serviceSelect\" >\r\n . {{ serviceprovider.victimProgramProvider}}\r\n </div>\r\n <div class=\"serviceButton\">\r\n <button mat-stroked-button color=\"primary\" (click)=\"deleteProvider(serviceprovider.victimServiceDetailId)\">Delete</button>\r\n </div>\r\n\r\n </div>\r\n\r\n </div>\r\n\r\n </mat-list-item>\r\n\r\n </mat-list>\r\n </div>\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>\r\n <div class='col-md-7'>\r\n\r\n </div>\r\n </div> -->\r\n <!-- <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <mat-form-field >\r\n <input matInput name=\"serviceGoal\" [(ngModel)]=\"editSafetyPlan.goal\" required placeholder=\"\">\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <mat-select name=\"goalStatus\" [style.width]=\"'50%'\" [(ngModel)]=\"editSafetyPlan.victimServiceStatusId\" required>\r\n <mat-option *ngFor=\" let victimServiceStatu of victimServiceStatus\" [value]=\"victimServiceStatu.victimServiceStatusId\" >{{victimServiceStatu.name}}</mat-option>\r\n </mat-select>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Goal Status Date:<font color=\"red\">*</font></b></div>\r\n <div class='col-md-7'>\r\n <input matInput name=\"goalStatusDate\" [matDatepicker]=\"goalStatusDate\" placeholder=\"Choose a date\" [(ngModel)]=\"editSafetyPlan.startDate\" required>\r\n <mat-datepicker-toggle matSuffix [for]=\"goalStatusDate\"></mat-datepicker-toggle>\r\n <mat-datepicker #goalStatusDate></mat-datepicker>\r\n </div>\r\n </div>\r\n\r\n <div class='row' >\r\n <div class='col-md-5 desc-label'><b>Comment:</b></div>\r\n <div class='col-md-7'>\r\n <textarea mdInput placeholder=\"\" rows=\"10\" cols=\"50\" name=\"comment\" [(ngModel)]=\"editSafetyPlan.comment\"></textarea>\r\n </div>\r\n </div> -->\r\n\r\n\r\n <div class='row' >\r\n <div class='col-md-12 text-center'>\r\n <!-- <button type=\"button\" class=\"btn btn-default btn-small\" (click)=\"print()\">Print</button> -->\r\n <button mat-stroked-button color=\"primary\" (click)=\"saveSafetyPlan()\" [disabled]=\"!spForm.valid\">Save</button>\r\n <!-- &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"commondialogRef.close()\">Cancel</button> -->\r\n &nbsp;&nbsp;<button mat-stroked-button color=\"primary\" (click)=\"back()\">Back</button>\r\n </div>\r\n </div>\r\n\r\n <!--status hisotry-->\r\n\r\n <mat-table #table [dataSource]=\"victimServiceStatusHistoriesDataSource\" class=\"example-table\">\r\n <ng-container matColumnDef=\"startDate\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Start Date</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.startDate | date}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"victimServiceStatusId\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Status</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.victimServiceStatusId}} </mat-cell>\r\n </ng-container>\r\n\r\n\r\n <ng-container matColumnDef=\"comment\">\r\n <mat-header-cell *matHeaderCellDef class=\"example-header-cell\">Comment</mat-header-cell>\r\n <mat-cell *matCellDef=\"let row\" class=\"example-cell\"> {{row.comment}} </mat-cell>\r\n </ng-container>\r\n <mat-header-row *matHeaderRowDef=\"[ 'startDate', 'victimServiceStatusId', 'comment']\" class=\"example-header-row\"></mat-header-row>\r\n <mat-row *matRowDef=\"let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];\" class=\"example-row\"></mat-row>\r\n </mat-table>\r\n\r\n\r\n\r\n\r\n</mat-card-content>\r\n</mat-card>\r\n", styles: ["div.serviceSelect{width:500px}div.serviceButton{width:20%}.container{margin:16px;display:grid;grid-template-columns:repeat(2,1fr);grid-gap:10px;grid-auto-rows:minmax(50px,auto);justify-items:stretch}.app-class .mat-mdc-list-item{height:auto}.textarea-content{width:500px}\n"] }]
3147
- }], ctorParameters: () => [{ type: i1$1.MatDialog }, { type: NgcSmartVictimService }, { type: i1.HttpClient }, { type: i4.MatSnackBar }, { type: i5.ActivatedRoute }, { type: i5.Router }, { type: CommonDialogService }, { type: i1$2.UntypedFormBuilder }] });
3148
-
3149
- const routes = [
3150
- //{path: 'casenote/:victimId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
3151
- { path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent, pathMatch: 'full', canActivate: [MsalGuard], resolve: { loginStaff: LoginStaffResolverService } },
3152
- { path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3153
- { path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent, pathMatch: 'full', resolve: { loginStaff: LoginStaffResolverService } },
3154
- { path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3155
- { path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3156
- { path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3157
- { path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService } },
3158
- { path: 'smart-error', component: SmartErrorComponent }
3159
- ];
3160
- class VictimRoutingModule {
3161
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3162
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, imports: [i5.RouterModule], exports: [RouterModule] }); }
3163
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, imports: [RouterModule.forChild(routes), RouterModule] }); }
3164
- }
3165
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: VictimRoutingModule, decorators: [{
3166
- type: NgModule,
3167
- args: [{
3168
- imports: [
3169
- RouterModule.forChild(routes)
3170
- ],
3171
- exports: [
3172
- RouterModule
3173
- ]
3174
- }]
3175
- }] });
3176
-
3177
- const COMPONENTS = [
3178
- NgcSmartVictimComponent,
3179
- SmartVictimDetailComponent,
3180
- SmartVictimDeleteConfirmComponent,
3181
- ];
3182
- const ENTRY_COMPONENTS = [
3183
- SmartVictimDeleteConfirmComponent,
3184
- ];
3185
- const BASE_MODULES = [
3186
- CommonModule,
3187
- ReactiveFormsModule
3188
- ];
3189
- const CORE_MODULES = [NgcSmartCoreModule, SmartAddressModule, SmartUiModule,];
3190
- const MATERIAL_MODULES = [
3191
- MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3192
- MatCardModule, MatSlideToggleModule,
3193
- MatListModule, MatIconModule, MatButtonToggleModule,
3194
- MatToolbarModule, MatTabsModule, MatExpansionModule,
3195
- MatMenuModule, MatInputModule, MatProgressBarModule,
3196
- MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3197
- MatDialogModule, MatSidenavModule, MatSelectModule,
3198
- MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule,
3199
- ];
3200
- class NgcSmartVictimModule {
3201
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
3202
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, declarations: [NgcSmartVictimComponent,
3203
- SmartVictimDetailComponent,
3204
- SmartVictimDeleteConfirmComponent, CaseNoteComponent,
3205
- ContactComponent,
3206
- VictimSafetyPlanComponent,
3207
- VictimSafetyPlanDetailComponent,
3208
- VictimSearchFormComponent,
3209
- SeriveProviderComponent], imports: [CommonModule,
3210
- ReactiveFormsModule, MatButtonModule, MatCheckboxModule, MatRadioModule, MatSliderModule,
3211
- MatCardModule, MatSlideToggleModule,
3212
- MatListModule, MatIconModule, MatButtonToggleModule,
3213
- MatToolbarModule, MatTabsModule, MatExpansionModule,
3214
- MatMenuModule, MatInputModule, MatProgressBarModule,
3215
- MatDatepickerModule, MatNativeDateModule, MatPaginatorModule,
3216
- MatDialogModule, MatSidenavModule, MatSelectModule,
3217
- MatTableModule, MatSortModule, MatGridListModule, CdkTableModule, LayoutModule, NgcSmartCoreModule, SmartAddressModule, SmartUiModule, CommonDialogModule,
3218
- FormsModule,
3219
- VictimRoutingModule,
3220
- ApolloModule], exports: [NgcSmartVictimComponent,
3221
- SmartVictimDetailComponent,
3222
- SmartVictimDeleteConfirmComponent, ApolloModule] }); }
3223
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, providers: [NgcSmartVictimService], imports: [BASE_MODULES, MATERIAL_MODULES, CORE_MODULES, CommonDialogModule,
3224
- FormsModule,
3225
- VictimRoutingModule,
3226
- ApolloModule, ApolloModule] }); }
3227
- }
3228
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.1.0", ngImport: i0, type: NgcSmartVictimModule, decorators: [{
3229
- type: NgModule,
3230
- args: [{
3231
- declarations: [...COMPONENTS,
3232
- CaseNoteComponent,
3233
- ContactComponent,
3234
- VictimSafetyPlanComponent,
3235
- VictimSafetyPlanDetailComponent,
3236
- VictimSearchFormComponent,
3237
- SeriveProviderComponent
3238
- ],
3239
- imports: [
3240
- ...BASE_MODULES,
3241
- ...MATERIAL_MODULES,
3242
- ...CORE_MODULES,
3243
- CommonDialogModule,
3244
- FormsModule,
3245
- VictimRoutingModule,
3246
- ApolloModule,
3247
- //SharedModule
3248
- ],
3249
- exports: [...COMPONENTS, ApolloModule],
3250
- providers: [NgcSmartVictimService]
3251
- }]
3252
- }] });
3253
-
3254
- /*
3255
- * Public API Surface of ngc-smart-victim
3256
- */
3257
-
3258
- /**
3259
- * Generated bundle index. Do not edit.
3260
- */
3261
-
3262
- export { CaseNoteComponent, NgcSmartVictimComponent, NgcSmartVictimModule, NgcSmartVictimService, SMART_LOOKUP_SERVICE_URL, SMART_OFFENDER_SERVICE_URL, SMART_VICTIM_SERVICE_URL, SMART_WARRANT_URL, SmartVictimDeleteConfirmComponent, SmartVictimDetailComponent, Victim, VictimAdvocate, VictimDrugUse, VictimGuardian, VictimListFilter$1 as VictimListFilter, VictimSupport, VictimWeaponUse, conditionalValidator, stringConditionalValidator };
3263
- //# sourceMappingURL=csmart-ngc-smart-victim.mjs.map