@ohioepa/oepa-ui-lib 1.2.12 → 1.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7202,6 +7202,7 @@ class OepaUserAccountService {
7202
7202
  idleSubject = new Subject();
7203
7203
  timeoutID;
7204
7204
  userAccount$ = new Subject();
7205
+ sessionID$ = new Subject(); // session ID is used for "backdoor" processing of internal (webapps) accounts
7205
7206
  authToken = '';
7206
7207
  constructor(http, ebizRootURL) {
7207
7208
  this.http = http;
@@ -7217,7 +7218,6 @@ class OepaUserAccountService {
7217
7218
  return this.http.get(this.hostUrl + this.accountsUrl + '/' + userid);
7218
7219
  }
7219
7220
  retrieveAccountByOHID(ohid, app) {
7220
- console.log('retrieve account for: ' + ohid);
7221
7221
  const url = this.hostUrl + this.accountsUrl + '/ohid/' + ohid;
7222
7222
  return this.http.get(url, { params: { 'app': app } }).pipe(map((userAccount) => {
7223
7223
  this.userAccount$.next(userAccount);
@@ -7225,31 +7225,27 @@ class OepaUserAccountService {
7225
7225
  }));
7226
7226
  }
7227
7227
  /**
7228
- * @deprecated Should not use session user ID for Amplify apps
7229
7228
  * Retrieve the user account for the currently logged in user.
7230
7229
  * @returns Observable<OepaUserAccount>
7231
7230
  */
7232
- retrieveAccountForCurrentUser() {
7231
+ retrieveAccountForCurrentUser(app) {
7233
7232
  return this.http.get(this.hostUrl + '/api/v1/userAccounts/login').pipe(map((account) => {
7234
7233
  if (!account) {
7235
7234
  if (this.personID && this.sessionID) {
7236
- this.retrieveAccountForInternalSession(this.personID, this.sessionID).subscribe({
7235
+ this.retrieveAccountForInternalSession(this.personID, this.sessionID, app).subscribe({
7237
7236
  next: internalAccount => {
7238
7237
  if (internalAccount) {
7239
7238
  this.account = internalAccount;
7240
7239
  }
7241
7240
  else {
7242
- this.logMessageOnServer('retrieveAccountForCurrentUser - no account, redirecting to logout');
7243
7241
  this.redirectToLogout();
7244
7242
  }
7245
7243
  }, error: err => {
7246
- this.logMessageOnServer('Failed retrieving internal account: ' + err);
7247
7244
  this.redirectToLogout();
7248
7245
  }
7249
7246
  });
7250
7247
  }
7251
7248
  else {
7252
- this.logMessageOnServer('retrieveAccountForCurrentUser - no account, redirecting to logout');
7253
7249
  this.redirectToLogout();
7254
7250
  }
7255
7251
  }
@@ -7274,19 +7270,17 @@ class OepaUserAccountService {
7274
7270
  }
7275
7271
  /**
7276
7272
  * Retrieve the user account for the currently logged in user.
7277
- * @deprecated should retrieve account by OHID instead
7278
7273
  * @param sessionID person ID for internal user
7279
7274
  * @returns Observable<OepaUserAccount>
7280
7275
  */
7281
- retrieveAccountForInternalSession(personID, sessionID) {
7276
+ retrieveAccountForInternalSession(personID, sessionID, app) {
7282
7277
  this.account = {};
7283
- const url = this.hostUrl + '/api/v1/userAccounts/internal/personID/' + personID + '/sessionID/' + sessionID;
7284
- console.log('retrieveAccountForInternalSession: ' + url);
7285
- return this.http.get(url).pipe(map((account) => {
7278
+ const url = this.hostUrl + this.accountsUrl + '/internal/personID/' + personID + '/sessionID/' + sessionID;
7279
+ return this.http.get(url, { params: { 'app': app } }).pipe(map((account) => {
7286
7280
  this.account = account;
7287
7281
  this.personID = personID;
7288
7282
  this.sessionID = sessionID;
7289
- console.log('retrieveAccountForInternalSession: ' + this.account?.loginName || '<unknown>');
7283
+ this.sessionID$.next(sessionID);
7290
7284
  return account;
7291
7285
  }));
7292
7286
  }
@@ -7361,13 +7355,13 @@ class OepaUserAccountService {
7361
7355
  * The methods below currently apply only to eBiz.
7362
7356
  * ===========================================================================================================================
7363
7357
  */
7364
- getWebappsRootURL() {
7358
+ getWebappsRootURL(app) {
7365
7359
  if (this.webappsRootURL) {
7366
7360
  return of(this.webappsRootURL);
7367
7361
  }
7368
7362
  else {
7369
7363
  const url = this.hostUrl + '/api/v1/gateway/gatewayConfig';
7370
- return this.http.get(url).pipe(map((gatewayConfig) => {
7364
+ return this.http.get(url, { params: { 'app': app } }).pipe(map((gatewayConfig) => {
7371
7365
  if (gatewayConfig) {
7372
7366
  this.webappsRootURL = gatewayConfig.webappsRootURL;
7373
7367
  }
@@ -7375,13 +7369,13 @@ class OepaUserAccountService {
7375
7369
  }));
7376
7370
  }
7377
7371
  }
7378
- getEBizVersion() {
7372
+ getEBizVersion(app) {
7379
7373
  if (this.ebizVersion) {
7380
7374
  return of(this.ebizVersion);
7381
7375
  }
7382
7376
  else {
7383
7377
  const url = this.hostUrl + '/api/v1/gateway/gatewayConfig';
7384
- return this.http.get(url).pipe(map((gatewayConfig) => {
7378
+ return this.http.get(url, { params: { 'app': app } }).pipe(map((gatewayConfig) => {
7385
7379
  if (gatewayConfig) {
7386
7380
  this.ebizVersion = gatewayConfig.versionNumber;
7387
7381
  }
@@ -7588,6 +7582,7 @@ class PinModalComponent {
7588
7582
  }
7589
7583
  submitCallback;
7590
7584
  submittingComponent;
7585
+ app = '';
7591
7586
  close = new EventEmitter();
7592
7587
  imageRoot = '/AngularWebApp/assets/images';
7593
7588
  oepaSubmissionForm;
@@ -7618,7 +7613,7 @@ class PinModalComponent {
7618
7613
  }
7619
7614
  retrievePin() {
7620
7615
  this.errorMessage = '';
7621
- this.userAccountService.retrieveAccountForCurrentUser().subscribe(account => {
7616
+ this.userAccountService.retrieveAccountForCurrentUser(this.app).subscribe(account => {
7622
7617
  if (account) {
7623
7618
  this.userAccount = account;
7624
7619
  this.currentUserID = account.loginName;
@@ -7736,7 +7731,7 @@ class PinModalComponent {
7736
7731
  });
7737
7732
  }
7738
7733
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PinModalComponent, deps: [{ token: OepaUserAccountService }, { token: i1$2.FormBuilder }, { token: OepaPinService }, { token: i2$1.BsModalRef }], target: i0.ɵɵFactoryTarget.Component });
7739
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PinModalComponent, selector: "oepa-pin-modal", inputs: { attestationID: "attestationID", submitCallback: "submitCallback", submittingComponent: "submittingComponent" }, outputs: { close: "close" }, ngImport: i0, template: "<form [formGroup]=\"oepaSubmissionForm\">\n <div class=\"modal-body\">\n\n <div [hidden]=\"noPin\">\n <div class=\"card-header\">\n <div class=\"row\" *ngIf=\"pinAttestation.text\">\n <div class=\"col-md-12\">\n <div class=\"well\" [innerHTML]=\"pinAttestation.text\"></div>\n </div>\n </div>\n </div>\n <br>\n <div class=\"card-header\" *ngIf=\"serviceAttestation\">\n <div class=\"row\" *ngIf=\"serviceAttestation.text\">\n <div class=\"col-md-12\">\n <div class=\"well\" [innerHTML]=\"serviceAttestation.text\">\"</div>\n </div>\n </div>\n </div>\n </div>\n <br>\n\n <div class=\"row\" *ngIf=\"loadingAttestations\">\n <div class=\"col-md-12\">\n <div class=\"alert alert-info\">\n <span class=\"spinner-border text-primary\" role=\"status\"></span> Loading PIN information...\n </div>\n </div>\n </div>\n\n <div [hidden]=\"loadingAttestations || noPin\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label style=\"padding: 5px;\"><b>Security Question:</b></label>\n <label>{{securityQuestion.question}}</label>\n <div>\n <input [ngClass]=\"{'is-invalid':showValidation && !oepaSubmissionForm.controls['securityAnswer'].valid}\"\n formControlName=\"securityAnswer\" type=\"password\" class=\"form-control\" name=\"securityAnswer\" placeholder=\"Answer\" required>\n <small class=\"invalid-feedback\" *ngIf=\"showValidation && !oepaSubmissionForm.controls['securityAnswer'].valid\">Answer to security question is required</small>\n </div>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label><b>PIN: </b></label>\n <div>\n <input [ngClass]=\"{'is-invalid':showValidation && !oepaSubmissionForm.controls['securityPIN'].valid}\"\n formControlName=\"securityPIN\" type=\"password\" class=\"form-control\" name=\"securityPIN\" placeholder=\"PIN\" required>\n <small class=\"invalid-feedback\" *ngIf=\"showValidation && !oepaSubmissionForm.controls['securityPIN'].valid\">A valid PIN is required</small>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <div >\n <div class=\"row\">\n <div class=\"col-md-12\">\n <!-- toggle hasPin message -->\n <div *ngIf=\"noPin\">\n <b>Attention:</b> Before you can submit, you first must activate your PIN. Cancel this submission, save the application/report and go back to the main eBusiness Home Page. \n Select <b>MY Account- Request New PIN</b> to get started. <br>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row\" *ngIf=\"errorMessage\">\n <div class=\"col-md-12\">\n <div class=\"alert alert-danger\" role=\"alert\">{{ errorMessage }}</div>\n </div>\n </div>\n\n </div>\n\n\n <div class=\"modal-footer\">\n <span *ngIf=\"submitInProgress === true\" id=\"wait\"><span class=\"spinner-border text-primary\" role=\"status\"></span>Please wait...&nbsp;&nbsp;</span>\n <button class=\"btn btn-primary mr-1\" (click)=\"submit()\" [disabled]=\"submitInProgress || !oepaSubmissionForm.valid\">Submit</button>\n <button class=\"btn btn-primary mr-1\" (click)=\"cancel()\" [disabled]=\"submitInProgress\">Cancel</button>\n </div>\n\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
7734
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: PinModalComponent, selector: "oepa-pin-modal", inputs: { attestationID: "attestationID", submitCallback: "submitCallback", submittingComponent: "submittingComponent", app: "app" }, outputs: { close: "close" }, ngImport: i0, template: "<form [formGroup]=\"oepaSubmissionForm\">\n <div class=\"modal-body\">\n\n <div [hidden]=\"noPin\">\n <div class=\"card-header\">\n <div class=\"row\" *ngIf=\"pinAttestation.text\">\n <div class=\"col-md-12\">\n <div class=\"well\" [innerHTML]=\"pinAttestation.text\"></div>\n </div>\n </div>\n </div>\n <br>\n <div class=\"card-header\" *ngIf=\"serviceAttestation\">\n <div class=\"row\" *ngIf=\"serviceAttestation.text\">\n <div class=\"col-md-12\">\n <div class=\"well\" [innerHTML]=\"serviceAttestation.text\">\"</div>\n </div>\n </div>\n </div>\n </div>\n <br>\n\n <div class=\"row\" *ngIf=\"loadingAttestations\">\n <div class=\"col-md-12\">\n <div class=\"alert alert-info\">\n <span class=\"spinner-border text-primary\" role=\"status\"></span> Loading PIN information...\n </div>\n </div>\n </div>\n\n <div [hidden]=\"loadingAttestations || noPin\">\n <div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label style=\"padding: 5px;\"><b>Security Question:</b></label>\n <label>{{securityQuestion.question}}</label>\n <div>\n <input [ngClass]=\"{'is-invalid':showValidation && !oepaSubmissionForm.controls['securityAnswer'].valid}\"\n formControlName=\"securityAnswer\" type=\"password\" class=\"form-control\" name=\"securityAnswer\" placeholder=\"Answer\" required>\n <small class=\"invalid-feedback\" *ngIf=\"showValidation && !oepaSubmissionForm.controls['securityAnswer'].valid\">Answer to security question is required</small>\n </div>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"form-group\">\n <label><b>PIN: </b></label>\n <div>\n <input [ngClass]=\"{'is-invalid':showValidation && !oepaSubmissionForm.controls['securityPIN'].valid}\"\n formControlName=\"securityPIN\" type=\"password\" class=\"form-control\" name=\"securityPIN\" placeholder=\"PIN\" required>\n <small class=\"invalid-feedback\" *ngIf=\"showValidation && !oepaSubmissionForm.controls['securityPIN'].valid\">A valid PIN is required</small>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n <div >\n <div class=\"row\">\n <div class=\"col-md-12\">\n <!-- toggle hasPin message -->\n <div *ngIf=\"noPin\">\n <b>Attention:</b> Before you can submit, you first must activate your PIN. Cancel this submission, save the application/report and go back to the main eBusiness Home Page. \n Select <b>MY Account- Request New PIN</b> to get started. <br>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"row\" *ngIf=\"errorMessage\">\n <div class=\"col-md-12\">\n <div class=\"alert alert-danger\" role=\"alert\">{{ errorMessage }}</div>\n </div>\n </div>\n\n </div>\n\n\n <div class=\"modal-footer\">\n <span *ngIf=\"submitInProgress === true\" id=\"wait\"><span class=\"spinner-border text-primary\" role=\"status\"></span>Please wait...&nbsp;&nbsp;</span>\n <button class=\"btn btn-primary mr-1\" (click)=\"submit()\" [disabled]=\"submitInProgress || !oepaSubmissionForm.valid\">Submit</button>\n <button class=\"btn btn-primary mr-1\" (click)=\"cancel()\" [disabled]=\"submitInProgress\">Cancel</button>\n </div>\n\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1$2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1$2.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i1$2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1$2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }] });
7740
7735
  }
7741
7736
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: PinModalComponent, decorators: [{
7742
7737
  type: Component,
@@ -7747,6 +7742,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
7747
7742
  type: Input
7748
7743
  }], submittingComponent: [{
7749
7744
  type: Input
7745
+ }], app: [{
7746
+ type: Input
7750
7747
  }], close: [{
7751
7748
  type: Output
7752
7749
  }] } });
@@ -9461,6 +9458,7 @@ class OepaHttpInterceptor {
9461
9458
  userAccountService;
9462
9459
  defaultTimeout = 5 * 60 * 1000;
9463
9460
  userID = '';
9461
+ sessionID = '';
9464
9462
  constructor(userAccountService) {
9465
9463
  this.userAccountService = userAccountService;
9466
9464
  this.userAccountService.userAccount$.subscribe(account => {
@@ -9468,6 +9466,9 @@ class OepaHttpInterceptor {
9468
9466
  this.userID = account.loginName || '';
9469
9467
  }
9470
9468
  });
9469
+ this.userAccountService.sessionID$.subscribe(sessionID => {
9470
+ this.sessionID = sessionID;
9471
+ });
9471
9472
  }
9472
9473
  /**
9473
9474
  * Add a timestamp as a query parameter to all http requests
@@ -9483,6 +9484,9 @@ class OepaHttpInterceptor {
9483
9484
  if (this.userID) {
9484
9485
  params['userid'] = this.userID;
9485
9486
  }
9487
+ if (this.sessionID) {
9488
+ params['sessionid'] = this.sessionID;
9489
+ }
9486
9490
  let changedReq = undefined;
9487
9491
  if (authToken) {
9488
9492
  changedReq = req.clone({