@csmart/ngc-smart-victim 0.1.5 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. package/karma.conf.js +32 -0
  2. package/ng-package.json +7 -0
  3. package/package.json +13 -26
  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 +248 -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 +25 -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/intake.service.ts +82 -0
  17. package/src/lib/safetyPlan/serviceProvider.component.ts +94 -0
  18. package/src/lib/safetyPlan/victimSafetyPlan.component.css +27 -0
  19. package/src/lib/safetyPlan/victimSafetyPlan.component.html +85 -0
  20. package/src/lib/safetyPlan/victimSafetyPlan.component.ts +178 -0
  21. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +234 -0
  22. package/src/lib/safetyPlan/victimSafetyPlanDetail.component.ts +492 -0
  23. package/src/lib/shared/app.shared.module.ts +118 -0
  24. package/src/lib/shared/directives/phone-mask.directive.ts +41 -0
  25. package/src/lib/shared/validators/date.validator.ts +73 -0
  26. package/src/lib/shared/validators/index.ts +1 -0
  27. package/src/lib/smart-victim-delete-confirm.component.ts +35 -0
  28. package/src/lib/smart-victim-detail/smart-victim-detail.component.css +43 -0
  29. package/src/lib/smart-victim-detail/smart-victim-detail.component.html +860 -0
  30. package/src/lib/smart-victim-detail/smart-victim-detail.component.spec.ts +25 -0
  31. package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +1241 -0
  32. package/src/lib/smart-victim.component.css +192 -0
  33. package/src/lib/smart-victim.component.html +133 -0
  34. package/src/lib/smart-victim.component.spec.ts +25 -0
  35. package/src/lib/smart-victim.component.ts +323 -0
  36. package/src/lib/smart-victim.model.ts +301 -0
  37. package/src/lib/smart-victim.module.ts +116 -0
  38. package/src/lib/smart-victim.service.spec.ts +12 -0
  39. package/src/lib/smart-victim.service.ts +563 -0
  40. package/src/lib/victim-routing.module.ts +34 -0
  41. package/{lib/victimSearch/VictimSearchFilter.d.ts → src/lib/victimSearch/VictimSearchFilter.ts} +4 -2
  42. package/src/lib/victimSearch/victimSearchForm.component.html +35 -0
  43. package/src/lib/victimSearch/victimSearchForm.component.ts +41 -0
  44. package/src/public-api.ts +12 -0
  45. package/src/test.ts +22 -0
  46. package/tsconfig.lib.json +37 -0
  47. package/tsconfig.spec.json +17 -0
  48. package/tslint.json +17 -0
  49. package/bundles/csmart-ngc-smart-victim.umd.js +0 -6426
  50. package/bundles/csmart-ngc-smart-victim.umd.js.map +0 -1
  51. package/bundles/csmart-ngc-smart-victim.umd.min.js +0 -16
  52. package/bundles/csmart-ngc-smart-victim.umd.min.js.map +0 -1
  53. package/csmart-ngc-smart-victim.d.ts +0 -19
  54. package/csmart-ngc-smart-victim.metadata.json +0 -1
  55. package/esm2015/csmart-ngc-smart-victim.js +0 -25
  56. package/esm2015/lib/caseNote/caseNote.component.js +0 -349
  57. package/esm2015/lib/common-dialog/common-dialog.component.js +0 -46
  58. package/esm2015/lib/common-dialog/common-dialog.module.js +0 -32
  59. package/esm2015/lib/common-dialog/common-dialog.service.js +0 -63
  60. package/esm2015/lib/contact/contact.component.js +0 -228
  61. package/esm2015/lib/intake.service.js +0 -183
  62. package/esm2015/lib/safetyPlan/serviceProvider.component.js +0 -130
  63. package/esm2015/lib/safetyPlan/victimSafetyPlan.component.js +0 -257
  64. package/esm2015/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -556
  65. package/esm2015/lib/shared/app.shared.module.js +0 -81
  66. package/esm2015/lib/shared/directives/phone-mask.directive.js +0 -168
  67. package/esm2015/lib/shared/validators/date.validator.js +0 -108
  68. package/esm2015/lib/shared/validators/index.js +0 -7
  69. package/esm2015/lib/smart-victim-delete-confirm.component.js +0 -61
  70. package/esm2015/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1405
  71. package/esm2015/lib/smart-victim.component.js +0 -476
  72. package/esm2015/lib/smart-victim.model.js +0 -631
  73. package/esm2015/lib/smart-victim.module.js +0 -84
  74. package/esm2015/lib/smart-victim.service.js +0 -792
  75. package/esm2015/lib/victim-routing.module.js +0 -40
  76. package/esm2015/lib/victimSearch/VictimSearchFilter.js +0 -20
  77. package/esm2015/lib/victimSearch/victimSearchForm.component.js +0 -59
  78. package/esm2015/public-api.js +0 -13
  79. package/esm5/csmart-ngc-smart-victim.js +0 -25
  80. package/esm5/lib/caseNote/caseNote.component.js +0 -372
  81. package/esm5/lib/common-dialog/common-dialog.component.js +0 -48
  82. package/esm5/lib/common-dialog/common-dialog.module.js +0 -36
  83. package/esm5/lib/common-dialog/common-dialog.service.js +0 -75
  84. package/esm5/lib/contact/contact.component.js +0 -281
  85. package/esm5/lib/intake.service.js +0 -194
  86. package/esm5/lib/safetyPlan/serviceProvider.component.js +0 -99
  87. package/esm5/lib/safetyPlan/victimSafetyPlan.component.js +0 -306
  88. package/esm5/lib/safetyPlan/victimSafetyPlanDetail.component.js +0 -628
  89. package/esm5/lib/shared/app.shared.module.js +0 -85
  90. package/esm5/lib/shared/directives/phone-mask.directive.js +0 -184
  91. package/esm5/lib/shared/validators/date.validator.js +0 -108
  92. package/esm5/lib/shared/validators/index.js +0 -7
  93. package/esm5/lib/smart-victim-delete-confirm.component.js +0 -51
  94. package/esm5/lib/smart-victim-detail/smart-victim-detail.component.js +0 -1497
  95. package/esm5/lib/smart-victim.component.js +0 -528
  96. package/esm5/lib/smart-victim.model.js +0 -541
  97. package/esm5/lib/smart-victim.module.js +0 -84
  98. package/esm5/lib/smart-victim.service.js +0 -1063
  99. package/esm5/lib/victim-routing.module.js +0 -44
  100. package/esm5/lib/victimSearch/VictimSearchFilter.js +0 -24
  101. package/esm5/lib/victimSearch/victimSearchForm.component.js +0 -70
  102. package/esm5/public-api.js +0 -13
  103. package/fesm2015/csmart-ngc-smart-victim.js +0 -5682
  104. package/fesm2015/csmart-ngc-smart-victim.js.map +0 -1
  105. package/fesm5/csmart-ngc-smart-victim.js +0 -6203
  106. package/fesm5/csmart-ngc-smart-victim.js.map +0 -1
  107. package/lib/caseNote/caseNote.component.d.ts +0 -45
  108. package/lib/common-dialog/common-dialog.component.d.ts +0 -11
  109. package/lib/common-dialog/common-dialog.module.d.ts +0 -2
  110. package/lib/common-dialog/common-dialog.service.d.ts +0 -8
  111. package/lib/contact/contact.component.d.ts +0 -37
  112. package/lib/intake.service.d.ts +0 -54
  113. package/lib/safetyPlan/serviceProvider.component.d.ts +0 -16
  114. package/lib/safetyPlan/victimSafetyPlan.component.d.ts +0 -49
  115. package/lib/safetyPlan/victimSafetyPlanDetail.component.d.ts +0 -57
  116. package/lib/shared/app.shared.module.d.ts +0 -2
  117. package/lib/shared/directives/phone-mask.directive.d.ts +0 -14
  118. package/lib/shared/validators/date.validator.d.ts +0 -9
  119. package/lib/shared/validators/index.d.ts +0 -1
  120. package/lib/smart-victim-delete-confirm.component.d.ts +0 -9
  121. package/lib/smart-victim-detail/smart-victim-detail.component.d.ts +0 -109
  122. package/lib/smart-victim.component.d.ts +0 -63
  123. package/lib/smart-victim.model.d.ts +0 -204
  124. package/lib/smart-victim.module.d.ts +0 -2
  125. package/lib/smart-victim.service.d.ts +0 -67
  126. package/lib/victim-routing.module.d.ts +0 -2
  127. package/lib/victimSearch/victimSearchForm.component.d.ts +0 -11
  128. package/public-api.d.ts +0 -4
@@ -0,0 +1,860 @@
1
+ <mat-card>
2
+ <mat-card-content>
3
+
4
+ <div [formGroup]="victimForm">
5
+
6
+ <mat-tab-group dynamicHeight mat-stretch-tabs>
7
+ <mat-tab label="Victim Detail" >
8
+ <div class='container'>
9
+
10
+ <mat-form-field>
11
+ <mat-label>Is victim a minor?<font color="red">* </font></mat-label>
12
+ <br>
13
+ <mat-radio-group formControlName="minorFlag" (change)="radioMinorChange($event)" [(ngModel)]="editVictim.minorFlag" >
14
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
15
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
16
+ </mat-radio-group>
17
+ <input matInput placeholder="" style="display: none">
18
+ <div class="help-block" *ngIf="victimForm.get('minorFlag').errors
19
+ && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)">
20
+ <mat-error>If victim a minor field is <strong>required</strong></mat-error>
21
+ </div>
22
+
23
+ </mat-form-field>
24
+
25
+ <mat-form-field>
26
+ <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>
27
+ <br>
28
+ <br>
29
+ <mat-radio-group class = "tp-radio-group" formControlName="victimAdvocateFlag" (change)="radioAdvocateChange($event)" [(ngModel)]="editVictim.victimAdvocateFlag">
30
+ <mat-radio-button color="primary" *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId">{{item.name}} </mat-radio-button>&nbsp;
31
+ </mat-radio-group>
32
+ <input matInput placeholder="" style="display: none">
33
+ <div class="help-block" *ngIf="victimForm.get('victimAdvocateFlag').errors
34
+ && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)">
35
+ <mat-error>If victim has advocate field is <strong>required</strong></mat-error>
36
+ </div>
37
+ </mat-form-field>
38
+
39
+
40
+ <mat-form-field>
41
+ <mat-label>Victim Currently Under Supervision:</mat-label>
42
+ <mat-select formControlName="underSupervisionFlag" name="supervision" [(ngModel)]="editVictim.underSupervisionFlag" >
43
+ <mat-option *ngFor="let item of flagOption" [value]="item.flagOptionYesNoUnknownId" >
44
+ {{item.name}}</mat-option>
45
+ </mat-select>
46
+ <div class="help-block" *ngIf="victimForm.get('underSupervisionFlag').errors
47
+ && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)">
48
+ <mat-error>under supervision field is <strong>required</strong></mat-error>
49
+ </div>
50
+ </mat-form-field>
51
+
52
+
53
+ <mat-form-field>
54
+ <mat-label>Relationship to Offender:</mat-label>
55
+ <mat-select formControlName="victimOffenderRelationshipTypeId" [(ngModel)]="editVictim.victimOffenderRelationshipTypeId" >
56
+ <mat-option *ngFor="let item of relationshipTypes" [value]="item.relationshipTypeId">{{item.name}}</mat-option>
57
+ </mat-select>
58
+ <div class="help-block" *ngIf="victimForm.get('victimOffenderRelationshipTypeId').errors
59
+ && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)">
60
+ <mat-error>relationship is <strong>required</strong></mat-error>
61
+ </div>
62
+ </mat-form-field>
63
+
64
+
65
+ <mat-form-field>
66
+ <mat-label>Victim Last Name:</mat-label>
67
+ <input matInput formControlName="lastName" [(ngModel)]="editVictim.lastName" >
68
+ <div class="help-block" *ngIf="victimForm.get('lastName').errors
69
+ && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)">
70
+ <mat-error>victim last name is <strong>required</strong></mat-error>
71
+ </div>
72
+ </mat-form-field>
73
+
74
+ <mat-form-field>
75
+ <mat-label>Victim First Name: </mat-label>
76
+ <input matInput formControlName="firstName" [(ngModel)]="editVictim.firstName" >
77
+ <div class="help-block" *ngIf="victimForm.get('firstName').errors
78
+ && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)">
79
+ <mat-error>victim first name is <strong>required</strong></mat-error>
80
+ </div>
81
+ </mat-form-field>
82
+
83
+ <mat-form-field>
84
+ <mat-label>Victim Middle Name:</mat-label>
85
+ <input matInput formControlName="middleName" [(ngModel)]="editVictim.middleName">
86
+ </mat-form-field>
87
+
88
+ <mat-form-field>
89
+ <mat-label>Victim Prefix:</mat-label>
90
+ <mat-select formControlName="prefixId" [(ngModel)]="editVictim.prefixId">
91
+ <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>
92
+ </mat-select>
93
+ </mat-form-field>
94
+
95
+ <mat-form-field>
96
+ <mat-label>Victim Suffix:</mat-label>
97
+ <mat-select formControlName="suffixId" [(ngModel)]="editVictim.suffixId">
98
+ <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>
99
+ </mat-select>
100
+ </mat-form-field>
101
+
102
+ <mat-form-field>
103
+ <mat-label>Victim Gender:</mat-label>
104
+ <mat-select formControlName="genderCode" [(ngModel)]="editVictim.genderCode">
105
+ <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>
106
+ </mat-select>
107
+ </mat-form-field>
108
+
109
+ <mat-form-field>
110
+ <mat-label>Date of Birth:</mat-label>
111
+ <input matInput
112
+ [matDatepicker]="victimBirthRef"
113
+ formControlName="birthDate"
114
+ [(ngModel)]="editVictim.birthDate"
115
+ (click)="victimBirthRef.open()"
116
+ (dateChange)="handleDOBChange($event)"
117
+ >
118
+ <mat-datepicker-toggle [for]="victimBirthRef" matSuffix></mat-datepicker-toggle>
119
+ <mat-datepicker #victimBirthRef></mat-datepicker>
120
+ </mat-form-field>
121
+
122
+ <mat-form-field>
123
+ <mat-label>Victim Home Phone:</mat-label>
124
+ <input
125
+ matInput
126
+ formControlName="homePhone"
127
+ [(ngModel)]="editVictim.homePhone"
128
+ appPhoneMask
129
+ maxlength="14"/>
130
+
131
+
132
+ <div class="help-block" *ngIf="victimForm.get('homePhone').errors
133
+ && (victimForm.get('homePhone').dirty || victimForm.get('homePhone').touched)">
134
+
135
+
136
+ <mat-error><strong>Home phone number format is not correct.</strong></mat-error>
137
+ </div>
138
+ </mat-form-field>
139
+
140
+ <mat-form-field >
141
+ <mat-label>Victim Cell Phone:</mat-label>
142
+ <input
143
+ matInput
144
+ formControlName="cellPhone"
145
+ appPhoneMask
146
+ [(ngModel)]="editVictim.cellPhone" >
147
+ <div class="help-block" *ngIf="victimForm.get('cellPhone').errors
148
+ && (victimForm.get('cellPhone').dirty || victimForm.get('cellPhone').touched)">
149
+ <mat-error><strong>Cell phone number format is not correct.</strong></mat-error>
150
+ </div>
151
+ </mat-form-field>
152
+
153
+
154
+ <mat-form-field >
155
+ <mat-label>Victim Work Phone:</mat-label>
156
+ <input matInput
157
+ formControlName="workPhone"
158
+ [(ngModel)]="editVictim.workPhone"
159
+ appPhoneMask
160
+ >
161
+ <div class="help-block" *ngIf="victimForm.get('workPhone').errors
162
+ && (victimForm.get('workPhone').dirty || victimForm.get('workPhone').touched)">
163
+ <mat-error><strong>Work phone number format is not correct.</strong></mat-error>
164
+ </div>
165
+ </mat-form-field>
166
+
167
+ <mat-form-field >
168
+ <mat-label>Victim Email:</mat-label>
169
+ <input matInput formControlName="email" [(ngModel)]="editVictim.email" >
170
+ <div class="help-block" *ngIf="victimForm.get('email').errors
171
+ && (victimForm.get('email').dirty || victimForm.get('email').touched)">
172
+ <mat-error><strong>victim email format is not correct.</strong></mat-error>
173
+ </div>
174
+ </mat-form-field>
175
+
176
+ <div></div>
177
+
178
+ <!-- <app-smart-address
179
+ [showPsa]="true"
180
+ [modifiedBy]="staffId"
181
+ [id]="addressId"
182
+ (addressIdChange)="onAddressChange($event)"
183
+ [outline]="true"
184
+ readonly="false"
185
+ [rowHeight]="80"
186
+ (isValid)="false"
187
+ [addressValidators]="addressValidators"
188
+ #addressComponent
189
+ > -->
190
+
191
+
192
+ <app-smart-address
193
+ [modifiedBy]="staffId"
194
+ [id]="addressId"
195
+ [outline]="true"
196
+ [showPsa]="true"
197
+ [addressValidators]="addressValidators"
198
+ [readonly]="false"
199
+ (addressIdChange)="onAddressChange($event)"
200
+ #addressComponent
201
+ >
202
+
203
+ </app-smart-address>
204
+
205
+
206
+ <!-- Docket:
207
+ <div>
208
+ <div *ngFor="let docket of docketlist; let i=index">
209
+ <mat-checkbox >{{docket.docketNumber}}</mat-checkbox>
210
+ </div>
211
+ </div> -->
212
+ <div>
213
+ <mat-checkbox color="primary" formControlName="liveWithOffenderFlag" name="liveWithOffenderFlag" [(ngModel)]="editVictim.liveWithOffenderFlag" (change)="showAddress($event)" >victim live with offender</mat-checkbox>
214
+ <br>
215
+ <mat-checkbox color="primary" formControlName="allowCsosaContactFlag" name="allowCsosaContactFlag" [(ngModel)]="editVictim.allowCsosaContactFlag">victim wants to be contacted by CSOSA</mat-checkbox>
216
+ </div>
217
+
218
+ </div>
219
+
220
+ <mat-card>
221
+ <mat-form-field>
222
+ <mat-label> Children in Common</mat-label>
223
+ <br>
224
+ <mat-radio-group formControlName="commonChildrenFlag" [(ngModel)]="editVictim.commonChildrenFlag" (change)="radioCicChange($event)">
225
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
226
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
227
+ </mat-radio-group>
228
+ <input matInput placeholder="" style="display: none">
229
+ </mat-form-field>
230
+
231
+ <div *ngIf="commonChildrenDivFlag">
232
+
233
+ <mat-form-field >
234
+ <mat-label>
235
+ Children number
236
+ </mat-label>
237
+ <input matInput formControlName="commonChildrenNumber" [(ngModel)]="editVictim.commonChildrenNumber" >
238
+ </mat-form-field>
239
+
240
+ </div>
241
+
242
+ <mat-form-field>
243
+ <mat-label>CPO: </mat-label>
244
+ <br>
245
+ <mat-radio-group formControlName="cpoExpirationFlag" [(ngModel)]="editVictim.cpoExpirationFlag" (change)="radioCpoChange($event)">
246
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
247
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
248
+ </mat-radio-group>
249
+ <input matInput placeholder="" style="display: none">
250
+ </mat-form-field>
251
+
252
+ <div *ngIf="cpoExpirationDivFlag">
253
+ <mat-form-field>
254
+ <mat-label>Expiration Date: </mat-label>
255
+ <input matInput
256
+ [matDatepicker]="cpoDateRef"
257
+ formControlName="cpoExpirationDate"
258
+ (click)="cpoDateRef.open()"
259
+ [(ngModel)]="editVictim.cpoExpirationDate" >
260
+ <mat-datepicker-toggle [for]="cpoDateRef" matSuffix></mat-datepicker-toggle>
261
+ <mat-datepicker #cpoDateRef></mat-datepicker>
262
+ </mat-form-field>
263
+
264
+ </div>
265
+
266
+ <br>
267
+ <br>
268
+
269
+ <mat-form-field>
270
+ <mat-label>Victim has a Support System in Place? </mat-label>
271
+ <br>
272
+ <mat-radio-group formControlName="supportInPlaceFlag" [(ngModel)]="editVictim.supportInPlaceFlag" (change)="radioSupportChange($event)">
273
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
274
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
275
+ </mat-radio-group>
276
+ <input matInput placeholder="" style="display: none">
277
+ </mat-form-field>
278
+
279
+ <div *ngIf="supportInPlaceDivFlag">
280
+ <mat-form-field>
281
+ <mat-label>Support type? </mat-label>
282
+ <mat-select #supportSel formControlName="victimSupports" [(ngModel)]="editVictim.victimSupports" multiple>
283
+ <div (mouseleave)="supportSel.close()">
284
+ <mat-option color="primary" *ngFor="let item of victimSupportTypes" [value]="item.victimSupportTypeId">
285
+ {{item.name}}
286
+ </mat-option>
287
+ </div>
288
+ </mat-select>
289
+ <input matInput placeholder="" style="display: none">
290
+ </mat-form-field>
291
+
292
+ </div>
293
+
294
+ <br>
295
+ <br>
296
+
297
+ <mat-form-field>
298
+ <mat-label>Weapons Involved?</mat-label>
299
+ <br>
300
+ <mat-radio-group formControlName="weaponInvolvedFlag" (change)="radioWeaponChange($event)" [(ngModel)]="editVictim.weaponInvolvedFlag" >
301
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
302
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
303
+ </mat-radio-group>
304
+ <input matInput placeholder="" style="display: none">
305
+ </mat-form-field>
306
+
307
+
308
+ <div *ngIf="weaponInvolvedDivFlag">
309
+ <mat-form-field>
310
+ <mat-label>Weapon Type</mat-label>
311
+ <mat-select #weaponSel formControlName="victimWeaponUses" multiple [(ngModel)]="editVictim.victimWeaponUses" (selectionChange)="checkOtherWeapon($event.value)" >
312
+ <div (mouseleave)="weaponSel.close()">
313
+ <mat-option color="primary" *ngFor="let item of weaponTypes" [value]="item.weaponTypeId">
314
+ {{item.name}}
315
+ </mat-option>
316
+ </div>
317
+ </mat-select>
318
+ <input matInput placeholder="" style="display: none">
319
+ </mat-form-field>
320
+ </div>
321
+
322
+ <div *ngIf="otherWeaponFlag">
323
+ <mat-form-field>
324
+ <mat-label>Other Weapon:* </mat-label>
325
+ <input matInput formControlName="otherWeapon" >
326
+ </mat-form-field>
327
+ <div class="help-block" *ngIf="victimForm.get('otherWeapon').errors
328
+ && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)">
329
+ <mat-error><strong>Other weapon is required.</strong></mat-error>
330
+ </div>
331
+ </div>
332
+
333
+
334
+ <br>
335
+ <br>
336
+
337
+ <mat-form-field>
338
+ <mat-label>Was Offender under the influence of alcohol at the time of the offense?</mat-label>
339
+ <br>
340
+ <mat-radio-group formControlName="alcoholUseFlag" [(ngModel)]="editVictim.alcoholUseFlag" >
341
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
342
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
343
+ </mat-radio-group>
344
+ <input matInput placeholder="" style="display: none">
345
+ </mat-form-field>
346
+
347
+ <br>
348
+ <br>
349
+
350
+ <mat-form-field>
351
+ <mat-label>Was Offender under the influence of drugs at the time of the offense?</mat-label>
352
+ <br>
353
+ <mat-radio-group formControlName="drugUseFlag" (change)="radioDrugChange($event)" [(ngModel)]="editVictim.drugUseFlag" >
354
+ <mat-radio-button color="primary" [value]="true">Yes</mat-radio-button>&nbsp;
355
+ <mat-radio-button color="primary" [value]="false">No</mat-radio-button>
356
+ </mat-radio-group>
357
+ <input matInput placeholder="" style="display: none">
358
+ </mat-form-field>
359
+
360
+ <div *ngIf="drugUseDivFlag">
361
+ <mat-form-field>
362
+ <mat-label>Drug:</mat-label>
363
+ <mat-select #drugSel formControlName="victimDrugUses" multiple (selectionChange)="checkOtherDrug($event.value)" >
364
+ <div (mouseleave)="drugSel.close()">
365
+ <mat-option color="primary" *ngFor="let item of drugs" [value]="item.drugTypeId">
366
+ {{item.name}}
367
+ </mat-option>
368
+
369
+ </div>
370
+ </mat-select>
371
+ <input matInput placeholder="" style="display: none">
372
+ </mat-form-field>
373
+
374
+ </div>
375
+
376
+ <div *ngIf="otherDrugFlag">
377
+ <mat-form-field>
378
+ <mat-label>Other Drug:* </mat-label>
379
+ <input matInput formControlName="otherDrug" >
380
+ </mat-form-field>
381
+ <div class="help-block" *ngIf="victimForm.get('otherDrug').errors
382
+ && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)">
383
+ <mat-error><strong>Other drug is required.</strong></mat-error>
384
+ </div>
385
+ </div>
386
+ <br>
387
+ <br>
388
+
389
+ <div>
390
+ <div>
391
+ <mat-label>
392
+ Access Risk: 1 thru 10 (10 greatest risk): &nbsp;<b> {{editVictim.accessRisk}}</b>
393
+ </mat-label>
394
+ </div>
395
+ <div>
396
+
397
+ <mat-slider
398
+ formControlName="accessRisk"
399
+ thumbLabel="true"
400
+ [displayWith]="formatLabel"
401
+ min="1"
402
+ max="10"
403
+ [(ngModel)]="editVictim.accessRisk"
404
+ ></mat-slider>
405
+
406
+ </div>
407
+
408
+ </div>
409
+
410
+ </mat-card>
411
+
412
+
413
+ <br><br><br>
414
+ </mat-tab>
415
+
416
+ <mat-tab *ngIf="guardianTabFlag" label="Legal Guardian">
417
+ <div class='container'>
418
+ <mat-form-field>
419
+ <mat-label>Guardian Last Name:</mat-label>
420
+ <input matInput formControlName="guardianLastName" [(ngModel)]="editVictim.guardianLastName" >
421
+ <!-- <div class="help-block" *ngIf="victimForm.get('guardianLastName').errors ">
422
+ <mat-error>Guardian last name is <strong>required</strong></mat-error>
423
+ </div> -->
424
+ </mat-form-field>
425
+
426
+ <mat-form-field>
427
+ <mat-label>Guardian First Name:</mat-label>
428
+ <input matInput formControlName="guardianFirstName" [(ngModel)]="editVictim.guardianFirstName" >
429
+ <!-- <div class="help-block" *ngIf="victimForm.get('guardianFirstName').errors ">
430
+ <mat-error>Guardian first name is <strong>required</strong></mat-error>
431
+ </div> -->
432
+
433
+ </mat-form-field>
434
+
435
+ <mat-form-field>
436
+ <mat-label>Guardian Prefix:</mat-label>
437
+ <mat-select formControlName="guardianPrefixId" [(ngModel)]="editVictim.guardianPrefixId" >
438
+ <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>
439
+ </mat-select>
440
+ </mat-form-field>
441
+
442
+ <mat-form-field>
443
+ <mat-label>Guardian Suffix:</mat-label>
444
+ <mat-select formControlName="guardianSuffixId" [(ngModel)]="editVictim.guardianSuffixId" >
445
+ <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>
446
+ </mat-select>
447
+ </mat-form-field>
448
+
449
+
450
+ <!-- <mat-form-field>
451
+ <mat-select placeholder="Choose" formControlName="guardianGender" [(ngModel)]="editVictim.guardianGender">
452
+ <mat-option *ngFor="let item of genders" [value]="item.genderCode">{{item.name}}</mat-option>
453
+ </mat-select>
454
+ </mat-form-field> -->
455
+
456
+
457
+ <mat-form-field>
458
+ <mat-label>Date of Birth:</mat-label>
459
+ <input matInput
460
+ [matDatepicker]="guardianDateRef"
461
+ formControlName="guardianBirthDate"
462
+ [(ngModel)]="editVictim.guardianBirthDate"
463
+ (click)="guardianDateRef.open()"
464
+ >
465
+ <mat-datepicker-toggle [for]="guardianDateRef" matSuffix></mat-datepicker-toggle>
466
+ <mat-datepicker #guardianDateRef></mat-datepicker>
467
+ </mat-form-field>
468
+
469
+ <div></div>
470
+ <mat-form-field >
471
+ <mat-checkbox
472
+ color = "primary"
473
+ formControlName="guardianNoPhoneFlag"
474
+
475
+ >
476
+ No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>
477
+ <input matInput placeholder="" style="display: none;">
478
+ </mat-form-field>
479
+
480
+
481
+ <div></div>
482
+ <mat-card>
483
+ <mat-form-field >
484
+ <mat-label>Guardian Home Phone:</mat-label>
485
+ <input matInput
486
+ formControlName="guardianHomePhone"
487
+ [(ngModel)]="editVictim.guardianHomePhone"
488
+ appPhoneMask
489
+ maxlength="14" >
490
+
491
+ <div class="help-block" *ngIf="victimForm.get('guardianHomePhone').errors
492
+ && (victimForm.get('guardianHomePhone').dirty || victimForm.get('guardianHomePhone').touched)">
493
+ <mat-error><strong>Guardian home phone number format is not correct.</strong></mat-error>
494
+ </div>
495
+
496
+
497
+ </mat-form-field>
498
+
499
+ <mat-form-field >
500
+ <mat-label>Guardian Cell Phone:</mat-label>
501
+ <input matInput
502
+ formControlName="guardianCellPhone"
503
+ [(ngModel)]="editVictim.guardianCellPhone"
504
+ appPhoneMask
505
+ maxlength="14"
506
+ >
507
+
508
+ <div class="help-block" *ngIf="victimForm.get('guardianCellPhone').errors
509
+ && (victimForm.get('guardianCellPhone').dirty || victimForm.get('guardianCellPhone').touched)">
510
+ <mat-error><strong>Guardian Cell phone number format is not correct.</strong></mat-error>
511
+ </div>
512
+
513
+
514
+
515
+
516
+ </mat-form-field>
517
+
518
+ <mat-form-field >
519
+ <mat-label>Guardian Work Phone:</mat-label>
520
+ <input matInput
521
+ formControlName="guardianWorkPhone"
522
+ [(ngModel)]="editVictim.guardianWorkPhone"
523
+ appPhoneMask
524
+ maxlength="14" >
525
+
526
+ <div class="help-block" *ngIf="victimForm.get('guardianWorkPhone').errors
527
+ && (victimForm.get('guardianWorkPhone').dirty || victimForm.get('guardianWorkPhone').touched)">
528
+ <mat-error><strong>Guardian work phone number format is not correct.</strong></mat-error>
529
+ </div>
530
+
531
+
532
+ </mat-form-field>
533
+ </mat-card>
534
+
535
+ <div></div>
536
+
537
+ <mat-form-field>
538
+ <mat-label>Guardian Email:</mat-label>
539
+ <input matInput formControlName="guardianEmail" [(ngModel)]="editVictim.guardianEmail" >
540
+ <div class="help-block" *ngIf="victimForm.get('guardianEmail').errors
541
+ && (victimForm.get('guardianEmail').dirty || victimForm.get('guardianEmail').touched)">
542
+ <mat-error><strong>Guardian email format is not correct.</strong></mat-error>
543
+ </div>
544
+ </mat-form-field>
545
+
546
+ <div></div>
547
+
548
+ <div>
549
+ <app-smart-address
550
+
551
+ [showPsa]="true"
552
+ [modifiedBy]="staffId"
553
+ [id]="guardianAddressId"
554
+ (addressIdChange)="onGuardianAddressChange($event)"
555
+ [outline]="true"
556
+ readonly="false"
557
+ [rowHeight]="80"
558
+ (isValid)="false"
559
+ [addressValidators]="addressValidators"
560
+ #guardianAddressComponent
561
+ >
562
+ </app-smart-address>
563
+ </div>
564
+ </div>
565
+
566
+ <br><br><br>
567
+ </mat-tab>
568
+
569
+ <!--advocate-->
570
+
571
+ <mat-tab *ngIf="advocateTabFlag" label="Advocate" >
572
+ <div class='container'>
573
+
574
+ <mat-form-field>
575
+ <mat-label>Advocate Last Name:</mat-label>
576
+ <input matInput formControlName="advocateLastName" [(ngModel)]="editVictim.advocateLastName" >
577
+ <div class="help-block" *ngIf="victimForm.get('advocateLastName').errors ">
578
+ <mat-error>Advocate last name is <strong>required</strong></mat-error>
579
+ </div>
580
+ </mat-form-field>
581
+
582
+ <mat-form-field>
583
+ <mat-label>Advocate First Name:</mat-label>
584
+ <input matInput formControlName="advocateFirstName" [(ngModel)]="editVictim.advocateFirstName" >
585
+ <div class="help-block" *ngIf="victimForm.get('advocateFirstName').errors ">
586
+ <mat-error>Advocate first name is <strong>required</strong></mat-error>
587
+ </div>
588
+ </mat-form-field>
589
+
590
+ <mat-form-field>
591
+ <mat-label>Advocate Prefix:</mat-label>
592
+ <mat-select formControlName="advocatePrefixId" [(ngModel)]="editVictim.advocatePrefixId" >
593
+ <mat-option *ngFor="let item of prefixes" [value]="item.prefixId">{{item.name}}</mat-option>
594
+ </mat-select>
595
+ </mat-form-field>
596
+
597
+ <mat-form-field>
598
+ <mat-label>Advocate Suffix:</mat-label>
599
+ <mat-select formControlName="advocateSuffixId" [(ngModel)]="editVictim.advocateSuffixId" >
600
+ <mat-option *ngFor="let item of suffixes" [value]="item.suffixId">{{item.name}}</mat-option>
601
+ </mat-select>
602
+ </mat-form-field>
603
+
604
+
605
+ <mat-form-field>
606
+ <mat-checkbox
607
+ color = "primary"
608
+ formControlName="advocateNoPhoneFlag"
609
+
610
+ [(ngModel)]="editVictim.advocateNoPhoneFlag" >
611
+ No Phone (If there is no phone, the phone fields are no longer required)</mat-checkbox>
612
+ <input matInput placeholder="" style="display: none;">
613
+ </mat-form-field>
614
+
615
+ <div></div>
616
+ <mat-card>
617
+ <mat-form-field >
618
+ <mat-label>Advocate Home Phone:</mat-label>
619
+ <input matInput
620
+ formControlName="advocateHomePhone"
621
+ [(ngModel)]="editVictim.advocateHomePhone"
622
+ appPhoneMask
623
+ maxlength="14" >
624
+
625
+ <div class="help-block" *ngIf="victimForm.get('advocateHomePhone').errors
626
+ && (victimForm.get('advocateHomePhone').dirty || victimForm.get('advocateHomePhone').touched)">
627
+ <mat-error><strong>Advocate home number format is not correct.</strong></mat-error>
628
+ </div>
629
+
630
+ </mat-form-field>
631
+
632
+ <mat-form-field>
633
+ <mat-label>Advocate Cell Phone:</mat-label>
634
+ <input matInput
635
+ formControlName="advocateCellPhone"
636
+ [(ngModel)]="editVictim.advocateCellPhone"
637
+ appPhoneMask
638
+ maxlength="14">
639
+
640
+ <div class="help-block" *ngIf="victimForm.get('advocateCellPhone').errors
641
+ && (victimForm.get('advocateCellPhone').dirty || victimForm.get('advocateCellPhone').touched)">
642
+ <mat-error><strong>Advocate cell number format is not correct.</strong></mat-error>
643
+ </div>
644
+
645
+
646
+ </mat-form-field>
647
+
648
+ <mat-form-field>
649
+ <mat-label>Advocate Work Phone:</mat-label>
650
+ <input matInput
651
+ formControlName="advocateWorkPhone"
652
+ [(ngModel)]="editVictim.advocateWorkPhone"
653
+ appPhoneMask
654
+ maxlength="14"
655
+ >
656
+
657
+ <div class="help-block" *ngIf="victimForm.get('advocateWorkPhone').errors
658
+ && (victimForm.get('advocateWorkPhone').dirty || victimForm.get('advocateWorkPhone').touched)">
659
+ <mat-error><strong>Advocate work number format is not correct.</strong></mat-error>
660
+ </div>
661
+
662
+ </mat-form-field>
663
+ </mat-card>
664
+
665
+ <div></div>
666
+
667
+ <mat-form-field>
668
+ <mat-label>Advocate Email:</mat-label>
669
+ <input matInput formControlName="advocateEmail" [(ngModel)]="editVictim.advocateEmail" >
670
+ <div class="help-block" *ngIf="victimForm.get('advocateEmail').errors
671
+ && (victimForm.get('advocateEmail').dirty || victimForm.get('advocateEmail').touched)">
672
+ <mat-error><strong>Advocate email format is not correct.</strong></mat-error>
673
+ </div>
674
+ </mat-form-field>
675
+
676
+ <div></div>
677
+
678
+
679
+ <div >
680
+ <app-smart-address
681
+ [showPsa]="true"
682
+ [modifiedBy]="staffId"
683
+ [id]="advocateAddressId"
684
+ (addressIdChange)="onAdvocateAddressChange($event)"
685
+ [outline]="true"
686
+ readonly="false"
687
+ [rowHeight]="80"
688
+ (isValid)="false"
689
+ [addressValidators]="addressValidators"
690
+ #advocateAddressComponent >
691
+ </app-smart-address>
692
+ </div>
693
+ </div>
694
+ <br><br><br>
695
+ </mat-tab>
696
+
697
+
698
+ <mat-tab label="Emergency Contact">
699
+ <div class='container'>
700
+
701
+ <mat-form-field>
702
+ <mat-label>Emergency Contact Name:</mat-label>
703
+ <input matInput formControlName="emergencyContact" [(ngModel)]="editVictim.emergencyContact" >
704
+ </mat-form-field>
705
+
706
+ <mat-form-field>
707
+ <mat-label>Emergency Phone Number:</mat-label>
708
+ <input matInput
709
+ formControlName="emergencyContactPhone"
710
+ [(ngModel)]="editVictim.emergencyContactPhone"
711
+ appPhoneMask
712
+ >
713
+ <div class="help-block" *ngIf="victimForm.get('emergencyContactPhone').errors
714
+ && (victimForm.get('emergencyContactPhone').dirty || victimForm.get('emergencyContactPhone').touched)">
715
+ <mat-error><strong>Emergency contact number format is not correct.</strong></mat-error>
716
+ </div>
717
+ </mat-form-field>
718
+
719
+ </div>
720
+ <br><br><br>
721
+ </mat-tab>
722
+
723
+ </mat-tab-group>
724
+ <div class='outer'>
725
+ <div>
726
+ 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>
727
+
728
+ <div class="help-block" *ngIf="victimForm.get('minorFlag').errors
729
+ && (victimForm.get('minorFlag').dirty || victimForm.get('minorFlag').touched)">
730
+ <mat-error>If victim a minor field is <strong>required</strong></mat-error>
731
+ </div>
732
+
733
+ <div class="help-block" *ngIf="victimForm.get('victimAdvocateFlag').errors
734
+ && (victimForm.get('victimAdvocateFlag').dirty || victimForm.get('victimAdvocateFlag').touched)">
735
+ <mat-error>If victim has advocate field is <strong>required</strong></mat-error>
736
+ </div>
737
+
738
+ <div class="help-block" *ngIf="victimForm.get('underSupervisionFlag').errors
739
+ && (victimForm.get('underSupervisionFlag').dirty || victimForm.get('underSupervisionFlag').touched)">
740
+ <mat-error>Under supervision field is <strong>required</strong></mat-error>
741
+ </div>
742
+
743
+ <div class="help-block" *ngIf="victimForm.get('victimOffenderRelationshipTypeId').errors
744
+ && (victimForm.get('victimOffenderRelationshipTypeId').dirty || victimForm.get('victimOffenderRelationshipTypeId').touched)">
745
+ <mat-error>Relationship is <strong>required</strong></mat-error>
746
+ </div>
747
+
748
+ <div class="help-block" *ngIf="victimForm.get('lastName').errors
749
+ && (victimForm.get('lastName').dirty || victimForm.get('lastName').touched)">
750
+ <mat-error>Victim last name is <strong>required</strong></mat-error>
751
+ </div>
752
+
753
+ <div class="help-block" *ngIf="victimForm.get('firstName').errors
754
+ && (victimForm.get('firstName').dirty || victimForm.get('firstName').touched)">
755
+ <mat-error>victim first name is <strong>required</strong></mat-error>
756
+ </div>
757
+
758
+ <div class="help-block" *ngIf="victimForm.get('guardianFirstName').errors
759
+ && (victimForm.get('guardianFirstName').dirty || victimForm.get('guardianFirstName').touched)">
760
+ <mat-error>Guardian first name is <strong>required</strong></mat-error>
761
+ </div>
762
+
763
+ <div class="help-block" *ngIf="victimForm.get('guardianLastName').errors
764
+ && (victimForm.get('guardianLastName').dirty || victimForm.get('guardianLastName').touched)" >
765
+ <mat-error>Guardian last name is <strong>required</strong></mat-error>
766
+ </div>
767
+
768
+ <div class="help-block" *ngIf="victimForm.get('advocateLastName').errors
769
+ && (victimForm.get('advocateLastName').dirty || victimForm.get('advocateLastName').touched)" >
770
+ <mat-error>Advocate last name is <strong>required</strong></mat-error>
771
+ </div>
772
+
773
+ <div class="help-block" *ngIf="victimForm.get('advocateFirstName').errors
774
+ && (victimForm.get('advocateFirstName').dirty || victimForm.get('advocateFirstName').touched)">
775
+ <mat-error>Advocate first name is <strong>required</strong></mat-error>
776
+ </div>
777
+
778
+
779
+ <div class="help-block" *ngIf="victimForm.get('otherWeapon').errors
780
+ && (victimForm.get('otherWeapon').dirty || victimForm.get('otherWeapon').touched)">
781
+ <mat-error>Other weapon field is <strong>required</strong></mat-error>
782
+ </div>
783
+
784
+ <div class="help-block" *ngIf="victimForm.get('otherDrug').errors
785
+ && (victimForm.get('otherDrug').dirty || victimForm.get('otherDrug').touched)">
786
+ <mat-error>Other drug field is <strong>required</strong></mat-error>
787
+ </div>
788
+
789
+
790
+ </div>
791
+
792
+ <div class="inner">
793
+ <button mat-raised-button color="primary" (click)="saveVictim()" [disabled]="!victimForm.valid" >Save </button>
794
+ </div>
795
+ &nbsp;&nbsp;
796
+ <div *ngIf="showDelete" class="inner">
797
+ <button mat-raised-button color="primary" (click)="deleteVictim()">Delete </button>
798
+ </div>
799
+ &nbsp;&nbsp;
800
+ <div class="inner">
801
+ <button mat-raised-button color="primary" (click)="cancel()">Clear </button>
802
+ </div>
803
+ &nbsp;&nbsp;
804
+ <button mat-raised-button color="primary" (click)="back()">Back</button>
805
+
806
+ </div>
807
+
808
+ </div>
809
+ <br>
810
+ <br>
811
+
812
+ <div align="right">
813
+ <button mat-raised-button color="primary" (click)="addContact()" >Add victim contact</button>
814
+ </div>
815
+
816
+ <div>
817
+
818
+ <mat-table #table [dataSource]="contactDataSource" class="example-table">
819
+ <ng-container matColumnDef="contactDate">
820
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Date</mat-header-cell>
821
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.contactDate | date}} </mat-cell>
822
+ </ng-container>
823
+
824
+
825
+ <ng-container matColumnDef="victimContactMethod">
826
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact Method</mat-header-cell>
827
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimContactMethod}} </mat-cell>
828
+ </ng-container>
829
+
830
+ <ng-container matColumnDef="nextContactDate">
831
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Next Contact Date</mat-header-cell>
832
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.nextContactDate | date}} </mat-cell>
833
+ </ng-container>
834
+
835
+
836
+ <ng-container matColumnDef="staff">
837
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Contact By</mat-header-cell>
838
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.staff}} </mat-cell>
839
+ </ng-container>
840
+ <ng-container matColumnDef="comment">
841
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>
842
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>
843
+ </ng-container>
844
+
845
+ <ng-container matColumnDef="contactId">
846
+ <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>
847
+ <mat-cell *matCellDef="let row" class="example-cell">
848
+
849
+ </mat-cell>
850
+ </ng-container>
851
+
852
+ <mat-header-row *matHeaderRowDef="['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId']" class="example-header-row"></mat-header-row>
853
+ <mat-row *matRowDef="let row; columns:['contactDate', 'victimContactMethod','nextContactDate', 'staff', 'comment', 'contactId'];" class="example-row"></mat-row>
854
+ </mat-table>
855
+
856
+
857
+ </div>
858
+
859
+ </mat-card-content>
860
+ </mat-card>