Skip to content

Commit

Permalink
scheduler wasa second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
NKOKKILIGADDA87 committed Nov 30, 2024
1 parent 306b6b9 commit 67c432e
Show file tree
Hide file tree
Showing 13 changed files with 95 additions and 54 deletions.
2 changes: 1 addition & 1 deletion WEB-INF/jboss-web.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<jboss-web>
<context-root>/scheduler</context-root>
<context-root>/scheduler-wasa</context-root>
</jboss-web>
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as moment from 'moment';
import { SetLanguageComponent } from '../../../core/components/set-language.component';
import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service';
import * as ExcelJS from 'exceljs';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';
import * as saveAs from 'file-saver';

declare global {
Expand All @@ -52,6 +53,7 @@ export class MonthlyReportComponent implements OnInit, DoCheck {
private schedulerService: SchedulerService,
public httpServiceService: HttpServiceService,
private confirmationService: ConfirmationService,
readonly sessionstorage: SessionStorageService,
) {}

providerServiceMapID: any;
Expand All @@ -63,8 +65,10 @@ export class MonthlyReportComponent implements OnInit, DoCheck {
criteriaHead: any;

ngOnInit() {
this.providerServiceMapID = localStorage.getItem('tm-providerServiceMapID');
this.userID = localStorage.getItem('tm-userID');
this.providerServiceMapID = this.sessionstorage.getItem(
'tm-providerServiceMapID',
);
this.userID = this.sessionstorage.getItem('tm-userID');
this.getServicePoint();
this.createMonthlyReportForm();
this.fetchLanguageResponse();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import * as moment from 'moment';
import { SetLanguageComponent } from '../../../core/components/set-language.component';
import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service';
import * as ExcelJS from 'exceljs';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';
import * as saveAs from 'file-saver';

declare global {
Expand All @@ -51,6 +52,7 @@ export class TotalConsultationReportComponent implements OnInit, DoCheck {
private schedulerService: SchedulerService,
public httpServiceService: HttpServiceService,
private confirmationService: ConfirmationService,
readonly sessionstorage: SessionStorageService,
) {}

providerServiceMapID: any;
Expand All @@ -62,8 +64,10 @@ export class TotalConsultationReportComponent implements OnInit, DoCheck {
criteriaHead: any;

ngOnInit() {
this.providerServiceMapID = localStorage.getItem('tm-providerServiceMapID');
this.userID = localStorage.getItem('tm-userID');
this.providerServiceMapID = this.sessionstorage.getItem(
'tm-providerServiceMapID',
);
this.userID = this.sessionstorage.getItem('tm-userID');
this.fetchLanguageResponse();
this.createTotalConsultationForm();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
import { HttpClient } from '@angular/common/http';
import { Injectable } from '@angular/core';
import { environment } from 'src/environments/environment';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';

@Injectable()
export class SchedulerService {
constructor(private http: HttpClient) {}
constructor(
private http: HttpClient,
readonly sessionstorage: SessionStorageService,
) {}

getServicePoints(userId: string, serviceProviderId: string) {
return this.http.post(environment.servicePointUrl, {
Expand Down Expand Up @@ -129,7 +133,7 @@ export class SchedulerService {
}

getAllSMSTemplates(smsTypeID?: any) {
const providerServiceMapID = localStorage.getItem(
const providerServiceMapID = this.sessionstorage.getItem(
'tm-providerServiceMapID',
);
return this.http.post(environment.getAllSMSTemplatesUrl, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { ActivatedRoute } from '@angular/router';
import { SetLanguageComponent } from '../../../core/components/set-language.component';
import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service';
import { MatTableDataSource } from '@angular/material/table';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';

@Component({
selector: 'app-create-sms-template',
Expand Down Expand Up @@ -70,6 +71,7 @@ export class CreateSmsTemplateComponent implements OnInit, DoCheck {
private confirmationService: ConfirmationService,
private location: Location,
private activatedRoute: ActivatedRoute,
readonly sessionstorage: SessionStorageService,
) {}
ngDoCheck(): void {
throw new Error('Method not implemented.');
Expand Down Expand Up @@ -207,8 +209,8 @@ export class CreateSmsTemplateComponent implements OnInit, DoCheck {

addSMSParameterTemplate() {
const reqObj = {
createdBy: localStorage.getItem('tm-userName'),
modifiedBy: localStorage.getItem('tm-userName'),
createdBy: this.sessionstorage.getItem('tm-userName'),
modifiedBy: this.sessionstorage.getItem('tm-userName'),
smsParameterName: this.parameter,
smsParameterType: this.smsParameterType.smsParameterType,
smsParameterID: this.smsParameterValue.smsParameterID,
Expand Down Expand Up @@ -250,8 +252,10 @@ export class CreateSmsTemplateComponent implements OnInit, DoCheck {

saveSMStemplate() {
const requestObject = {
createdBy: localStorage.getItem('tm-userName'),
providerServiceMapID: localStorage.getItem('tm-providerServiceMapID'),
createdBy: this.sessionstorage.getItem('tm-userName'),
providerServiceMapID: this.sessionstorage.getItem(
'tm-providerServiceMapID',
),
smsParameterMaps: this.mappedSMSParameter,
smsTemplate: this.smsTemplate,
smsTemplateName: this.smsTemplateName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import { Router } from '@angular/router';
import { SetLanguageComponent } from '../../../core/components/set-language.component';
import { HttpServiceService } from 'src/app/app-modules/core/services/http-service.service';
import { MatTableDataSource } from '@angular/material/table';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';
import { MatPaginator } from '@angular/material/paginator';
@Component({
selector: 'app-sms-template-list',
Expand All @@ -52,6 +53,7 @@ export class SmsTemplateListComponent implements OnInit, DoCheck {
private confirmationService: ConfirmationService,
public httpServiceService: HttpServiceService,
private router: Router,
readonly sessionstorage: SessionStorageService,
) {}

ngOnInit() {
Expand Down Expand Up @@ -89,7 +91,7 @@ export class SmsTemplateListComponent implements OnInit, DoCheck {

activateDeactivate(template: any, flag: any) {
template.deleted = flag;
template.modifiedBy = localStorage.getItem('tm-userName');
template.modifiedBy = this.sessionstorage.getItem('tm-userName');
this.schedulerService.updateSMSTemplate(template).subscribe({
next: (res: any) => {
console.log('res', res);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { Component, DoCheck, OnInit } from '@angular/core';
import { SchedulerService } from '../shared/services/scheduler.service';
import { SetLanguageComponent } from '../../core/components/set-language.component';
import { HttpServiceService } from '../../core/services/http-service.service';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';

@Component({
selector: 'app-specialization-calander-view',
Expand All @@ -41,6 +42,7 @@ export class SpecializationCalanderViewComponent implements OnInit, DoCheck {
constructor(
private schedulerService: SchedulerService,
public httpServiceService: HttpServiceService,
readonly sessionstorage: SessionStorageService,
) {}

ngOnInit() {
Expand All @@ -63,8 +65,10 @@ export class SpecializationCalanderViewComponent implements OnInit, DoCheck {
const specializationDetails = {
date: new Date(this.viewDate),
specializationID: this.selectedSpecialization,
userID: localStorage.getItem('tm-userID'),
providerServiceMapID: localStorage.getItem('tm-providerServiceMapID'),
userID: this.sessionstorage.getItem('tm-userID'),
providerServiceMapID: this.sessionstorage.getItem(
'tm-providerServiceMapID',
),
};

this.schedulerService
Expand Down
15 changes: 10 additions & 5 deletions src/app/app-modules/scheduler/timesheet/timesheet.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ import { CalendarOptions } from '@fullcalendar/core';
import dayGridPlugin from '@fullcalendar/daygrid';
import { DateTime } from 'ts-luxon';
import * as moment from 'moment';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';

@Component({
selector: 'app-timesheet',
Expand Down Expand Up @@ -81,6 +82,7 @@ export class TimesheetComponent implements OnInit, OnChanges, DoCheck {
public httpServiceService: HttpServiceService,
private confirmationService: ConfirmationService,
private schedulerService: SchedulerService,
readonly sessionstorage: SessionStorageService,
) {}

ngOnInit() {
Expand Down Expand Up @@ -116,9 +118,11 @@ export class TimesheetComponent implements OnInit, OnChanges, DoCheck {
console.log('param', param);
this.designation = param['designation'];
if (this.designation === 'TC Specialist') {
userInfo = { userID: localStorage.getItem('tm-userID') };
userInfo = { userID: this.sessionstorage.getItem('tm-userID') };
} else {
userInfo = { userID: localStorage.getItem('supervisor-specialistID') };
userInfo = {
userID: this.sessionstorage.getItem('supervisor-specialistID'),
};
}
this.selectedSpecialist = userInfo;
this.schedulerService
Expand Down Expand Up @@ -158,7 +162,8 @@ export class TimesheetComponent implements OnInit, OnChanges, DoCheck {

availabilityFormValue.ExcludeDays = this.getExcludedDays(this.dayList);

availabilityFormValue.createdBy = localStorage.getItem('tm-userName');
availabilityFormValue.createdBy =
this.sessionstorage.getItem('tm-userName');
availabilityFormValue.userID = this.selectedSpecialist.userID;

if (availabilityFormValue.isAvailability === 'true') {
Expand Down Expand Up @@ -337,10 +342,10 @@ export class TimesheetComponent implements OnInit, OnChanges, DoCheck {
this.selectedSpecialist = undefined;
this.availabiltyForm.reset();

const providerServiceMapID = localStorage.getItem(
const providerServiceMapID = this.sessionstorage.getItem(
'tm-providerServiceMapID',
);
const userID = localStorage.getItem('tm-userID');
const userID = this.sessionstorage.getItem('tm-userID');
const specializationID = this.selectedSpecialization.specializationID;
this.schedulerService
.getSpecialist({ specializationID, providerServiceMapID, userID })
Expand Down
27 changes: 16 additions & 11 deletions src/app/redir-open/redir-open.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import { SpinnerService } from '../app-modules/core/services/spinner.service';
import { Location } from '@angular/common';
import { AuthService } from '../app-modules/core/services/auth.service';
import { ConfirmationService } from '../app-modules/core/services/confirmation.service';
import { SessionStorageService } from 'src/app/app-modules/core/services/session-storage.service';

@Component({
selector: 'app-redir-open',
Expand All @@ -56,6 +57,7 @@ export class RedirOpenComponent implements OnInit {
private auth: AuthService,
private confirmationService: ConfirmationService,
private authService: AuthService,
readonly sessionstorage: SessionStorageService,
) {}

ngOnInit() {
Expand Down Expand Up @@ -96,7 +98,7 @@ export class RedirOpenComponent implements OnInit {
params['user'] === 'undefined' ? undefined : params['user'];
if (this.externalSession && this.externalSession.auth) {
sessionStorage.setItem('tm-key', this.externalSession.auth);
sessionStorage.setItem(
this.sessionstorage.setItem(
'tm-parentLogin',
`${this.externalSession.protocol}//${this.externalSession.host}`,
);
Expand Down Expand Up @@ -131,7 +133,7 @@ export class RedirOpenComponent implements OnInit {
const designation = this.getUserDesignation(res.data);

const providerServiceMapID = TMPrevilegeObj[0].providerServiceMapID;
sessionStorage.setItem(
this.sessionstorage.setItem(
'apimanClientKey',
TMPrevilegeObj[0].apimanClientKey,
);
Expand Down Expand Up @@ -174,30 +176,33 @@ export class RedirOpenComponent implements OnInit {
}

storeExernalSessionData(externalSession: any, loginResponse: any) {
sessionStorage.setItem(
this.sessionstorage.setItem(
'tm-fallback',
`${this.externalSession.protocol}//${this.externalSession.host}#${this.externalSession.fallbackURL}`,
);
sessionStorage.setItem(
this.sessionstorage.setItem(
'tm-return',
`${this.externalSession.protocol}//${this.externalSession.host}#${this.externalSession.returnURL}`,
);
sessionStorage.setItem(
this.sessionstorage.setItem(
'tm-parentLogin',
`${this.externalSession.protocol}//${this.externalSession.host}`,
);
sessionStorage.setItem('tm-host', `${this.externalSession.parentApp}`);
this.sessionstorage.setItem('tm-host', `${this.externalSession.parentApp}`);
sessionStorage.setItem('tm-key', this.externalSession.auth);
sessionStorage.setItem('tm-isAuthenticated', 'true');

localStorage.setItem('tm-roles', JSON.stringify(loginResponse.roles));
localStorage.setItem('tm-designation', loginResponse.designation);
localStorage.setItem('tm-userName', loginResponse.userName);
localStorage.setItem(
this.sessionstorage.setItem(
'tm-roles',
JSON.stringify(loginResponse.roles),
);
this.sessionstorage.setItem('tm-designation', loginResponse.designation);
this.sessionstorage.setItem('tm-userName', loginResponse.userName);
this.sessionstorage.setItem(
'tm-providerServiceMapID',
loginResponse.providerServiceMapID,
);
localStorage.setItem('tm-userID', loginResponse.userID);
this.sessionstorage.setItem('tm-userID', loginResponse.userID);
}

checkUserRolesAndDesignation(roles: any, designation: any) {
Expand Down
6 changes: 6 additions & 0 deletions src/environments/enckey.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export const keys = {
dev: '896Y7lbv0qFr1WgppH0NjSNRJZ9nDciBNeH6MA0F1MZDJb0SXhceLPw2kSpdObG1',
test: '896Y7lbv0qFr1WgppH0NjSNRJZ9nDciBNeH6MA0F1MZDJb0SXhceLPw2kSpdObG1',
prod: '896Y7lbv0qFr1WgppH0NjSNRJZ9nDciBNeH6MA0F1MZDJb0SXhceLPw2kSpdObG1',
ci: '896Y7lbv0qFr1WgppH0NjSNRJZ9nDciBNeH6MA0F1MZDJb0SXhceLPw2kSpdObG1',
};
17 changes: 9 additions & 8 deletions src/environments/environment.development.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.

const commonIP = 'https://183.82.107.186:8080/';
const tmIP = 'https://183.82.107.186:8080/';
const schedulerIP = 'https://183.82.107.186:8080/';
const commonIP = 'https://amritwprdev.piramalswasthya.org/';
const tmIP = 'https://amritwprdev.piramalswasthya.org/';
const schedulerIP = 'https://amritwprdev.piramalswasthya.org/';

// Without API MAN Configuration
const COMMON_API_OPEN = `${commonIP}commonapi-v1.0/`;
const COMMON_API = `${commonIP}commonapi-v1.0/`;
const SCHEDULER_API = `${schedulerIP}schedulerapi-v1.0/`;
const TM_API = `${tmIP}tmapi-v1.0/`;
const COMMON_API_OPEN = `${commonIP}commonapi-3.0.0/`;
const COMMON_API = `${commonIP}commonapi-v3.0.0/`;
const SCHEDULER_API = `${schedulerIP}schedulerapi-v3.0.0/`;
const TM_API = `${tmIP}tmapi-v3.0.0/`;
import { keys } from './enckey';

export const environment = {
production: true,

encKey: keys.dev,
app: `TM`,

/**
Expand Down
17 changes: 9 additions & 8 deletions src/environments/environment.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@
// `ng build --env=prod` then `environment.prod.ts` will be used instead.
// The list of which env maps to which file can be found in `.angular-cli.json`.

const commonIP = 'https://183.82.107.186:8080/';
const tmIP = 'https://183.82.107.186:8080/';
const schedulerIP = 'https://183.82.107.186:8080/';
const commonIP = 'https://amritwprdev.piramalswasthya.org/';
const tmIP = 'https://amritwprdev.piramalswasthya.org/';
const schedulerIP = 'https://amritwprdev.piramalswasthya.org/';

// Without API MAN Configuration
const COMMON_API_OPEN = `${commonIP}commonapi-v1.0/`;
const COMMON_API = `${commonIP}commonapi-v1.0/`;
const SCHEDULER_API = `${schedulerIP}schedulerapi-v1.0/`;
const TM_API = `${tmIP}tmapi-v1.0/`;
const COMMON_API_OPEN = `${commonIP}commonapi-v3.0.0/`;
const COMMON_API = `${commonIP}commonapi-v3.0.0/`;
const SCHEDULER_API = `${schedulerIP}schedulerapi-v3.0.0/`;
const TM_API = `${tmIP}tmapi-v3.0.0/`;
import { keys } from './enckey';

export const environment = {
production: true,

encKey: keys.prod,
app: `TM`,

/**
Expand Down
Loading

0 comments on commit 67c432e

Please sign in to comment.