@csmart/ngc-smart-victim 1.18.8 → 1.18.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -43,6 +43,7 @@ div.services {
43
43
  .main-container{
44
44
  display: flex;
45
45
  margin-top: 8px;
46
+ flex-direction: column;
46
47
  }
47
48
 
48
49
  .add-action{
@@ -81,7 +82,7 @@ mat-form-field {
81
82
  .Column
82
83
  {
83
84
  display: table-cell;
84
-
85
+
85
86
  }
86
87
 
87
88
  .sp-form textarea {
@@ -189,4 +190,56 @@ mat-form-field {
189
190
  -moz-hyphens: auto;
190
191
  -webkit-hyphens: auto;
191
192
  hyphens: auto;
192
- }
193
+ }
194
+
195
+ .smart-card{
196
+ background-color: var(--mdc-elevated-card-container-color);
197
+ border: 1px solid #ccc;
198
+ border-radius: 8px;
199
+ box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
200
+ padding: 16px 0px 16px 2px;
201
+ width: 100%;
202
+ }
203
+
204
+ .smart-card-header{
205
+ display: flex;
206
+ flex-direction: column;
207
+ align-items:start;
208
+ }
209
+
210
+ .smart-label{
211
+ font-size: 16px !important;
212
+ }
213
+
214
+ .smart-card-table{
215
+ margin: 16px 0px;
216
+ }
217
+
218
+ .smart-flex-container {
219
+ display: flex !important;
220
+ justify-content: space-between;
221
+ flex-wrap: wrap;
222
+ }
223
+
224
+ .smart-action-content{
225
+ display: flex;
226
+ justify-content: flex-end;
227
+ margin: 12px;
228
+ }
229
+
230
+ .smart-button{
231
+ margin: 0px 4px;
232
+ }
233
+
234
+ .smart-add-button{
235
+ margin: 0px 4px;
236
+ font-size: 1.25em !important;
237
+ }
238
+
239
+ .material-icons {
240
+ vertical-align: baseline !important;
241
+ }
242
+
243
+ .smart-paginator{
244
+ display: flex !important;
245
+ }
@@ -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 = {
@@ -89,9 +89,6 @@ export class VictimDrugUse {
89
89
  ) { }
90
90
  }
91
91
 
92
-
93
-
94
-
95
92
  export class VictimSupport {
96
93
  constructor(
97
94
  // public victimSupportId: number,
@@ -105,6 +102,17 @@ export class VictimSupport {
105
102
  ) { }
106
103
  }
107
104
 
105
+ export class VictimRelationship {
106
+ constructor(
107
+ public victimId: number,
108
+
109
+ public victimRelationshipTypeId: string,
110
+
111
+ public modifiedBy: number
112
+
113
+ ) { }
114
+ }
115
+
108
116
  export class VictimGuardian {
109
117
  constructor(public victimGuardianId: number,
110
118
 
@@ -285,7 +293,7 @@ export interface VictimServiceTypeProgramProviderModel {
285
293
  public alcoholUseFlag: boolean,
286
294
  public accessRisk: string,
287
295
  public modifiedBy: number,
288
- public relationship: string,
296
+ //public relationship: string,
289
297
 
290
298
  public vVictimAdvocate: VictimAdvocate,
291
299
  public vVictimGuardian: VictimGuardian,
@@ -294,6 +302,8 @@ export interface VictimServiceTypeProgramProviderModel {
294
302
  public victimWeaponUses: VictimWeaponUse[],
295
303
  public victimDrugUses: VictimDrugUse[],
296
304
 
305
+ public victimRelationships: VictimRelationship[],
306
+
297
307
  public allowCsosaContactFlag: boolean,
298
308
  public liveWithOffenderFlag: boolean
299
309
  ) { }
@@ -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,
@@ -366,6 +366,25 @@ postVictimSupport(id: any, val: any) {
366
366
  );
367
367
  }
368
368
 
369
+ /*
370
+ putVictimRelationship(id: any, val: any) {
371
+ const tempVal = JSON.stringify(val);
372
+ return this.http.put(this.smartVictimServiceUrl + 'VictimRelationships/' + id, tempVal, options).pipe
373
+ (
374
+ map(res => { return res;})
375
+ );
376
+ }
377
+
378
+ postVictimRelationship(id: any, val: any) {
379
+ const tempVal = JSON.stringify(val);
380
+ return this.http.post(this.smartVictimServiceUrl + 'VictimRelationships/' + id, tempVal, options).pipe
381
+ (
382
+ map(res => { return res;})
383
+ );
384
+ }
385
+
386
+ */
387
+
369
388
  deleteVictims(val: any, staffId: number) {
370
389
  return this.http.delete(this.smartVictimServiceUrl+ 'Victims/' + val + '?staffId='+ staffId, options).pipe
371
390
  (
@@ -1,6 +1,7 @@
1
1
  import { MsalGuard } from '@azure/msal-angular';
2
2
  import { SmartErrorComponent } from '@csmart/ngc-smart-core';
3
- import { LoginStaffResolverService, SelectedOffenderResolverService} from '@csmart/ngc-smart-core';
3
+ import { LoginStaffResolverService, SelectedOffenderResolverService,SmartAuthorizationGuard,
4
+ SmartOffenderRedirectGuard,} from '@csmart/ngc-smart-core';
4
5
  import { Routes, RouterModule } from '@angular/router';
5
6
  import { NgModule } from '@angular/core';
6
7
  import { CaseNoteComponent } from './caseNote/caseNote.component';
@@ -13,13 +14,13 @@ import { NgcSmartVictimComponent} from './smart-victim.component'
13
14
  const routes: Routes = [
14
15
 
15
16
  //{path: 'casenote/:victimId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
16
- {path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent,pathMatch: 'full',canActivate: [MsalGuard],resolve: { loginStaff: LoginStaffResolverService } },
17
- {path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
18
- {path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent,pathMatch: 'full',resolve: { loginStaff: LoginStaffResolverService } },
19
- {path: 'victimList', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
20
- {path: 'victimHome', component: NgcSmartVictimComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
21
- {path: 'victimContact/:victimId', component: ContactComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
22
- {path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, resolve: { loginStaff: LoginStaffResolverService, selectedOffender: SelectedOffenderResolverService} },
17
+ {path: 'casenote/:victimId/:offenderId', component: CaseNoteComponent,pathMatch: 'full', canActivate: [MsalGuard, SmartAuthorizationGuard], },
18
+ {path: 'saftyPlan/:victimId', component: VictimSafetyPlanComponent,pathMatch: 'full',},
19
+ {path: 'saftyPlanDetail/:victimServiceId/:victimId', component: VictimSafetyPlanDetailComponent,pathMatch: 'full', },
20
+ {path: 'victimList', component: NgcSmartVictimComponent, },
21
+ {path: 'victimHome', component: NgcSmartVictimComponent, },
22
+ {path: 'victimContact/:victimId', component: ContactComponent, },
23
+ {path: 'victimDetail/:victimId', component: SmartVictimDetailComponent, },
23
24
  {path: 'smart-error', component: SmartErrorComponent }
24
25
  ];
25
26
 
@@ -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,