@csmart/ngc-smart-victim 1.18.8 → 1.18.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -5,134 +5,128 @@
5
5
  </div>
6
6
 
7
7
  <div *ngIf="showDetail">
8
- <csmart-victim-detail [victimDetail]="victimDetail"
8
+ <csmart-victim-detail [victimDetail]="victimDetail"
9
9
  [staffId]="staffId"
10
10
  [offenderId] ="offenderId"
11
11
  [isIntake]="isIntake"
12
- (onSave)="save($event)"
12
+ (onSave)="save($event)"
13
13
  (onCancel)="cancel()" >
14
14
  </csmart-victim-detail>
15
15
  </div>
16
16
  <div class="main-container">
17
-
18
- <div class="add-action" *ngIf="showAdd">
19
- <button mat-raised-button color="primary"
20
- accessControl
21
- [accessControlConfig]="createAccessControlConfig"
17
+ <mat-card id="divVictim" class="smart-card-table">
18
+ <div class="smart-action-content">
19
+ <button mat-stroked-button color="primary"
20
+ accessControl
21
+ [accessControlConfig]="createAccessControlConfig"
22
+ *ngIf="showAdd"
23
+ class="smart-add-button"
22
24
  (click)="addRecord()">
23
25
  <mat-icon>add</mat-icon>
24
26
  Add Victim
25
27
  </button>
26
- &nbsp;&nbsp;
27
-
28
- <div *ngIf="isIntake">
29
- <button
30
- mat-raised-button
31
- color="primary"
32
- accessControl
33
- [accessControlConfig]="updateAccessControlConfig"
34
- (click)="saveIntake()">
35
- Continue
36
- </button>
37
- </div>
28
+ <button
29
+ mat-stroked-button
30
+ class="smart-add-button"
31
+ *ngIf="isIntake"
32
+ color="primary"
33
+ accessControl
34
+ [accessControlConfig]="updateAccessControlConfig"
35
+ (click)="saveIntake()">
36
+ Continue
37
+ </button>
38
+ </div>
39
+ <div *ngIf="victimListDataSource.data.length > 0">
40
+ <mat-table #table [dataSource]="victimListDataSource" >
38
41
 
39
- </div>
40
- <div *ngIf="showListFlag">
41
- <mat-card id="divVictim" >
42
- <mat-card-content >
43
- <mat-table #table [dataSource]="victimListDataSource" >
44
-
45
- <ng-container matColumnDef="lastName">
46
- <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>
47
- <mat-cell *matCellDef="let row" > {{row.lastName}} </mat-cell>
48
- </ng-container>
42
+ <ng-container matColumnDef="lastName">
43
+ <mat-header-cell *matHeaderCellDef>Victim Last Name</mat-header-cell>
44
+ <mat-cell *matCellDef="let row" > {{row.lastName}} </mat-cell>
45
+ </ng-container>
49
46
 
50
47
 
51
- <ng-container matColumnDef="firstName">
52
- <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>
53
- <mat-cell *matCellDef="let row" > {{row.firstName}} </mat-cell>
48
+ <ng-container matColumnDef="firstName">
49
+ <mat-header-cell *matHeaderCellDef >Victim First Name</mat-header-cell>
50
+ <mat-cell *matCellDef="let row" > {{row.firstName}} </mat-cell>
51
+ </ng-container>
52
+
53
+ <div *ngIf="showRelationshipColumn">
54
+ <ng-container matColumnDef="relationship">
55
+ <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>
56
+ <mat-cell *matCellDef="let row" > {{row.relationship}} </mat-cell>
54
57
  </ng-container>
55
-
56
- <div *ngIf="showRelationshipColumn">
57
- <ng-container matColumnDef="relationship">
58
- <mat-header-cell *matHeaderCellDef >Relationship to Offender</mat-header-cell>
59
- <mat-cell *matCellDef="let row" > {{row.relationship}} </mat-cell>
60
- </ng-container>
61
- </div>
62
-
63
- <div *ngIf="showOffenderPhoneColumn">
64
- <ng-container matColumnDef="homePhone">
65
- <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>
66
- <mat-cell *matCellDef="let row" >
67
- Home phone: {{formatPhoneNumber(row.homePhone)}}<br>
68
- Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>
69
- Work Phone: {{formatPhoneNumber(row.workPhone)}}
70
-
71
- </mat-cell>
72
- </ng-container>
73
- </div>
74
-
75
- <div *ngIf="showOffenderNameColumn">
76
- <ng-container matColumnDef="offenderName">
77
- <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>
78
- <mat-cell *matCellDef="let row" > {{row.offenderName}} </mat-cell>
79
- </ng-container>
80
- </div>
81
-
82
- <ng-container matColumnDef="victimId">
83
- <mat-header-cell *matHeaderCellDef ></mat-header-cell>
58
+ </div>
59
+
60
+ <div *ngIf="showOffenderPhoneColumn">
61
+ <ng-container matColumnDef="homePhone">
62
+ <mat-header-cell *matHeaderCellDef >Phone Number</mat-header-cell>
84
63
  <mat-cell *matCellDef="let row" >
85
-
86
- <!-- <div *ngIf="accessByModule">
87
- <mat-checkbox></mat-checkbox>
88
- </div> -->
89
-
90
- <div *ngIf="showEdit">
91
- <button class="edit-btn" mat-icon-button color="primary" matTooltip="View/Edit Victim"
92
- accessControl
93
- [accessControlConfig]="updateAccessControlConfig"
94
- (click)="editVictimDetail(row)">
95
- <i class="material-icons">mode_edit</i>
96
- </button>
97
- </div>
98
-
99
-
100
-
101
- &nbsp;&nbsp;
102
-
103
- <div *ngIf="showCaseNote">
104
- <button type="button" matTooltip="CaseNote" mat-raised-button color="primary"
105
- accessControl
106
- [accessControlConfig]="updateAccessControlConfig"
107
- (click)="goToCaseNote(row.victimId)">
108
- <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Case Note
109
- </button>
110
- </div>
111
- &nbsp;&nbsp;
112
-
113
- <div *ngIf="showSafetyPlan">
114
- <button type="button" matTooltip="safety plan" mat-raised-button color="primary"
115
- accessControl
116
- [accessControlConfig]="updateAccessControlConfig"
117
- (click)="goToSaftyPlan(row.victimId)">
118
- <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Safety Plan
119
- </button>
120
- </div>
121
- &nbsp;&nbsp;
122
-
64
+ Home phone: {{formatPhoneNumber(row.homePhone)}}<br>
65
+ Cell Phone: {{formatPhoneNumber(row.cellPhone)}}<br>
66
+ Work Phone: {{formatPhoneNumber(row.workPhone)}}
67
+
123
68
  </mat-cell>
124
69
  </ng-container>
70
+ </div>
71
+
72
+ <div *ngIf="showOffenderNameColumn">
73
+ <ng-container matColumnDef="offenderName">
74
+ <mat-header-cell *matHeaderCellDef>Offender Name</mat-header-cell>
75
+ <mat-cell *matCellDef="let row" > {{row.offenderName}} </mat-cell>
76
+ </ng-container>
77
+ </div>
125
78
 
126
- <mat-header-row *matHeaderRowDef="displayedColumns" class="example-header-row"></mat-header-row>
127
- <mat-row *matRowDef="let row; columns: displayedColumns" class="example-row"></mat-row>
128
- </mat-table>
79
+ <ng-container matColumnDef="victimId">
80
+ <mat-header-cell *matHeaderCellDef ></mat-header-cell>
81
+ <mat-cell *matCellDef="let row" >
129
82
 
130
- <mat-paginator #paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
131
- </mat-card-content>
132
- </mat-card>
133
- </div>
83
+ <!-- <div *ngIf="accessByModule">
84
+ <mat-checkbox></mat-checkbox>
85
+ </div> -->
134
86
 
87
+ <div *ngIf="showEdit">
88
+ <button class="edit-btn" mat-icon-button color="primary" matTooltip="View/Edit Victim"
89
+ accessControl
90
+ [accessControlConfig]="updateAccessControlConfig"
91
+ (click)="editVictimDetail(row)">
92
+ <i class="material-icons">mode_edit</i>
93
+ </button>
94
+ </div>
95
+
96
+
97
+
98
+ &nbsp;&nbsp;
99
+
100
+ <div *ngIf="showCaseNote">
101
+ <button type="button" matTooltip="CaseNote" mat-stroked-button color="primary"
102
+ accessControl
103
+ [accessControlConfig]="updateAccessControlConfig"
104
+ (click)="goToCaseNote(row.victimId)">
105
+ <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Case Note
106
+ </button>
107
+ </div>
108
+ &nbsp;&nbsp;
109
+
110
+ <div *ngIf="showSafetyPlan">
111
+ <button type="button" matTooltip="safety plan" mat-stroked-button color="primary"
112
+ accessControl
113
+ [accessControlConfig]="updateAccessControlConfig"
114
+ (click)="goToSaftyPlan(row.victimId)">
115
+ <span class="glyphicon glyphicon-pencil" ></span>&nbsp;Safety Plan
116
+ </button>
117
+ </div>
118
+ &nbsp;&nbsp;
119
+
120
+ </mat-cell>
121
+ </ng-container>
122
+
123
+ <mat-header-row *matHeaderRowDef="displayedColumns" class="example-header-row"></mat-header-row>
124
+ <mat-row *matRowDef="let row; columns: displayedColumns" class="example-row"></mat-row>
125
+ </mat-table>
126
+ <mat-paginator #paginator [pageSize]="10" [pageSizeOptions]="[5, 10, 25, 100]"></mat-paginator>
127
+ </div>
128
+ </mat-card>
135
129
  <div>
136
130
  <b>{{msg}}</b>
137
131
  </div>
138
- </div>
132
+ </div>
@@ -58,6 +58,7 @@ export class NgcSmartVictimComponent implements OnInit, OnChanges, AfterViewInit
58
58
  doSpin: boolean = false;
59
59
  showListFlag: boolean = false;
60
60
  msg: string = "";
61
+ selectedOffender: SelectedOffender;
61
62
  isIntake = false;
62
63
 
63
64
  updateAccessControlConfig: SmartAccessControlConfig;
@@ -142,7 +143,8 @@ export class NgcSmartVictimComponent implements OnInit, OnChanges, AfterViewInit
142
143
  if(queryParams['routeTo']) {
143
144
  this.router.navigate([queryParams['routeTo']]);
144
145
  }
145
- var data = this.route.snapshot.data;
146
+ const selData = this.route.snapshot.data;
147
+ this.selectedOffender = selData['selectedOffender'];
146
148
  var myPath = this.router.url.slice(-10);
147
149
 
148
150
 
@@ -158,9 +160,11 @@ export class NgcSmartVictimComponent implements OnInit, OnChanges, AfterViewInit
158
160
  console.log(this.intakeFlag);
159
161
  console.log(myPath);
160
162
 
161
- if (this.intakeFlag == "true") {
162
- this.isIntake = true;
163
- }
163
+ // if (this.intakeFlag == "true") {
164
+ // this.isIntake = true;
165
+ // }
166
+
167
+ this.isIntake = this.selectedOffender.intakeFlag;
164
168
 
165
169
  this.displayedColumns = ["lastName", "firstName"];
166
170
 
@@ -214,7 +218,7 @@ export class NgcSmartVictimComponent implements OnInit, OnChanges, AfterViewInit
214
218
  this.showCaseNote = "true";
215
219
  this.showSafetyPlan = "true";
216
220
 
217
- myOffenderId = data.selectedOffender.offenderId;
221
+ myOffenderId = selData.selectedOffender.offenderId;
218
222
  }
219
223
 
220
224
  const victimListFilter: VictimListFilter = {
@@ -1,4 +1,4 @@
1
- import { HttpClient,HttpResponse, HttpHeaders } from '@angular/common/http';
1
+ import { HttpClient, HttpResponse, HttpHeaders } from '@angular/common/http';
2
2
  import { Injectable, Inject } from '@angular/core';
3
3
  import { SMART_LOOKUP_SERVICE_URL, SMART_OFFENDER_SERVICE_URL,SMART_VICTIM_SERVICE_URL,
4
4
  VictimListFilter,VictimDrugUse,Victim,VictimSafetyPlan,
@@ -21,12 +21,12 @@
21
21
  <mat-form-field>
22
22
  <input matInput placeholder="Offender CSOSA #"[(ngModel)]="filter.offenderId" name="offenderId" id="offenderId">
23
23
  </mat-form-field>
24
-
25
-
24
+
25
+
26
26
  <section>
27
- <button id="victimSearchButton" mat-raised-button color="primary" (click)="onChange()">Search</button>
27
+ <button id="victimSearchButton" mat-stroked-button color="primary" (click)="onChange()">Search</button>
28
28
  <span style="padding-right: 5px;"></span>
29
- <button mat-raised-button color="primary" type="reset" value="Reset">Clear Changes</button>
29
+ <button mat-stroked-button color="primary" type="reset" value="Reset">Clear Changes</button>
30
30
  </section>
31
31
  </div>
32
32
  </mat-expansion-panel>
package/src/test.ts CHANGED
@@ -9,14 +9,8 @@ import {
9
9
  platformBrowserDynamicTesting
10
10
  } from '@angular/platform-browser-dynamic/testing';
11
11
 
12
- declare const require: any;
13
-
14
12
  // First, initialize the Angular testing environment.
15
13
  getTestBed().initTestEnvironment(
16
14
  BrowserDynamicTestingModule,
17
15
  platformBrowserDynamicTesting()
18
16
  );
19
- // Then we find all the tests.
20
- const context = require.context('./', true, /\.spec\.ts$/);
21
- // And load the modules.
22
- context.keys().map(context);
package/tsconfig.lib.json CHANGED
@@ -2,7 +2,6 @@
2
2
  "extends": "../../tsconfig.json",
3
3
  "compilerOptions": {
4
4
  "outDir": "../../out-tsc/lib",
5
- "target": "es2020",
6
5
  "module": "es2015",
7
6
  "moduleResolution": "node",
8
7
  "declaration": true,