@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,35 @@
1
+ import { Observable } from 'rxjs';
2
+ import { CommonDialogComponent } from './common-dialog.component';
3
+ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
4
+ import { Injectable } from '@angular/core';
5
+
6
+ @Injectable()
7
+ export class CommonDialogService {
8
+
9
+ constructor(private dialog: MatDialog) { }
10
+
11
+ public confirm(title: string, message: string, cmdYesTitle: string, cmdNoTitle: string): Observable<boolean> {
12
+
13
+ let dialogRef: MatDialogRef<CommonDialogComponent>;
14
+
15
+ dialogRef = this.dialog.open(CommonDialogComponent);
16
+ dialogRef.componentInstance.title = title;
17
+ dialogRef.componentInstance.message = message;
18
+ dialogRef.componentInstance.cmdYesTitle = cmdYesTitle;
19
+ dialogRef.componentInstance.cmdNoTitle = cmdNoTitle;
20
+ return dialogRef.afterClosed();
21
+ }
22
+
23
+ public warning(title: string, message: string, cmdOkTitle: string, ): Observable<boolean> {
24
+
25
+ let dialogRef: MatDialogRef<CommonDialogComponent>;
26
+
27
+ dialogRef = this.dialog.open(CommonDialogComponent);
28
+ dialogRef.componentInstance.title = title;
29
+ dialogRef.componentInstance.message = message;
30
+ dialogRef.componentInstance.cmdYesTitle = cmdOkTitle;
31
+
32
+ return dialogRef.afterClosed();
33
+ }
34
+
35
+ }
@@ -0,0 +1,20 @@
1
+
2
+ mat-form-field {
3
+ width: 50%;
4
+ }
5
+ .container{
6
+ margin: 16px;
7
+ display: grid;
8
+ grid-template-columns: repeat(1, 1fr);
9
+ grid-gap: 10px;
10
+ grid-auto-rows: minmax(50px, auto);
11
+ justify-items: stretch;
12
+ }
13
+
14
+ .mat-select-content{
15
+ width:300px;
16
+ }
17
+
18
+ .mat-select-inner{
19
+ width:290px;
20
+ }
@@ -0,0 +1,124 @@
1
+
2
+ <mat-card>
3
+ <mat-card-header>
4
+
5
+ </mat-card-header>
6
+ <mat-card-content>
7
+
8
+ <mat-toolbar color="primary">
9
+ <h4 class="card-header" >Contact detail</h4>
10
+ </mat-toolbar>
11
+ <br>
12
+
13
+
14
+
15
+ <mat-card >
16
+ <div class='container'>
17
+ <form [formGroup]="contactForm" #contactDetailForm="ngForm" >
18
+
19
+
20
+
21
+ <div>
22
+ <mat-form-field>
23
+ <mat-label>Contact Date:</mat-label>
24
+ <input matInput formControlName="contactDate"
25
+ (click)="contactDate.open()"
26
+ [matDatepicker]="contactDate"
27
+ placeholder="Choose a contact date"
28
+ [(ngModel)]="editContact.contactDate" required>
29
+ <mat-datepicker-toggle matSuffix [for]="contactDate"></mat-datepicker-toggle>
30
+ <mat-datepicker #contactDate></mat-datepicker>
31
+ </mat-form-field>
32
+
33
+ <div class="validation-errors">
34
+ <div
35
+ class="help-block"
36
+ *ngIf="
37
+ contactForm
38
+ .get('contactDate')
39
+ .hasError('required') &&
40
+ (contactForm.get('contactDate').dirty ||
41
+ contactForm.get('contactDate').touched)">
42
+ <mat-error>Contact date is
43
+ <strong>required</strong></mat-error>
44
+ </div>
45
+ <div
46
+ class="help-block"
47
+ *ngIf="
48
+ contactForm.get('contactDate').hasError('date') &&
49
+ (contactForm.get('contactDate').dirty ||
50
+ contactForm.get('contactDate').touched)">
51
+ <mat-error >future Date is <strong>not allowed</strong> for contact date</mat-error>
52
+ </div>
53
+ </div>
54
+ </div>
55
+
56
+
57
+
58
+ <div>
59
+ <mat-form-field>
60
+ <mat-label>Contact Method:</mat-label>
61
+ <mat-select placeholder="contactMethod" formControlName="contactMethod" required [(ngModel)]="editContact.victimContactMethodId">
62
+ <mat-option *ngFor=" let contactMethod of contactMethods" [value]="contactMethod.victimContactMethodId" >{{contactMethod.name}}</mat-option>
63
+ </mat-select>
64
+ </mat-form-field>
65
+ </div>
66
+
67
+ <div>
68
+ <mat-form-field class="mat-select-content">
69
+ <mat-label>Contact By:</mat-label>
70
+ <mat-select formControlName="contactBy" required [(ngModel)]="editContact.contactedBy" class="mat-select-inner">
71
+ <mat-option *ngFor=" let item of staff" [value]="item.staffId" >{{ item.fullName}}</mat-option>
72
+ </mat-select>
73
+ </mat-form-field>
74
+ </div>
75
+
76
+ <div>
77
+
78
+ <mat-form-field>
79
+ <mat-label>Comments </mat-label>
80
+ <textarea
81
+ matInput
82
+ placeholder=""
83
+ required formControlName="comment"
84
+ [(ngModel)]="editContact.comment"
85
+ cdkTextareaAutosize
86
+ #autosize="cdkTextareaAutosize"
87
+ cdkAutosizeMinRows="1"
88
+ cdkAutosizeMaxRows="5">
89
+ </textarea>
90
+ </mat-form-field>
91
+ </div>
92
+
93
+ <div>
94
+ <mat-form-field>
95
+ <mat-label>Next Contact Date: </mat-label>
96
+ <input matInput formControlName="nextContactDate"
97
+ (click)="nextContactDate.open()"
98
+ [matDatepicker]="nextContactDate"
99
+ placeholder="Choose a next contact date"
100
+ [(ngModel)]="editContact.nextContactDate" required>
101
+ <mat-datepicker-toggle matSuffix [for]="nextContactDate"></mat-datepicker-toggle>
102
+ <mat-datepicker #nextContactDate></mat-datepicker>
103
+ </mat-form-field>
104
+ </div>
105
+
106
+ <div>
107
+ <!-- <button mat-raised-button color="primary" (click)="saveContact()" [disabled]="!contactForm.form.valid" >Save</button> -->
108
+ <button mat-raised-button color="primary" (click)="saveContact()" [disabled]="!contactForm.valid" >Save</button>
109
+ &nbsp;&nbsp;<button mat-raised-button color="primary" >Cancel</button>
110
+ &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()" >Back</button>
111
+ </div>
112
+
113
+ </form>
114
+ </div>
115
+ </mat-card>
116
+
117
+
118
+ <br>
119
+
120
+
121
+
122
+
123
+ </mat-card-content>
124
+ </mat-card>
@@ -0,0 +1,176 @@
1
+ import { Component, OnInit,Inject,OnChanges, Input, Output, EventEmitter,AfterViewInit } from '@angular/core';
2
+ import { NgcSmartVictimService } from '../smart-victim.service';
3
+ import { FormControl, FormGroup, FormBuilder,Validators } from '@angular/forms';
4
+ import { CommonDialogService} from '.././common-dialog/common-dialog.service';
5
+ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';
6
+ import { SelectedOffender, LoginStaff } from '@csmart/ngc-smart-core';
7
+ import { Router, ActivatedRoute } from '@angular/router';
8
+ import { Contact} from '../smart-victim.model';
9
+ import { SmartAuthService } from '@csmart/ngc-smart-core';
10
+ import { dateValidator,passDateValidator,dateLessThan } from '../shared/validators';
11
+ import { MatSnackBar } from '@angular/material/snack-bar';
12
+
13
+ @Component({
14
+ templateUrl: './contact.component.html',
15
+ styleUrls: ['./contact.component.css'],
16
+ })
17
+ export class ContactComponent implements OnInit,AfterViewInit {
18
+
19
+ offenderId: number;
20
+ loginStaff: LoginStaff;
21
+ contact: Contact;
22
+ editContact: Contact = <Contact>{};
23
+ errorMessage: string;
24
+ contactMethods: any[];
25
+ contactBy: any[];
26
+ result: any;
27
+ victimName: string;
28
+ staffId: number;
29
+ victimId: number;
30
+ hiddenAddNewFlag: boolean;
31
+ contactForm: FormGroup;
32
+ private sub: any;
33
+ staff: any = {};
34
+
35
+ constructor(
36
+
37
+ private _victimServicesComponent: NgcSmartVictimService,
38
+ //private commonDialogService: CommonDialogService,
39
+ public snackBar: MatSnackBar,
40
+ private route: ActivatedRoute,
41
+ private router: Router,
42
+ private smartAuthService: SmartAuthService,
43
+
44
+ ) {
45
+ this.contactForm = new FormGroup({
46
+ //contactDate: new FormControl(),
47
+ contactDate:new FormControl('', Validators.compose([
48
+ dateValidator() ])),
49
+
50
+ contactMethod: new FormControl(),
51
+ contactBy: new FormControl(),
52
+ comment: new FormControl(),
53
+ nextContactDate: new FormControl()
54
+ });
55
+ }
56
+
57
+ ngAfterViewInit() {
58
+ this.smartAuthService.setPermission('Victim', this.route.snapshot);
59
+ }
60
+
61
+ ngOnInit() {
62
+ var data = this.route.snapshot.data;
63
+ this.loginStaff = data.loginStaff;
64
+ this.staffId = this.loginStaff.staffId;
65
+
66
+ this.staff = [
67
+ {
68
+ staffId: this.loginStaff.staffId,
69
+ fullName: this.loginStaff.firstName + ' ' + this.loginStaff.lastName,
70
+ },
71
+ ];
72
+
73
+
74
+ this.sub = this.route.params.subscribe(params => {
75
+ this.victimId = params['victimId'];
76
+ console.log('my this.victimId');
77
+ console.log(this.victimId);
78
+
79
+ });
80
+
81
+
82
+ this._victimServicesComponent.getContactMethods().subscribe(
83
+ (items: any) => {
84
+ this.contactMethods = items;
85
+ console.log('this.contactMethods');
86
+ console.log(this.contactMethods);
87
+ }
88
+ );
89
+
90
+ // this._victimServicesComponent.getContactBys().subscribe(
91
+ // (items: any) => {
92
+ // this.contactBy= items;
93
+ // }
94
+ // );
95
+
96
+
97
+ // this._victimServicesComponent.getContacts(this.victimId).subscribe(
98
+ // caseNoteList => {
99
+
100
+ // this.caseNoteList = caseNoteList;
101
+
102
+ // }
103
+ // );
104
+
105
+ }
106
+ onEditContact(victimContactId: number){
107
+
108
+ // this.hiddenDetailFlag =false;
109
+ // this.hiddenAddNewFlag = true;
110
+
111
+ // this.addDisableFlag = true;
112
+ // this.editCaseNote = this.caseNoteList.find(x => x.victimCaseNoteId === victimCaseNoteId);
113
+
114
+ }
115
+
116
+ // onDeleteCaseNote(victimCaseNoteId: number){
117
+ // this.commonDialogService
118
+ // .confirm('', 'Do you want to delete this case note?', 'Yes', 'No')
119
+ // .subscribe(res => {this.result = res;
120
+ // if (this.result) {
121
+ // this._victimServicesComponent.deleteCaseNote(victimCaseNoteId, this.staffId)
122
+ // .subscribe(result => {
123
+ // this.snackBar.open('delete Successfully !', '', { duration: 3000,});
124
+
125
+ // this._victimServicesComponent.getCasetNotes(this.victimId).subscribe(
126
+ // caseNoteList => {
127
+ // this.caseNoteList = caseNoteList;
128
+
129
+ // }
130
+ // );
131
+ // }
132
+ // );
133
+ // }
134
+
135
+ // });
136
+ // }
137
+ onAddNew(){
138
+
139
+ // this.editCas.caseNoteDate = null;
140
+ // this.editCaseNote.contactTypeId = null;
141
+ // this.editCaseNote.victimContactPurposeId = null;
142
+ // this.editCaseNote.comment = null;
143
+ }
144
+ back(){
145
+
146
+
147
+ this.router.navigate(['victimDetail', this.victimId ]);
148
+ }
149
+
150
+ saveContact(){
151
+
152
+ const contact: Contact = {
153
+ victimId:this.victimId,
154
+ victimContactId: 0,
155
+ contactDate: this.editContact.contactDate,
156
+ victimContactMethodId: this.editContact.victimContactMethodId,
157
+ contactMethod: null,
158
+ contactedByName: null,
159
+ contactedBy: this.editContact.contactedBy,
160
+ comment: this.editContact.comment,
161
+ nextContactDate: this.editContact.nextContactDate,
162
+ modifiedBy: this.staffId,
163
+
164
+ };
165
+ this._victimServicesComponent.addContact(contact).subscribe(
166
+ result => {
167
+ this.snackBar.open('Saved Successfully !', '', {
168
+ duration: 3000,
169
+ });
170
+
171
+ this.router.navigate(['victimDetail', this.victimId ]);
172
+ }
173
+ );
174
+ }
175
+
176
+ }
@@ -0,0 +1,82 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ import { Observable } from 'rxjs';
3
+ import { map, filter } from 'rxjs/operators';
4
+ import { Injectable,Inject } from '@angular/core';
5
+ import { SMART_OFFENDER_SERVICE_URL} from './smart-victim.model';
6
+
7
+
8
+ const headers = new Headers({ 'Content-Type': 'application/json' });
9
+ @Injectable({
10
+ providedIn: 'root'
11
+ })
12
+ export class IntakeServicesComponent {
13
+ //serviceData = environment.smartOffenderServiceUrl;
14
+ constructor(private http: HttpClient,
15
+ @Inject(SMART_OFFENDER_SERVICE_URL) private smartOffenderServiceUrl: string,
16
+ ) {}
17
+ getIntakeByOffender(offenderId: any): Observable<Intake> {
18
+ return this.http
19
+ .get<Intake>(this.smartOffenderServiceUrl + 'IntakeBasic/offender/' + offenderId)
20
+ .pipe();
21
+ }
22
+
23
+ updateIntakeSteps(
24
+ offenderId: number,
25
+ intakeStepStatus: IntakeStepStatusModel,
26
+ ) {
27
+ return this.http.put(
28
+ this.smartOffenderServiceUrl + '/IntakeStepStatus/' + offenderId,
29
+ intakeStepStatus,
30
+ );
31
+ }
32
+ }
33
+
34
+ export interface Intake {
35
+ intakeId: number;
36
+ offenderId: number;
37
+ intakeOffenderReportStatusId?: any;
38
+ startDate: string;
39
+ endDate?: any;
40
+ assignmentId?: any;
41
+ modifiedBy: number;
42
+ }
43
+
44
+ export interface IntakeStepStatus {
45
+ intakeStepStatusId: number;
46
+ intakeId: number;
47
+ intakeStepId: string;
48
+ completedDate: Date;
49
+ modifiedBy: number;
50
+ }
51
+
52
+ export interface IntakeStepStatusModel
53
+ {
54
+ offenderId: number;
55
+ intakeStepId: string;
56
+ modifiedBy: number;
57
+ }
58
+
59
+ export class IntakeStep{
60
+ public static PhysicalInformation = "PHYSIN";
61
+ public static Photo = "PHOTOS";
62
+ public static HousingInformation = "HOUSE";
63
+ public static DocketInformation = "DOCKET";
64
+ public static Alias = "ALIAS";
65
+ public static IntakeBasicInformation = "INTKBI";
66
+ public static ContactInformation = "CONTCT";
67
+ public static DeceasedInformation = "DEATH";
68
+ public static DriversLicense = "DRVLIC";
69
+ public static EmploymentInformation = "EMPLOY";
70
+ public static GangAffiliation = "GANG";
71
+ public static HealthInsurance = "HLTHINS";
72
+ public static Identification = "IDNTFCTN";
73
+ public static InternetIdentifier = "INTERNETID";
74
+ public static MilitaryService = "MLTSVC";
75
+ public static School = "SCHOOL";
76
+ public static SelectiveService = "SLCTVSVC";
77
+ public static Vehicle = "VEHICLE";
78
+ public static VictimInformation = "VICTIM";
79
+ public static WarrantInformation = "WARRNT";
80
+ public static RunningRecord = "RUNREC";
81
+ public static Signature = "SIGN";
82
+ }
@@ -0,0 +1,94 @@
1
+ import { Component, OnInit, Inject } from '@angular/core';
2
+ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
3
+ import { FormBuilder, FormGroup } from '@angular/forms';
4
+ import { ProvidersDialogData} from '../smart-victim.model';
5
+ import { NgcSmartVictimService } from '../smart-victim.service';
6
+
7
+
8
+ @Component({
9
+ selector: 'app-service-provider',
10
+ template: `
11
+ <h1 mat-dialog-title> {{data.serviceType}}</h1>
12
+ <div mat-dialog-content class="main" [formGroup]="spForm">
13
+ <mat-form-field>
14
+ <mat-label>service provider</mat-label>
15
+
16
+ <mat-select formControlName="voteeProviderId">
17
+ <mat-option
18
+ *ngFor="let providerOption of programProviders"
19
+ [value]="providerOption.victimProgramProviderId">{{ providerOption.victimProgramProvider }}
20
+ </mat-option>
21
+ </mat-select>
22
+
23
+ </mat-form-field>
24
+
25
+ </div>
26
+ <div mat-dialog-actions class="actions">
27
+ <button mat-raised-button color="primary" (click)="cancel()" cdkFocusInitial>
28
+ Cancel Change
29
+ </button>
30
+ <button mat-raised-button color="primary" [mat-dialog-close]="spForm.value" >
31
+ Save Change
32
+ </button>
33
+ </div>
34
+ `,
35
+ styles: [
36
+ `
37
+ .main {
38
+ width: 100%;
39
+ display: flex;
40
+ flex-direction: column;
41
+ }
42
+
43
+ .actions{
44
+ display: flex;
45
+ }
46
+ `,
47
+ ],
48
+ })
49
+
50
+
51
+
52
+ export class SeriveProviderComponent implements OnInit {
53
+ spForm: FormGroup;
54
+ programProviders:[];
55
+
56
+ constructor(
57
+ private formBuilder: FormBuilder,
58
+ public dialogRef: MatDialogRef<SeriveProviderComponent>,
59
+ private _victimServicesComponent: NgcSmartVictimService,
60
+ @Inject(MAT_DIALOG_DATA) public data: ProvidersDialogData,
61
+ ) {
62
+
63
+
64
+ this.spForm = this.formBuilder.group({
65
+ voteeProviderId: [''],
66
+
67
+ });
68
+ }
69
+
70
+ cancel() {
71
+ this.dialogRef.close();
72
+ }
73
+
74
+ ngOnInit() {
75
+ console.log('data.providerCollections')
76
+ console.log(this.data);
77
+ console.log(this.data.serviceTypeId);
78
+
79
+ this._victimServicesComponent.getvVictimServiceTypeProgramProviders().subscribe(
80
+ (items: any) => {
81
+ this.programProviders = items.filter( (y) => (y.victimServiceTypeId === this.data.serviceTypeId));
82
+ console.log('this.programProviders');
83
+ console.log(this.programProviders);
84
+ }
85
+ );
86
+
87
+ this.spForm.get('voteeProviderId').valueChanges.subscribe(voteeProviderId => {
88
+ console.log('voteeProviderId in service provider component.')
89
+ console.log(voteeProviderId)
90
+
91
+
92
+ })
93
+ }
94
+ }
@@ -0,0 +1,27 @@
1
+
2
+ div.serviceSelect
3
+ {
4
+ width: 500px;
5
+
6
+ }
7
+ div.serviceButton
8
+ {
9
+ width: 20%;
10
+
11
+ }
12
+ .container{
13
+ margin: 16px;
14
+ display: grid;
15
+ grid-template-columns: repeat(2, 1fr);
16
+ grid-gap: 10px;
17
+ grid-auto-rows: minmax(50px, auto);
18
+ justify-items: stretch;
19
+ }
20
+
21
+ .app-class .mat-list-item {
22
+ height: auto;
23
+ }
24
+
25
+ .textarea-content{
26
+ width:500px;
27
+ }
@@ -0,0 +1,85 @@
1
+
2
+ <mat-card>
3
+ <mat-card-header>
4
+ </mat-card-header>
5
+ <mat-card-content>
6
+ <mat-toolbar color="primary">
7
+ <h4 class="card-header" style="display: inline-block;">Safety Plan</h4>
8
+ </mat-toolbar>
9
+ <br>
10
+ <button mat-raised-button color="primary" (click)="goToSafetyPlanDetail(0)" >Add Goal</button>
11
+ &nbsp;&nbsp;<button mat-raised-button color="primary" (click)="back()">Back</button>
12
+ <br>
13
+ <br>
14
+ <mat-table #table [dataSource]="safetyPlanDataSource" class="example-table">
15
+ <ng-container matColumnDef="startDate">
16
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>
17
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.startDate | date}} </mat-cell>
18
+ </ng-container>
19
+ <ng-container matColumnDef="goal">
20
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Goal</mat-header-cell>
21
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.goal }} </mat-cell>
22
+ </ng-container>
23
+ <ng-container matColumnDef="victimServiceStatus">
24
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>
25
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatus }} </mat-cell>
26
+ </ng-container>
27
+ <ng-container matColumnDef="comment">
28
+ <mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>
29
+ <mat-cell *matCellDef="let row" class="example-cell"> {{row.comment }} </mat-cell>
30
+ </ng-container>
31
+
32
+ <ng-container matColumnDef="victimServiceId">
33
+ <mat-header-cell *matHeaderCellDef class="example-header-cell"></mat-header-cell>
34
+ <!-- <mat-cell *matCellDef="let row" class="example-cell">
35
+ <button type="button" mat-raised-button color="primary" (click)="goToSafetyPlanDetail(row.victimServiceId)">
36
+ <span class="glyphicon glyphicon-pencil" ></span>&nbsp;
37
+ <mat-icon>edit</mat-icon>
38
+ </button>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ &nbsp;&nbsp;
47
+ <button type="button" mat-raised-button color="primary" (click)="onDeleteSafetyPlan(row.victimServiceId)">
48
+ <span class="glyphicon glyphicon-trash" ></span>&nbsp;Delete
49
+ </button>
50
+ </mat-cell> -->
51
+
52
+ <mat-cell *matCellDef="let element">
53
+
54
+ <button class="edit-btn" mat-icon-button color="primary" matTooltip="Edit Safety Plan" (click)="goToSafetyPlanDetail(element.victimServiceId)">
55
+ <i class="material-icons">mode_edit</i>
56
+ </button>
57
+
58
+ &nbsp;&nbsp;
59
+
60
+ <button
61
+ class="delete-btn"
62
+ matTooltip="Delete Safety Plan"
63
+ mat-icon-button
64
+ color="primary"
65
+ (click)="onDeleteSafetyPlan(element.victimServiceId)">
66
+ <i class="material-icons">delete</i>
67
+ </button>
68
+
69
+
70
+
71
+
72
+
73
+ </mat-cell>
74
+
75
+
76
+
77
+ </ng-container>
78
+
79
+ <mat-header-row *matHeaderRowDef="['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId']" class="example-header-row"></mat-header-row>
80
+ <mat-row *matRowDef="let row; columns:['startDate', 'goal', 'victimServiceStatus', 'comment', 'victimServiceId'];" class="example-row"></mat-row>
81
+ </mat-table>
82
+
83
+
84
+ </mat-card-content>
85
+ </mat-card>