diff --git a/.eslintrc.json b/.eslintrc.json index 94bb02a..424b1d1 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -39,6 +39,21 @@ "eqeqeq": 1 } }, + { + "files": [ + "*.js" + ], + "parserOptions": { + "ecmaVersion": 2020 + }, + "env": { + "node": true, + "es6": true + }, + "extends": [ + "eslint:recommended" + ] + }, { "files": [ "*.html" diff --git a/.github/workflows/build-on-pull-request.yml b/.github/workflows/build-on-pull-request.yml index 739403c..c679681 100644 --- a/.github/workflows/build-on-pull-request.yml +++ b/.github/workflows/build-on-pull-request.yml @@ -7,21 +7,28 @@ jobs: Build: runs-on: ubuntu-latest steps: - - name: Checkout code - uses: actions/checkout@v3 + - name: Checkout code with submodule + uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + submodules: true + fetch-depth: 0 + + - name: Update submodules + run: | + git submodule init + git submodule update --recursive - name: Setup JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: 17 distribution: 'zulu' - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: 18 @@ -30,8 +37,6 @@ jobs: npm config set legacy-peer-deps true npm install -g @angular/cli npm install typescript@5.1.3 --save-dev - npm install ng2-smart-table@1.2.1 - npm install node-sass npm install --force - npm run build + npm run build-ci diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml new file mode 100644 index 0000000..9c4b597 --- /dev/null +++ b/.github/workflows/commit-lint.yml @@ -0,0 +1,30 @@ +name: Commit Compliance + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + commitlint: + runs-on: ubuntu-latest + + steps: + - name: Checkout code with submodule + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + submodules: true + fetch-depth: 0 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + + - name: Install dependencies + run: npm ci --legacy-peer-deps + + - name: Run commitlint on PR + run: | + npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose diff --git a/.github/workflows/lint_audit.yml b/.github/workflows/lint_audit.yml new file mode 100755 index 0000000..a47735b --- /dev/null +++ b/.github/workflows/lint_audit.yml @@ -0,0 +1,12 @@ +name: ESLint and NPM Audit + +on: + push: + branches: [main, master, develop] + pull_request: + branches: [main, master, develop] + +jobs: + lint-and-audit: + uses: PSMRI/.github/.github/workflows/lint_audit.yml@main + diff --git a/.github/workflows/package-prod.yml b/.github/workflows/package-prod.yml deleted file mode 100644 index 4ff7e10..0000000 --- a/.github/workflows/package-prod.yml +++ /dev/null @@ -1,48 +0,0 @@ -name: Package Prod -on: - push: - branches: [ "master"] - -jobs: - Package: - runs-on: ubuntu-latest - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - steps: - - - name: Checkout code - uses: actions/checkout@v3 - - - name: Set up Java - uses: actions/setup-java@v3 - with: - java-version: '17' - distribution: 'zulu' - - - name: Set up Node.js - uses: actions/setup-node@v2 - with: - node-version: 18 - - - name: Build with Yarn - run: | - npm config set legacy-peer-deps true - npm install -g @angular/cli - npm install -g grunt-cli - npm install typescript@5.1.3 --save-dev - npm install ng2-smart-table@1.2.1 - npm install node-sass --force - npm install --force - ng build --configuration production - - - - name: Upload WAR file as artifact - uses: actions/upload-artifact@v2 - with: - name: ECD-UI - path: dist/ecd-ui-next/ecd-ui-next.war diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 95a98a9..db4cf66 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -16,16 +16,16 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Java - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: '17' distribution: 'zulu' - name: Set up Node.js - uses: actions/setup-node@v2 + uses: actions/setup-node@v4 with: node-version: 18 @@ -34,16 +34,14 @@ jobs: npm config set legacy-peer-deps true npm install -g @angular/cli npm install typescript@5.1.3 --save-dev - npm install ng2-smart-table@1.2.1 - npm install node-sass npm install --force - npm run build + npm run build-ci - name: Create WAR file - run: jar -cvf ecd-ui-next.war -C dist . + run: jar -cvf ecd-ui.war -C dist . - name: Upload WAR file as artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ECD-UI - path: ecd-ui-next.war + path: dist/ecd-ui/ecd-ui.war diff --git a/.github/workflows/sast.yml b/.github/workflows/sast.yml index 72de49f..4489a6d 100644 --- a/.github/workflows/sast.yml +++ b/.github/workflows/sast.yml @@ -35,24 +35,24 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 with: category: "/language:${{matrix.language}}" diff --git a/.gitignore b/.gitignore index 89f7697..f34e68e 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /tmp /out-tsc /bazel-out +/environments/enckey.ts`` # Node /node_modules @@ -42,4 +43,5 @@ testem.log Thumbs.db /.vscode src/environments/environment.ci.ts +src/environments/environment.ts target diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..e511780 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "Common-UI"] + path = Common-UI + url = https://github.com/PSMRI/Common-UI.git diff --git a/.husky/commit-msg b/.husky/commit-msg new file mode 100644 index 0000000..136cbda --- /dev/null +++ b/.husky/commit-msg @@ -0,0 +1 @@ +commitlint --edit ./.git/COMMIT_EDITMSG diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..2312dc5 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npx lint-staged diff --git a/.nvmrc b/.nvmrc index 6f7f377..3f430af 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v16 +v18 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 06f0dc7..9a5f17e 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -118,11 +118,11 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. -Community Impact Guidelines were inspired by +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder][Mozilla CoC]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dc34fb9..42e12a0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -3,21 +3,25 @@ AMRIT is released under the GPLv3 license. If you would like to contribute something, or want to hack on the code this document should help you get started. # Code of Conduct + This project adheres to the [Contributor Covenant](CODE_OF_CONDUCT.md). -By participating, you are expected to uphold this code. Please report unacceptable behavior to amrit@piramalswasthya.org. +By participating, you are expected to uphold this code. Please report unacceptable behavior to . # Using GitHub Issues + We use GitHub issues to track bugs and enhancements reported by the community. -If you have a general usage question please ask on amrit@piramalswasthya.org. +If you have a general usage question please ask on . If you are reporting a bug, please help to speed up problem diagnosis by providing as much information as possible. Ideally, that would include a small sample project that reproduces the problem. # Reporting Security Vulnerabilities + If you think you have found a security vulnerability in AMRIT please *DO NOT* disclose it publicly until we've had a chance to fix it. -Please don't report security vulnerabilities using GitHub issues, instead drop an email to amrit@piramalswasthya.org by providing as much as information as possible. +Please don't report security vulnerabilities using GitHub issues, instead drop an email to by providing as much as information as possible. # Code Conventions and Housekeeping + None of these are essential for a pull request, but they will all help. They can also be added after the original pull request but before a merge. * Make sure all new `.java` files have a Javadoc class comment with at least an `@author` tag identifying you, and preferably at least a paragraph on what the class is for. @@ -29,4 +33,5 @@ None of these are essential for a pull request, but they will all help. They ca * When writing a commit message please follow [these conventions](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). # Working with the Code -For information on editing, building, and testing the code, see the [developer guide](https://psmri.github.io/PSMRI) page on the project wiki. + +For information on editing, building, and testing the code, see the [developer guide](https://github.com/PSMRI/PSMRI) page on the project wiki. diff --git a/Common-UI b/Common-UI new file mode 160000 index 0000000..7356786 --- /dev/null +++ b/Common-UI @@ -0,0 +1 @@ +Subproject commit 7356786614ca5793589328d8abaa179a39ead119 diff --git a/README.md b/README.md index 9447d3a..099bc19 100644 --- a/README.md +++ b/README.md @@ -31,10 +31,9 @@ The Early Childhood Development (ECD) Initiative by the Ministry of Health and F This microservice is built using Java and the Spring Boot framework, with MySQL as the underlying database. Before building the ECD module, ensure you have the following prerequisites: -- JDK 1.8 +- JDK 17 - Maven -- NPM / YARN -- Spring Boot V2 +- Nodejs v18.10.0 - MySQL ### Installation @@ -52,6 +51,7 @@ To install the ECD module, please follow these steps: ## Building war files To build deployable war files + ```bash mvn -B package --file pom.xml -P ``` @@ -68,6 +68,15 @@ All the features of the ECD service are exposed as REST endpoints. Please refer The ECD module offers comprehensive management capabilities for your application. +## Filing Issues + +If you encounter any issues, bugs, or have feature requests, please file them in the [main AMRIT repository](https://github.com/PSMRI/AMRIT/issues). Centralizing all feedback helps us streamline improvements and address concerns efficiently. + +## Join Our Community + +We’d love to have you join our community discussions and get real-time support! +Join our [Discord server](https://discord.gg/FVQWsf5ENS) to connect with contributors, ask questions, and stay updated. + UTF-8 - ecd-ui-next-v1.0 + ecd-ui-v3.0.0 10.208.122.38 9990 localhost @@ -79,7 +79,7 @@ - ecd-ui-next-v1.0 + ${artifactId}-${version} maven-clean-plugin diff --git a/scripts/ci-prebuild.js b/scripts/ci-prebuild.js old mode 100644 new mode 100755 index ccc8830..513ce93 --- a/scripts/ci-prebuild.js +++ b/scripts/ci-prebuild.js @@ -41,6 +41,11 @@ const defaultEnvValues = { COMMON_API_BASE: '', ADMIN_API_BASE: '', ECD_API_BASE: '', + SESSION_STORAGE_ENC_KEY: '', + TELEPHONY_SERVER: '', + SITE_KEY:'', + CAPTCHA_CHALLENGE_URL:'', + ENABLE_CAPTCHA: false, }; // Generate output data diff --git a/src/app/app-modules/associate-anm-mo/agents-innerpage/agents-innerpage.component.ts b/src/app/app-modules/associate-anm-mo/agents-innerpage/agents-innerpage.component.ts index 30ff3df..0ecb4d0 100644 --- a/src/app/app-modules/associate-anm-mo/agents-innerpage/agents-innerpage.component.ts +++ b/src/app/app-modules/associate-anm-mo/agents-innerpage/agents-innerpage.component.ts @@ -33,6 +33,7 @@ import { LoginserviceService } from '../../services/loginservice/loginservice.se import { DomSanitizer } from '@angular/platform-browser'; import { AssociateAnmMoService } from '../../services/associate-anm-mo/associate-anm-mo.service'; import { SetLanguageService } from '../../services/set-language/set-language.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-agents-innerpage', @@ -77,6 +78,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { private ctiService: CtiService, private loginService: LoginserviceService, public sanitizer: DomSanitizer, + readonly sessionstorage:SessionStorageService, private setLanguageService: SetLanguageService, ) { } @@ -97,7 +99,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { this.getSelectedLanguage(); this.addListener(); this.isEnableComp = "Outbound Worklist"; - this.roleId = sessionStorage.getItem('roleId'); + this.roleId = this.sessionstorage.getItem('roleId'); // this.associateAnmMoService.setContainer(this.container); this.route.queryParams.subscribe((params: any) => { if(params !== undefined && params !==null){ @@ -151,9 +153,9 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { - this.benPhoneNo = sessionStorage.getItem("benPhoneNo"); - this.callId = sessionStorage.getItem("callId"); - // sessionStorage.setItem("onCall", "true"); + this.benPhoneNo = this.sessionstorage.getItem("benPhoneNo"); + this.callId = this.sessionstorage.getItem("callId"); + // this.sessionstorage.setItem("onCall", "true"); this.timeRemaining = this.ctiService.wrapupTime; @@ -286,15 +288,15 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { const reqObj = { obCallId: this.associateAnmMoService.selectedBenDetails.obCallId, - callReceivedUserId: sessionStorage.getItem('userId'), + callReceivedUserId: this.sessionstorage.getItem('userID'), beneficiaryRegId: this.associateAnmMoService.selectedBenDetails.beneficiaryRegId, - calledServiceId: sessionStorage.getItem('providerServiceMapID'), - psmId: sessionStorage.getItem('providerServiceMapID'), + calledServiceId: this.sessionstorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), subCategory: this.associateAnmMoService.selectedBenDetails.ecdCallType, callId: eventData[2], - createdBy: sessionStorage.getItem("userName"), + createdBy: this.sessionstorage.getItem('userName'), agentId: this.loginService.agentId, - receivedRoleName: sessionStorage.getItem('role'), + receivedRoleName: this.sessionstorage.getItem('role'), phoneNo: phNo, isMother: this.associateAnmMoService.isMother, }; @@ -307,13 +309,13 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { if(response && response.response) { this.associateAnmMoService.callDetailId = response.response.benCallId; - sessionStorage.setItem("onCall", "true"); + this.sessionstorage.setItem("onCall", "true"); this.callId = eventData[2]; - sessionStorage.setItem("benPhoneNo", eventData[1]); - sessionStorage.setItem("callId", eventData[2]); + this.sessionstorage.setItem("benPhoneNo", eventData[1]); + this.sessionstorage.setItem("callId", eventData[2]); - this.benPhoneNo = sessionStorage.getItem("benPhoneNo"); - this.callId = sessionStorage.getItem("callId"); + this.benPhoneNo = this.sessionstorage.getItem("benPhoneNo"); + this.callId = this.sessionstorage.getItem("callId"); this.associateAnmMoService.setLoadDetailsInReg(true); @@ -341,20 +343,16 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { "transfer event received, routing to inner page agent and then from their route to call screen" ); - sessionStorage.setItem("onCall", "true"); + this.sessionstorage.setItem("onCall", "true"); this.callId = eventData[2]; - sessionStorage.setItem("benPhoneNo", this.eventSpiltData[1]); - sessionStorage.setItem("callId", this.eventSpiltData[2]); + this.sessionstorage.setItem("benPhoneNo", this.eventSpiltData[1]); + this.sessionstorage.setItem("callId", this.eventSpiltData[2]); - this.benPhoneNo = sessionStorage.getItem("benPhoneNo"); - this.callId = sessionStorage.getItem("callId"); + this.benPhoneNo = this.sessionstorage.getItem("benPhoneNo"); + this.callId = this.sessionstorage.getItem("callId"); this.associateAnmMoService.setOpenComp("Call Closed"); - // this.associateAnmMoService.loadComponent( - // OutboundWorklistComponent, - // null - // ); + } - this.getAgentState(); } viewBenRegScreen() { @@ -484,15 +482,15 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { obCallId: this.associateAnmMoService.selectedBenDetails.obCallId, motherId :this.associateAnmMoService.selectedBenDetails.mctsidNo?this.associateAnmMoService.selectedBenDetails.mctsidNo:this.associateAnmMoService.selectedBenDetails.motherId, childId:this.associateAnmMoService.selectedBenDetails.mctsidNoChildId?this.associateAnmMoService.selectedBenDetails.mctsidNoChildId:null, - userId: sessionStorage.getItem('userId'), + userId: this.sessionstorage.getItem('userID'), agentId: this.loginService.agentId, - role: sessionStorage.getItem('role'), - phoneNo: sessionStorage.getItem("benPhoneNo"), - psmId: sessionStorage.getItem('providerServiceMapID'), + role: this.sessionstorage.getItem('role'), + phoneNo: this.sessionstorage.getItem("benPhoneNo"), + psmId: this.sessionstorage.getItem('providerServiceMapID'), ecdCallType:this.associateAnmMoService.selectedBenDetails.outboundCallType, - callId: sessionStorage.getItem("callId"), + callId: this.sessionstorage.getItem("callId"), isOutbound: true, - beneficiaryRegId: (this.associateAnmMoService.selectedBenDetails.beneficiaryRegId === null) ? sessionStorage.getItem("beneficiaryRegId"): this.associateAnmMoService.selectedBenDetails.beneficiaryRegId, + beneficiaryRegId: (this.associateAnmMoService.selectedBenDetails.beneficiaryRegId === null) ? this.sessionstorage.getItem("beneficiaryRegId"): this.associateAnmMoService.selectedBenDetails.beneficiaryRegId, isFurtherCallRequired: true, reasonForNoFurtherCallsId: null, reasonForNoFurtherCalls: null, @@ -511,19 +509,20 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { isHrp: this.associateAnmMoService.isMother?this.associateAnmMoService.isHighRiskPregnancy:false, isHrni: (this.associateAnmMoService.isMother === false)?this.associateAnmMoService.isHighRiskInfant:false, deleted: false, - createdBy: sessionStorage.getItem("userName"), - modifiedBy: sessionStorage.getItem("userName"), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), complaintId: null, - isWrongNumber: false + isWrongNumber: false, + preferredLanguage: null }; const commonReqobj = { benCallID: this.associateAnmMoService.callDetailId, - callID: sessionStorage.getItem("callId"), + callID: this.sessionstorage.getItem("callId"), remarks: null, callTypeID: this.callTypeId, emergencyType: 0, - agentIPAddress: sessionStorage.getItem("agentIp"), - createdBy: sessionStorage.getItem("userName"), + agentIPAddress: this.sessionstorage.getItem("agentIp"), + createdBy: this.sessionstorage.getItem('userName'), isFollowupRequired: false, fitToBlock: false, endCall: true, @@ -546,7 +545,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { 'success' ); this.unsubscribeWrapupTime(); - sessionStorage.setItem("onCall", "false"); + this.sessionstorage.setItem("onCall", "false"); this.associateAnmMoService.fromComponent = null; this.associateAnmMoService.setCallClosure(); this.resetSessions(); @@ -577,7 +576,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { getCallTypes() { const reqObj={ - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') } this.associateAnmMoService.getCallTypes(reqObj).subscribe( (response:any) => { @@ -649,7 +648,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { (response: any) => { if (response && response.statusCode === 200 && response.data) { const agentIp = response.data.agent_ip - sessionStorage.setItem('agentIp', agentIp); + this.sessionstorage.setItem('agentIp', agentIp); } else { this.confirmationService.openDialog(response.errorMessage, `info`); @@ -667,7 +666,7 @@ export class AgentsInnerpageComponent implements OnInit, DoCheck, OnDestroy { }) backToDashboard(){ - if(sessionStorage.getItem("onCall") === "true") { + if(this.sessionstorage.getItem("onCall") === "true") { this.confirmationService.openDialog(this.currentLanguageSet.youAreNotAllowedToGoBackToDashboard, 'info') } diff --git a/src/app/app-modules/associate-anm-mo/associate-anm-mo.module.ts b/src/app/app-modules/associate-anm-mo/associate-anm-mo.module.ts index 58fa519..32adf51 100644 --- a/src/app/app-modules/associate-anm-mo/associate-anm-mo.module.ts +++ b/src/app/app-modules/associate-anm-mo/associate-anm-mo.module.ts @@ -44,6 +44,12 @@ import { BenRegistrationComponent } from './beneficiary-registration/ben-registr import { BeneficiaryCallHistoryComponent } from './beneficiary-call-history/beneficiary-call-history.component'; import { HighRiskReasonsComponent } from './high-risk-reasons/high-risk-reasons.component'; import { SharedModule } from '../shared/shared.module'; +import { MatDialogModule } from '@angular/material/dialog'; +import { VideoConsultationComponent } from './video-consultation/video-consultation.component'; +import { SafeUrlPipe } from './safe-url.pipe'; +import { MatSnackBarModule } from '@angular/material/snack-bar'; +import { FloatingVideoComponent } from './floating-videocall/floating-video.component'; + @NgModule({ @@ -56,7 +62,11 @@ import { SharedModule } from '../shared/shared.module'; EcdQuestionnaireComponent, BenRegistrationComponent, BeneficiaryCallHistoryComponent, - HighRiskReasonsComponent + HighRiskReasonsComponent, + VideoConsultationComponent, + SafeUrlPipe, + FloatingVideoComponent + // VideoComponent, ], imports: [ @@ -72,7 +82,9 @@ import { SharedModule } from '../shared/shared.module'; MaterialModule, FormsModule, ReactiveFormsModule, - SharedModule + SharedModule, + MatDialogModule, + MatSnackBarModule ], providers: [DatePipe], }) diff --git a/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.html b/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.html index 878fa89..ccdf9f5 100644 --- a/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.html +++ b/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.html @@ -1,614 +1,309 @@
- -

{{currentLanguageSet?.beneficiaryRegistration}}

- -
- -
+ +

{{currentLanguageSet?.beneficiaryRegistration}}

+ +
+ +
+
-
-
- - {{ currentLanguageSet?.motherID}} - - -
- -
- - {{ currentLanguageSet?.childId}} - - -
- - -
- - {{ currentLanguageSet?.childName}} - + +
+ + {{ currentLanguageSet?.motherID}} + -
+
-
- - {{ currentLanguageSet?.motherName}} - - -
- -
- - {{ enableMotherRecord ? currentLanguageSet?.husbandName : currentLanguageSet?.fatherName }} - +
+ + {{ currentLanguageSet?.childId}} + -
+
- - -
- - {{currentLanguageSet?.gender}} - - - {{ genders.genderName }} - - - -
- -
- - {{ currentLanguageSet?.age}} - - -
-
- - {{ currentLanguageSet?.age}} - - -
-
- - {{ currentLanguageSet?.state}} - - -
- -
- - {{ currentLanguageSet?.district}} - - -
+
+ + {{ currentLanguageSet?.childName}} + + +
-
- - {{ currentLanguageSet?.block}} - - -
+
+ + {{ currentLanguageSet?.motherName}} + + +
+ +
+ + {{ enableMotherRecord ? currentLanguageSet?.husbandName : + currentLanguageSet?.fatherName }} + + +
-
- - {{ currentLanguageSet?.village}} - - -
- - - - - - - - - +
- +
+ + {{ currentLanguageSet?.district}} + + +
- - -
- - {{ currentLanguageSet?.healthBlock}} - - -
+
+ + {{ currentLanguageSet?.block}} + + +
-
- - {{ currentLanguageSet?.phcName}} - - -
-
- - {{ currentLanguageSet?.subFacilitySubCentres}} - - -
+
+ + {{ currentLanguageSet?.village}} + + +
- - - - -
- - {{ currentLanguageSet?.phoneNumber}} - - -
-
- + +
+ + {{ currentLanguageSet?.healthBlock}} + + +
+ +
+ + {{ currentLanguageSet?.phcName}} + + +
+ +
+ + {{ + currentLanguageSet?.subFacilitySubCentres}} + + +
+ +
+ + {{ currentLanguageSet?.phoneNumber}} + + +
+ +
+ {{ currentLanguageSet?.phoneNumOfWhom}} - + {{ number.name }} -
+
+ +
+ + {{ currentLanguageSet?.alternatePhoneNum}} + + +
-
- - {{ currentLanguageSet?.alternatePhoneNum}} - - -
- -
- +
+ {{ currentLanguageSet?.ashaName}} - + -
+
-
- - {{ currentLanguageSet?.ashaPhoneNum}} - +
+ + {{ currentLanguageSet?.ashaPhoneNum}} + -
+
-
- +
+ {{ currentLanguageSet?.anmName}} - + -
+
-
- - {{ currentLanguageSet?.anmPhoneNum}} - - -
+
+ + {{ currentLanguageSet?.anmPhoneNum}} + + +
+ +
+ + {{ currentLanguageSet?.lmp}} + + MM/DD/YYYY + + + +
+
+ + {{ currentLanguageSet?.lmp}} + + MM/DD/YYYY + + + +
+ +
+ + {{ currentLanguageSet?.edd}} + + MM/DD/YYYY + + + +
+
+ + {{ currentLanguageSet?.dob}} + + MM/DD/YYYY + + + +
-
- - {{ currentLanguageSet?.lmp}} - - MM/DD/YYYY - - - -
-
- - {{ currentLanguageSet?.lmp}} - - MM/DD/YYYY - - - -
-
- - {{ currentLanguageSet?.edd}} - - MM/DD/YYYY - - - -
-
- - {{ currentLanguageSet?.dob}} - - MM/DD/YYYY - - - -
- - - -
- - {{ currentLanguageSet?.ecdCallType}} - - -
-
+
+ + {{ currentLanguageSet?.ecdCallType}} + + +
+ +
- {{ currentLanguageSet?.address}} - - -
+ {{ currentLanguageSet?.address}} + +
+
-
- - - - - -
+
+ + + + + + + +
+ + + +
+ +
+ +
+ +
+ - -
- - \ No newline at end of file + \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.ts b/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.ts index 9ff88b5..2b351e5 100644 --- a/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.ts +++ b/src/app/app-modules/associate-anm-mo/beneficiary-registration/ben-registration/ben-registration.component.ts @@ -16,26 +16,28 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * -* You should have received a copy of the GNU General Public License +* You should have received a copy of the GNU General Public License * along with this program. If not, see https://www.gnu.org/licenses/. */ import { DatePipe } from '@angular/common'; -import { Component, DoCheck, OnInit } from '@angular/core'; +import { Component, DoCheck, OnInit} from '@angular/core'; import { FormBuilder, FormControl, FormGroup } from '@angular/forms'; import { AssociateAnmMoService } from 'src/app/app-modules/services/associate-anm-mo/associate-anm-mo.service'; import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { LoginserviceService } from 'src/app/app-modules/services/loginservice/loginservice.service'; -import * as moment from 'moment'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { MatLegacyDialog as MatDialog, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; +import { VideoConsultationService } from '../../video-consultation/videoService'; @Component({ selector: 'app-ben-registration', templateUrl: './ben-registration.component.html', - styleUrls: ['./ben-registration.component.css'] -})export class BenRegistrationComponent implements OnInit, DoCheck { + styleUrls: ['./ben-registration.component.css'], +}) export class BenRegistrationComponent implements OnInit, DoCheck { // viewDetails:any=this.data.selectedDetails; enableMotherRecord = false; @@ -44,10 +46,10 @@ import * as moment from 'moment'; // isEditMode: boolean = true; maxDate = new Date(); minDate = new Date(); - - + + currentLanguageSet: any; - + phoneNumber = [ { id: 1, @@ -63,89 +65,79 @@ import * as moment from 'moment'; districtMasterList: any; blockMasterList: any; villageMasterList: any; - // genderMasterList:any; - genderMasterList : any; + genderMasterList: any; ageLimit = 120; - valueEntered : any; - // = [ - // { - // "genderID" : 1, - // "genderName" : "Male" - // }, - // { - // "genderID" : 2, - // "genderName" : "Female" - // } - // ]; + valueEntered: any; + enableUpdateButton = false; minimumDate: any; - + callerPhoneNumber: any; + agentID: any; + agentName: any; + hideVideoCall = true; + constructor( private fb: FormBuilder, private datePipe: DatePipe, - private confirmationService:ConfirmationService, - private associateAnmMoService: AssociateAnmMoService, + private confirmationService: ConfirmationService, + public associateAnmMoService: AssociateAnmMoService, private setLanguageService: SetLanguageService, - private masterService:MasterService, + private masterService: MasterService, private loginService: LoginserviceService, + readonly sessionstorage: SessionStorageService, + public dialog: MatDialog, + public videoService: VideoConsultationService, - ) { - } + ) { + } ngOnInit(): void { + this.videoService.videoCallPrompt = true; + this.associateAnmMoService.isBenRegistartionData$.subscribe((responseComp) => { - if (responseComp !== null && responseComp ===true ) { - if(this.associateAnmMoService.selectedBenDetails.beneficiaryRegId !== null && + if (responseComp !== null && responseComp === true) { + if (this.associateAnmMoService.selectedBenDetails.beneficiaryRegId !== null && this.associateAnmMoService.selectedBenDetails.beneficiaryRegId !== undefined) { - this.enableUpdateButton = true; - } else{ - this.enableUpdateButton = false; - } + this.enableUpdateButton = true; + } else { + this.enableUpdateButton = false; + } } - - }); + + }); console.log(this.associateAnmMoService.selectedBenDetails); this.getSelectedLanguage(); // this.stateMaster(); this.genderMaster(); this.minDate.setMonth(this.maxDate.getMonth() - 10); - // this.associateAnmMoService.isMotherRecordData$.subscribe(res => { - // if(res == true){ - // this.enableMotherRecord = true; - // } else { - // this.enableMotherRecord = false; - // } - // }) - - this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { if (responseComp !== null && responseComp === "Call Closed") { this.benRegistrationForm.reset(); } - - }); - + + }); + this.associateAnmMoService.loadDetailsInRegFlag$.subscribe(res => { - if(res === true){ + if (res === true) { this.benRegistrationForm.reset(); - -if( this.associateAnmMoService.isMother) { - this.enableMotherRecord = true; -} -else{ - this.enableMotherRecord = false; -} + + if (this.associateAnmMoService.isMother) { + this.enableMotherRecord = true; + } + else { + this.enableMotherRecord = false; + } this.patchValueForviewDetails(); - - } + + } }) - - this.selectedRole = sessionStorage.getItem('role'); - - this.minimumDate = new Date(); - this.minimumDate.setDate(this.maxDate.getDate()-1000); + + this.selectedRole = this.sessionstorage.getItem('role'); + + this.minimumDate = new Date(); + this.minimumDate.setDate(this.maxDate.getDate() - 1000); } getSelectedLanguage() { @@ -158,25 +150,25 @@ else{ ngDoCheck() { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); } genderMaster() { this.masterService.getGenderMaster().subscribe( (response: any) => { if (response) { this.genderMasterList = response - + } else { this.confirmationService.openDialog(response.errorMessage, 'error'); } }, (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); else - this.confirmationService.openDialog(err.title + err.detail, 'error') - } + this.confirmationService.openDialog(err.title + err.detail, 'error') + } ); } @@ -200,10 +192,10 @@ else{ // this.confirmationService.openDialog(err.title + err.detail, 'error') // } // ); - + // } - benRegistrationForm = new FormGroup({ + benRegistrationForm = new FormGroup({ motherId: new FormControl(''), mctsidNoChildId: new FormControl(''), childName: new FormControl(''), @@ -238,7 +230,7 @@ else{ // console.log(this.phonenumofwhom); // } - patchValueForviewDetails(){ + patchValueForviewDetails() { // let viewDetails: any = // [ // { @@ -265,15 +257,15 @@ else{ // } // ]; - let viewDetails:any = null; + let viewDetails: any = null; viewDetails = this.associateAnmMoService.selectedBenDetails; - if(viewDetails !== null){ + if (viewDetails !== null) { this.benRegistrationForm.patchValue(viewDetails); - if(viewDetails.gender !== undefined && viewDetails.gender !== null) { - - this.genderMasterList.filter((values:any) => { + if (viewDetails.gender !== undefined && viewDetails.gender !== null) { + + this.genderMasterList.filter((values: any) => { if (viewDetails.gender !== undefined && viewDetails.gender !== null && (values.genderName.toLowerCase() === viewDetails.gender.toLowerCase())) { this.benRegistrationForm.controls.genderID.setValue(values.genderID); this.benRegistrationForm.controls.genderName.setValue(values.genderName); @@ -282,7 +274,7 @@ else{ }); } - if(this.enableMotherRecord && viewDetails.mctsidNo !== undefined && viewDetails.mctsidNo !== null) { + if (this.enableMotherRecord && viewDetails.mctsidNo !== undefined && viewDetails.mctsidNo !== null) { this.benRegistrationForm.controls.motherId.setValue(viewDetails.mctsidNo); this.benRegistrationForm.controls.motherName.setValue(viewDetails.name); this.benRegistrationForm.controls.phoneNo.setValue(viewDetails.whomPhoneNo); @@ -295,7 +287,7 @@ else{ // let eDate = new Date(viewDetails.edd); // eDate = new Date(eDate.getTime() + eDate.getTimezoneOffset() * 60000) // this.benRegistrationForm.controls.edd.setValue(eDate); - + // Calculate EDD based on LMP Date const eddDate = new Date(lDate); eddDate.setDate(eddDate.getDate() + 7); // Add 7 days @@ -309,20 +301,20 @@ else{ dobDate = new Date(dobDate.getTime() + dobDate.getTimezoneOffset() * 60000) this.benRegistrationForm.controls.dob.setValue(dobDate); - if(this.benRegistrationForm.controls.dob.value){ + if (this.benRegistrationForm.controls.dob.value) { this.benRegistrationForm.controls.dob.setErrors(null) } } - if(viewDetails.fatherName !== undefined && viewDetails.fatherName !== null) { + if (viewDetails.fatherName !== undefined && viewDetails.fatherName !== null) { this.benRegistrationForm.controls.husbandName.setValue(viewDetails.fatherName); } this.benRegistrationForm.controls.stateID.setValue(viewDetails.stateName); this.benRegistrationForm.controls.districtID.setValue(viewDetails.districtName); - this.benRegistrationForm.controls.blockID.setValue(viewDetails.blockName); - this.benRegistrationForm.controls.districtBranchID.setValue(viewDetails.villageName); + this.benRegistrationForm.controls.blockID.setValue(viewDetails.blockName); + this.benRegistrationForm.controls.districtBranchID.setValue(viewDetails.villageName); // this.patchDemographicMasters(viewDetails); @@ -337,153 +329,51 @@ else{ // this.benRegistrationForm.controls.districtBranchID.setValue(745); // console.log("details", this.benRegistrationForm.valid); } - } + } - // patchDemographicMasters(viewDetails:any) { - // this.stateMasterList.filter((values:any) => { - // if (viewDetails.stateName !== undefined && viewDetails.stateName !== null && (values.stateName.toLowerCase() === viewDetails.stateName.toLowerCase())) { - // this.benRegistrationForm.controls.stateID.setValue(values.stateID); - // } - // }); - - // if(this.benRegistrationForm.controls.stateID.value !== undefined && this.benRegistrationForm.controls.stateID.value !== null && this.benRegistrationForm.controls.stateID.value !== ""){ - // this.getDistrictMaster(this.benRegistrationForm.controls.stateID.value,viewDetails); - // } - // } - -// getDistrictMaster(stateID:any,viewDetails:any) { - -// this.masterService.getDistrictMaster(stateID).subscribe( -// (response: any) => { -// if (response && response.data !== null) { -// this.districtMasterList = response.data; -// this.blockMasterList = []; -// this.villageMasterList = []; - -// this.districtMasterList.filter((values:any) => { -// if (viewDetails.districtName !== undefined && viewDetails.districtName !== null && (values.districtName.toLowerCase() === viewDetails.districtName.toLowerCase())) { -// this.benRegistrationForm.controls.districtID.setValue(values.districtID); -// } -// }); - -// if(this.benRegistrationForm.controls.districtID.value !== undefined && this.benRegistrationForm.controls.districtID.value !== null && this.benRegistrationForm.controls.districtID.value !== ""){ -// this.getBlockMaster(this.benRegistrationForm.controls.districtID.value,viewDetails); -// } - -// } else { -// this.confirmationService.openDialog(response.errorMessage, 'error'); -// } -// }, -// (err: any) => { -// if(err && err.error) -// this.confirmationService.openDialog(err.error, 'error'); -// else -// this.confirmationService.openDialog(err.title + err.detail, 'error') -// } -// ); - - -// } - - - // getBlockMaster(dictrictID:any,viewDetails:any) { - // this.masterService.getBlockMaster(dictrictID).subscribe( - // (response: any) => { - // if (response && response.data !== null) { - // this.blockMasterList = response.data; - // this.villageMasterList = []; - - // this.blockMasterList.filter((values:any) => { - // if (viewDetails.blockName !== undefined && viewDetails.blockName !== null && (values.blockName.toLowerCase() === viewDetails.blockName.toLowerCase())) { - // this.benRegistrationForm.controls.blockID.setValue(values.blockID); - // } - // }); - - // if(this.benRegistrationForm.controls.blockID.value !== undefined && this.benRegistrationForm.controls.blockID.value !== null && this.benRegistrationForm.controls.blockID.value !== ""){ - // this.getVillageMaster(this.benRegistrationForm.controls.blockID.value,viewDetails); - // } - - // } else { - // this.confirmationService.openDialog(response.errorMessage, 'error'); - // } - // }, - // (err: any) => { - // if(err && err.error) - // this.confirmationService.openDialog(err.error, 'error'); - // else - // this.confirmationService.openDialog(err.title + err.detail, 'error') - // } - // ); - // } - - // getVillageMaster(blockID:any,viewDetails:any) { - // this.masterService.getVillageMaster(blockID).subscribe( - // (response: any) => { - // if (response && response.data !== null) { - // this.villageMasterList = response.data; - - // this.villageMasterList.filter((values:any) => { - // if (viewDetails.villageName !== undefined && viewDetails.villageName !== null && (values.villageName.toLowerCase() === viewDetails.villageName.toLowerCase())) { - // this.benRegistrationForm.controls.districtBranchID.setValue(values.districtBranchID); - // } - // }); - - - - // } else { - // this.confirmationService.openDialog(response.errorMessage, 'error'); - // } - // }, - // (err: any) => { - // if(err && err.error) - // this.confirmationService.openDialog(err.error, 'error'); - // else - // this.confirmationService.openDialog(err.title + err.detail, 'error') - // } - // ); - // } - - setGenderName(genderValue:any) { - this.benRegistrationForm.controls.genderName.setValue(genderValue); - } + setGenderName(genderValue: any) { + this.benRegistrationForm.controls.genderName.setValue(genderValue); + } - onSubmit() { - let lmpDateValue=null; - let eddDateValue=null; - let dobDateValue=null; - if(this.enableMotherRecord) { - lmpDateValue = moment(this.benRegistrationForm.controls.lmpDate.value).format('YYYY-MM-DDThh:mm:ssZ'); - eddDateValue = moment(this.benRegistrationForm.controls.edd.value).format('YYYY-MM-DDThh:mm:ssZ'); + onSubmit() { + let lmpDateValue = null; + let eddDateValue = null; + let dobDateValue = null; + if (this.enableMotherRecord) { + + lmpDateValue = this.formatDateValue(this.benRegistrationForm.controls.lmpDate.value); + eddDateValue = this.formatDateValue(this.benRegistrationForm.controls.edd.value); } else { - dobDateValue = moment(this.benRegistrationForm.controls.dob.value).format('YYYY-MM-DDThh:mm:ssZ'); + dobDateValue = this.formatDateValue(this.benRegistrationForm.controls.dob.value); + } const demographicReq = { - // "stateID" :this.benRegistrationForm.controls.stateID.value, - // "districtID": this.benRegistrationForm.controls.districtID.value, - // "blockID" : this.benRegistrationForm.controls.blockID.value, - // "districtBranchID" : this.benRegistrationForm.controls.districtBranchID.value, - "addressLine1" : (this.benRegistrationForm.controls.address.value !== undefined && this.benRegistrationForm.controls.address.value !== null && this.benRegistrationForm.controls.address.value !== "") ? this.benRegistrationForm.controls.address.value : undefined, - "createdBy" : sessionStorage.getItem("userName") + // "stateID" :this.benRegistrationForm.controls.stateID.value, + // "districtID": this.benRegistrationForm.controls.districtID.value, + // "blockID" : this.benRegistrationForm.controls.blockID.value, + // "districtBranchID" : this.benRegistrationForm.controls.districtBranchID.value, + "addressLine1": (this.benRegistrationForm.controls.address.value !== undefined && this.benRegistrationForm.controls.address.value !== null && this.benRegistrationForm.controls.address.value !== "") ? this.benRegistrationForm.controls.address.value : undefined, + "createdBy": this.sessionstorage.getItem('userName') }; const phoneDetails = []; - if(this.benRegistrationForm.controls.phoneNo.value !== undefined && this.benRegistrationForm.controls.phoneNo.value !== null) { + if (this.benRegistrationForm.controls.phoneNo.value !== undefined && this.benRegistrationForm.controls.phoneNo.value !== null) { const phnReq = { - "phoneNo" : this.benRegistrationForm.controls.phoneNo.value, - "createdBy" : sessionStorage.getItem("userName") + "phoneNo": this.benRegistrationForm.controls.phoneNo.value, + "createdBy": this.sessionstorage.getItem('userName') } phoneDetails.push(phnReq); } - if(this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") { + if (this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") { const altPhnReq = { - "phoneNo" : this.benRegistrationForm.controls.alternatePhoneNo.value, - "createdBy" : sessionStorage.getItem("userName") + "phoneNo": this.benRegistrationForm.controls.alternatePhoneNo.value, + "createdBy": this.sessionstorage.getItem('userName') } phoneDetails.push(altPhnReq); } @@ -493,121 +383,125 @@ else{ const reqObj = { "motherId": this.benRegistrationForm.controls.motherId.value, - "childId" : (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.mctsidNoChildId.value : undefined, - "name": (this.benRegistrationForm.controls.childName.value !== undefined && this.benRegistrationForm.controls.childName.value !== null && this.benRegistrationForm.controls.childName.value !== "") ? this.benRegistrationForm.controls.childName.value : this.benRegistrationForm.controls.motherName.value, - "motherName" : (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.motherName.value : undefined, - "spouseName" : (this.benRegistrationForm.controls.husbandName.value !== undefined && this.benRegistrationForm.controls.husbandName.value !== null && this.benRegistrationForm.controls.husbandName.value !== "") ? this.benRegistrationForm.controls.husbandName.value : undefined, - "genderID" : this.benRegistrationForm.controls.genderID.value, + "childId": (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.mctsidNoChildId.value : undefined, + "name": (this.benRegistrationForm.controls.childName.value !== undefined && this.benRegistrationForm.controls.childName.value !== null && this.benRegistrationForm.controls.childName.value !== "") ? this.benRegistrationForm.controls.childName.value : this.benRegistrationForm.controls.motherName.value, + "motherName": (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.motherName.value : undefined, + "spouseName": (this.benRegistrationForm.controls.husbandName.value !== undefined && this.benRegistrationForm.controls.husbandName.value !== null && this.benRegistrationForm.controls.husbandName.value !== "") ? this.benRegistrationForm.controls.husbandName.value : undefined, + "genderID": this.benRegistrationForm.controls.genderID.value, "genderName": this.benRegistrationForm.controls.genderName.value, "phoneNo": this.benRegistrationForm.controls.phoneNo.value, "phoneNoOfWhom": this.benRegistrationForm.controls.phoneNoOf.value, - "alternatePhoneNo":(this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") ? this.benRegistrationForm.controls.alternatePhoneNo.value : undefined, - "dateOfBirth" : dobDateValue, + "alternatePhoneNo": (this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") ? this.benRegistrationForm.controls.alternatePhoneNo.value : undefined, + "dateOfBirth": dobDateValue, "age": this.benRegistrationForm.controls.age.value, - "lmp" : lmpDateValue, - "edd" : eddDateValue, - "i_bendemographics" : demographicReq, + "lmp": lmpDateValue, + "edd": eddDateValue, + "i_bendemographics": demographicReq, "benPhoneMaps": phoneDetails, - "vanID" : this.loginService.currentServiceId, + "vanID": this.loginService.currentServiceId, "emergencyRegistration": false, - "ashaName":this.benRegistrationForm.controls.ashaName.value, - "ashaPh":this.benRegistrationForm.controls.ashaPhoneNo.value, - "anmName":this.benRegistrationForm.controls.anmName.value, - "anmPh":this.benRegistrationForm.controls.anmPhoneNo.value, - "phcName" : this.benRegistrationForm.controls.phcName.value, + "ashaName": this.benRegistrationForm.controls.ashaName.value, + "ashaPh": this.benRegistrationForm.controls.ashaPhoneNo.value, + "anmName": this.benRegistrationForm.controls.anmName.value, + "anmPh": this.benRegistrationForm.controls.anmPhoneNo.value, + "phcName": this.benRegistrationForm.controls.phcName.value, "blockName": this.benRegistrationForm.controls.healthBlock.value, - "providerServiceMapID": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName") + "providerServiceMapID": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName') }; - + this.associateAnmMoService.registerBeneficiary(reqObj).subscribe( (response: any) => { - - if(response !== null && response.response && response.response.BenRegId !== undefined && response.response.BenRegId !== null) { - const benRegId = response.response.BenRegId; - const benId = response.response.BeneficiaryId; - sessionStorage.setItem('beneficiaryRegId', benRegId); - this.associateAnmMoService.selectedBenDetails.childName = this.benRegistrationForm.controls.childName.value, - this.associateAnmMoService.selectedBenDetails.motherName = this.benRegistrationForm.controls.motherName.value, - this.associateAnmMoService.selectedBenDetails.spouseName = this.benRegistrationForm.controls.husbandName.value, - this.associateAnmMoService.selectedBenDetails.genderName = this.benRegistrationForm.controls.genderName.value, - this.associateAnmMoService.selectedBenDetails.phoneNo = this.benRegistrationForm.controls.phoneNo.value, - this.associateAnmMoService.selectedBenDetails.phoneNoOfWhom = this.benRegistrationForm.controls.phoneNoOf.value, - this.associateAnmMoService.selectedBenDetails.alternatePhoneNo = this.benRegistrationForm.controls.alternatePhoneNo.value, - this.associateAnmMoService.selectedBenDetails.ashaName = this.benRegistrationForm.controls.ashaName.value, - this.associateAnmMoService.selectedBenDetails.ashaPh = this.benRegistrationForm.controls.ashaPhoneNo.value, - this.associateAnmMoService.selectedBenDetails.anmName = this.benRegistrationForm.controls.anmName.value, - this.associateAnmMoService.selectedBenDetails.anmPh = this.benRegistrationForm.controls.anmPhoneNo.value, - this.associateAnmMoService.selectedBenDetails.phcName = this.benRegistrationForm.controls.phcName.value, - this.associateAnmMoService.selectedBenDetails.blockName = this.benRegistrationForm.controls.healthBlock.value, - this.associateAnmMoService.selectedBenDetails.address = this.benRegistrationForm.controls.address.value, - this.associateAnmMoService.selectedBenDetails.dob =moment(this.benRegistrationForm.controls.dob.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.associateAnmMoService.selectedBenDetails.lmpDate =moment(this.benRegistrationForm.controls.lmpDate.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.associateAnmMoService.selectedBenDetails.edd =moment(this.benRegistrationForm.controls.edd.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.associateAnmMoService.selectedBenDetails.age = this.benRegistrationForm.controls.age.value, - - this.confirmationService.openDialog(this.currentLanguageSet.beneficiaryRegisteredSuccessfully + " " + benId, `success`); - this.associateAnmMoService.setOpenComp("ECD Questionnaire"); - this.associateAnmMoService.onClickOfEcdQuestionnaire(true); - - } - else { - this.confirmationService.openDialog(this.currentLanguageSet.issueInBeneficiaryReg, 'error'); - } - }, - (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); - else - this.confirmationService.openDialog(err.title + err.detail, 'error') - }); - - + if (response !== null && response.response && response.response.BenRegId !== undefined && response.response.BenRegId !== null) { + const benRegId = response.response.BenRegId; + const benId = response.response.BeneficiaryId; + this.videoService.benRegId = response.response.BenRegId + this.sessionstorage.setItem('beneficiaryRegId', benRegId); + this.associateAnmMoService.selectedBenDetails.childName = this.benRegistrationForm.controls.childName.value, + this.associateAnmMoService.selectedBenDetails.motherName = this.benRegistrationForm.controls.motherName.value, + this.associateAnmMoService.selectedBenDetails.spouseName = this.benRegistrationForm.controls.husbandName.value, + this.associateAnmMoService.selectedBenDetails.genderName = this.benRegistrationForm.controls.genderName.value, + this.associateAnmMoService.selectedBenDetails.phoneNo = this.benRegistrationForm.controls.phoneNo.value, + this.associateAnmMoService.selectedBenDetails.phoneNoOfWhom = this.benRegistrationForm.controls.phoneNoOf.value, + this.associateAnmMoService.selectedBenDetails.alternatePhoneNo = this.benRegistrationForm.controls.alternatePhoneNo.value, + this.associateAnmMoService.selectedBenDetails.ashaName = this.benRegistrationForm.controls.ashaName.value, + this.associateAnmMoService.selectedBenDetails.ashaPh = this.benRegistrationForm.controls.ashaPhoneNo.value, + this.associateAnmMoService.selectedBenDetails.anmName = this.benRegistrationForm.controls.anmName.value, + this.associateAnmMoService.selectedBenDetails.anmPh = this.benRegistrationForm.controls.anmPhoneNo.value, + this.associateAnmMoService.selectedBenDetails.phcName = this.benRegistrationForm.controls.phcName.value, + this.associateAnmMoService.selectedBenDetails.blockName = this.benRegistrationForm.controls.healthBlock.value, + this.associateAnmMoService.selectedBenDetails.address = this.benRegistrationForm.controls.address.value, + this.associateAnmMoService.selectedBenDetails.dob = this.formatDateValue(this.benRegistrationForm.controls.dob.value), + this.associateAnmMoService.selectedBenDetails.lmpDate = this.formatDateValue(this.benRegistrationForm.controls.lmpDate.value), + this.associateAnmMoService.selectedBenDetails.edd = this.formatDateValue(this.benRegistrationForm.controls.edd.value), + this.associateAnmMoService.selectedBenDetails.age = this.benRegistrationForm.controls.age.value, + + this.confirmationService.openDialog(this.currentLanguageSet.beneficiaryRegisteredSuccessfully + " " + benRegId, `success`); + this.associateAnmMoService.setOpenComp("ECD Questionnaire"); + this.associateAnmMoService.onClickOfEcdQuestionnaire(true); + // this.performAction(); + + } + else { + this.confirmationService.openDialog(this.currentLanguageSet.issueInBeneficiaryReg, 'error'); + } + }, + (err: any) => { + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); + else + this.confirmationService.openDialog(err.title + err.detail, 'error') + }); + - - // this.associateAnmMoService.loadComponent( - // EcdQuestionnaireComponent, - // null - // ); - } - goToClosure(){ - this.confirmationService + + + // this.associateAnmMoService.loadComponent( + // EcdQuestionnaireComponent, + // null + // ); + } + + goToClosure() { + this.confirmationService .openDialog( this.currentLanguageSet.doYouWantToCloseTheCall, 'confirm' ) .afterClosed() .subscribe((response) => { - if(response){ + if (response) { this.associateAnmMoService.fromComponent = "Beneficiary Registration"; this.associateAnmMoService.setOpenComp("Call Closure"); } }); - - - } - onUpdate() { - let lmpDateValue=null; - let eddDateValue=null; - let dobDateValue=null; - if(this.enableMotherRecord) { - lmpDateValue = moment(this.benRegistrationForm.controls.lmpDate.value).format('YYYY-MM-DDThh:mm:ssZ'); - eddDateValue = moment(this.benRegistrationForm.controls.edd.value).format('YYYY-MM-DDThh:mm:ssZ'); + + } + + onUpdate() { + let lmpDateValue = null; + let eddDateValue = null; + let dobDateValue = null; + if (this.enableMotherRecord) { + lmpDateValue = this.formatDateValue(this.benRegistrationForm.controls.lmpDate.value); + eddDateValue = this.formatDateValue(this.benRegistrationForm.controls.edd.value); } else { - dobDateValue = moment(this.benRegistrationForm.controls.dob.value).format('YYYY-MM-DDThh:mm:ssZ'); + dobDateValue = this.formatDateValue(this.benRegistrationForm.controls.dob.value); } - let benRegId = null; - if(this.associateAnmMoService.selectedBenDetails !== null) { + let benRegId = null; + if (this.associateAnmMoService.selectedBenDetails !== null) { benRegId = this.associateAnmMoService.selectedBenDetails.beneficiaryRegId; - } + this.videoService.benRegId = benRegId + + } const demographicReq = { "beneficiaryRegID": benRegId, @@ -615,165 +509,195 @@ else{ // "districtID": this.benRegistrationForm.controls.districtID.value, // "blockID" : this.benRegistrationForm.controls.blockID.value, // "districtBranchID" : this.benRegistrationForm.controls.districtBranchID.value, - "addressLine1" : (this.benRegistrationForm.controls.address.value !== undefined && this.benRegistrationForm.controls.address.value !== null && this.benRegistrationForm.controls.address.value !== "") ? this.benRegistrationForm.controls.address.value : undefined, - "createdBy" : sessionStorage.getItem("userName"), - "modifiedBy" : sessionStorage.getItem("userName") - }; - - const phoneDetails = []; - if(this.benRegistrationForm.controls.phoneNo.value !== undefined && this.benRegistrationForm.controls.phoneNo.value !== null) { - - const phnReq = { - "parentBenRegID": benRegId, - "beneficiaryRegID": benRegId, - "phoneNo" : this.benRegistrationForm.controls.phoneNo.value, - "modifiedBy": sessionStorage.getItem("userName"), - "createdBy" : sessionStorage.getItem("userName") - } - phoneDetails.push(phnReq); - } + "addressLine1": (this.benRegistrationForm.controls.address.value !== undefined && this.benRegistrationForm.controls.address.value !== null && this.benRegistrationForm.controls.address.value !== "") ? this.benRegistrationForm.controls.address.value : undefined, + "createdBy": this.sessionstorage.getItem('userName'), + "modifiedBy": this.sessionstorage.getItem('userName') + }; - if(this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") { + const phoneDetails = []; + if (this.benRegistrationForm.controls.phoneNo.value !== undefined && this.benRegistrationForm.controls.phoneNo.value !== null) { - const altPhnReq = { - "parentBenRegID": benRegId, - "beneficiaryRegID": benRegId, - "phoneNo" : this.benRegistrationForm.controls.alternatePhoneNo.value, - "modifiedBy": sessionStorage.getItem("userName"), - "createdBy" : sessionStorage.getItem("userName") - } - phoneDetails.push(altPhnReq); - } + const phnReq = { + "parentBenRegID": benRegId, + "beneficiaryRegID": benRegId, + "phoneNo": this.benRegistrationForm.controls.phoneNo.value, + "modifiedBy": this.sessionstorage.getItem('userName'), + "createdBy": this.sessionstorage.getItem('userName') + } + phoneDetails.push(phnReq); + } + + if (this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") { + + const altPhnReq = { + "parentBenRegID": benRegId, + "beneficiaryRegID": benRegId, + "phoneNo": this.benRegistrationForm.controls.alternatePhoneNo.value, + "modifiedBy": this.sessionstorage.getItem('userName'), + "createdBy": this.sessionstorage.getItem('userName') + } + phoneDetails.push(altPhnReq); + } - const reqObj = { - "beneficiaryRegID": benRegId, - "motherId": this.benRegistrationForm.controls.motherId.value, - "childId" : (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.mctsidNoChildId.value : undefined, - "name": (this.benRegistrationForm.controls.childName.value !== undefined && this.benRegistrationForm.controls.childName.value !== null && this.benRegistrationForm.controls.childName.value !== "") ? this.benRegistrationForm.controls.childName.value : this.benRegistrationForm.controls.motherName.value, - "motherName" : (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.motherName.value : undefined, - "spouseName" : (this.benRegistrationForm.controls.husbandName.value !== undefined && this.benRegistrationForm.controls.husbandName.value !== null && this.benRegistrationForm.controls.husbandName.value !== "") ? this.benRegistrationForm.controls.husbandName.value : undefined, - "genderID" : this.benRegistrationForm.controls.genderID.value, - "genderName": this.benRegistrationForm.controls.genderName.value, - "phoneNo": this.benRegistrationForm.controls.phoneNo.value, - "phoneNoOfWhom": this.benRegistrationForm.controls.phoneNoOf.value, - "alternatePhoneNo":(this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") ? this.benRegistrationForm.controls.alternatePhoneNo.value : undefined, - "dateOfBirth" : dobDateValue, - "age": this.benRegistrationForm.controls.age.value, - "lmp" : lmpDateValue, - "edd" : eddDateValue, - "i_bendemographics" : demographicReq, - "benPhoneMaps": phoneDetails, - "emergencyRegistration": false, - "changeInSelfDetails": true, - "changeInOtherDetails": true, - "changeInAddress": true, - "changeInContacts": true, - "changeInFamilyDetails": true, - "is1097": false, - "vanID" : this.loginService.currentServiceId, - "ashaName":this.benRegistrationForm.controls.ashaName.value, - "ashaPh":this.benRegistrationForm.controls.ashaPhoneNo.value, - "anmName":this.benRegistrationForm.controls.anmName.value, - "anmPh":this.benRegistrationForm.controls.anmPhoneNo.value, - "phcName" : this.benRegistrationForm.controls.phcName.value, - "blockName": this.benRegistrationForm.controls.healthBlock.value, - "providerServiceMapID": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName"), - "modifiedBy": sessionStorage.getItem("userName") - }; - -console.log(reqObj); - - this.associateAnmMoService.updateBeneficiary(reqObj).subscribe( - (response: any) => { - - if(response !== null && response.response !== null) { - - this.associateAnmMoService.selectedBenDetails.childName = this.benRegistrationForm.controls.childName.value, - this.associateAnmMoService.selectedBenDetails.motherName = this.benRegistrationForm.controls.motherName.value, - this.associateAnmMoService.selectedBenDetails.spouseName = this.benRegistrationForm.controls.husbandName.value, - this.associateAnmMoService.selectedBenDetails.genderName = this.benRegistrationForm.controls.genderName.value, - this.associateAnmMoService.selectedBenDetails.phoneNo = this.benRegistrationForm.controls.phoneNo.value, - this.associateAnmMoService.selectedBenDetails.phoneNoOfWhom = this.benRegistrationForm.controls.phoneNoOf.value, - this.associateAnmMoService.selectedBenDetails.alternatePhoneNo = this.benRegistrationForm.controls.alternatePhoneNo.value, - this.associateAnmMoService.selectedBenDetails.ashaName = this.benRegistrationForm.controls.ashaName.value, - this.associateAnmMoService.selectedBenDetails.ashaPh = this.benRegistrationForm.controls.ashaPhoneNo.value, - this.associateAnmMoService.selectedBenDetails.anmName = this.benRegistrationForm.controls.anmName.value, - this.associateAnmMoService.selectedBenDetails.anmPh = this.benRegistrationForm.controls.anmPhoneNo.value, - this.associateAnmMoService.selectedBenDetails.phcName = this.benRegistrationForm.controls.phcName.value, - this.associateAnmMoService.selectedBenDetails.blockName = this.benRegistrationForm.controls.healthBlock.value, - this.associateAnmMoService.selectedBenDetails.address = this.benRegistrationForm.controls.address.value, - this.associateAnmMoService.selectedBenDetails.lmpDate =moment(this.benRegistrationForm.controls.lmpDate.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.associateAnmMoService.selectedBenDetails.dob =moment(this.benRegistrationForm.controls.dob.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.associateAnmMoService.selectedBenDetails.age = this.benRegistrationForm.controls.age.value, - this.associateAnmMoService.selectedBenDetails.edd =moment(this.benRegistrationForm.controls.edd.value).format('YYYY-MM-DDThh:mm:ssZ'), - this.confirmationService.openDialog(response.response, `success`); - this.associateAnmMoService.setOpenComp("ECD Questionnaire"); - this.associateAnmMoService.onClickOfEcdQuestionnaire(true); - - } - else { - this.confirmationService.openDialog(response.errorMessage, 'error'); - } - }, - (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); - else - this.confirmationService.openDialog(err.title + err.detail, 'error') - }); + const reqObj = { + "beneficiaryRegID": benRegId, + "motherId": this.benRegistrationForm.controls.motherId.value, + "childId": (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.mctsidNoChildId.value : undefined, + "name": (this.benRegistrationForm.controls.childName.value !== undefined && this.benRegistrationForm.controls.childName.value !== null && this.benRegistrationForm.controls.childName.value !== "") ? this.benRegistrationForm.controls.childName.value : this.benRegistrationForm.controls.motherName.value, + "motherName": (this.benRegistrationForm.controls.mctsidNoChildId.value !== undefined && this.benRegistrationForm.controls.mctsidNoChildId.value !== null && this.benRegistrationForm.controls.mctsidNoChildId.value !== "") ? this.benRegistrationForm.controls.motherName.value : undefined, + "spouseName": (this.benRegistrationForm.controls.husbandName.value !== undefined && this.benRegistrationForm.controls.husbandName.value !== null && this.benRegistrationForm.controls.husbandName.value !== "") ? this.benRegistrationForm.controls.husbandName.value : undefined, + "genderID": this.benRegistrationForm.controls.genderID.value, + "genderName": this.benRegistrationForm.controls.genderName.value, + "phoneNo": this.benRegistrationForm.controls.phoneNo.value, + "phoneNoOfWhom": this.benRegistrationForm.controls.phoneNoOf.value, + "alternatePhoneNo": (this.benRegistrationForm.controls.alternatePhoneNo.value !== undefined && this.benRegistrationForm.controls.alternatePhoneNo.value !== null && this.benRegistrationForm.controls.alternatePhoneNo.value !== "") ? this.benRegistrationForm.controls.alternatePhoneNo.value : undefined, + "dateOfBirth": dobDateValue, + "age": this.benRegistrationForm.controls.age.value, + "lmp": lmpDateValue, + "edd": eddDateValue, + "i_bendemographics": demographicReq, + "benPhoneMaps": phoneDetails, + "emergencyRegistration": false, + "changeInSelfDetails": true, + "changeInOtherDetails": true, + "changeInAddress": true, + "changeInContacts": true, + "changeInFamilyDetails": true, + "is1097": false, + "vanID": this.loginService.currentServiceId, + "ashaName": this.benRegistrationForm.controls.ashaName.value, + "ashaPh": this.benRegistrationForm.controls.ashaPhoneNo.value, + "anmName": this.benRegistrationForm.controls.anmName.value, + "anmPh": this.benRegistrationForm.controls.anmPhoneNo.value, + "phcName": this.benRegistrationForm.controls.phcName.value, + "blockName": this.benRegistrationForm.controls.healthBlock.value, + "providerServiceMapID": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName'), + "modifiedBy": this.sessionstorage.getItem('userName') + }; - - } + console.log(reqObj); - openEcdQuestionnaire(){ - this.confirmationService + this.associateAnmMoService.updateBeneficiary(reqObj).subscribe( + (response: any) => { + + if (response !== null && response.response !== null) { + + this.associateAnmMoService.selectedBenDetails.childName = this.benRegistrationForm.controls.childName.value, + this.associateAnmMoService.selectedBenDetails.motherName = this.benRegistrationForm.controls.motherName.value, + this.associateAnmMoService.selectedBenDetails.spouseName = this.benRegistrationForm.controls.husbandName.value, + this.associateAnmMoService.selectedBenDetails.genderName = this.benRegistrationForm.controls.genderName.value, + this.associateAnmMoService.selectedBenDetails.phoneNo = this.benRegistrationForm.controls.phoneNo.value, + this.associateAnmMoService.selectedBenDetails.phoneNoOfWhom = this.benRegistrationForm.controls.phoneNoOf.value, + this.associateAnmMoService.selectedBenDetails.alternatePhoneNo = this.benRegistrationForm.controls.alternatePhoneNo.value, + this.associateAnmMoService.selectedBenDetails.ashaName = this.benRegistrationForm.controls.ashaName.value, + this.associateAnmMoService.selectedBenDetails.ashaPh = this.benRegistrationForm.controls.ashaPhoneNo.value, + this.associateAnmMoService.selectedBenDetails.anmName = this.benRegistrationForm.controls.anmName.value, + this.associateAnmMoService.selectedBenDetails.anmPh = this.benRegistrationForm.controls.anmPhoneNo.value, + this.associateAnmMoService.selectedBenDetails.phcName = this.benRegistrationForm.controls.phcName.value, + this.associateAnmMoService.selectedBenDetails.blockName = this.benRegistrationForm.controls.healthBlock.value, + this.associateAnmMoService.selectedBenDetails.address = this.benRegistrationForm.controls.address.value, + this.associateAnmMoService.selectedBenDetails.age = this.benRegistrationForm.controls.age.value, + this.associateAnmMoService.selectedBenDetails.lmpDate = this.formatDateValue(this.benRegistrationForm.controls.lmpDate.value), + this.associateAnmMoService.selectedBenDetails.dob = this.formatDateValue(this.benRegistrationForm.controls.dob.value), + this.associateAnmMoService.selectedBenDetails.edd = this.formatDateValue(this.benRegistrationForm.controls.edd.value), this.confirmationService.openDialog(response.response, `success`); + this.associateAnmMoService.setOpenComp("ECD Questionnaire"); + this.associateAnmMoService.onClickOfEcdQuestionnaire(true); + + // this.performAction(); + + } + else { + this.confirmationService.openDialog(response.errorMessage, 'error'); + } + }, + (err: any) => { + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); + else + this.confirmationService.openDialog(err.title + err.detail, 'error') + }); + + + } + + openEcdQuestionnaire() { + this.confirmationService .openDialog( this.currentLanguageSet.areYouSureWantToProceedEcdQuestionnaire, 'confirm' ) .afterClosed() .subscribe((response) => { - if(response){ - this.associateAnmMoService.setOpenComp("ECD Questionnaire"); - this.associateAnmMoService.onClickOfEcdQuestionnaire(true); + if (response) { + + // this.performAction(); + + this.associateAnmMoService.setOpenComp("ECD Questionnaire"); + this.associateAnmMoService.onClickOfEcdQuestionnaire(true); } }); - - } + } - calculateEdd() { - - if (this.benRegistrationForm.controls.lmpDate.value !== null) { - const eddDate = new Date(this.benRegistrationForm.controls.lmpDate.value); - eddDate.setDate(this.benRegistrationForm.controls.lmpDate.value.getDate() + 7); - eddDate.setMonth(this.benRegistrationForm.controls.lmpDate.value.getMonth() + 9); - this.benRegistrationForm.patchValue({ edd: eddDate }) - } else { - console.log("EDD VALUE", this.benRegistrationForm.controls.edd.value); - this.benRegistrationForm.patchValue({ edd: null }) - } + + calculateEdd() { + + if (this.benRegistrationForm.controls.lmpDate.value !== null) { + const eddDate = new Date(this.benRegistrationForm.controls.lmpDate.value); + eddDate.setDate(this.benRegistrationForm.controls.lmpDate.value.getDate() + 7); + eddDate.setMonth(this.benRegistrationForm.controls.lmpDate.value.getMonth() + 9); + this.benRegistrationForm.patchValue({ edd: eddDate }) + } else { + console.log("EDD VALUE", this.benRegistrationForm.controls.edd.value); + this.benRegistrationForm.patchValue({ edd: null }) } + } - ageEntered() { + ageEntered() { this.valueEntered = this.benRegistrationForm.controls.age.value; if (this.valueEntered) { - if(this.valueEntered < 12 || this.valueEntered > 50) { - this.confirmationService.openDialog( this.currentLanguageSet.pleaseValidateAge, 'warn'); + if (this.valueEntered < 12 || this.valueEntered > 50) { + this.confirmationService.openDialog(this.currentLanguageSet.pleaseValidateAge, 'warn'); this.benRegistrationForm.patchValue({ age: null }); } else if (this.valueEntered > this.ageLimit) { - this.confirmationService.openDialog( this.currentLanguageSet.pleaseValidateAge, 'warn'); + this.confirmationService.openDialog(this.currentLanguageSet.pleaseValidateAge, 'warn'); this.benRegistrationForm.patchValue({ age: null }); - } + } } - + } - -} + + performAction() { + if (!this.benRegistrationForm.controls.phoneNo.value) { + this.confirmationService.openDialog( + this.currentLanguageSet?.phoneNumberRequired || 'Phone number is required for video call', + 'error' + ); + return; + } + this.videoService.videoCallPrompt = true; + // this.cdr.detectChanges(); + this.videoService.setVideoCallData( + true, // or your dynamic video call status + this.benRegistrationForm.controls.phoneNo.value, + this.videoService.meetLink, + this.loginService.agentId, + sessionStorage.getItem('userName')) + } + + formatDateValue(value: any) { + + const dateObj = new Date(value); + const finalDate = `${dateObj.getFullYear()}-${String(dateObj.getMonth() + 1).padStart(2, "0")}-${String(dateObj.getDate()).padStart(2, "0")}T00:00:00+05:30`; + return finalDate; + + } + +} \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.html b/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.html index b42ef6e..6a1fda6 100644 --- a/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.html +++ b/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.html @@ -5,210 +5,292 @@

{{currentLanguageSet?.callClosure}}

-
- - -
-
-
- {{currentLanguageSet?.noFurtherCallRequired}} - - {{currentLanguageSet?.yes}} - {{currentLanguageSet?.no}} - -
-
- - {{currentLanguageSet?.reasonForNoCall}} - - - {{ option.name }} - - - {{ - currentLanguageSet.fieldIsRequired }} - -
-
-
-
- {{currentLanguageSet?.callAnswered}} - - - {{currentLanguageSet?.yes}} - {{currentLanguageSet?.no}} - -
- -
- - {{currentLanguageSet?.reasonOfNotAnswered}} - - - {{ option.name }} - - - {{ - currentLanguageSet.fieldIsRequired }} - - -
-
- {{currentLanguageSet?.iVRFeedbackRequired}} -
-
-
-
- {{currentLanguageSet?.callVerified}} - - - {{currentLanguageSet?.yes}} - {{currentLanguageSet?.no}} - - -
-
- {{currentLanguageSet?.callDisconnected}} - - - {{currentLanguageSet?.yes}} - {{currentLanguageSet?.no}} - -
-
- {{currentLanguageSet?.isWrongNumber}} - - - {{currentLanguageSet?.yes}} - {{currentLanguageSet?.no}} - -
-
- {{currentLanguageSet?.stickyAgent}} -
-
-
-
- - {{currentLanguageSet?.typeOfComplaint}} - - - {{ option.name }} - - - - - -
-
- - {{currentLanguageSet?.nextAttempt}} - - - -
- -
-
-
- - {{currentLanguageSet?.complaintRemarksCall}} - - - -
-
- - {{currentLanguageSet?.callClosureRemarks}} - - - -
-
- -
-
- - {{currentLanguageSet?.sendAdvice}} - - - -
-
- - {{currentLanguageSet?.alternateNumber}} - - - -
-
- -
-
-
- - -
- -
-
-
-
-
- \ No newline at end of file + + +
+ + {{currentLanguageSet?.alternateNumber}} + + + +
+
+ +
+ +
+ + +
+ + + +
+ + +
+ +
+ + + \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.ts b/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.ts index b67d181..95368e5 100644 --- a/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.ts +++ b/src/app/app-modules/associate-anm-mo/call-closure/call-closure.component.ts @@ -37,6 +37,8 @@ import { MasterService } from '../../services/masterService/master.service'; import { AgentsInnerpageComponent } from '../agents-innerpage/agents-innerpage.component'; import { SpinnerService } from '../../services/spinnerService/spinner.service'; import { Subscription, map, timer } from 'rxjs'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { VideoConsultationService } from '../video-consultation/videoService'; @Component({ selector: 'app-call-closure', @@ -81,6 +83,7 @@ export class CallClosureComponent implements OnInit, DoCheck, AfterContentChecke isCallVerified: [''], isCallDisconnected: [''], isWrongNumber: [''], + phoneNumber: [null], isStickyAgentRequired: false, complaintId: [''], typeOfComplaint: [''], @@ -88,6 +91,7 @@ export class CallClosureComponent implements OnInit, DoCheck, AfterContentChecke // nextAttemptTime: [''], complaintRemarks: [''], callRemarks: [''], + preferredLanguage: [null], sendAdvice: [null], altPhoneNo: [null, [Validators.pattern("^((\\+91-?)|0)?[0-9]{10}$")]], iVRFeedbackRequired: false @@ -95,6 +99,11 @@ export class CallClosureComponent implements OnInit, DoCheck, AfterContentChecke ); isCallVerifiedStatus: any; isWrongNumberStatus : any; + languages: any = []; + enableCallDisconnectAndFurtherCall= false; + enableWrongNumber = false; + enablePreferredLanguage = false; + enablePhoneNumber = false; constructor( private setLanguageService: SetLanguageService, private fb: FormBuilder, @@ -107,10 +116,14 @@ export class CallClosureComponent implements OnInit, DoCheck, AfterContentChecke private sms_service: SmsTemplateService, private router: Router, private masterService:MasterService, - private spinnerService: SpinnerService + readonly sessionstorage:SessionStorageService, + private spinnerService: SpinnerService, + public videoService: VideoConsultationService, + ) { } + getSelectedLanguage() { if ( @@ -125,10 +138,10 @@ private sms_service: SmsTemplateService, ngOnInit(): void { this.minimumDate = new Date(); console.log(this.minimumDate); - this.phoneNo = sessionStorage.getItem("benPhoneNo"); + this.phoneNo = this.sessionstorage.getItem("benPhoneNo"); const url = "" this.ctiHandlerURL = this.sanitizer.bypassSecurityTrustResourceUrl(url); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); console.log(this.selectedRole); this.getSelectedLanguage(); this.getReasonsOfNotCallRequired(); @@ -136,6 +149,7 @@ private sms_service: SmsTemplateService, this.getComplaints(); this.getCallTypes(); this.isStickyAgentValid(); + this.getLanguageMaster(); this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { if (responseComp !== null && responseComp === "Call Closed") { @@ -152,7 +166,13 @@ private sms_service: SmsTemplateService, this.disableIVRFeedback = true this.barMinimized = true; this.isCorrectDateAndTime = true; - this.callClosureForm.reset(); + this.enableCallDisconnectAndFurtherCall = false; + this.enableWrongNumber = false; + this.enablePhoneNumber = false; + this.clearPreferredLanguageValidator(); + this.clearIsFurtherCallValidator(); + this.enablePreferredLanguage = false; + this.callClosureForm.reset(); } }); @@ -309,15 +329,15 @@ private sms_service: SmsTemplateService, obCallId: this.associateAnmMoService.selectedBenDetails.obCallId, motherId :this.associateAnmMoService.selectedBenDetails.mctsidNo?this.associateAnmMoService.selectedBenDetails.mctsidNo:this.associateAnmMoService.selectedBenDetails.motherId, childId:this.associateAnmMoService.selectedBenDetails.mctsidNoChildId?this.associateAnmMoService.selectedBenDetails.mctsidNoChildId:null, - userId: sessionStorage.getItem('userId'), + userId: this.sessionstorage.getItem('userID'), agentId: this.loginService.agentId, - role: sessionStorage.getItem('role'), - phoneNo: sessionStorage.getItem("benPhoneNo"), - psmId: sessionStorage.getItem('providerServiceMapID'), + role: this.sessionstorage.getItem('role'), + phoneNo: this.sessionstorage.getItem("benPhoneNo"), + psmId: this.sessionstorage.getItem('providerServiceMapID'), ecdCallType:this.associateAnmMoService.selectedBenDetails.outboundCallType, - callId: sessionStorage.getItem("callId"), + callId: this.sessionstorage.getItem("callId"), isOutbound: true, - beneficiaryRegId: (this.associateAnmMoService.selectedBenDetails.beneficiaryRegId === null) ? sessionStorage.getItem('beneficiaryRegId'): this.associateAnmMoService.selectedBenDetails.beneficiaryRegId, + beneficiaryRegId: (this.associateAnmMoService.selectedBenDetails.beneficiaryRegId === null) ? this.sessionstorage.getItem('beneficiaryRegId'): this.associateAnmMoService.selectedBenDetails.beneficiaryRegId, isFurtherCallRequired: (formData.isFurtherCallRequired==="Yes")?true:false, reasonForNoFurtherCallsId: formData.reasonForNoFurtherCallsId, reasonForNoFurtherCalls: formData.reasonForNoFurtherCalls, @@ -327,6 +347,7 @@ private sms_service: SmsTemplateService, reasonForCallNotAnswered: formData.reasonForCallNotAnswered, isCallDisconnected: (formData.isCallDisconnected==="Yes")?true:false, isWrongNumber: this.isWrongNumberStatus, + correctPhoneNumber: formData.phoneNumber, typeOfComplaint: (formData.typeOfComplaint !== null && formData.typeOfComplaint !== undefined && formData.typeOfComplaint !== "") ? formData.typeOfComplaint : null, complaintRemarks: (formData.complaintRemarks !== null && formData.complaintRemarks !== undefined && formData.complaintRemarks !== "") ? formData.complaintRemarks : null, nextAttemptDate: (formData.nextAttemptDate !== null && formData.nextAttemptDate !== undefined && formData.nextAttemptDate !== "") ? formData.nextAttemptDate : null, @@ -337,18 +358,19 @@ private sms_service: SmsTemplateService, isHrp: this.associateAnmMoService.isMother?this.associateAnmMoService.isHighRiskPregnancy:false, isHrni: (this.associateAnmMoService.isMother === false)?this.associateAnmMoService.isHighRiskInfant:false, deleted: false, - createdBy: sessionStorage.getItem("userName"), - modifiedBy: sessionStorage.getItem("userName"), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), complaintId: (formData.complaintId !== null && formData.complaintId !== undefined && formData.complaintId !== "") ? formData.complaintId : null, + preferredLanguage: formData.preferredLanguage }; const commonReqobj = { benCallID: this.associateAnmMoService.callDetailId, - callID: sessionStorage.getItem("callId"), + callID: this.sessionstorage.getItem("callId"), remarks: formData.callRemarks, callTypeID: this.callTypeId, emergencyType: 0, - agentIPAddress: sessionStorage.getItem("agentIp"), - createdBy: sessionStorage.getItem("userName"), + agentIPAddress: this.sessionstorage.getItem("agentIp"), + createdBy: this.sessionstorage.getItem('userName'), isFollowupRequired: false, fitToBlock: false, endCall: true, @@ -372,12 +394,18 @@ private sms_service: SmsTemplateService, this.associateAnmMoService.setStopTimer(true); console.log("timer stopped"); this.unsubscribeWrapupTime(); - sessionStorage.setItem("onCall", "false"); + this.sessionstorage.setItem("onCall", "false"); this.associateAnmMoService.fromComponent = null; this.associateAnmMoService.setCallClosure(); this.showCallAnswerNoDropdown=false; this.showVerifiedFields = false; this.showDetails = false; + this.enableCallDisconnectAndFurtherCall = false; + this.enableWrongNumber = false; + this.enablePhoneNumber = false; + this.clearPreferredLanguageValidator(); + this.clearIsFurtherCallValidator(); + this.enablePreferredLanguage = false; this.disableIVRFeedback = true; this.resetSessions(); this.resetForm(); @@ -448,28 +476,45 @@ private sms_service: SmsTemplateService, this.callClosureForm.reset(); } selectedReasonOfNoFutherCall(value: any) { + const isDisconnect = this.callClosureForm.controls["isCallDisconnected"].value; if (value === 'No') { this.showDetails = true - - + this.clearPreferredLanguageValidator(); + this.callClosureForm.controls['preferredLanguage'].reset(); + this.enablePreferredLanguage = false; this.callClosureForm.controls['reasonForNoFurtherCallsId'].reset(); this.callClosureForm.controls['reasonForNoFurtherCalls'].reset(); + const reasonForNoFurtherCallsIdControl = this.callClosureForm.get('reasonForNoFurtherCallsId'); + reasonForNoFurtherCallsIdControl?.setValidators([Validators.required]); + reasonForNoFurtherCallsIdControl?.updateValueAndValidity(); this.callClosureForm.controls['nextAttemptDate'].reset(); this.callClosureForm.controls['nextAttemptDate'].disable(); // this.callClosureForm.addControl('reasonForNoFurtherCallsId', this.fb.control('', Validators.required)); // this.callClosureForm.addControl('reasonForNoFurtherCalls', this.fb.control('', Validators.required)); } else { - this.showDetails = false - this.callClosureForm.controls['nextAttemptDate'].enable(); + // this.callClosureForm.removeControl('reasonForNoFurtherCallsId'); // this.callClosureForm.removeControl('reasonForNoFurtherCalls'); + this.showDetails = false + if(this.selectedRole !== undefined && this.selectedRole !== null && this.selectedRole.toLowerCase() === "associate") { + const preferredLanguageControl = this.callClosureForm.get('preferredLanguage'); + preferredLanguageControl?.setValidators([Validators.required]); + preferredLanguageControl?.updateValueAndValidity(); + } + this.enablePreferredLanguage = true; this.callClosureForm.controls['reasonForNoFurtherCallsId'].reset(); this.callClosureForm.controls['reasonForNoFurtherCalls'].reset(); this.callClosureForm.controls['reasonForNoFurtherCallsId'].setValue(0); this.callClosureForm.controls['reasonForNoFurtherCalls'].setValue(''); + + this.clearIsFurtherCallValidator(); + + if(isDisconnect === 'Yes') { + this.callClosureForm.controls['nextAttemptDate'].enable(); + } } } @@ -478,6 +523,13 @@ private sms_service: SmsTemplateService, this.showCallAnswerNoDropdown = true; this.showVerifiedFields = false; this.disableIVRFeedback = true; + this.enableCallDisconnectAndFurtherCall = false; + this.enableWrongNumber = false; + this.showDetails = false; + this.enablePhoneNumber = false; + this.clearPreferredLanguageValidator(); + this.clearIsFurtherCallValidator(); + this.enablePreferredLanguage = false; for(let i=0; i { @@ -711,15 +770,88 @@ private sms_service: SmsTemplateService, } - checkIsNextAttempt(callAnswered:string, callVerified:string, callDisconnected:string ){ - if(callAnswered === "Yes" && callVerified === "Yes" && callDisconnected === "No"){ + onCallverified(callVerified:string) { + this.callClosureForm.controls['isCallDisconnected'].reset(); + this.callClosureForm.controls['isWrongNumber'].reset(); + this.callClosureForm.controls['isFurtherCallRequired'].reset(); + this.callClosureForm.controls['reasonForNoFurtherCallsId'].reset(); + this.callClosureForm.controls['nextAttemptDate'].enable(); + this.callClosureForm.controls['preferredLanguage'].reset(); + this.callClosureForm.controls['phoneNumber'].reset(); + this.showDetails = false; + this.enablePhoneNumber = false; + this.clearPreferredLanguageValidator(); + this.clearIsFurtherCallValidator(); + this.enablePreferredLanguage = false; + if(callVerified === "Yes") { + this.enableCallDisconnectAndFurtherCall = true; + this.enableWrongNumber = false; + } + else { + this.enableCallDisconnectAndFurtherCall = false; + this.enableWrongNumber = true; + } + + + } + + checkIsNextAttempt(callDisconnected:string ){ + const isFurtherCall = this.callClosureForm.controls["isFurtherCallRequired"].value; + if(callDisconnected === "No"){ this.callClosureForm.controls['nextAttemptDate'].disable(); this.callClosureForm.controls['nextAttemptDate'].reset(); } - else{ + else if(isFurtherCall === "Yes") { this.callClosureForm.controls['nextAttemptDate'].enable(); this.isNextAttempt = true; + } + + } + + onWrongNumberChange(wrongNumber:string ){ + + this.callClosureForm.controls['phoneNumber'].reset(); + if(wrongNumber === "No"){ + this.enablePhoneNumber = false; + } + else { + this.enablePhoneNumber = true; + } + } + + getLanguageMaster(){ + if(this.selectedRole !== undefined && this.selectedRole !== null && (this.selectedRole.toLowerCase() === "associate" || this.selectedRole.toLowerCase() === "anm") ) { + this.masterService.getLanguageMaster().subscribe((response: any) => { + if(response && response.length > 0){ + this.languages = response; + }else { + this.confirmationService.openDialog(this.currentLanguageSet.noLanguagesFound, 'error'); + } + }, + (err: any) => { + this.confirmationService.openDialog(err.error, 'error'); + } + ); + } + } + + clearPhoneNoValidator() { + const phoneNumberontrol = this.callClosureForm.get('phoneNumber'); + phoneNumberontrol?.clearValidators(); + phoneNumberontrol?.updateValueAndValidity(); + } + + clearPreferredLanguageValidator() { + const preferredLanguageControl = this.callClosureForm.get('preferredLanguage'); + preferredLanguageControl?.clearValidators(); + preferredLanguageControl?.updateValueAndValidity(); + } + + clearIsFurtherCallValidator() { + const reasonForNoFurtherCallsIdControl = this.callClosureForm.get('reasonForNoFurtherCallsId'); + reasonForNoFurtherCallsIdControl?.clearValidators(); + reasonForNoFurtherCallsIdControl?.updateValueAndValidity(); } } export interface gradeMapping { diff --git a/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.html b/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.html index 6b0e21f..e09f42d 100644 --- a/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.html +++ b/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.html @@ -3,769 +3,452 @@

{{ currentLanguageSet?.ecdQuestionnaire }}

- + -
- -
- - - - Beneficiary Details -
- - -
-
-
- -
-
- - Mother Id - - -
-
- - Mother Name - - -
-
- - Husband's Name - - -
-
- - Age - - -
-
- - District Name - - -
-
- - Health Block - - -
-
- - PHC Name - - -
-
- - Sub Facility / Sub Center - - -
-
- - Village Name - - -
-
- - Address - - -
-
- - Phone Number - - -
-
- - Phone Number of Whom - - -
-
- - Alternate Phone Number - - -
- -
- - Asha Name - - -
- -
- - Asha PhoneNo - - -
- -
- - ANM Name - - -
- -
- - ANM PhoneNO - - -
- -
- - LMP Date - - -
- -
- - Expected Deivery Date - - -
-
-
-
- - Child Id - - -
-
- - Child Name - - -
-
- - Mother Id - - -
-
- - Mother Name - - -
-
- - Father Name - - -
-
- - Gender - - -
-
- - District Name - - -
-
- - Health Block - - -
-
- - PHC Name - - -
-
- - Sub Facility / Sub Center - - -
-
- - Village Name - - -
-
- - Address - - -
-
- - Phone Number - - -
-
- - Phone Number of Whom - - -
-
- - Alternate Phone Number - - -
- -
- - Asha Name - - -
- -
- - Asha PhoneNo - - -
- -
- - ANM Name - - -
- -
- - ANM PhoneNO - - -
- -
- - Date of birth - - -
-
-
-
-
-
-
- -
- -
- -
- - {{section.sectionName}} - - -
-
  • {{ques.question}}
  • -
    - -
    -
  • {{ques.question}} - - -
    -
    - - - - Please enter mandatory field - - - - - Please enter mandatory field - - - - - Please enter mandatory field - - - - - {{ option.options }} - - - - Please enter mandatory field - - - - - Please enter mandatory field - - - - - - {{option.options}} - - Please enter mandatory field - - - - - - - - {{ option.options }} - - - - Please enter mandatory field - - - - - - +
    + + ANM Name + + +
    - +
    + + ANM PhoneNO + + +
    - -
    +
    + + + +
  • +
    +
    + +
    + +
    + +
    + + {{section.sectionName}} + + +
    +
  • {{ques.question}}
  • +
    + +
    +
  • {{ques.question}} + + +
    +
    + + + + Please + enter mandatory field + + + + + Please + enter mandatory field + + + + + Please + enter mandatory field + + + + + {{ option.options }} + + + + Please + enter mandatory field + + + + + Please + enter mandatory field + + + + + + {{option.options}} + + Please + enter mandatory field + + + + + + + + {{ option.options }} + + + + Please + enter mandatory field + + + + +
    +
    +
  • +
    +
    +
    + +
    - -
    - -
    - - -
    - - + + +
    +
    - -
    -
    - +
    + +
    -
    -
    - - Questionnaires not mapped against the call type - -
    +
    + + Questionnaires not mapped against the call type + +
    -
    - - -
    +
    + + +
    -
    - +
    + +
    +
    + +
    - + + \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.ts b/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.ts index c6de106..46e3503 100644 --- a/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.ts +++ b/src/app/app-modules/associate-anm-mo/ecd-questionnaire/ecd-questionnaire.component.ts @@ -34,6 +34,9 @@ import { SetLanguageService } from '../../services/set-language/set-language.ser import { BeneficiaryCallHistoryComponent } from '../beneficiary-call-history/beneficiary-call-history.component'; import { CallClosureComponent } from '../call-closure/call-closure.component'; import { HighRiskReasonsComponent } from '../high-risk-reasons/high-risk-reasons.component'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { VideoConsultationService } from '../video-consultation/videoService'; + @Component({ selector: 'app-ecd-questionnaire', @@ -77,18 +80,20 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { benData: any; disableFields: any = true; formattedDOB = ''; - + formattedLMP = ''; + formattedEDD = ''; constructor( private setLanguageService: SetLanguageService, private fb: FormBuilder, private elementRef: ElementRef, - private associateAnmMoService: AssociateAnmMoService, + public associateAnmMoService: AssociateAnmMoService, private confirmationService: ConfirmationService, public dialog: MatDialog, private masterService: MasterService, private changeDetectorRefs: ChangeDetectorRef, - + readonly sessionstorage:SessionStorageService, + public videoService: VideoConsultationService, ) { } beneficiaryMotherDataForm = this.fb.group({ @@ -138,8 +143,16 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { ngOnInit(): void { this.getSelectedLanguage(); - this.role = sessionStorage.getItem('role') + this.role = this.sessionstorage.getItem('role') + + this.videoService.isMeetAvailable = true; + + if (this.videoService.callStatus === 'Ongoing' && this.videoService.meetLink) { + this.videoService.isMeetAvailable = true; + } + this.associateAnmMoService.loadEcdQuestionnaireData$.subscribe(res => { + if(res === true){ if(this.associateAnmMoService.selectedBenDetails){ this.benData = this.associateAnmMoService.selectedBenDetails; @@ -147,8 +160,7 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { this.childId = this.benData.mctsidNoChildId; this.beneficiaryChildDataForm.patchValue(this.benData); - const dobDate = new Date(this.benData.dob); - this.formattedDOB = dobDate.toISOString().split('T')[0]; + this.formattedDOB = new Date(this.benData.dob).toLocaleDateString('en-CA'); this.beneficiaryChildDataForm.patchValue({ childId: this.benData.mctsidNoChildId, dob: this.formattedDOB @@ -161,6 +173,14 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { motherName: (this.benData.motherName !== null && this.benData.motherName !== undefined && this.benData.motherName !== "") ? this.benData.motherName : this.benData.name, motherId: this.benData.mctsidNo }); + this.formattedLMP = new Date(this.benData.lmpDate).toLocaleDateString('en-CA'); + this.beneficiaryMotherDataForm.patchValue({ + lmpDate: this.formattedLMP + }); + this.formattedEDD = new Date(this.benData.edd).toLocaleDateString('en-CA'); + this.beneficiaryMotherDataForm.patchValue({ + edd: this.formattedEDD + }); this.enableChildForm = false; } } @@ -171,6 +191,7 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { // this.getHrniMaster(); // this.getCongentialAnomaliesMaster(); this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { + if (responseComp !== null && responseComp === "Call Closed") { this.filteredQuesData = []; this.enableHrpReasons = false; @@ -192,7 +213,7 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { this.step = 0; this.page = 0; this.myStepper.selectedIndex = 0; - } + } }); } @@ -433,9 +454,9 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { // } getEcdQuestionaire(){ - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const callType = this.benData.outboundCallType; - const role = sessionStorage.getItem('role'); + const role = this.sessionstorage.getItem('role'); this.associateAnmMoService.fetchBeneficiaryQuestionnaire( psmId,callType,role).subscribe((res: any) => { if(res && res.length > 0){ this.filterEcdQuestionnaire(res); @@ -818,8 +839,8 @@ export class EcdQuestionnaireComponent implements OnInit, AfterViewInit { ecdCallType: this.benData.outboundCallType, benCallId: this.associateAnmMoService.callDetailId, questionnaireResponse: saveQuestionsData, - psmId: sessionStorage.getItem('providerServiceMapID'), - createdBy: sessionStorage.getItem('userName') + psmId: this.sessionstorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName') } this.associateAnmMoService.saveQuestionnaireResponse(reqObj).subscribe((res: any) => { if(res){ diff --git a/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.css b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.css new file mode 100644 index 0000000..97825f6 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.css @@ -0,0 +1,54 @@ + + .floating-video { + position: fixed; + width: 500px; + height: 700px; + background: white; + border: 1px solid #ccc; + box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); + z-index: 10000; + top: 100px; + left: 100px; + display: flex; + flex-direction: column; + overflow: hidden; + border-radius: 8px; + transition: transform 0.2s ease; /* Optional for smooth drag */ +} + +.drag-header { + height: 40px; + background: #f0f0f0; + cursor: move; + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 12px; + font-weight: bold; + user-select: none; + flex-shrink: 0; + border-bottom: 1px solid #ddd; +} + +#jitsi-container { + flex-grow: 1; + width: 100% !important; + height: 100% !important; + position: relative; +} + +.close-btn { + background-color: red; + color: white; + border: none; + border-radius: 4px; + font-size: 16px; + width: 25px; + height: 25px; + cursor: pointer; + line-height: 1; + text-align: center; + display: flex; + align-items: center; + justify-content: center; +} diff --git a/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.html b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.html new file mode 100644 index 0000000..3f0c945 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.html @@ -0,0 +1,10 @@ + +
    +
    + Video Call + +
    + +
    +
    + \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.ts b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.ts new file mode 100644 index 0000000..4a4af1a --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/floating-videocall/floating-video.component.ts @@ -0,0 +1,149 @@ +import { + Component, + AfterViewInit, + ElementRef, + ViewChild, + ChangeDetectionStrategy + } from '@angular/core'; +import { VideoConsultationService } from '../video-consultation/videoService'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; + + declare let JitsiMeetExternalAPI: any; + + @Component({ + selector: 'app-floating-video', + templateUrl: './floating-video.component.html', + styleUrls: ['./floating-video.component.css'], + changeDetection: ChangeDetectionStrategy.OnPush + }) + export class FloatingVideoComponent implements AfterViewInit { + @ViewChild('jitsiContainer', { static: true }) jitsiContainerRef!: ElementRef; + @ViewChild('floatingWindow', { static: true }) floatingWindowRef!: ElementRef; + + private isDragging = false; + private offsetX = 0; + private offsetY = 0; + private lastMove = 0; + + + constructor( + public videoService: VideoConsultationService, + readonly sessionstorage: SessionStorageService, + + ) {} + + ngAfterViewInit(): void { + const container = this.jitsiContainerRef?.nativeElement; + + if ((!this.videoService.apiInitialized || container?.childElementCount === 0) && this.videoService.meetLink) { + this.initializeJitsi(); + } + } + + initializeJitsi(): void { + + if (!this.jitsiContainerRef?.nativeElement) { + console.error('Jitsi container not available'); + return; + } + + this.videoService.apiInitialized = true; // Add this flag to prevent double init + + const domain = 'vc.piramalswasthya.org'; + try { + const options = { + roomName: this.videoService.meetLink?.split('/').pop(), + parentNode: this.jitsiContainerRef.nativeElement, + userInfo: { + displayName: this.sessionstorage.getItem('userName'), + }, + configOverwrite: { + startWithAudioMuted: false, + startWithVideoMuted: false, + prejoinPageEnabled: false, + disableModeratorIndicator: true, + serviceUrl: 'wss://vc.piramalswasthya.org/xmpp-websocket', + enableNoAudioDetection: true, + enableNoisyMicDetection: true + + }, + interfaceConfigOverwrite: { + SHOW_JITSI_WATERMARK: false, + SHOW_BRAND_WATERMARK: false, + disableDeepLinking: true, + SHOW_POWERED_BY: false, + TOOLBAR_BUTTONS: [ + 'microphone', 'recording', 'camera', 'fullscreen', + 'hangup', + 'chat', 'settings', 'raisehand', + 'videoquality' + ], + } + }; + + const api = new JitsiMeetExternalAPI(domain, options); + api.addListener('readyToClose', () => this.close()); + } catch (error) { + console.error('Failed to initialize Jitsi:', error); + this.videoService.apiInitialized = false; + } + } + + close(): void { + this.videoService.resetVideoCall(); + } + + startDrag(event: MouseEvent): void { + event.preventDefault(); + this.isDragging = true; + + const rect = this.floatingWindowRef.nativeElement.getBoundingClientRect(); + this.offsetX = event.clientX - rect.left; + this.offsetY = event.clientY - rect.top; + + document.addEventListener('mousemove', this.onDrag); + document.addEventListener('mouseup', this.endDrag); + } + + + + onDrag = (event: MouseEvent): void => { + if (!this.isDragging) return; + + const now = Date.now(); + if (now - this.lastMove < 16) return; // Throttle to ~60fps + this.lastMove = now; + + const left = event.clientX - this.offsetX; + const top = event.clientY - this.offsetY; + + const floatingEl = this.floatingWindowRef.nativeElement; + + // Apply constraints to keep window within the viewport (optional but helpful) + const maxLeft = window.innerWidth - floatingEl.offsetWidth; + const maxTop = window.innerHeight - floatingEl.offsetHeight; + + floatingEl.style.left = `${Math.max(0, Math.min(left, maxLeft))}px`; + floatingEl.style.top = `${Math.max(0, Math.min(top, maxTop))}px`; + floatingEl.style.right = 'auto'; + floatingEl.style.bottom = 'auto'; + }; + + endDrag = () => { + this.isDragging = false; + document.removeEventListener('mousemove', this.onDrag); + document.removeEventListener('mouseup', this.endDrag); + }; + + ngOnDestroy(): void { + // Clean up any remaining event listeners + document.removeEventListener('mousemove', this.onDrag); + document.removeEventListener('mouseup', this.endDrag); + + // Reset the video service if needed + if (this.videoService.showFloatingVideo) { + this.videoService.resetVideoCall(); + } + } + } + \ No newline at end of file diff --git a/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.html b/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.html index 30b4bd0..0afa1d7 100644 --- a/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.html +++ b/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.html @@ -122,16 +122,16 @@

    - + - + {{currentLanguageSet?.recordUploadDate}} @@ -187,6 +187,7 @@

    +
    - - diff --git a/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.ts b/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.ts index b2b2aae..ce1e675 100644 --- a/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.ts +++ b/src/app/app-modules/associate-anm-mo/outbound-worklist/outbound-worklist.component.ts @@ -25,7 +25,7 @@ import { AfterViewInit, ChangeDetectorRef, Component, DoCheck, OnInit, ViewChild import { MatSort } from '@angular/material/sort'; import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { SetLanguageService } from '../../services/set-language/set-language.service'; -import {MatLegacyDialog as MatDialog, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef} from '@angular/material/legacy-dialog'; +import { MatLegacyDialog as MatDialog, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef } from '@angular/material/legacy-dialog'; import { ViewDetailsComponent } from '../view-details/view-details.component'; import { ConfirmationService } from '../../services/confirmation/confirmation.service'; import { ActivatedRoute, Router } from '@angular/router'; @@ -38,6 +38,7 @@ import { LoginserviceService } from '../../services/loginservice/loginservice.se import { CtiService } from '../../services/cti/cti.service'; import { map, Subscription, timer } from 'rxjs'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-outbound-worklist', @@ -48,29 +49,33 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit @ViewChild(MatSort) sort: MatSort | null = null; @ViewChild(MatPaginator) paginator: MatPaginator | null = null; dataSource = new MatTableDataSource(); - outBoundListForMother:any[]=[]; - outBoundListForChild:any[]=[]; + outBoundListForMother: any[] = []; + outBoundListForChild: any[] = []; currentLanguageSet: any; - activeMother=true; - activeChild=false; + activeMother = true; + activeChild = false; searchTerm: any; - mappedOutBoundWorkList:any[]=[]; + mappedOutBoundWorkList: any[] = []; displayedColumns: string[] = []; isChecked = false; isAutoPreviewDial = false; previewWindowTime: any; - agentStatus:any; + agentStatus: any; autoPreviewTimeSub: Subscription = new Subscription; - autoCallStarted:any=false + autoCallStarted: any = false + showPrompt = false; + + constructor( private setLanguageService: SetLanguageService, public dialog: MatDialog, public cd: ChangeDetectorRef, - private confirmationService:ConfirmationService, + private confirmationService: ConfirmationService, private router: Router, private associateAnmMoService: AssociateAnmMoService, private loginService: LoginserviceService, - private ctiService: CtiService + readonly sessionstorage: SessionStorageService, + private ctiService: CtiService, ) { } ngDoCheck() { @@ -82,26 +87,26 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit this.getSelectedLanguage(); this.isChecked = false; this.getAutoPreviewDialing(); - this.associateAnmMoService.agentCurrentStatusData$.subscribe((response)=>{ - if( response !== undefined){ + this.associateAnmMoService.agentCurrentStatusData$.subscribe((response) => { + if (response !== undefined) { this.agentStatus = response; - if((this.agentStatus === "FREE" || this.agentStatus === "READY") ) { - if(this.isAutoPreviewDial && this.associateAnmMoService.isStartAutoPreviewDial && this.dataSource.data.length > 0 && !this.associateAnmMoService.autoDialing && sessionStorage.getItem("onCall") === "false" && this.previewWindowTime !== null && this.previewWindowTime !== undefined) { - this.isChecked = true; - const previewTime = this.previewWindowTime * 1000; - - this.autoPreviewTimeSub = timer(previewTime).pipe( - map(() => { - this.StartAutoPreviewDialing(true); - }) - ).subscribe(); - + if ((this.agentStatus === "FREE" || this.agentStatus === "READY")) { + if (this.isAutoPreviewDial && this.associateAnmMoService.isStartAutoPreviewDial && this.dataSource.data.length > 0 && !this.associateAnmMoService.autoDialing && this.sessionstorage.getItem("onCall") === "false" && this.previewWindowTime !== null && this.previewWindowTime !== undefined) { + this.isChecked = true; + const previewTime = this.previewWindowTime * 1000; + + this.autoPreviewTimeSub = timer(previewTime).pipe( + map(() => { + this.StartAutoPreviewDialing(true); + }) + ).subscribe(); + + } } } - } - }) + }) // this.associateAnmMoService.resetAgentState(); - + } @@ -113,123 +118,123 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit this.currentLanguageSet = this.setLanguageService.languageData; } - selectedRecord(activeValue:any){ + selectedRecord(activeValue: any) { this.reset(); - if(activeValue==='mother'){ - this.activeMother=true - this.activeChild=false - this.dataSource.paginator = this.paginator; - this.getAutoPreviewDialing(); - } - else{ - this.activeChild=true - this.activeMother=false - this.dataSource.paginator = this.paginator - this.getAutoPreviewDialing(); - } + if (activeValue === 'mother') { + this.activeMother = true + this.activeChild = false + this.dataSource.paginator = this.paginator; + this.getAutoPreviewDialing(); + } + else { + this.activeChild = true + this.activeMother = false + this.dataSource.paginator = this.paginator + this.getAutoPreviewDialing(); + } } - selectedRecordAfterFirstDial(activeValue:any){ - - if(activeValue==='mother'){ - this.activeMother=true - this.activeChild=false - this.dataSource.paginator = this.paginator; - this.getOutBoundWorklistCalls(); - } - else{ - this.activeChild=true - this.activeMother=false - this.dataSource.paginator = this.paginator - this.getOutBoundWorklistCalls(); - } + selectedRecordAfterFirstDial(activeValue: any) { + + if (activeValue === 'mother') { + this.activeMother = true + this.activeChild = false + this.dataSource.paginator = this.paginator; + this.getOutBoundWorklistCalls(); + } + else { + this.activeChild = true + this.activeMother = false + this.dataSource.paginator = this.paginator + this.getOutBoundWorklistCalls(); + } } getOutBoundWorklistCalls() { - + const reqObj: any = { - userId: sessionStorage.getItem('userId'), + userId: this.sessionstorage.getItem('userID'), }; - if(this.activeMother === true){ - this.dataSource.sort=null + if (this.activeMother === true) { + this.dataSource.sort = null this.associateAnmMoService.getMotherRecord(reqObj).subscribe( - (response: any) => { - if (response) { - this.outBoundListForMother=response - this.mappedOutBoundWorkList = response; - this.dataSource.data = []; - this.dataSource.data = response; - this.dataSource.data.forEach((sectionCount: any, index: number) => { - sectionCount.sno = index + 1; - }); - this.displayedColumns= [ - 'sno', - 'phoneNo', - 'wPhoneNumber', - 'mctsidNo', - 'lapseTime', - 'callAttemptNo', - // 'callStatus', - 'recordUploadDate', - 'ecdCallType', - 'view', - 'action' - ]; - this.dataSource.paginator = this.paginator; - this.dataSource.sort=this.sort; - } else { - this.confirmationService.openDialog(response.errorMessage, 'error'); - } - }, - (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); - else - this.confirmationService.openDialog(err.title + err.detail, 'error') + (response: any) => { + if (response) { + this.outBoundListForMother = response + this.mappedOutBoundWorkList = response; + this.dataSource.data = []; + this.dataSource.data = response; + this.dataSource.data.forEach((sectionCount: any, index: number) => { + sectionCount.sno = index + 1; + }); + this.displayedColumns = [ + 'sno', + 'phoneNo', + 'wPhoneNumber', + 'mctsidNo', + 'lapseTime', + 'callAttemptNo', + // 'callStatus', + 'recordUploadDate', + 'ecdCallType', + 'view', + 'action' + ]; + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } else { + this.confirmationService.openDialog(response.errorMessage, 'error'); + } + }, + (err: any) => { + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); + else + this.confirmationService.openDialog(err.title + err.detail, 'error') }); } - else{ - this.dataSource.sort=null; + else { + this.dataSource.sort = null; this.associateAnmMoService.getChildRecord(reqObj).subscribe( - (response: any) => { - if (response) { - this.outBoundListForChild=response - this.mappedOutBoundWorkList = this.outBoundListForChild; - this.dataSource.data = []; - this.dataSource.data = this.outBoundListForChild; - this.dataSource.data.forEach((sectionCount: any, index: number) => { - sectionCount.sno = index + 1; - }); - this.displayedColumns= [ - 'sno', - 'phoneNo', - 'wPhoneNumber', - 'childId', - 'lapseTime', - 'callAttemptNo', - // 'callStatus', - 'recordUploadDate', - 'ecdCallType', - 'view', - 'action' - ]; - this.dataSource.paginator = this.paginator; - this.dataSource.sort=this.sort; - } - else { - this.confirmationService.openDialog(response.errorMessage, 'error'); - } - }, - (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); - else - this.confirmationService.openDialog(err.title + err.detail, 'error') + (response: any) => { + if (response) { + this.outBoundListForChild = response + this.mappedOutBoundWorkList = this.outBoundListForChild; + this.dataSource.data = []; + this.dataSource.data = this.outBoundListForChild; + this.dataSource.data.forEach((sectionCount: any, index: number) => { + sectionCount.sno = index + 1; + }); + this.displayedColumns = [ + 'sno', + 'phoneNo', + 'wPhoneNumber', + 'childId', + 'lapseTime', + 'callAttemptNo', + // 'callStatus', + 'recordUploadDate', + 'ecdCallType', + 'view', + 'action' + ]; + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } + else { + this.confirmationService.openDialog(response.errorMessage, 'error'); + } + }, + (err: any) => { + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); + else + this.confirmationService.openDialog(err.title + err.detail, 'error') }); } - - + + } filterSearchTerm(searchTerm?: string) { if (!searchTerm) { @@ -243,11 +248,11 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit if ( key === 'phoneNoOfWhom' || key === 'whomPhoneNo' || - key === 'mctsidNo'|| - key === 'displayOBCallType'|| - key ==='recordUploadDate'|| + key === 'mctsidNo' || + key === 'displayOBCallType' || + key === 'recordUploadDate' || key === 'mctsidNoChildId' || - key === 'phoneNo'|| + key === 'phoneNo' || key === 'phoneNoOf' ) { const value: string = '' + item[key]; @@ -261,190 +266,163 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit }); } } - - openDialog(element:any): void { - // var modifiedReqObj={ - // Aasha:element.Aasha, - // Address:element.Address, - // anmName:element.anmName, - // callAttemptNo:element.callAttemptNo, - // callStatus:eleme - // } - // console.log(element); - this.dialog.open(ViewDetailsComponent,{ - autoFocus: false, - disableClose: false , - data: { selectedDetails: element , activeChild:this.activeChild, activeMother:this.activeMother} - }); - + + openDialog(element: any): void { + this.dialog.open(ViewDetailsComponent, { + autoFocus: false, + disableClose: false, + data: { selectedDetails: element, activeChild: this.activeChild, activeMother: this.activeMother } + }); + } getAutoPreviewDialing() { - - const userId = sessionStorage.getItem('userId'); - const psmId = sessionStorage.getItem('providerServiceMapID'); - const roleId = sessionStorage.getItem('roleId'); - + + const userId = this.sessionstorage.getItem('userID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); + const roleId = this.sessionstorage.getItem('roleId'); + this.associateAnmMoService.getAutoPreviewDialing(userId, roleId, psmId).subscribe( - (response:any) => { - - if(response && response !== undefined && response !== null){ - this.isAutoPreviewDial = response.isAutoPreviewDial; - if(this.isAutoPreviewDial) - { - this.previewWindowTime = response.previewWindowTime; - this.associateAnmMoService.isStartAutoPreviewDial = true - this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { - if (responseComp !== null && (responseComp === "Outbound Worklist" || responseComp === "Call Closed")) { - this.searchTerm = null; - if(this.activeMother === true) { - this.selectedRecordAfterFirstDial("mother"); - } - else { - this.selectedRecordAfterFirstDial("child"); - } - } - - }); - // this.getOutBoundWorklistCalls(); - } - else{ - this.previewWindowTime = null; - this.associateAnmMoService.isStartAutoPreviewDial = false - this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { - if (responseComp !== null && (responseComp === "Outbound Worklist" || responseComp === "Call Closed")) { - this.searchTerm = null; - if(this.activeMother === true) { - this.selectedRecordAfterFirstDial("mother"); - } - else { - this.selectedRecordAfterFirstDial("child"); - } - } - - }); - // this.getOutBoundWorklistCalls(); + (response: any) => { + + if (response && response !== undefined && response !== null) { + this.isAutoPreviewDial = response.isAutoPreviewDial; + if (this.isAutoPreviewDial) { + this.previewWindowTime = response.previewWindowTime; + this.associateAnmMoService.isStartAutoPreviewDial = true + this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { + if (responseComp !== null && (responseComp === "Outbound Worklist" || responseComp === "Call Closed")) { + this.searchTerm = null; + if (this.activeMother === true) { + this.selectedRecordAfterFirstDial("mother"); + } + else { + this.selectedRecordAfterFirstDial("child"); + } + } + + }); + // this.getOutBoundWorklistCalls(); + } + else { + this.previewWindowTime = null; + this.associateAnmMoService.isStartAutoPreviewDial = false + this.associateAnmMoService.openCompFlag$.subscribe((responseComp) => { + if (responseComp !== null && (responseComp === "Outbound Worklist" || responseComp === "Call Closed")) { + this.searchTerm = null; + if (this.activeMother === true) { + this.selectedRecordAfterFirstDial("mother"); + } + else { + this.selectedRecordAfterFirstDial("child"); + } + } + + }); + // this.getOutBoundWorklistCalls(); + } } - } }, (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); else - this.confirmationService.openDialog(err.title + err.detail, 'error') - }); + this.confirmationService.openDialog(err.title + err.detail, 'error') + }); } - callBeneficary(element:any, isMother:boolean){ - - + callBeneficary(element: any, isMother: boolean) { + + this.associateAnmMoService.selectedBenDetails = element; console.log(this.associateAnmMoService.selectedBenDetails); this.associateAnmMoService.isMother = isMother; - let phNo:any = null; - if(this.associateAnmMoService.isMother !== undefined && this.associateAnmMoService.isMother !== null && this.associateAnmMoService.isMother === true) { + let phNo: any = null; + if (this.associateAnmMoService.isMother !== undefined && this.associateAnmMoService.isMother !== null && this.associateAnmMoService.isMother === true) { phNo = this.associateAnmMoService.selectedBenDetails.whomPhoneNo; } - else if(this.associateAnmMoService.isMother !== undefined && this.associateAnmMoService.isMother !== null && this.associateAnmMoService.isMother === false) { - + else if (this.associateAnmMoService.isMother !== undefined && this.associateAnmMoService.isMother !== null && this.associateAnmMoService.isMother === false) { + phNo = this.associateAnmMoService.selectedBenDetails.phoneNo; } - /** - * todo remove this code - */ - // this.associateAnmMoService.setLoadDetailsInReg(true); - // this.associateAnmMoService.setOpenComp("Beneficiary Registration"); - - - - - if (this.loginService.agentId === undefined) { - this.confirmationService.openDialog(this.currentLanguageSet.agentIdNotAvailable, 'error') - } else { - if (sessionStorage.getItem('agentIp') === undefined) { - const reqObjs={ - "agent_id" : this.loginService.agentId - } - this.ctiService + + if (this.loginService.agentId === undefined) { + this.confirmationService.openDialog(this.currentLanguageSet.agentIdNotAvailable, 'error') + } else { + if (this.sessionstorage.getItem('agentIp') === undefined) { + const reqObjs = { + "agent_id": this.loginService.agentId + } + this.ctiService .getAgentIpAddress(reqObjs) .subscribe( (response: any) => { - - sessionStorage.setItem('agentIp', response.data.agent_ip); - - this.ctiService - .callBeneficiaryManual(this.loginService.agentId, phNo) - .subscribe( - (response:any) => { - // this.dataService.onCall.next({ - // isonCall: true, - // }); - - - - if (response.data.status === "SUCCESS") { - - sessionStorage.setItem("onCall", "true"); - this.associateAnmMoService.setBenRegistartionComp(true); - } - else { - this.confirmationService.openDialog(response.errorMessage, 'error'); - } - }, - (err: any) => { - if(err && err.error) + + this.sessionstorage.setItem('agentIp', response.data.agent_ip); + + this.ctiService + .callBeneficiaryManual(this.loginService.agentId, phNo) + .subscribe( + (response: any) => { + + if (response.data.status === "SUCCESS") { + + this.sessionstorage.setItem("onCall", "true"); + this.associateAnmMoService.setBenRegistartionComp(true); + } + else { + this.confirmationService.openDialog(response.errorMessage, 'error'); + } + }, + (err: any) => { + if (err && err.error) this.confirmationService.openDialog(err.error, 'error'); - else + else this.confirmationService.openDialog(err.title + err.detail, 'error') - }); - - }, - (error) => { - console.log(error); - } - ); - } - else { - this.ctiService + }); + + }, + (error) => { + console.log(error); + } + ); + } + else { + this.ctiService .callBeneficiaryManual(this.loginService.agentId, phNo) .subscribe( - (response:any) => { - // this.dataService.onCall.next({ - // isonCall: true, - // }); - + (response: any) => { - if (response.data.status === "SUCCESS") { - sessionStorage.setItem("onCall", "true"); + this.sessionstorage.setItem("onCall", "true"); this.associateAnmMoService.setBenRegistartionComp(true); } }, (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); else - this.confirmationService.openDialog(err.title + err.detail, 'error') - }); - - } + this.confirmationService.openDialog(err.title + err.detail, 'error') + }); + } - -// this.associateAnmMoService.setOpenComp("Beneficiary Registration"); -// this.associateAnmMoService.loadComponent(BenRegistrationComponent,null); + } + + // this.associateAnmMoService.setOpenComp("Beneficiary Registration"); + // this.associateAnmMoService.loadComponent(BenRegistrationComponent,null); } - StartAutoPreviewDialing(isChecked:any) { + StartAutoPreviewDialing(isChecked: any) { this.associateAnmMoService.autoDialing = true; if (this.autoPreviewTimeSub) { this.autoPreviewTimeSub.unsubscribe(); } - if(isChecked === true) { + if (isChecked === true) { /** * todo reset this value after user logOut */ @@ -454,153 +432,114 @@ export class OutboundWorklistComponent implements OnInit, DoCheck, AfterViewInit else { this.associateAnmMoService.isStartAutoPreviewDial = false; } - - } - - getAgentState(isMother:any) { - const reqObj = {"agent_id" : this.loginService.agentId}; - this.ctiService.getAgentState(reqObj).subscribe((response:any) => { - if (response && response.data && response.data.stateObj.stateName) { - if ( - response.data.stateObj.stateName.toUpperCase() === "FREE" || - response.data.stateObj.stateName.toUpperCase() === "READY" - ) { - this.startAutoDialCall(isMother); - } else { - this.reset(); - } - } - else { + + } + + getAgentState(isMother: any) { + const reqObj = { "agent_id": this.loginService.agentId }; + this.ctiService.getAgentState(reqObj).subscribe((response: any) => { + if (response && response.data && response.data.stateObj.stateName) { + if ( + response.data.stateObj.stateName.toUpperCase() === "FREE" || + response.data.stateObj.stateName.toUpperCase() === "READY" + ) { + this.startAutoDialCall(isMother); + } else { this.reset(); } + } + else { + this.reset(); + } }, (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); else - this.confirmationService.openDialog(err.title + err.detail, 'error') + this.confirmationService.openDialog(err.title + err.detail, 'error') this.reset(); - }); -} + }); + } -startAutoDialCall(isMother:any) { + startAutoDialCall(isMother: any) { + + if (isMother === true) { + + if (this.mappedOutBoundWorkList.length > 0) { + this.callBeneficary(this.mappedOutBoundWorkList[0], true); + + } + + } else { + + if (this.mappedOutBoundWorkList.length > 0) { + this.callBeneficary(this.mappedOutBoundWorkList[0], false); + + } - if (isMother === true) { - - if(this.mappedOutBoundWorkList.length > 0) { - this.callBeneficary(this.mappedOutBoundWorkList[0],true); - - } - } else { - - if(this.mappedOutBoundWorkList.length > 0) { - this.callBeneficary(this.mappedOutBoundWorkList[0],false); - } - - } -} -reset() { -this.isChecked = false; -this.associateAnmMoService.autoDialing =false; -} + reset() { + this.isChecked = false; + this.associateAnmMoService.autoDialing = false; + } + + + EnableAutoPreviewDialing() { + if (this.isChecked === true) { + const value = 0; + if (this.dataSource.data.length > 0) { + const currentcALLisGoingOn = this.callApi(this.dataSource.data[value])//will call to calling Api and get Result whether call still going on + if (currentcALLisGoingOn === false) { + setTimeout(() => { + if (this.activeMother) { + this.outBoundListForMother.splice(value, 1); + this.dataSource.data = this.outBoundListForMother + } + else { + this.outBoundListForChild.splice(value, 1); + this.dataSource.data = this.outBoundListForChild + } // <<<---using ()=> syntax - EnableAutoPreviewDialing(){ - // if(this.isChecked===true){ - // let value=0; - // if(this.dataSource.data.length>0){ - // let refreshIntervalId = setInterval(()=>{ - // // console.log("still calling") - // // console.log(this.isChecked); - // let dataSourceLength = this.dataSource.data.length; - // if(value0){ - const currentcALLisGoingOn=this.callApi( this.dataSource.data[value])//will call to calling Api and get Result whether call still going on - if(currentcALLisGoingOn===false){ - setTimeout(()=>{ - if(this.activeMother){ - this.outBoundListForMother.splice(value , 1); - this.dataSource.data=this.outBoundListForMother - } - else{ - this.outBoundListForChild.splice(value , 1); - this.dataSource.data=this.outBoundListForChild - } // <<<---using ()=> syntax - // this.dataSource.data=this.outBoundListForMother; - this.EnableAutoPreviewDialing(); + this.EnableAutoPreviewDialing(); }, 10000); - - } - - } - else{ - this.isChecked=false; - } -} -} + } -callApi(value:any){ - console.log(value); - return false -} + } + else { + this.isChecked = false; + } + } -ngAfterViewInit() { - this.dataSource.paginator = this.paginator; - this.dataSource.sort = this.sort; -} -openCallClosure(){ - this.associateAnmMoService.setOpenComp("Call Closure"); - // this.associateAnmMoService.loadComponent( - // CallClosureComponent, - // null - // ); } - openEcdQuestionnaire(){ - // this.associateAnmMoService.loadComponent( - // EcdQuestionnaireComponent, - // null - // ); + callApi(value: any) { + console.log(value); + return false + } + + ngAfterViewInit() { + this.dataSource.paginator = this.paginator; + this.dataSource.sort = this.sort; + } + openCallClosure() { + this.associateAnmMoService.setOpenComp("Call Closure"); + } + + openEcdQuestionnaire() { this.associateAnmMoService.setOpenComp("ECD Questionnaire"); this.associateAnmMoService.onClickOfEcdQuestionnaire(true); - } - openBenCallHistory(){ + } + openBenCallHistory() { this.associateAnmMoService.setOpenComp("Beneficiary Call History"); // this.associateAnmMoService.loadComponent(BeneficiaryCallHistoryComponent,null) } - - } diff --git a/src/app/app-modules/associate-anm-mo/safe-url.pipe.ts b/src/app/app-modules/associate-anm-mo/safe-url.pipe.ts new file mode 100644 index 0000000..4a4e6ee --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/safe-url.pipe.ts @@ -0,0 +1,13 @@ +import { Pipe, PipeTransform } from '@angular/core'; +import { DomSanitizer, SafeResourceUrl } from '@angular/platform-browser'; + +@Pipe({ + name: 'safeUrl' +}) +export class SafeUrlPipe implements PipeTransform { + constructor(private sanitizer: DomSanitizer) {} + + transform(url: string): SafeResourceUrl { + return this.sanitizer.bypassSecurityTrustResourceUrl(url); + } +} diff --git a/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.css b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.css new file mode 100644 index 0000000..e3ebe08 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.css @@ -0,0 +1,231 @@ +.modal-content { + background: #ffffff; + padding: 5px; + border-radius: 12px; + box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2); + max-width: 600px; /* Increased width */ + width: 90%; /* Responsive width */ + margin: auto; + text-align: center; + display: flexbox; +} + +.mainCard { + height: auto; + margin-top: 5px; + margin-left: 5px; + margin-right: 5px; + width: 99%; + background-color: #F2F2F2; + border: 1px solid #4FA2D0; + box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.25); + border-radius: 10px !important; +} +/* Title */ +.title { + font-size: 20px; + font-weight: bold; + margin-bottom: 20px; + color: #010102; +} + +/* Buttons */ +.btn { + width: 100%; + padding: 5px; + font-size: 16px; + border-radius: 8px !important; + margin-top: 10px; + font-family: 'Lato', sans-serif; +} + +/* Disabled Button */ +button[disabled] { + opacity: 0.6; + cursor: not-allowed; +} + +/* Link Status Styling */ +.link-status { + margin-top: 10px; +} + +.sent { + color: green; + font-weight: bold; +} + +/* Red color for 'Not Sent' */ +.not-sent { + color: red; + font-weight: bold; +} + +.not-initiated { + color: gray; +} + +.ongoing { + color: orange; + font-weight: bold; +} + +.completed { + color: green; + font-weight: bold; +} + +/* Align text and dropdown side by side */ +.receipt-container { + display: flex; + align-items: center; + gap: 15px; /* Space between text and dropdown */ +} + +/* Ensure dropdown is properly sized */ +.receipt-container .form-control { + width: 200px; /* Adjust width as needed */ + font-size: 16px; +} + + +.form-control { + width: 100%; + padding: 10px; + border: 1px solid #ced4da; + border-radius: 8px; + font-size: 16px; + margin-top: 5px; +} + +.troubleshooting { + background: #f8d7da; + padding: 10px; + border-radius: 8px; + margin-bottom: 15px; +} + +.troubleshoot-message { + font-weight: bold; + color: #721c24; +} + +.alternative-message { + background: #f4f4f4; + padding: 15px; + border-radius: 8px; + margin-top: 15px; +} + +.status { + font-size: 18px; + margin-bottom: 15px; +} + +.consent-modal { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.consent-actions { + display: flex; + justify-content: space-around; + margin-top: 20px; + margin-bottom: 20px; +} + +.btn-success { + background-color: #28a745; + color: white; +} + +.btn-success:hover { + background-color: #218838; +} + +.btn-danger { + background-color: #dc3545; + color: white; +} + +.btn-danger:hover { + background-color: #c82333; +} + +.snackbar-success { + background-color: #4caf50 !important; /* Green */ + color: white !important; +} + +.snackbar-error { + background-color: #f44336 !important; /* Red */ + color: white !important; +} + + +.jitsi-wrapper { + position: relative; + width: 100%; + margin-top: 20px; +} + +#jitsi-container { + height: 600px; + width: 100%; + background: #eee; +} + +:host ::ng-deep .jitsi-iframe { + width: 100% !important; + height: 100% !important; +} +/* Ensure the button appears below the video nicely */ +.end-call-button { + display: block; + margin: 20px auto 0 auto; /* center the button with spacing */ + max-width: 300px; +} + +.close-button { + position: absolute; + top: 10px; + right: 10px; + color: #555; + z-index: 1000; +} + +.full-width { + height: 40px; + font-family: "Lato", sans-serif; + font-weight: 700; + color: #ffffff; + margin-top: 5px; + width: 100%; + max-width: 150px; + box-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25); +} + +:host { + all: initial; + font-family: inherit; + font-size: 16px; +} + +/* Responsive Design */ +@media (max-width: 576px) { + .modal-content { + width: 90%; + } + + .btn { + font-size: 14px; + } +} diff --git a/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.html b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.html new file mode 100644 index 0000000..a4ba180 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.html @@ -0,0 +1,98 @@ +
    + + + +

    Video Consultation Consent

    +

    + By agreeing, your consent to a secure video consultation, + understanding that your data will be handled confidentially. +

    + + + +
    +

    Note: We are continuing the video consultation on agreeing by Beneficiary.

    +

    Video Consultation

    + + + + + + +

    Link Sent Status: + + {{ videoService.linkStatus }} + +

    + +
    +

    Beneficiary Link Receipt Confirmation:

    + +
    + + + + + + + + +

    + Consultation Status: + + {{ videoService.callStatus }} + +

    + + +
    +

    Video consultation is not possible. Proceed with the ECD questionnaire workflow.

    + +
    +
    +
    +
    diff --git a/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.ts b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.ts new file mode 100644 index 0000000..f693b83 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/video-consultation/video-consultation.component.ts @@ -0,0 +1,211 @@ +import { + Component, ElementRef, EventEmitter, Input, Output, + ViewChild +} from '@angular/core'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { MatSnackBar } from '@angular/material/snack-bar'; +import { AssociateAnmMoService } from '../../services/associate-anm-mo/associate-anm-mo.service'; +import { SmsTemplateService } from '../../services/smsTemplate/sms-template.service'; +import { LoginserviceService } from '../../services/loginservice/loginservice.service'; +import { map, switchMap } from 'rxjs/operators'; +import { VideoConsultationService } from './videoService'; + +interface VideoCallRequest { + dateOfCall: string; + callerPhoneNumber: string; + agentID: string; + agentName: string; + meetingLink: string; + callStatus: string; + callDuration: string; + providerServiceMapID: number; + closureRemark: string; + beneficiaryRegID:string; +} + +interface VideocallStatusUpdate { + meetingLink: string; + callStatus: string; + callDuration: string; + modifiedBy: string; +} + +@Component({ + selector: 'app-video-consultation', + templateUrl: './video-consultation.component.html', + styleUrls: ['./video-consultation.component.css'] +}) +export class VideoConsultationComponent { + @ViewChild('jitsiContainer', { static: false }) jitsiContainerRef!: ElementRef; + + @Output() consultationClosed = new EventEmitter(); + + + constructor( + private associateAnmMoService: AssociateAnmMoService, + private sms_service: SmsTemplateService, + private loginService: LoginserviceService, + readonly sessionstorage: SessionStorageService, + private snackBar: MatSnackBar, + public videoService: VideoConsultationService, + ) { } + + + sendOrResendLink(): void { + this.associateAnmMoService.generateLink().subscribe({ + next: (response: any) => { + this.videoService.linkSent = true; + this.videoService.meetLink = response.meetingLink; + + this.send_sms(this.videoService.meetLink, this.videoService.callerPhoneNumber); + }, + error: () => { + this.videoService.linkStatus = 'Not Sent' + } + }); + } + + startConsultation(): void { + this.videoService.callStartTime = new Date(); + this.videoService.callStatus = 'Ongoing'; + this.videoService.isMeetAvailable = true; + + this.videoService.startFloatingCall(this.videoService.meetLink); + // this.videoService.startFloatingCall("https://vc.piramalswasthya.org/30x656cr") + this.videoService.showFloatingVideo = true; + + this.snackBar.open('Call has started', 'Close', { + duration: 3000, + verticalPosition: 'top', + panelClass: ['snackbar-success'] + }); + + this.saveVideoCallRequest(this.videoService.meetLink, 'Initiated'); + } + + endConsultation(): void { + this.videoService.callEndTime = new Date(); + this.videoService.callStatus = 'Completed'; + this.videoService.setVideoCallData( + false, '', '', '', '') + const callDuration = this.calculateCallDuration(); + + const updateRequest: VideocallStatusUpdate = { + meetingLink: this.videoService.meetLink, + callStatus: 'COMPLETED', + callDuration, + modifiedBy: this.sessionstorage.getItem('userName') + }; + + this.associateAnmMoService.updateCallStatus(updateRequest).subscribe({ + next: () => { + this.videoService.SMSStatus = 'Call record updated successfully'; + }, + error: () => { + this.videoService.SMSStatus = 'Failed to update call record'; + } + }); + + this.videoService.reset(); + this.consultationClosed.emit(); + } + + updateReceiptConfirmation(event: Event): void { + const value = (event.target as HTMLSelectElement).value; + this.videoService.receiptConfirmation = value; + + if (value === 'Not Received') { + this.videoService.linkStatus = 'Not Sent'; + } + } + + handleConsent(agreed: boolean): void { + if (agreed) { + this.videoService.videoConsultationAvailable = agreed; + } else { + // this.endConsultation(); + this.videoService.reset(); + this.consultationClosed.emit() + } + } + + send_sms(link: string, phoneNo: string): void { + const currentServiceID = this.loginService.currentServiceId; + + this.sms_service.getSMStypes(currentServiceID).pipe( + map((res: any) => res?.data?.find((t: any) => t.smsType === 'Video Consultation')?.smsTypeID), + switchMap((smsTypeID: string | null) => { + if (!smsTypeID) throw new Error('Video Consultation type not found'); + return this.sms_service.getSMStemplates(this.sessionstorage.getItem('providerServiceMapID'), smsTypeID).pipe( + map((res: any) => ({ + smsTemplateID: res?.data?.find((tpl: any) => !tpl.deleted)?.smsTemplateID, + smsTemplateTypeID: smsTypeID + })) + ); + }), + switchMap(({ smsTemplateID, smsTemplateTypeID }) => { + if (!smsTemplateID) throw new Error('Valid SMS template not found'); + const reqObj = { + sms_Advice: link, + phoneNo, + createdBy: this.sessionstorage.getItem('userName'), + is1097: false, + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), + smsTemplateID, + smsTemplateTypeID, + beneficiaryRegID: this.videoService.benRegId, + }; + return this.sms_service.sendSMS([reqObj]); + }) + ).subscribe({ + next: () => { + this.snackBar.open('SMS sent successfully', 'Close', { + duration: 3000, + verticalPosition: 'top', + panelClass: ['snackbar-success'] + }); + this.saveVideoCallRequest(link, 'Initiated'); + this.videoService.linkStatus = 'Sent Successfully'; + }, + error: (err) => { + console.error('Error sending SMS:', err); + this.videoService.linkStatus = 'Sent Successfully'; + + this.snackBar.open('SMS not sent', 'Close', { + duration: 3000, + verticalPosition: 'top', + panelClass: ['snackbar-error'] + }); + } + }); + } + + saveVideoCallRequest(link: string, status: string): void { + const request: VideoCallRequest = { + dateOfCall: new Date().toISOString(), + callerPhoneNumber: this.videoService.callerPhoneNumber, + agentID: this.videoService.agentID, + agentName: this.videoService.agentName, + meetingLink: link, + callStatus: status, + callDuration: '0', + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), + closureRemark: '', + beneficiaryRegID: this.videoService.benRegId, + }; + + this.associateAnmMoService.saveVideoCall(request).subscribe({ + next: () => this.videoService.SMSStatus = 'SMS Sent Successfully', + error: () => this.videoService.SMSStatus = 'Failed to send SMS' + }); + } + + calculateCallDuration(): string { + if (!this.videoService.callStartTime || !this.videoService.callEndTime) return '0'; + const totalSeconds = Math.floor((this.videoService.callEndTime.getTime() - this.videoService.callStartTime.getTime()) / 1000); + const minutes = Math.floor(totalSeconds / 60); + const seconds = totalSeconds % 60; + return `${minutes}m ${seconds}s`; + } + +} diff --git a/src/app/app-modules/associate-anm-mo/video-consultation/videoService.ts b/src/app/app-modules/associate-anm-mo/video-consultation/videoService.ts new file mode 100644 index 0000000..85c6fa6 --- /dev/null +++ b/src/app/app-modules/associate-anm-mo/video-consultation/videoService.ts @@ -0,0 +1,101 @@ +import { Injectable } from "@angular/core"; +import { BehaviorSubject } from "rxjs"; + + +@Injectable({ providedIn: 'root' }) + +export class VideoConsultationService { + +private videoStateChange = new BehaviorSubject<{[key: string]: any}>({}); +videoStateChange$ = this.videoStateChange.asObservable(); + + videoCallPrompt = false; + videoConsultationAvailable = false; + linkSent = false; + linkStatus = ''; + receiptConfirmation = ''; + callStatus: 'Not Initiated' | 'Ongoing' | 'Completed' = 'Not Initiated'; + isMeetAvailable = false; + meetLink = ""; + SMSStatus = ''; + apiInitialized = false; + showFloatingVideo = false; + isVideoCallActive = false; + callerPhoneNumber= ''; + agentID= ''; + agentName= ''; + callStartTime: Date | null = null; + callEndTime: Date | null = null; + benRegId = '' + + // Add methods if needed to update status or reset + reset() { + this.videoCallPrompt = false; + this.videoConsultationAvailable = false; + this.linkSent = false; + this.linkStatus = ''; + this.receiptConfirmation = ''; + this.callStatus = 'Not Initiated'; + this.isMeetAvailable = false; + this.meetLink = ''; + this.SMSStatus = ''; + this.isVideoCallActive = false; + // Notify subscribers of the reset + + this.videoStateChange.next({ + action: 'reset', + isVideoCallActive: false + }); +} + + + + +resetVideoCall() { + this.showFloatingVideo = false; + this.apiInitialized = false; + } + + reinitializeJitsi() { + this.apiInitialized = false; + this.isMeetAvailable = true; + } + + startFloatingCall(link: string) { + this.meetLink = link; + this.showFloatingVideo = true; + this.apiInitialized = false; + } + + setVideoCallData(isVideoCallActive: boolean, phoneNumber: any, meetLink: any, agentID: any, name: any) { + this.isVideoCallActive = isVideoCallActive; + this.callerPhoneNumber = phoneNumber; + this.meetLink = meetLink; + this.agentID = agentID; + this.agentName = name; + + this.videoStateChange.next({ + action: 'setVideoCallData', + isVideoCallActive + }); + } + + // Getters + getIsVideoCallActive() { + return this.isVideoCallActive; + } + getMeetLink() { + return this.meetLink; + } + getAgentId() { + return this.agentID; + } + getAgentName() { + return this.agentName; + } + getCallerPhoneNumber() { + return this.callerPhoneNumber; + } + +} + diff --git a/src/app/app-modules/core/activity-this-week/activity-this-week.component.ts b/src/app/app-modules/core/activity-this-week/activity-this-week.component.ts index 511959f..39f5520 100644 --- a/src/app/app-modules/core/activity-this-week/activity-this-week.component.ts +++ b/src/app/app-modules/core/activity-this-week/activity-this-week.component.ts @@ -24,6 +24,7 @@ import { Component, DoCheck, OnInit } from '@angular/core'; import { SetLanguageService } from '../../services/set-language/set-language.service'; import { Router } from '@angular/router'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 @@ -140,19 +141,20 @@ export class ActivityThisWeekComponent implements OnInit, DoCheck { constructor( private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private router: Router ) {} ngOnInit(): void { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); console.log(this.selectedRole); this.setActivities(); } ngDoCheck() { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); this.setActivities(); } diff --git a/src/app/app-modules/core/alerts-notifications-locationmessages/open-alerts-notification-locationmessages/open-alerts-notification-locationmessages.component.ts b/src/app/app-modules/core/alerts-notifications-locationmessages/open-alerts-notification-locationmessages/open-alerts-notification-locationmessages.component.ts index fbcc26c..21c5265 100644 --- a/src/app/app-modules/core/alerts-notifications-locationmessages/open-alerts-notification-locationmessages/open-alerts-notification-locationmessages.component.ts +++ b/src/app/app-modules/core/alerts-notifications-locationmessages/open-alerts-notification-locationmessages/open-alerts-notification-locationmessages.component.ts @@ -26,6 +26,7 @@ import { MatLegacyDialogRef as MatDialogRef, MAT_LEGACY_DIALOG_DATA as MAT_DIALO import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { CoreService } from 'src/app/app-modules/services/core/core.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-open-alerts-notification-locationmessages', @@ -47,6 +48,7 @@ export class OpenAlertsNotificationLocationmessagesComponent implements OnInit, @Inject(MAT_DIALOG_DATA) public data: any, private coreService: CoreService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private confirmationService: ConfirmationService, ) {} @@ -72,10 +74,10 @@ export class OpenAlertsNotificationLocationmessagesComponent implements OnInit, getdialogData(){ const reqObj = { - userID: sessionStorage.getItem('userId'), - roleID: sessionStorage.getItem('roleId'), + userID: this.sessionstorage.getItem('userID'), + roleID: this.sessionstorage.getItem('roleId'), notificationTypeID: this.notificationIdType, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') } this.coreService.getAlertsNotifications(reqObj).subscribe((res: any) => { if(res.statusCode === 200){ @@ -170,10 +172,10 @@ export class OpenAlertsNotificationLocationmessagesComponent implements OnInit, reInitialize() { this.coreService.getAlertsNotifications({ - userID: sessionStorage.getItem('userId'), - roleID: sessionStorage.getItem('roleId'), + userID: this.sessionstorage.getItem('userID'), + roleID: this.sessionstorage.getItem('roleId'), notificationTypeID: this.data.notificationTypeID, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') }).subscribe((response: any) => { console.log(response.data, "notification messages refreshed response"); this.dialogData = response.data; diff --git a/src/app/app-modules/core/charts/agent-quality-score-chart/agent-quality-score-chart.component.ts b/src/app/app-modules/core/charts/agent-quality-score-chart/agent-quality-score-chart.component.ts index 39191bf..27cd749 100644 --- a/src/app/app-modules/core/charts/agent-quality-score-chart/agent-quality-score-chart.component.ts +++ b/src/app/app-modules/core/charts/agent-quality-score-chart/agent-quality-score-chart.component.ts @@ -29,6 +29,7 @@ import { MasterService } from 'src/app/app-modules/services/masterService/master import { QualitySupervisorService } from 'src/app/app-modules/services/quality-supervisor/quality-supervisor.service'; import { SetLanguageService } from '../../../services/set-language/set-language.service'; import { ajax, css } from "jquery"; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 @@ -53,6 +54,7 @@ export class AgentQualityScoreChartComponent implements OnInit, DoCheck { private setLanguageService: SetLanguageService, private qualitySupervisorService: QualitySupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -115,7 +117,7 @@ export class AgentQualityScoreChartComponent implements OnInit, DoCheck { getAgentQualityScoreData() { this.qualityGradeData = []; this.setAgentGradeData(this.qualityGradeData); - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const month = (this.month !== null && this.month !== undefined) ? this.month : null; this.qualitySupervisorService diff --git a/src/app/app-modules/core/charts/centre-overall-quality-rating-chart/centre-overall-quality-rating-chart.component.ts b/src/app/app-modules/core/charts/centre-overall-quality-rating-chart/centre-overall-quality-rating-chart.component.ts index 0dfec21..5f1500d 100644 --- a/src/app/app-modules/core/charts/centre-overall-quality-rating-chart/centre-overall-quality-rating-chart.component.ts +++ b/src/app/app-modules/core/charts/centre-overall-quality-rating-chart/centre-overall-quality-rating-chart.component.ts @@ -29,6 +29,7 @@ import { MasterService } from 'src/app/app-modules/services/masterService/master import { QualitySupervisorService } from 'src/app/app-modules/services/quality-supervisor/quality-supervisor.service'; import { SetLanguageService } from '../../../services/set-language/set-language.service'; import { ajax, css } from "jquery"; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 @@ -53,6 +54,7 @@ export class CentreOverallQualityRatingChartComponent implements OnInit, DoCheck private setLanguageService: SetLanguageService, private qualitySupervisorService: QualitySupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -141,7 +143,7 @@ export class CentreOverallQualityRatingChartComponent implements OnInit, DoCheck ]; this.setQualityRatingData(this.qualityRatingData); - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const month = (this.month !== null && this.month !== undefined) ? this.month : null this.qualitySupervisorService diff --git a/src/app/app-modules/core/charts/customer-satisfaction/customer-satisfaction.component.ts b/src/app/app-modules/core/charts/customer-satisfaction/customer-satisfaction.component.ts index 96a553a..af07048 100644 --- a/src/app/app-modules/core/charts/customer-satisfaction/customer-satisfaction.component.ts +++ b/src/app/app-modules/core/charts/customer-satisfaction/customer-satisfaction.component.ts @@ -29,6 +29,7 @@ import { MasterService } from 'src/app/app-modules/services/masterService/master import { QualitySupervisorService } from 'src/app/app-modules/services/quality-supervisor/quality-supervisor.service'; import { SetLanguageService } from '../../../services/set-language/set-language.service'; import { ajax, css } from "jquery"; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 10-02-2023 @@ -48,6 +49,7 @@ export class CustomerSatisfactionComponent implements OnInit, DoCheck { private setLanguageService: SetLanguageService, private qualitySupervisorService: QualitySupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -85,7 +87,7 @@ export class CustomerSatisfactionComponent implements OnInit, DoCheck { this.customerSatisfactionData = []; this.setCustomerSatisfactionData(this.customerSatisfactionData); - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.qualitySupervisorService .getCustomerSatisfactionData(this.frequency, psmId) diff --git a/src/app/app-modules/core/charts/skillset-wise-quality-rating-chart/skillset-wise-quality-rating-chart.component.ts b/src/app/app-modules/core/charts/skillset-wise-quality-rating-chart/skillset-wise-quality-rating-chart.component.ts index a1ac735..a8533ba 100644 --- a/src/app/app-modules/core/charts/skillset-wise-quality-rating-chart/skillset-wise-quality-rating-chart.component.ts +++ b/src/app/app-modules/core/charts/skillset-wise-quality-rating-chart/skillset-wise-quality-rating-chart.component.ts @@ -29,6 +29,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { ajax, css } from "jquery"; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 10-02-2023 @@ -53,13 +54,14 @@ export class SkillsetWiseQualityRatingChartComponent implements OnInit, DoCheck private setLanguageService: SetLanguageService, private qualitySupervisorService: QualitySupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} ngOnInit(): void { this.getSelectedLanguage(); this.getMonthForCurrentYear(); - this.psmId = sessionStorage.getItem('providerServiceMapID'); + this.psmId = this.sessionstorage.getItem('providerServiceMapID'); this.agentRole = 'ANM'; this.month = new Date().toLocaleString('default', { month: 'long' }); this.getRoleMaster(); diff --git a/src/app/app-modules/core/charts/tenure-wise-quality-ratings/tenure-wise-quality-ratings.component.ts b/src/app/app-modules/core/charts/tenure-wise-quality-ratings/tenure-wise-quality-ratings.component.ts index 9e0c306..177b5a1 100644 --- a/src/app/app-modules/core/charts/tenure-wise-quality-ratings/tenure-wise-quality-ratings.component.ts +++ b/src/app/app-modules/core/charts/tenure-wise-quality-ratings/tenure-wise-quality-ratings.component.ts @@ -29,6 +29,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { ajax, css } from "jquery"; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-tenure-wise-quality-ratings', @@ -51,12 +52,13 @@ export class TenureWiseQualityRatingsComponent implements OnInit, DoCheck { private setLanguageService: SetLanguageService, private qualitySupervisorService: QualitySupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} ngOnInit(): void { this.getSelectedLanguage(); - this.psmId = sessionStorage.getItem('providerServiceMapID'); + this.psmId = this.sessionstorage.getItem('providerServiceMapID'); this.getRoleMaster(); this.agentRole = "ANM" this.getTenureQualityRatingsData(); @@ -103,7 +105,7 @@ export class TenureWiseQualityRatingsComponent implements OnInit, DoCheck { this.qualityRatingData = []; this.setTenureQualityRatingData(this.qualityRatingData); - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.qualitySupervisorService .getTenureWiseQualityRatingsData(psmId, this.agentRole) diff --git a/src/app/app-modules/core/core.module.ts b/src/app/app-modules/core/core.module.ts index d670c83..6f1812c 100644 --- a/src/app/app-modules/core/core.module.ts +++ b/src/app/app-modules/core/core.module.ts @@ -42,6 +42,7 @@ import { OpenAlertsNotificationLocationmessagesComponent } from './alerts-notifi import { AgentQualityScoreChartComponent } from './charts/agent-quality-score-chart/agent-quality-score-chart.component'; import { SharedModule } from '../shared/shared.module'; import { NgModule } from '@angular/core'; +import { AuthService } from "../services/auth.service"; @NgModule({ @@ -73,6 +74,9 @@ import { NgModule } from '@angular/core'; CallStatisticsComponent, HeaderComponent, ], + providers: [ + AuthService + ] // entryComponents: [CommonDialogComponent], }) export class CoreModule {} diff --git a/src/app/app-modules/core/dashboard/dashboard.component.ts b/src/app/app-modules/core/dashboard/dashboard.component.ts index 0f98af6..4e6ea06 100644 --- a/src/app/app-modules/core/dashboard/dashboard.component.ts +++ b/src/app/app-modules/core/dashboard/dashboard.component.ts @@ -35,6 +35,7 @@ import { AssociateAnmMoService } from '../../services/associate-anm-mo/associate import { MasterService } from '../../services/masterService/master.service'; import { ConfirmationService } from '../../services/confirmation/confirmation.service'; import { SupervisorService } from '../../services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 18-01-2023 @@ -77,6 +78,7 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { private associateAnmMoService: AssociateAnmMoService, private masterService: MasterService, private confirmationService:ConfirmationService, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) {} @@ -84,11 +86,11 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { this.getFrequencyMaster(); this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); this.agentId = this.loginService.agentId; this.getALertsNotifLocMessages(); this.getNotificationType(); - const selectedRoleName = sessionStorage.getItem("role"); + const selectedRoleName = this.sessionstorage.getItem("role"); if(selectedRoleName !== undefined && selectedRoleName !== null && (selectedRoleName.toLowerCase() === "associate" || selectedRoleName.toLowerCase() === "anm" || selectedRoleName.toLowerCase() === "mo")) { this.timerSubscription = timer(0, 15000).pipe( @@ -109,7 +111,7 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { ngDoCheck() { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); this.agentId = this.loginService.agentId; // this.getALertsNotifLocMessages(); } @@ -193,9 +195,9 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { getALertsNotifLocMessages(){ const reqObj = { - userID: sessionStorage.getItem('userId'), - roleID: sessionStorage.getItem('roleId'), - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + userID: this.sessionstorage.getItem('userID'), + roleID: this.sessionstorage.getItem('roleId'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') } this.loginService.getAlertsNotifLocMessagesCount(reqObj).subscribe((res: any) => { if(res && res.statusCode === 200){ @@ -225,7 +227,7 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -247,10 +249,10 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { openDialogcomponent(notificationData: any, dialogTitle: any, notificationTypeID: any){ const reqObj = { - userID: sessionStorage.getItem('userId'), - roleID: sessionStorage.getItem('roleId'), + userID: this.sessionstorage.getItem('userID'), + roleID: this.sessionstorage.getItem('roleId'), notificationTypeID: notificationTypeID, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') } this.coreService.getAlertsNotifications(reqObj).subscribe((res: any) => { if(res.statusCode === 200){ @@ -292,10 +294,10 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { getdialogData(dialogTitle: any, notificationTypeID: any){ const reqObj = { - userID: sessionStorage.getItem('userId'), - roleID: sessionStorage.getItem('roleId'), + userID: this.sessionstorage.getItem('userID'), + roleID: this.sessionstorage.getItem('roleId'), notificationTypeID: notificationTypeID, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID') + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID') } this.coreService.getAlertsNotifications(reqObj).subscribe((res: any) => { if(res.statusCode === 200){ @@ -321,9 +323,9 @@ export class DashboardComponent implements OnInit, DoCheck, OnDestroy { if (callId !== undefined && callId !== null && callId !== "undefined" && callId !== "" ) { - sessionStorage.setItem("benPhoneNo", benPhoneNo); - sessionStorage.setItem("callId", callId); - sessionStorage.setItem("onCall", "true"); + this.sessionstorage.setItem("benPhoneNo", benPhoneNo); + this.sessionstorage.setItem("callId", callId); + this.sessionstorage.setItem("onCall", "true"); this.associateAnmMoService.loadComponent( OutboundWorklistComponent, diff --git a/src/app/app-modules/core/header/header.component.ts b/src/app/app-modules/core/header/header.component.ts index a77dba6..5255ae0 100644 --- a/src/app/app-modules/core/header/header.component.ts +++ b/src/app/app-modules/core/header/header.component.ts @@ -32,7 +32,9 @@ import { CtiService } from '../../services/cti/cti.service'; import { LoginserviceService } from '../../services/loginservice/loginservice.service'; import { SetLanguageService } from '../../services/set-language/set-language.service'; import { QualityAuditorService } from '../../services/quality-auditor/quality-auditor.service'; - +import { CookieService } from 'ngx-cookie-service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AuthService } from "../../services/auth.service"; @Component({ selector: 'app-header', @@ -87,6 +89,9 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange private fb: FormBuilder, private ctiService: CtiService, private qualityAuditorService: QualityAuditorService, + private cookieService: CookieService, + readonly sessionstorage:SessionStorageService, + private auth: AuthService, ) { } @@ -104,19 +109,28 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange this.loginService.enableRoleFlag$.subscribe((response) => { if (response) { - const userRolesString = sessionStorage.getItem('userRoles'); - if (userRolesString !== null) { - this.roles = JSON.parse(userRolesString); - this.getLanguageList(); - } + setTimeout(() => { + const userRolesString:any = this.sessionstorage.getItem('userRoles'); + if (userRolesString !== null) { + this.roles = JSON.parse(userRolesString); + this.getLanguageList(); + //this.refreshLogin(); + } + }, 1000); } - }); - } + }); + } ngDoCheck(){ - this.isAuthenticated = sessionStorage.getItem("isAuthenticated") === "true" ? true : false; - this.userName = (sessionStorage.getItem("userName") !== null && sessionStorage.getItem("userName") !== undefined) ? sessionStorage.getItem("userName"): null; - const role = sessionStorage.getItem("role"); + const isAuth = sessionStorage.getItem("isAuthenticated"); + if(isAuth === 'true'){ + this.isAuthenticated = true; + }else{ + this.isAuthenticated = false; + } + //this.isAuthenticated = this.sessionstorage.getItem("isAuthenticated") === "true" ? true : false; + this.userName = (this.sessionstorage.getItem('userName') !== null && this.sessionstorage.getItem('userName') !== undefined) ? this.sessionstorage.getItem('userName'): null; + const role = this.sessionstorage.getItem("role"); if(role !== null && role !== undefined && role !== ""){ this.headersForm.controls.selectRole.patchValue(role); this.roleSelection(role); @@ -131,8 +145,8 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange } ngAfterViewInit(){ - const userRolesString = sessionStorage.getItem('userRoles'); - if (userRolesString !== null) { + const userRolesString = this.sessionstorage.getItem('userRoles'); + if (userRolesString && userRolesString !== null) { this.roles = JSON.parse(userRolesString); } this.getSelectedLanguage(); @@ -140,16 +154,36 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange } ngOnChanges(){ - const userRolesString = sessionStorage.getItem('userRoles'); + const userRolesString = this.sessionstorage.getItem('userRoles'); if (userRolesString !== null) { this.roles = JSON.parse(userRolesString); } } + refreshLogin(){ + this.auth.getUserDetails().subscribe((res: any) => { + // console.log(">>>>>>", res); + if (res.statusCode === '200') { + if (res.data.previlegeObj && res.data.previlegeObj[0]) { + this.cookieService.set('Jwttoken', res.data.Jwttoken); + delete res.data.Jwttoken; + this.sessionstorage.setItem('loginDataResponse', JSON.stringify(res.data)); + this.sessionstorage.setItem('key', res.key); + // this.sessionstorage.setItem('designation', this.designation); + this.sessionstorage.setItem('userID', res.userID); + this.sessionstorage.setItem('userName', res.userName); + this.sessionstorage.setItem('username', res.userName); + } else { + this.confirmationService.openDialog('Seems you are logged in from somewhere else, Logout from there & try back in.', 'error'); + } + } + }); + } + logout(){ - const isOnCall = sessionStorage.getItem("onCall"); + const isOnCall = this.sessionstorage.getItem("onCall"); if(isOnCall === "true") { this.confirmationService.openDialog(this.currentLanguageSet.youAreNotAllowedToLogOutCloseTheCall, 'info') } @@ -189,10 +223,10 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange this.roleSelected = false; } - if( sessionStorage.getItem("onCall") !== undefined && sessionStorage.getItem("onCall") !== null && sessionStorage.getItem("onCall") === "false" && this.roleSelected === true) { + if( this.sessionstorage.getItem("onCall") !== undefined && this.sessionstorage.getItem("onCall") !== null && this.sessionstorage.getItem("onCall") === "false" && this.roleSelected === true) { this.roleSelected = true; } - else if(sessionStorage.getItem("onCall") !== undefined && sessionStorage.getItem("onCall") !== null && sessionStorage.getItem("onCall") === "true") { + else if(this.sessionstorage.getItem("onCall") !== undefined && this.sessionstorage.getItem("onCall") !== null && this.sessionstorage.getItem("onCall") === "true") { this.roleSelected = false; } } @@ -203,10 +237,10 @@ export class HeaderComponent implements OnInit, DoCheck, AfterViewInit, OnChange if(res){ const route = role + "/dashboard" this.router.navigate(['/dashboard']); - sessionStorage.setItem('role', role); + this.sessionstorage.setItem('role', role); this.roles.filter((item: any) => { if(item.RoleName === role){ - sessionStorage.setItem('roleId', item.RoleID); + this.sessionstorage.setItem('roleId', item.RoleID); } }); this.coreService.onRoleChange(true) diff --git a/src/app/app-modules/core/rating/rating.component.ts b/src/app/app-modules/core/rating/rating.component.ts index f927b1b..45bd401 100644 --- a/src/app/app-modules/core/rating/rating.component.ts +++ b/src/app/app-modules/core/rating/rating.component.ts @@ -29,6 +29,7 @@ import { SetLanguageService } from '../../services/set-language/set-language.ser import { MatLegacyPaginator as MatPaginator } from '@angular/material/legacy-paginator'; import { MatSort } from '@angular/material/sort'; import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 02-03-2023 @@ -48,11 +49,11 @@ export class RatingComponent implements OnInit, DoCheck { 'grade', ]; constructor(private setLanguageService: SetLanguageService, private loginService: LoginserviceService, - private confirmationService: ConfirmationService, private coreService: CoreService) {} + private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, private coreService: CoreService) {} ngOnInit(): void { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); this.getAgentRatingScore(); } @@ -73,9 +74,9 @@ export class RatingComponent implements OnInit, DoCheck { * For fetching agent's latest audit score and grade */ getAgentRatingScore() { - const userId = sessionStorage.getItem('userId'); + const userId = this.sessionstorage.getItem('userID'); // let userId = 2002; - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.coreService diff --git a/src/app/app-modules/core/reports/reports.component.ts b/src/app/app-modules/core/reports/reports.component.ts index 480c822..a0ef4c3 100644 --- a/src/app/app-modules/core/reports/reports.component.ts +++ b/src/app/app-modules/core/reports/reports.component.ts @@ -24,6 +24,7 @@ import { Component, DoCheck, OnInit } from '@angular/core'; import { SetLanguageService } from '../../services/set-language/set-language.service'; import { Router } from '@angular/router'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 @@ -64,12 +65,13 @@ export class ReportsComponent implements OnInit, DoCheck { constructor( private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private router: Router ) {} ngOnInit(): void { this.getSelectedLanguage(); - this.selectedRole = sessionStorage.getItem('role'); + this.selectedRole = this.sessionstorage.getItem('role'); } ngDoCheck() { diff --git a/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.html b/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.html index 5ddbdc0..c341065 100644 --- a/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.html +++ b/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.html @@ -133,7 +133,7 @@

    - + {{ currentLanguageSet?.validCall }} @@ -202,7 +202,7 @@

    {{ currentLanguageSet?.casesheet }} - diff --git a/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.ts b/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.ts index 13cf258..8ea7112 100644 --- a/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.ts +++ b/src/app/app-modules/quality-auditor/call-audit/call-audit/call-audit.component.ts @@ -36,6 +36,8 @@ import { ViewCasesheetComponent } from '../../view-casesheet/view-casesheet.comp import * as moment from 'moment'; import { tr } from 'date-fns/locale'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import {MatLegacyDialog as MatDialog, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef} from '@angular/material/legacy-dialog'; @Component({ selector: 'app-call-audit', @@ -97,6 +99,8 @@ export class CallAuditComponent implements OnInit { private masterService: MasterService, private confirmationService: ConfirmationService, private changeDetectorRefs: ChangeDetectorRef, + readonly sessionstorage:SessionStorageService, + public dialog: MatDialog ) { } callAuditForm = this.fb.group({ @@ -199,7 +203,7 @@ export class CallAuditComponent implements OnInit { } getRoleMasters(){ - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(psmId).subscribe((res: any) => { if(res && res.length > 0){ res.filter((role: any) => { @@ -218,7 +222,7 @@ export class CallAuditComponent implements OnInit { } getCyclesMaster(){ - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getCyclesMaster(psmId).subscribe((res: any) => { if(res && res.length > 0){ this.cycles = res; @@ -233,7 +237,7 @@ export class CallAuditComponent implements OnInit { } getLanguageMaster(){ - const userId = sessionStorage.getItem('userId'); + const userId = this.sessionstorage.getItem('userID'); this.masterService.getLanguageMasterByUserId(userId).subscribe((res: any) => { if(res && res.length > 0){ this.languages = res; @@ -329,23 +333,23 @@ export class CallAuditComponent implements OnInit { console.log("route required", data) } - filterSearchTerm(searchTerm: any) { - if (!searchTerm && !this.data) { + filterSearchTerm(searchTerm?: string) { + if (!searchTerm) { this.callAuditData.data = this.callData; this.callAuditData.paginator = this.paginator; this.callAuditData.sort = this.sort; - }else if (!searchTerm && this.data) { - this.callAuditData.data = this.callData; - this.callAuditData.paginator = this.data.data.paginator; - this.callAuditData.sort = this.data.data.sort; } else { + this.callAuditData.data = []; + this.callAuditData.paginator = this.paginator; + this.callAuditData.sort = this.sort; this.callData.forEach((item: any) => { for (const key in item) { if ( key === 'beneficiaryid' || key === 'beneficiaryname' || key === 'phoneNo' || - key === 'agetname' + key === 'agetname' || + key === 'outboundCallType' ) { const value: string = '' + item[key]; if (value.toLowerCase().indexOf(searchTerm.toLowerCase()) >= 0) { @@ -359,6 +363,7 @@ export class CallAuditComponent implements OnInit { }); } } + onSearchClicked(){ this.paginator.firstPage(); this.lastLength = null; @@ -370,7 +375,7 @@ export class CallAuditComponent implements OnInit { getQualityAudiotorWorklist(){ if(this.callAuditForm.controls['selectedRadioButton'].value === '1'){ const reqObj = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), languageId: this.cycleWiseForm.controls.language.value, agentId: this.cycleWiseForm.controls.agentId.value, roleId: this.cycleWiseForm.controls.roleId.value, @@ -415,7 +420,7 @@ export class CallAuditComponent implements OnInit { const fromDate = moment(this.dateWiseForm.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); const toDate = moment(this.dateWiseForm.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); const reqObj = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), languageId: this.dateWiseForm.controls.language.value, agentId: this.dateWiseForm.controls.agentId.value, roleId: this.dateWiseForm.controls.roleId.value, @@ -468,16 +473,17 @@ export class CallAuditComponent implements OnInit { } viewCasheet(element:any){ - const reqObj={ - benCallId:element.benCallID, - beneficiaryId:element.beneficiaryid, - paginator: this.paginator, - sort: this.sort, - } - this.qualityAuditorService.loadComponent( - ViewCasesheetComponent, - reqObj - ); + + + this.dialog.open(ViewCasesheetComponent,{ + width: "900px", + disableClose: true , + data: { + + benCallId : element.benCallID, + beneficiaryId : element.beneficiaryid + } + }); } invalidTimeFlag = false; validateTime(start_date: any, end_date: any, start_time: any, end_time: any) { diff --git a/src/app/app-modules/quality-auditor/call-rating/call-rating.component.html b/src/app/app-modules/quality-auditor/call-rating/call-rating.component.html index e561753..2e85af7 100644 --- a/src/app/app-modules/quality-auditor/call-rating/call-rating.component.html +++ b/src/app/app-modules/quality-auditor/call-rating/call-rating.component.html @@ -25,6 +25,10 @@

    +
    + +
    +

    diff --git a/src/app/app-modules/quality-auditor/call-rating/call-rating.component.ts b/src/app/app-modules/quality-auditor/call-rating/call-rating.component.ts index 22fd758..013cba2 100644 --- a/src/app/app-modules/quality-auditor/call-rating/call-rating.component.ts +++ b/src/app/app-modules/quality-auditor/call-rating/call-rating.component.ts @@ -32,6 +32,10 @@ import { QualityAuditorService } from '../../services/quality-auditor/quality-au import { SetLanguageService } from '../../services/set-language/set-language.service'; import { CallAuditComponent } from '../call-audit/call-audit/call-audit.component'; import { MatPaginator } from '@angular/material/paginator'; +import { ViewCasesheetComponent } from '../view-casesheet/view-casesheet.component'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import {MatLegacyDialog as MatDialog, MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, MatLegacyDialogRef as MatDialogRef} from '@angular/material/legacy-dialog'; + @Component({ selector: 'app-call-rating', @@ -59,6 +63,7 @@ export class CallRatingComponent implements OnInit{ grades: any; finalGrade: any; benCallId: any; + beneficiaryId: any; auditType: any; filteredRatingQuestions: any = []; audioResponse: any = " "; @@ -75,7 +80,9 @@ export class CallRatingComponent implements OnInit{ private setLanguageService: SetLanguageService, private fb: FormBuilder, private qualityAuditorService: QualityAuditorService, - private confirmationService: ConfirmationService + private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, + public dialog: MatDialog ) { } ngOnInit(): void { @@ -84,6 +91,7 @@ export class CallRatingComponent implements OnInit{ if(this.data !== undefined && this.data !== null){ this.routedData = this.data.data; this.benCallId = this.routedData.benCallID; + this.beneficiaryId = this.routedData.beneficiaryid; this.auditType = this.data.type; } this.getSectionQuestions(); @@ -118,7 +126,7 @@ export class CallRatingComponent implements OnInit{ } getQualityGrades(){ - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.qualityAuditorService.getQualityAuditGrades(psmId).subscribe((res: any) => { if(res && res.length > 0){ this.grades = res; @@ -155,7 +163,7 @@ export class CallRatingComponent implements OnInit{ } getSectionQuestions(){ - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.qualityAuditorService.getQuesSecForCallRatings(psmId).subscribe((res: any) => { if(res && res.length > 0){ this.ratingQuestions = res; @@ -374,9 +382,9 @@ export class CallRatingComponent implements OnInit{ ecdCallType: this.routedData.outboundCallType, agentId: this.routedData.agentid, benCallId: this.routedData.benCallID, - qualityAuditorId: sessionStorage.getItem('userId'), - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + qualityAuditorId: this.sessionstorage.getItem('userID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; reqObj.push(obj); } @@ -423,11 +431,11 @@ export class CallRatingComponent implements OnInit{ ecdCallType: this.routedData.outboundCallType, agentId: this.routedData.agentid, benCallId: this.routedData.benCallID, - qualityAuditorId: sessionStorage.getItem('userId'), - psmId: sessionStorage.getItem('providerServiceMapID'), + qualityAuditorId: this.sessionstorage.getItem('userID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: false, - modifiedBy: sessionStorage.getItem('userName'), - createdBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), }; quesObj.push(obj) } @@ -442,11 +450,11 @@ export class CallRatingComponent implements OnInit{ callRemarks: this.callRemarks ? this.callRemarks: null, agentId: this.routedData.agentid, benCallId: this.routedData.benCallID, - qualityAuditorId: sessionStorage.getItem('userId'), - psmId: sessionStorage.getItem('providerServiceMapID'), + qualityAuditorId: this.sessionstorage.getItem('userID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: false, - modifiedBy: sessionStorage.getItem('userName'), - createdBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), } const reqObj = { @@ -483,4 +491,17 @@ export class CallRatingComponent implements OnInit{ this.qualityAuditorService.loadComponent(CallAuditComponent, {data:data}); this.qualityAuditorService.showForm = this.showCallAuditForm; } + + + viewCasheet(){ + + this.dialog.open(ViewCasesheetComponent,{ + width: "900px", + disableClose: true , + data: { + benCallId : this.benCallId, + beneficiaryId : this.beneficiaryId + } + }); + } } diff --git a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.css b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.css index d6aec7a..5810a3d 100644 --- a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.css +++ b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.css @@ -1,6 +1,5 @@ .mainHeadingDiv { margin-top: 15px; - /* margin-left: 30px; */ } .mainHeading { @@ -52,9 +51,7 @@ .table-no-border tr, th, .table-no-border tr td, .table-no-border thead tr th, .table-no-border tbody tr th, .table-no-border tbody tr td { border: none; } -/* .caseSheet-TableStyling{ -margin: 20px; -} */ + th{ font-family: "Lato", sans-serif; font-weight: 600; @@ -66,3 +63,40 @@ td{ font-size: 16px; } .table-bordered th, .table-bordered td { border: 1px solid #4fa2d0 !important } + +::ng-deep .mat-dialog-container{ + overflow: hidden; + padding: 0px !important; +} +::ng-deep .mat-dialog-title{ + background-color:#ffb800; + padding: 24px; +} + +::ng-deep .mat-dialog-content { + margin: 0px; + overflow: hidden; + padding-top: 25px; + padding-bottom: 50px; + +} + + +.inline { + display: inline-block; +} +.fontStyleDialog{ + font-family: "Lato", sans-serif; + font-weight: 600; + font-size: 24px; + position: relative; +} + +.closeButton { + float: right; + background: #E14646; + color: #ffffff; + border: none; + cursor: pointer; +} + diff --git a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.html b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.html index aa8cd35..b224661 100644 --- a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.html +++ b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.html @@ -1,11 +1,16 @@ -
    -
    -

    - {{ currentLanguageSet?.casesheet }} - -

    -
    -
    +

    {{ currentLanguageSet?.casesheet }} + + +

    + + +
    + +
    +
    +
    @@ -108,7 +113,7 @@

    {{ currentLanguageSet?.questionnaireDetails }}

    - +
    @@ -122,7 +127,7 @@

    Question
    -
    +
    No Data Found
    @@ -134,26 +139,24 @@

    {{ currentLanguageSet?.isFurtherCallRequired }} - {{ currentLanguageSet?.yes }} - {{ currentLanguageSet?.no }} + {{ beneficiaryCaseSheetData?.isFurtherCallRequired === true ? currentLanguageSet?.yes : (beneficiaryCaseSheetData?.isFurtherCallRequired === false ? currentLanguageSet?.no : '')}} {{ currentLanguageSet?.reasonForNoFurtherCalls }} {{beneficiaryCaseSheetData?.reasonForNoFurtherCalls}} {{ currentLanguageSet?.isCallAnswered }} - {{ currentLanguageSet?.yes }} - {{ currentLanguageSet?.no }} + {{ beneficiaryCaseSheetData?.isCallAnswered === true ? currentLanguageSet?.yes : (beneficiaryCaseSheetData?.isCallAnswered === false ? currentLanguageSet?.no : '') }} {{ currentLanguageSet?.reasonForCallNotAnswered }} {{beneficiaryCaseSheetData?.reasonForCallNotAnswered}} + {{ currentLanguageSet?.isCallVerified }} - {{ currentLanguageSet?.yes }} - {{ currentLanguageSet?.no }} + {{beneficiaryCaseSheetData?.isCallVerified === true ? currentLanguageSet?.yes : (beneficiaryCaseSheetData?.isCallVerified === false ? currentLanguageSet?.no : '') }} {{ currentLanguageSet?.isCallDisconnected }} - {{ currentLanguageSet?.yes }} - {{ currentLanguageSet?.no }} + {{beneficiaryCaseSheetData?.isCallDisconnected === true ? currentLanguageSet?.yes : (beneficiaryCaseSheetData?.isCallDisconnected === false ? currentLanguageSet?.no : '') }} + {{ currentLanguageSet?.typeOfComplaint }} {{beneficiaryCaseSheetData?.typeOfComplaint}} @@ -169,13 +172,10 @@

    {{ currentLanguageSet?.sendAdvice }} {{beneficiaryCaseSheetData?.sendAdvice}} - {{ currentLanguageSet?.isWrongNumber }} - {{beneficiaryCaseSheetData?.isWrongNumber}} + {{ currentLanguageSet?.isCallWrongNumber }} + {{beneficiaryCaseSheetData?.isWrongNumber === true ? currentLanguageSet?.yes : (beneficiaryCaseSheetData?.isWrongNumber === false ? currentLanguageSet?.no : '') }} - + @@ -183,4 +183,6 @@

    - \ No newline at end of file + +

    + \ No newline at end of file diff --git a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.ts b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.ts index e98d078..2c8d9d3 100644 --- a/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.ts +++ b/src/app/app-modules/quality-auditor/view-casesheet/view-casesheet.component.ts @@ -1,8 +1,19 @@ -import { Component, DoCheck, Input, OnInit } from '@angular/core'; +import { Component, DoCheck, Input, OnInit, ElementRef, ViewChild } from '@angular/core'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { QualityAuditorService } from '../../services/quality-auditor/quality-auditor.service'; import { ConfirmationService } from '../../services/confirmation/confirmation.service'; import { CallAuditComponent } from '../call-audit/call-audit/call-audit.component'; +import jsPDF from 'jspdf'; +import html2canvas from 'html2canvas'; +import { Inject } from '@angular/core'; +import { + MatLegacyDialog as MatDialog, + MatLegacyDialogRef as MatDialogRef, + MAT_LEGACY_DIALOG_DATA as MAT_DIALOG_DATA, +} from '@angular/material/legacy-dialog'; + +import { SpinnerService } from '../../services/spinnerService/spinner.service'; + @Component({ selector: 'app-view-casesheet', @@ -10,15 +21,20 @@ import { CallAuditComponent } from '../call-audit/call-audit/call-audit.componen styleUrls: ['./view-casesheet.component.css'] }) export class ViewCasesheetComponent implements OnInit, DoCheck { - @Input() data:any currentLanguageSet: any; beneficiaryCaseSheetData:any; questionnaireCaseSheetData:any; beneficiaryID:any; + + @ViewChild('content', { static: false }) content!: ElementRef; + constructor( + @Inject(MAT_DIALOG_DATA) public data: any, + public dialogRef: MatDialogRef, private setLanguageService: SetLanguageService, private qualityAuditorService: QualityAuditorService, private confirmationService: ConfirmationService, + private spinnerService: SpinnerService ) { } getCaseSheetData(benCallID:any){ @@ -60,12 +76,35 @@ export class ViewCasesheetComponent implements OnInit, DoCheck { ) this.currentLanguageSet = this.setLanguageService.languageData; } - backToQualityAudit(){ - const data:any = {}; - data.paginator = this.data.paginator; - data.sort = this.data.sort; - this.qualityAuditorService.loadComponent(CallAuditComponent, {data:data}); - this.qualityAuditorService.showForm = false; + + + generatePDF() { + this.spinnerService.setLoading(true); + const data = this.content.nativeElement; + html2canvas(data, { scale: 1.5 }).then(canvas => { + const imgWidth = 212; + const pageHeight = 297; + const imgHeight = canvas.height * imgWidth / canvas.width; + let heightLeft = imgHeight; + const pdf = new jsPDF('p', 'mm', 'a4'); + let position = 0; + pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, position, imgWidth, imgHeight); + heightLeft -= pageHeight; + while (heightLeft >= 0) { + position = heightLeft - imgHeight; + pdf.addPage(); + pdf.addImage(canvas.toDataURL('image/png'), 'PNG', 0, position, imgWidth, imgHeight); + heightLeft -= pageHeight; + } + const pdfOutput = pdf.output('blob'); + const blobUrl = URL.createObjectURL(pdfOutput); + this.spinnerService.setLoading(false); + const newWindow = window.open(blobUrl); + if (newWindow) { + newWindow.focus(); + } + }); } + } diff --git a/src/app/app-modules/quality-supervisor/activites/Grade-config/create-grade-config/create-grade-config.component.ts b/src/app/app-modules/quality-supervisor/activites/Grade-config/create-grade-config/create-grade-config.component.ts index cc0c744..7fd505b 100644 --- a/src/app/app-modules/quality-supervisor/activites/Grade-config/create-grade-config/create-grade-config.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/Grade-config/create-grade-config/create-grade-config.component.ts @@ -30,6 +30,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-grade-config', templateUrl: './create-grade-config.component.html', @@ -56,6 +57,7 @@ export class CreateGradeConfigComponent implements OnInit, DoCheck { private fb: FormBuilder, private confirmationService: ConfirmationService, private qualitysupervisorService: QualitySupervisorService, + readonly sessionstorage:SessionStorageService, private masterService:MasterService ) { } @@ -91,7 +93,7 @@ export class CreateGradeConfigComponent implements OnInit, DoCheck { } getGrades() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getGradeMaster(psmId).subscribe( (response: any) => { if (response) { @@ -186,8 +188,8 @@ export class CreateGradeConfigComponent implements OnInit, DoCheck { grade: formData.grade, minValue: formData.minValue, maxValue: formData.maxValue, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID') + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID') }; const checkfromBufferList = this.checkDuplicateRange(gradeObj); const checkFromMainList = this.checkDuplicateRangeFromMainList(gradeObj) diff --git a/src/app/app-modules/quality-supervisor/activites/Grade-config/edit-grade-config/edit-grade-config.component.ts b/src/app/app-modules/quality-supervisor/activites/Grade-config/edit-grade-config/edit-grade-config.component.ts index 4ae2367..7388d07 100644 --- a/src/app/app-modules/quality-supervisor/activites/Grade-config/edit-grade-config/edit-grade-config.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/Grade-config/edit-grade-config/edit-grade-config.component.ts @@ -30,6 +30,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-grade-config', @@ -66,6 +67,7 @@ export class EditGradeConfigComponent implements OnInit, DoCheck { private fb: FormBuilder, private confirmationService: ConfirmationService, private qualitysupervisorService: QualitySupervisorService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) { } @@ -89,7 +91,7 @@ export class EditGradeConfigComponent implements OnInit, DoCheck { this.currentLanguageSet = this.setLanguageService.languageData; } getGrades() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getGradeMaster(psmId).subscribe( (response: any) => { if (response) { @@ -150,9 +152,9 @@ export class EditGradeConfigComponent implements OnInit, DoCheck { minValue: editValue.minValue, maxValue: editValue.maxValue, deleted: false, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; const checkFromMainList = this.checkDuplicateRangeFromMainList(reqObj) console.log(reqObj); diff --git a/src/app/app-modules/quality-supervisor/activites/Grade-config/grade-configuration/grade-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/Grade-config/grade-configuration/grade-configuration.component.ts index 1cf83af..665521c 100644 --- a/src/app/app-modules/quality-supervisor/activites/Grade-config/grade-configuration/grade-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/Grade-config/grade-configuration/grade-configuration.component.ts @@ -31,6 +31,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { LoginserviceService } from 'src/app/app-modules/services/loginservice/loginservice.service'; import { EditGradeConfigComponent } from '../edit-grade-config/edit-grade-config.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-grade-configuration', @@ -57,6 +58,7 @@ export class GradeConfigurationComponent implements OnInit, AfterViewInit { private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, private loginService: LoginserviceService, + readonly sessionstorage:SessionStorageService, ) { } getSelectedLanguage() { @@ -94,7 +96,7 @@ export class GradeConfigurationComponent implements OnInit, AfterViewInit { getGrades() { const reqObj: any = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitySupervisorService.getGradesMappedData(reqObj).subscribe( (response: any) => { @@ -166,9 +168,9 @@ export class GradeConfigurationComponent implements OnInit, AfterViewInit { grade: tableValue.grade, minValue: tableValue.minValue, maxValue: tableValue.maxValue, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: type === 'activate' ? 'false' : 'true' }; diff --git a/src/app/app-modules/quality-supervisor/activites/agent-mapping-configuration/agent-mapping-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/agent-mapping-configuration/agent-mapping-configuration.component.ts index 37714af..ca292de 100644 --- a/src/app/app-modules/quality-supervisor/activites/agent-mapping-configuration/agent-mapping-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/agent-mapping-configuration/agent-mapping-configuration.component.ts @@ -31,6 +31,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { LoginserviceService } from 'src/app/app-modules/services/loginservice/loginservice.service'; import { EditAgentComponent } from '../edit-agent/edit-agent.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-agent-mapping-configuration', @@ -58,6 +59,7 @@ export class AgentMappingConfigurationComponent implements OnInit, AfterViewInit private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, private loginService: LoginserviceService, + readonly sessionstorage:SessionStorageService, private qualitySupervisorService: QualitySupervisorService ) { } @@ -115,7 +117,7 @@ export class AgentMappingConfigurationComponent implements OnInit, AfterViewInit getAuditors() { const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitySupervisorService.getAgentMappedData(reqObj.psmId).subscribe( (response: any) => { @@ -173,9 +175,9 @@ export class AgentMappingConfigurationComponent implements OnInit, AfterViewInit qualityAuditorName: tableValue.qualityAuditorName, roleName: tableValue.roleName, agentName: tableValue.agentName, - modifiedBy: sessionStorage.getItem('userName'), - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + modifiedBy: this.sessionstorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), agentIds:agentIds, agentNames:agentNames, deleted: type === 'activate' ? 'false' : 'true' diff --git a/src/app/app-modules/quality-supervisor/activites/create-agent/create-agent.component.ts b/src/app/app-modules/quality-supervisor/activites/create-agent/create-agent.component.ts index c0a5e15..227910d 100644 --- a/src/app/app-modules/quality-supervisor/activites/create-agent/create-agent.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/create-agent/create-agent.component.ts @@ -31,6 +31,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { AgentMappingConfigurationComponent } from '../agent-mapping-configuration/agent-mapping-configuration.component'; import { TitleCasePipe } from '@angular/common'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-agent', templateUrl: './create-agent.component.html', @@ -58,6 +59,7 @@ export class CreateAgentComponent implements OnInit, DoCheck { private qualitysupervisorService: QualitySupervisorService, private masterService: MasterService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private titlecasePipe:TitleCasePipe ) { } @@ -90,7 +92,7 @@ export class CreateAgentComponent implements OnInit, DoCheck { // }, // ]; - // let psmId = sessionStorage.getItem('providerServiceMapID'); + // let psmId = this.sessionstorage.getItem('providerServiceMapID'); // this.masterService.getAuditorMaster(psmId).subscribe( // (response: any) => { @@ -106,7 +108,7 @@ export class CreateAgentComponent implements OnInit, DoCheck { // ); // } getRoles() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(psmId).subscribe( (response: any) => { if (response) { @@ -290,8 +292,8 @@ export class CreateAgentComponent implements OnInit, DoCheck { qualityAuditorName: formData.qualityAuditorName, roleName: formData.roleName, agentNames: this.selectedAgentlist, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; console.log(reqObj); // this.openConfirmatoryDialog(); diff --git a/src/app/app-modules/quality-supervisor/activites/edit-agent/edit-agent.component.ts b/src/app/app-modules/quality-supervisor/activites/edit-agent/edit-agent.component.ts index f8a9de9..5b027e2 100644 --- a/src/app/app-modules/quality-supervisor/activites/edit-agent/edit-agent.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/edit-agent/edit-agent.component.ts @@ -30,6 +30,7 @@ import { AgentMappingConfigurationComponent } from '../agent-mapping-configurati import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-agent', @@ -55,6 +56,7 @@ export class EditAgentComponent implements OnInit, DoCheck { private qualitysupervisorService: QualitySupervisorService, private setLanguageService: SetLanguageService, private masterService: MasterService, + readonly sessionstorage:SessionStorageService, ) { } editQualityAuditorForm = this.fb.group({ @@ -207,7 +209,7 @@ export class EditAgentComponent implements OnInit, DoCheck { } getRoles() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(psmId).subscribe( (response: any) => { if (response) { @@ -325,9 +327,9 @@ export class EditAgentComponent implements OnInit, DoCheck { roleName: this.selectedmappedList.roleName, agentName: editValue.agentName, deleted: false, - modifiedBy: sessionStorage.getItem('userName'), - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + modifiedBy: this.sessionstorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), agentIds:agentIds, agentNames:agentNames }; diff --git a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/create-qa-question-config/create-qa-question-config/create-qa-question-config.component.ts b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/create-qa-question-config/create-qa-question-config/create-qa-question-config.component.ts index 9f5335f..1f0af87 100644 --- a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/create-qa-question-config/create-qa-question-config/create-qa-question-config.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/create-qa-question-config/create-qa-question-config/create-qa-question-config.component.ts @@ -30,6 +30,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { QaQuestionConfigComponent } from '../../qa-question-config/qa-question-config/qa-question-config.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-qa-question-config', @@ -63,6 +64,7 @@ export class CreateQaQuestionConfigComponent implements OnInit, DoCheck { private qualitysupervisorService: QualitySupervisorService, private masterService: MasterService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, ) { } ngOnInit(): void { @@ -203,7 +205,7 @@ export class CreateQaQuestionConfigComponent implements OnInit, DoCheck { } }); const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitysupervisorService.getAuditSectionMap(reqObj.psmId).subscribe( @@ -265,8 +267,8 @@ export class CreateQaQuestionConfigComponent implements OnInit, DoCheck { options: options, scores: scores, isFatalQues: addData.isFatalQues, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; const checkTableList = this.checkDuplicateRank(sectionObj); if(checkTableList === false){ @@ -288,7 +290,7 @@ export class CreateQaQuestionConfigComponent implements OnInit, DoCheck { getQuestionnaires() { this.qaQuestionnaireConfigList = []; - const psmId= sessionStorage.getItem('providerServiceMapID'); + const psmId= this.sessionstorage.getItem('providerServiceMapID'); this.qualitysupervisorService.getQuestionnaireData(psmId).subscribe( (response: any) => { if (response) { diff --git a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/edit-qa-question-config/edit-qa-config/edit-qa-config.component.ts b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/edit-qa-question-config/edit-qa-config/edit-qa-config.component.ts index c55dff8..94174a8 100644 --- a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/edit-qa-question-config/edit-qa-config/edit-qa-config.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/edit-qa-question-config/edit-qa-config/edit-qa-config.component.ts @@ -30,6 +30,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { QaQuestionConfigComponent } from '../../qa-question-config/qa-question-config/qa-question-config.component'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-qa-config', @@ -59,6 +60,7 @@ export class EditQaConfigComponent implements OnInit, DoCheck { private confirmationService: ConfirmationService, private qualitysupervisorService: QualitySupervisorService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService, ) { } @@ -187,7 +189,7 @@ export class EditQaConfigComponent implements OnInit, DoCheck { getSectionList(){ const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitysupervisorService.getAuditSectionMap(reqObj.psmId).subscribe( @@ -213,7 +215,7 @@ export class EditQaConfigComponent implements OnInit, DoCheck { getQuestionnaires() { this.qaQuestionnaireConfigList = []; - const psmId= sessionStorage.getItem('providerServiceMapID'); + const psmId= this.sessionstorage.getItem('providerServiceMapID'); this.qualitysupervisorService.getQuestionnaireData(psmId).subscribe( (response: any) => { if (response) { @@ -267,9 +269,9 @@ export class EditQaConfigComponent implements OnInit, DoCheck { sectionRank: editValueData.sectionRank, deleted: false, isFatalQues: editValueData.isFatalQues, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), options: optionValue, scores: scores }; diff --git a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/qa-question-config/qa-question-config/qa-question-config.component.ts b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/qa-question-config/qa-question-config/qa-question-config.component.ts index cd5a854..c78566a 100644 --- a/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/qa-question-config/qa-question-config/qa-question-config.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/quality-audit-question-config/qa-question-config/qa-question-config/qa-question-config.component.ts @@ -30,6 +30,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { CreateQaQuestionConfigComponent } from '../../create-qa-question-config/create-qa-question-config/create-qa-question-config.component'; import { EditQaConfigComponent } from '../../edit-qa-question-config/edit-qa-config/edit-qa-config.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-qa-question-config', @@ -59,6 +60,7 @@ export class QaQuestionConfigComponent implements OnInit, AfterViewInit { private qualitysupervisorService: QualitySupervisorService, private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, ) { } ngOnInit(): void { @@ -116,7 +118,7 @@ export class QaQuestionConfigComponent implements OnInit, AfterViewInit { getQuestionnaires() { this.qaQuestionnaireConfigList = []; - const psmId= sessionStorage.getItem('providerServiceMapID'); + const psmId= this.sessionstorage.getItem('providerServiceMapID'); this.qualitysupervisorService.getQuestionnaireData(psmId).subscribe( (response: any) => { if (response) { @@ -137,7 +139,7 @@ export class QaQuestionConfigComponent implements OnInit, AfterViewInit { getSections() { const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitysupervisorService.getAuditSectionMap(reqObj.psmId).subscribe( (response: any) => { @@ -201,10 +203,10 @@ export class QaQuestionConfigComponent implements OnInit, AfterViewInit { questionnaire: tableValue.question, questionRank: tableValue.questionRank, answerType: tableValue.answerType, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: type === 'activate' ? false : true, - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; this.qualitysupervisorService.updateQuestionConfiguration(reqObj).subscribe( diff --git a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/createquality-section-configuration/createquality-section-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/createquality-section-configuration/createquality-section-configuration.component.ts index 26f7720..09fb935 100644 --- a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/createquality-section-configuration/createquality-section-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/createquality-section-configuration/createquality-section-configuration.component.ts @@ -30,6 +30,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { QualitySectionConfigurationComponent } from '../quality-section-configuration/quality-section-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ @@ -52,7 +53,8 @@ export class CreatequalitySectionConfigurationComponent implements OnInit, After sectionName: any; sectionRank: any; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private qualitySupervisorService: QualitySupervisorService,private confirmationService: ConfirmationService) { } + constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService,private qualitySupervisorService: QualitySupervisorService,private confirmationService: ConfirmationService) { } ngOnInit(): void { this.getSelectedLanguage(); @@ -103,8 +105,8 @@ export class CreatequalitySectionConfigurationComponent implements OnInit, After sectionName: formData.sectionName, sectionDesc: formData.sectionDescription, rank: formData.rank, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID') + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID') }; const checkfromBufferList = this.checkDuplicateRank(sectionObj); diff --git a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/edit-quality-section-configuration/edit-quality-section-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/edit-quality-section-configuration/edit-quality-section-configuration.component.ts index 36367b3..42fd44c 100644 --- a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/edit-quality-section-configuration/edit-quality-section-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/edit-quality-section-configuration/edit-quality-section-configuration.component.ts @@ -29,6 +29,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { QualitySectionConfigurationComponent } from '../quality-section-configuration/quality-section-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-quality-section-configuration', @@ -47,7 +48,8 @@ export class EditQualitySectionConfigurationComponent implements OnInit { sectionName: any; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private qualitySupervisorService: QualitySupervisorService,private confirmationService: ConfirmationService) { } + constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService,private qualitySupervisorService: QualitySupervisorService,private confirmationService: ConfirmationService) { } validateWhitespace(control: FormControl) { if(control.value !== null && control.value !== undefined){ @@ -121,10 +123,10 @@ export class EditQualitySectionConfigurationComponent implements OnInit { sectionName:editValue.sectionName , rank: editValue.rank, sectionDesc: editValue.sectionDesc, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: false, - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; const checkFromMainList = this.checkDuplicateRangeFromMainList(reqObj) console.log(reqObj); diff --git a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/quality-section-configuration/quality-section-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/quality-section-configuration/quality-section-configuration.component.ts index 1fbc129..452685b 100644 --- a/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/quality-section-configuration/quality-section-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/qualityAudit-sectionConfiguration/quality-section-configuration/quality-section-configuration.component.ts @@ -31,6 +31,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { CreatequalitySectionConfigurationComponent } from '../createquality-section-configuration/createquality-section-configuration.component'; import { EditQualitySectionConfigurationComponent } from '../edit-quality-section-configuration/edit-quality-section-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-quality-section-configuration', @@ -58,6 +59,7 @@ export class QualitySectionConfigurationComponent implements OnInit, AfterViewIn constructor( private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private qualitySupervisorService: QualitySupervisorService ) {} ngOnInit(): void { @@ -83,7 +85,7 @@ export class QualitySectionConfigurationComponent implements OnInit, AfterViewIn } getAuditSectionDetails() { const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitySupervisorService .getAuditSectionMap(reqObj.psmId) @@ -131,7 +133,7 @@ export class QualitySectionConfigurationComponent implements OnInit, AfterViewIn getQuestionaireConfiguartionMap(){ const reqObj: any = { - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitySupervisorService .getListOfMapQuestionaireConfiguration(reqObj.psmId) @@ -199,10 +201,10 @@ export class QualitySectionConfigurationComponent implements OnInit, AfterViewIn sectionName: tableValue.sectionName, sectionDesc: tableValue.sectionDesc, rank: tableValue.rank, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: type === 'activate' ? false : true, - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; this.qualitySupervisorService.updateSectionConfiguration(reqObj).subscribe( diff --git a/src/app/app-modules/quality-supervisor/activites/reports-quality-supervisor/reports-quality-supervisor.component.ts b/src/app/app-modules/quality-supervisor/activites/reports-quality-supervisor/reports-quality-supervisor.component.ts index a49d794..f5efcef 100644 --- a/src/app/app-modules/quality-supervisor/activites/reports-quality-supervisor/reports-quality-supervisor.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/reports-quality-supervisor/reports-quality-supervisor.component.ts @@ -29,6 +29,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import * as FileSaver from 'file-saver'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-reports-quality-supervisor', @@ -48,7 +49,7 @@ export class ReportsQualitySupervisorComponent implements OnInit, AfterViewInit reportsData: any = []; today:any; constructor(private setLanguageService: SetLanguageService,private fb: FormBuilder, - private qualitySupervisorService: QualitySupervisorService) { } + readonly sessionstorage:SessionStorageService, private qualitySupervisorService: QualitySupervisorService) { } reportsForm = this.fb.group({ startDate: ['',Validators.required], @@ -82,7 +83,7 @@ export class ReportsQualitySupervisorComponent implements OnInit, AfterViewInit const reqObj = { startDate: this.reportsForm.controls.startDate.value, endDate: this.reportsForm.controls.endDate.value, - providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), } this.qualitySupervisorService.qualityReportDownload(reqObj).subscribe((res:any)=>{ if(res !== undefined && res !== null && res.statusCode === 200){ diff --git a/src/app/app-modules/quality-supervisor/activites/sample-selection/create-sample-selection/create-sample-selection.component.ts b/src/app/app-modules/quality-supervisor/activites/sample-selection/create-sample-selection/create-sample-selection.component.ts index e1811e1..9c5a3f0 100644 --- a/src/app/app-modules/quality-supervisor/activites/sample-selection/create-sample-selection/create-sample-selection.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/sample-selection/create-sample-selection/create-sample-selection.component.ts @@ -31,6 +31,7 @@ import { QualitySupervisorService } from 'src/app/app-modules/services/quality-s import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { NumberFormatStyle } from '@angular/common'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-sample-selection', @@ -75,6 +76,7 @@ export class CreateSampleSelectionComponent implements OnInit, DoCheck { private fb: FormBuilder, private confirmationService: ConfirmationService, private qualitysupervisorService: QualitySupervisorService, + readonly sessionstorage:SessionStorageService, private masterService:MasterService ) { } @@ -100,7 +102,7 @@ export class CreateSampleSelectionComponent implements OnInit, DoCheck { this.currentLanguageSet = this.setLanguageService.languageData; } getCycles() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getCyclesMaster(psmId).subscribe( (response: any) => { if (response) { @@ -200,8 +202,8 @@ export class CreateSampleSelectionComponent implements OnInit, DoCheck { ancSampleSize:formData.ancSampleSize, pncSampleSize:formData.pncSampleSize, totalSampleSize:formData.totalSampleSize, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; const checkfromBufferList = this.checkDuplicateRange(sampleObj); const checkFromMainList = this.checkDuplicateRangeFromMainList(sampleObj) diff --git a/src/app/app-modules/quality-supervisor/activites/sample-selection/edit-sample-selection/edit-sample-selection.component.ts b/src/app/app-modules/quality-supervisor/activites/sample-selection/edit-sample-selection/edit-sample-selection.component.ts index 2bac5ef..8c7c31c 100644 --- a/src/app/app-modules/quality-supervisor/activites/sample-selection/edit-sample-selection/edit-sample-selection.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/sample-selection/edit-sample-selection/edit-sample-selection.component.ts @@ -30,6 +30,7 @@ import { SampleSelectionConfigurationComponent } from '../sample-selection-confi import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-sample-selection', @@ -67,6 +68,7 @@ export class EditSampleSelectionComponent implements OnInit { private fb: FormBuilder, private confirmationService: ConfirmationService, private qualitysupervisorService: QualitySupervisorService, + readonly sessionstorage:SessionStorageService, private masterService:MasterService ) { } @@ -183,7 +185,7 @@ export class EditSampleSelectionComponent implements OnInit { } getCycles() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getCyclesMaster(psmId).subscribe( (response: any) => { if (response) { @@ -247,9 +249,9 @@ export class EditSampleSelectionComponent implements OnInit { pncSampleSize: editValue.pncSampleSize, totalSampleSize: editValue.totalSampleSize, deleted: false, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; const checkFromMainList = this.checkDuplicateRangeFromMainList(reqObj) console.log(reqObj); diff --git a/src/app/app-modules/quality-supervisor/activites/sample-selection/sample-selection-configuration/sample-selection-configuration.component.ts b/src/app/app-modules/quality-supervisor/activites/sample-selection/sample-selection-configuration/sample-selection-configuration.component.ts index c6387f6..c3b93c8 100644 --- a/src/app/app-modules/quality-supervisor/activites/sample-selection/sample-selection-configuration/sample-selection-configuration.component.ts +++ b/src/app/app-modules/quality-supervisor/activites/sample-selection/sample-selection-configuration/sample-selection-configuration.component.ts @@ -31,6 +31,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { LoginserviceService } from 'src/app/app-modules/services/loginservice/loginservice.service'; import { EditSampleSelectionComponent } from '../edit-sample-selection/edit-sample-selection.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-sample-selection-configuration', @@ -60,6 +61,7 @@ export class SampleSelectionConfigurationComponent implements OnInit, AfterViewI private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, private loginService: LoginserviceService, + readonly sessionstorage:SessionStorageService, ) { } getSelectedLanguage() { @@ -101,7 +103,7 @@ export class SampleSelectionConfigurationComponent implements OnInit, AfterViewI } getSampleList() { const reqObj: any = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), }; this.qualitySupervisorService.getCycleMappedData(reqObj).subscribe( (response: any) => { @@ -166,9 +168,9 @@ export class SampleSelectionConfigurationComponent implements OnInit, AfterViewI ancSampleSize: tableValue.ancSampleSize, pncSampleSize: tableValue.pncSampleSize, totalSampleSize: tableValue.totalSampleSize, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: type === 'activate' ? 'false' : 'true', }; diff --git a/src/app/app-modules/services/associate-anm-mo/associate-anm-mo.service.ts b/src/app/app-modules/services/associate-anm-mo/associate-anm-mo.service.ts index fdefe0a..ed2aa90 100644 --- a/src/app/app-modules/services/associate-anm-mo/associate-anm-mo.service.ts +++ b/src/app/app-modules/services/associate-anm-mo/associate-anm-mo.service.ts @@ -41,53 +41,53 @@ export class AssociateAnmMoService { isHighRiskInfant = false; autoDialing = false; - callWrapup: any=""; + callWrapup: any = ""; callWrapupFlag = new BehaviorSubject(this.callWrapup); callWrapupFlag$ = this.callWrapupFlag.asObservable(); - resetCallClosure: any=""; + resetCallClosure: any = ""; callClosureFlag = new BehaviorSubject(this.resetCallClosure); callClosureFlag$ = this.callClosureFlag.asObservable(); - openComp: any=""; + openComp: any = ""; openCompFlag = new BehaviorSubject(this.openComp); openCompFlag$ = this.openCompFlag.asObservable(); - fromComponent :any = null; + fromComponent: any = null; - loadDetailsInReg: any=""; + loadDetailsInReg: any = ""; loadDetailsInRegFlag = new BehaviorSubject(this.loadDetailsInReg); loadDetailsInRegFlag$ = this.loadDetailsInRegFlag.asObservable(); - isMotherRecord: any=""; + isMotherRecord: any = ""; isMotherRecordData = new BehaviorSubject(this.isMotherRecord); isMotherRecordData$ = this.isMotherRecordData.asObservable(); - loadEcdQuestionnaire: any=""; + loadEcdQuestionnaire: any = ""; loadEcdQuestionnaireData = new BehaviorSubject(this.loadEcdQuestionnaire); loadEcdQuestionnaireData$ = this.loadEcdQuestionnaireData.asObservable(); - isBenCallHistory: any=""; + isBenCallHistory: any = ""; isBenCallHistoryData = new BehaviorSubject(this.isBenCallHistory); isBenCallHistoryData$ = this.isBenCallHistoryData.asObservable(); - isBenRegistartion: any=""; + isBenRegistartion: any = ""; isBenRegistartionData = new BehaviorSubject(this.isBenRegistartion); isBenRegistartionData$ = this.isBenRegistartionData.asObservable(); - resetAgentStatus: any=""; + resetAgentStatus: any = ""; resetAgentStatusFlag = new BehaviorSubject(this.resetAgentStatus); resetAgentStatusFlag$ = this.resetAgentStatusFlag.asObservable(); - stopTimer: any=""; + stopTimer: any = ""; stopTimerFlag = new BehaviorSubject(this.stopTimer); stopTimerFlag$ = this.stopTimerFlag.asObservable(); - agentCurrentStatus: any=""; + agentCurrentStatus: any = ""; agentCurrentStatusData = new BehaviorSubject(this.agentCurrentStatus); agentCurrentStatusData$ = this.agentCurrentStatusData.asObservable(); - - constructor(private http: HttpClient, private resolver: ComponentFactoryResolver) { } + + constructor(private http: HttpClient, private resolver: ComponentFactoryResolver) { } loadComponent(component: any, data: any) { @@ -100,7 +100,7 @@ export class AssociateAnmMoService { setContainer(container: any) { this.container = container; } - callClosure(reqObj: any) { + callClosure(reqObj: any) { return this.http.post(environment.updateCallClosureUrl, reqObj); } @@ -112,155 +112,159 @@ export class AssociateAnmMoService { } -saveBenCallDetails(reqObj: any) { - return this.http.post(environment.saveBenCallDetails, reqObj); -} -getAutoPreviewDialing(userId: any,roleId: any,psmId: any) { - return this.http.get(environment.getAgentAutoPreviewDialingUrl + "/" + userId + "/" + roleId + "/" + psmId); -} + saveBenCallDetails(reqObj: any) { + return this.http.post(environment.saveBenCallDetails, reqObj); + } + getAutoPreviewDialing(userId: any, roleId: any, psmId: any) { + return this.http.get(environment.getAgentAutoPreviewDialingUrl + "/" + userId + "/" + roleId + "/" + psmId); + } -setCloseCallOnWrapup() { - this.callWrapup = 1; - this.callWrapupFlag.next(1); -} + setCloseCallOnWrapup() { + this.callWrapup = 1; + this.callWrapupFlag.next(1); + } -resetCloseCallOnWrapup() -{ - this.callWrapup = 0; - this.callWrapupFlag.next(0); -} + resetCloseCallOnWrapup() { + this.callWrapup = 0; + this.callWrapupFlag.next(0); + } -setCallClosure() { - this.resetCallClosure = 1; - this.callClosureFlag.next(1); -} + setCallClosure() { + this.resetCallClosure = 1; + this.callClosureFlag.next(1); + } -clearCallClosure() -{ - this.resetCallClosure = 0; - this.callClosureFlag.next(0); -} + clearCallClosure() { + this.resetCallClosure = 0; + this.callClosureFlag.next(0); + } - getAgentMasterData(){ + getAgentMasterData() { return this.http.get(environment.getAgentMasterDataUrl); } - fetchBeneficiaryQuestionnaire(reqObj: any, callType: any, role:any){ + fetchBeneficiaryQuestionnaire(reqObj: any, callType: any, role: any) { return this.http.get(environment.getBeneficiaryQuestionnaire + reqObj + '/' + callType + '/' + role); } - saveQuestionnaireResponse(reqObj: any){ + saveQuestionnaireResponse(reqObj: any) { return this.http.post(environment.saveBenQuestionnaireResponseUrl, reqObj); } - getHRPDetails(reqObj: any){ + getHRPDetails(reqObj: any) { return this.http.get(environment.getBenHrpHrniDetailsUrl + "motherId=" + reqObj.motherId); } - getHRNIDetails(reqObj: any){ + getHRNIDetails(reqObj: any) { return this.http.get(environment.getBenHrpHrniDetailsUrl + "childId=" + reqObj.childId); } - registerBeneficiary(reqObj: any){ + registerBeneficiary(reqObj: any) { return this.http.post(environment.registerBeneficiaryUrl, reqObj); } - updateBeneficiary(reqObj: any){ + updateBeneficiary(reqObj: any) { return this.http.post(environment.updateBeneficiaryUrl, reqObj); } -setLoadDetailsInReg(value:any) { - this.loadDetailsInReg = value; - this.loadDetailsInRegFlag.next(this.loadDetailsInReg); -} - -resetLoadDetailsInReg() -{ - this.loadDetailsInReg = null; - this.loadDetailsInRegFlag.next(this.loadDetailsInReg); -} - - -setOpenComp(value:any) { - this.openComp = value; - this.openCompFlag.next(this.openComp); -} - -resetOpenComp() -{ - this.openComp = null; - this.openCompFlag.next(this.openComp); -} - -setBenHistoryComp(value:any) { - this.isBenCallHistory = value; - this.isBenCallHistoryData.next(this.isBenCallHistory); -} - -resetBenHistoryComp() -{ - this.isBenCallHistory = null; - this.isBenCallHistoryData.next(this.isBenCallHistory); -} - -setBenRegistartionComp(value:any) { - this.isBenRegistartion = value; - this.isBenRegistartionData.next(this.isBenRegistartion); -} - -resetBenRegistartionComp() -{ - this.isBenRegistartion = null; - this.isBenRegistartionData.next(this.isBenRegistartion); -} - -getMotherRecord(reqObj:any){ - return this.http.get(environment.getMotherOutboundWorkListUrl + '/' + reqObj.userId); -} -getChildRecord(reqObj:any){ - return this.http.get(environment.getChildOutboundWorkListUrl + '/' + reqObj.userId); -} - - -onClickOfOutboundWorklistScreen(value:any) { - this.isMotherRecord = value; - this.isMotherRecordData.next(this.isMotherRecord); -} - -onClickOfEcdQuestionnaire(value: any){ - this.loadEcdQuestionnaire = value; - this.loadEcdQuestionnaireData.next(this.loadEcdQuestionnaire); -} - -getBeneficiaryCallHistory(reqObj:any){ - return this.http.get(environment.getBeneficiaryCallHistoryUrl , {params: reqObj}); -} -getCallHistoryDetails(reqObj:any){ - return this.http.get(environment.getCallHistoryDetailsUrl + '/' + reqObj); -} - -setResetAgentStatus(value:any) { - this.resetAgentStatus = value; - this.resetAgentStatusFlag.next(this.resetAgentStatus); -} - -setStopTimer(value: any) { - this.stopTimer = value; - this.stopTimerFlag.next(this.stopTimer); -} - -clearStopTimer() { - this.stopTimer = null; - this.stopTimerFlag.next(this.stopTimer); -} - -setAgentState(value:any){ - this.agentCurrentStatus = value; - this.agentCurrentStatusData.next(this.agentCurrentStatus); -} -resetAgentState() -{ - this.agentCurrentStatus = null; - this.agentCurrentStatus.next(this.agentCurrentStatus); -} + setLoadDetailsInReg(value: any) { + this.loadDetailsInReg = value; + this.loadDetailsInRegFlag.next(this.loadDetailsInReg); + } + + resetLoadDetailsInReg() { + this.loadDetailsInReg = null; + this.loadDetailsInRegFlag.next(this.loadDetailsInReg); + } + + + setOpenComp(value: any) { + this.openComp = value; + this.openCompFlag.next(this.openComp); + } + + resetOpenComp() { + this.openComp = null; + this.openCompFlag.next(this.openComp); + } + + setBenHistoryComp(value: any) { + this.isBenCallHistory = value; + this.isBenCallHistoryData.next(this.isBenCallHistory); + } + + resetBenHistoryComp() { + this.isBenCallHistory = null; + this.isBenCallHistoryData.next(this.isBenCallHistory); + } + + setBenRegistartionComp(value: any) { + this.isBenRegistartion = value; + this.isBenRegistartionData.next(this.isBenRegistartion); + } + + resetBenRegistartionComp() { + this.isBenRegistartion = null; + this.isBenRegistartionData.next(this.isBenRegistartion); + } + + getMotherRecord(reqObj: any) { + return this.http.get(environment.getMotherOutboundWorkListUrl + '/' + reqObj.userId); + } + getChildRecord(reqObj: any) { + return this.http.get(environment.getChildOutboundWorkListUrl + '/' + reqObj.userId); + } + + + onClickOfOutboundWorklistScreen(value: any) { + this.isMotherRecord = value; + this.isMotherRecordData.next(this.isMotherRecord); + } + + onClickOfEcdQuestionnaire(value: any) { + this.loadEcdQuestionnaire = value; + this.loadEcdQuestionnaireData.next(this.loadEcdQuestionnaire); + } + + getBeneficiaryCallHistory(reqObj: any) { + return this.http.get(environment.getBeneficiaryCallHistoryUrl, { params: reqObj }); + } + getCallHistoryDetails(reqObj: any) { + return this.http.get(environment.getCallHistoryDetailsUrl + '/' + reqObj); + } + + setResetAgentStatus(value: any) { + this.resetAgentStatus = value; + this.resetAgentStatusFlag.next(this.resetAgentStatus); + } + setStopTimer(value: any) { + this.stopTimer = value; + this.stopTimerFlag.next(this.stopTimer); + } + + clearStopTimer() { + this.stopTimer = null; + this.stopTimerFlag.next(this.stopTimer); + } + + setAgentState(value: any) { + this.agentCurrentStatus = value; + this.agentCurrentStatusData.next(this.agentCurrentStatus); + } + resetAgentState() { + this.agentCurrentStatus = null; + this.agentCurrentStatus.next(this.agentCurrentStatus); + } + + generateLink() { + return this.http.post(environment.generateVideoLinkURL, {}); + } + + saveVideoCall(reqObj: any) { + return this.http.post(environment.sendSMSAPI, reqObj); + } + + updateCallStatus(reqObj: any) { + return this.http.post(environment.updateCallStatusAPI, reqObj); + } } \ No newline at end of file diff --git a/src/app/app-modules/services/auth.service.ts b/src/app/app-modules/services/auth.service.ts new file mode 100644 index 0000000..2c0162e --- /dev/null +++ b/src/app/app-modules/services/auth.service.ts @@ -0,0 +1,56 @@ +/* + * AMRIT – Accessible Medical Records via Integrated Technology + * Integrated EHR (Electronic Health Records) Solution + * + * Copyright (C) "Piramal Swasthya Management and Research Institute" + * + * This file is part of AMRIT. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see https://www.gnu.org/licenses/. + */ +import { HttpClient } from '@angular/common/http'; +import { Injectable } from '@angular/core'; +import { Observable } from 'rxjs'; + +import { environment } from 'src/environments/environment'; + +@Injectable() +export class AuthService { + constructor(private http: HttpClient) {} + + logoutUser() { + return this.http.post(environment.logoutUrl, ''); + } + getUIVersionAndCommitDetails(url: any) { + return this.http.get(url); + } + // getAPIVersionAndCommitDetails() { + // return this.http.get(environment.apiVersionUrl); + // } + login(userName: string, password: string, doLogout: any) { + return this.http.post(environment.getLoginURL, { + userName: userName, + password: password, + doLogout: doLogout, + withCredentials: true, + + }); + } + + getUserDetails() { + return this.http.post(environment.getSessionExistsURL, {}); + } + + // /* AN4085822 - Concurrent login issue*/ +} diff --git a/src/app/app-modules/services/captcha-service/captcha.service.ts b/src/app/app-modules/services/captcha-service/captcha.service.ts new file mode 100644 index 0000000..3859980 --- /dev/null +++ b/src/app/app-modules/services/captcha-service/captcha.service.ts @@ -0,0 +1,33 @@ +import { Injectable } from '@angular/core'; +import { environment } from 'src/environments/environment'; + +@Injectable({ + providedIn: 'root', +}) +export class CaptchaService { + private scriptLoaded = false; + + loadScript(): Promise { + return new Promise((resolve, reject) => { + if (this.scriptLoaded) return resolve(); + + const script = document.createElement('script'); + script.src = environment.captchaChallengeURL; + script.async = true; + script.defer = true; + script.onload = () => { + this.scriptLoaded = true; + resolve(); + }; + script.onerror = (event) => { + this.scriptLoaded = false; + reject( + new Error( + `Failed to load CAPTCHA script from ${environment.captchaChallengeURL}: ${event}`, + ), + ); + }; + document.head.appendChild(script); + }); + } +} diff --git a/src/app/app-modules/services/core/session-storage.service.spec.ts b/src/app/app-modules/services/core/session-storage.service.spec.ts new file mode 100644 index 0000000..78a1335 --- /dev/null +++ b/src/app/app-modules/services/core/session-storage.service.spec.ts @@ -0,0 +1,16 @@ +import { TestBed } from '@angular/core/testing'; + +import { SessionStorageService } from './session-storage.service'; + +describe('SessionStorageService', () => { + let service: SessionStorageService; + + beforeEach(() => { + TestBed.configureTestingModule({}); + service = TestBed.inject(SessionStorageService); + }); + + it('should be created', () => { + expect(service).toBeTruthy(); + }); +}); diff --git a/src/app/app-modules/services/core/session-storage.service.ts b/src/app/app-modules/services/core/session-storage.service.ts new file mode 100644 index 0000000..5cdd728 --- /dev/null +++ b/src/app/app-modules/services/core/session-storage.service.ts @@ -0,0 +1,44 @@ +import { Injectable } from '@angular/core'; +import { environment } from "../../../../environments/environment"; +import { StorageService } from 'ng-cryptostore'; + +@Injectable({ + providedIn: 'root' +}) +export class SessionStorageService { + + userID:any; + userName:any; + username:any; + fullName:any; + facilityID:any; + facilityDetail:any; + benFlowID:any; + healthID:any; + providerServiceID:any; + services:any; + SECRET_KEY = environment.encKey; + uid:any; + uname:any; + + constructor( + private store:StorageService + ) {} + + setItem(key: string, value: any): void { + this.store.set(key, value, this.SECRET_KEY); + } + + getItem(key: string): any | null { + return this.store.get(key, this.SECRET_KEY); + } + + removeItem(key: string): void { + sessionStorage.removeItem(key); + } + + clear(): void { + sessionStorage.clear(); + } + +} diff --git a/src/app/app-modules/services/cti/cti.service.spec.ts b/src/app/app-modules/services/cti/cti.service.spec.ts index 0e19f56..513d36e 100644 --- a/src/app/app-modules/services/cti/cti.service.spec.ts +++ b/src/app/app-modules/services/cti/cti.service.spec.ts @@ -23,7 +23,7 @@ import { TestBed } from '@angular/core/testing'; -import { CtiService } from '../cti.service'; +import { CtiService } from './cti.service'; describe('CtiService', () => { let service: CtiService; diff --git a/src/app/app-modules/services/http-inteceptor/http-interceptor.service.ts b/src/app/app-modules/services/http-inteceptor/http-interceptor.service.ts index 8c0e70c..cb98ed8 100644 --- a/src/app/app-modules/services/http-inteceptor/http-interceptor.service.ts +++ b/src/app/app-modules/services/http-inteceptor/http-interceptor.service.ts @@ -39,6 +39,7 @@ import { ConfirmationService } from '../confirmation/confirmation.service'; import { environment } from 'src/environments/environment'; import { SetLanguageService } from '../set-language/set-language.service'; import { throwError } from 'rxjs/internal/observable/throwError'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Injectable({ providedIn: 'root', @@ -51,7 +52,8 @@ export class HttpInterceptorService implements HttpInterceptor { private router: Router, private confirmationService: ConfirmationService, private http: HttpClient, - private setLanguageService: SetLanguageService + readonly sessionstorage:SessionStorageService, + private setLanguageService: SetLanguageService, ) {} intercept( diff --git a/src/app/app-modules/services/masterService/master.service.ts b/src/app/app-modules/services/masterService/master.service.ts index 563484d..d28a822 100644 --- a/src/app/app-modules/services/masterService/master.service.ts +++ b/src/app/app-modules/services/masterService/master.service.ts @@ -140,4 +140,8 @@ export class MasterService { return this.http.get(environment.getGenderMasterUrl); } + getAgentMasterByRoleIdAndLanguage(roleId : any,language : any){ + return this.http.get(environment.getAgentMasterByRoleIdAndLanguageUrl + "/" + roleId + "/" + language); + } + } diff --git a/src/app/app-modules/services/supervisor/supervisor.service.ts b/src/app/app-modules/services/supervisor/supervisor.service.ts index 34d6300..6f0960d 100644 --- a/src/app/app-modules/services/supervisor/supervisor.service.ts +++ b/src/app/app-modules/services/supervisor/supervisor.service.ts @@ -440,4 +440,8 @@ export class SupervisorService { updateParentChildMapping(reqData:any){ return this.http.post(environment.updateParentChildMappingURL,reqData) } + + getLowRiskRecordsByLanguage(psmId: any, phoneNoType: any, recordType: any, fDate: any, tDate: any, language: any, role: any) { + return this.http.get(environment.getLowRiskRecordsByLanguageUrl + '/' + psmId + '/' + phoneNoType + '/' + recordType + '/' + fDate + '/' + tDate + '/' + language + '/' + role); + } } diff --git a/src/app/app-modules/supervisor/activities/alerts/alert-notification/alert-notification.component.ts b/src/app/app-modules/supervisor/activities/alerts/alert-notification/alert-notification.component.ts index 54b05e7..34b6ca3 100644 --- a/src/app/app-modules/supervisor/activities/alerts/alert-notification/alert-notification.component.ts +++ b/src/app/app-modules/supervisor/activities/alerts/alert-notification/alert-notification.component.ts @@ -36,6 +36,7 @@ import { EditAlertComponent } from './edit-alert/edit-alert.component'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-alert-notification', @@ -81,7 +82,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni roleId: any; allRoleIDs: any = []; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService , private masterService: MasterService,) { } + constructor(readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService , private masterService: MasterService,) { } ngOnInit(): void { this.getSelectedLanguage(); @@ -89,7 +90,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni this.getRolesForAlert(); // this.alertDataSource.data = this.alertData; - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); } alertNotificationForm = this.fb.group({ @@ -123,7 +124,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni const validStartDate = moment(startDate).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const validEndDate = moment(endDate).endOf('day').format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID : this.communicationTypeId, roleIDs : this.allRoleIDs, validEndDate : validEndDate , @@ -154,7 +155,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -168,7 +169,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni }) } getRolesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if (res.length !== 0) { this.roles = res.filter((item : any) => { @@ -240,7 +241,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni .subscribe((response) => { if (response) { const reqObj: any = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID: this.communicationTypeId, notificationID: element.notificationID , roleID: element.roleID, @@ -249,7 +250,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni notification: element.notification, notificationDesc: element.notificationDesc, deleted: type === 'activate' ? 'false' : 'true', - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; this.supervisorService.saveEditAlert(reqObj).subscribe( @@ -287,8 +288,8 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni // onPublish(){ // // this.canEdit = false; // let reqObj= { - // providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), - // modifiedBy: sessionStorage.getItem('userName'), + // providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), + // modifiedBy: this.sessionstorage.getItem('userName'), // } // this.supervisorService.publishAlert(reqObj).subscribe((res:any)=>{ // if(res.data !== undefined && res.data !== null){ @@ -301,7 +302,7 @@ export class AlertNotificationComponent implements OnInit, DoCheck, AfterViewIni getOfficesForAlert(){ const reqObj = { - providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), roleID: this.roleID } this.supervisorService.getOffices(reqObj).subscribe((res:any)=>{ diff --git a/src/app/app-modules/supervisor/activities/alerts/alert-notification/create-alert/create-alert.component.ts b/src/app/app-modules/supervisor/activities/alerts/alert-notification/create-alert/create-alert.component.ts index fc0668a..f5f5e71 100644 --- a/src/app/app-modules/supervisor/activities/alerts/alert-notification/create-alert/create-alert.component.ts +++ b/src/app/app-modules/supervisor/activities/alerts/alert-notification/create-alert/create-alert.component.ts @@ -32,6 +32,7 @@ import { AlertNotificationComponent } from '../alert-notification.component'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-alert', @@ -79,12 +80,12 @@ export class CreateAlertComponent implements OnInit, DoCheck { Stime = ''; Etime = ''; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService, private masterService: MasterService,) { } + constructor(readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService, private masterService: MasterService,) { } ngOnInit(): void { this.getSelectedLanguage(); this.getNotificationType(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); this.getRolesForAlert(); this.getLocationsForAlert(); } @@ -111,7 +112,7 @@ export class CreateAlertComponent implements OnInit, DoCheck { getRolesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ res.filter((role: any) => { @@ -141,7 +142,7 @@ export class CreateAlertComponent implements OnInit, DoCheck { } getOfficesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getOfficesMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ this.offices = res; @@ -150,7 +151,7 @@ export class CreateAlertComponent implements OnInit, DoCheck { } getLocationsForAlert() { - const providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); const roleID = this.createAlertNotificationForm.controls.roleType.value; this.masterService.getLocationsMaster(providerServiceMapID, roleID).subscribe((res: any) => { if (res !== undefined && res.data !== undefined) { @@ -232,7 +233,7 @@ export class CreateAlertComponent implements OnInit, DoCheck { notification: this.createAlertNotificationForm.controls.subject.value, notificationDesc: this.createAlertNotificationForm.controls.message.value, notificationTypeID : this.communicationTypeId, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), roleID : this.createAlertNotificationForm.controls.roleType.value, workingLocationID : workLocationId[i], validFrom: new Date( @@ -265,7 +266,7 @@ export class CreateAlertComponent implements OnInit, DoCheck { getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ diff --git a/src/app/app-modules/supervisor/activities/alerts/alert-notification/edit-alert/edit-alert.component.ts b/src/app/app-modules/supervisor/activities/alerts/alert-notification/edit-alert/edit-alert.component.ts index 061f100..d32c9f1 100644 --- a/src/app/app-modules/supervisor/activities/alerts/alert-notification/edit-alert/edit-alert.component.ts +++ b/src/app/app-modules/supervisor/activities/alerts/alert-notification/edit-alert/edit-alert.component.ts @@ -31,6 +31,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { AlertNotificationComponent } from '../alert-notification.component'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-alert', @@ -68,7 +69,7 @@ export class EditAlertComponent implements OnInit, DoCheck { Stime = ''; Etime = ''; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } + constructor(readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } ngOnInit(): void { @@ -89,7 +90,7 @@ export class EditAlertComponent implements OnInit, DoCheck { this.getSelectedLanguage(); this.getNotificationType(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); this.range.controls.start.setValue(startDate); this.range.controls.end.setValue(endDate); this.editAlertForm.controls.startTime.patchValue(startTime); @@ -117,7 +118,7 @@ export class EditAlertComponent implements OnInit, DoCheck { getRolesForAlert(){ // let reqObj = { - // providerServiceMapId: sessionStorage.getItem('providerServiceMapID') + // providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID') // } this.supervisorService.getRole().subscribe((res:any)=>{ if(res.data !== undefined && res.data !== null && res.statusCode === 200 ){ @@ -144,7 +145,7 @@ export class EditAlertComponent implements OnInit, DoCheck { getOfficesForAlert(){ const reqObj = { - providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), roleID: this.roleID } this.supervisorService.getOffices(reqObj).subscribe((res:any)=>{ @@ -218,7 +219,7 @@ export class EditAlertComponent implements OnInit, DoCheck { endDate.setMilliseconds(0); const reqObj = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID: this.communicationTypeId, roleID: this.data.role.RoleID, notificationID: this.data.notificationID, @@ -254,7 +255,7 @@ export class EditAlertComponent implements OnInit, DoCheck { } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ diff --git a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.css b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.css index 692162b..813046d 100644 --- a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.css +++ b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.css @@ -163,3 +163,7 @@ margin-left: 20px !important; } +.buttonWidthForAllocate { + width: 200px; +} + diff --git a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.html b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.html index b7f8313..161c193 100644 --- a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.html +++ b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.html @@ -225,6 +225,15 @@

    {{ currentLanguageSet?.allocateCallRecords }}

    + + {{ currentLanguageSet?.preferredLanguage }} + + + {{ language.languageName }} + + + + {{ currentLanguageSet?.allocateTo }} {{ currentLanguageSet?.allocateCallRecords }}

    required /> - +
    +

    {{ currentLanguageSet?.allocate }} + diff --git a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.ts b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.ts index 98c66b5..80a6d66 100644 --- a/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.ts +++ b/src/app/app-modules/supervisor/activities/call-allocation/call-allocation/call-allocation.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ @@ -43,10 +44,10 @@ export class CallAllocationComponent implements OnInit, DoCheck { allocate: any; isAllocateEnabled = false; isFormValid = false; - isSubmitDisabled = true; + isSubmitDisabled = true; isAllocateDisabled = true; enableAllocate = false; - recordsData: any= []; + recordsData: any = []; enableAgentAllocation = false; enableMotherData = false; userRoles: any; @@ -55,12 +56,14 @@ export class CallAllocationComponent implements OnInit, DoCheck { currentLanguageSet: any; languageData: any; - rolesArr:any[] = []; + rolesArr: any[] = []; + languages: any = []; + enableLanguage = false; recordData = [ { id: 1, - name: "Mother", + name: "Mother", }, { id: 2, @@ -98,8 +101,9 @@ export class CallAllocationComponent implements OnInit, DoCheck { private supervisorService: SupervisorService, private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, - private masterService: MasterService) { - } + readonly sessionstorage: SessionStorageService, + private masterService: MasterService) { + } ngOnInit(): void { this.enableMotherData = true; @@ -107,9 +111,10 @@ export class CallAllocationComponent implements OnInit, DoCheck { this.checkSubmitDisabledButton(); }); this.getMasterData(); + this.getLanguageMaster(); } - ngDoCheck(){ + ngDoCheck() { this.getSelectedLanguage(); } @@ -133,6 +138,7 @@ export class CallAllocationComponent implements OnInit, DoCheck { recordType: new FormControl('', [Validators.required]), phoneNoType: new FormControl('', [Validators.required]), agentType: new FormControl('', [Validators.required]), + preferredLanguage: new FormControl(null), allocateTo: new FormControl('', [Validators.required]), numericValue: new FormControl('', [Validators.required]), }); @@ -140,7 +146,7 @@ export class CallAllocationComponent implements OnInit, DoCheck { onClickOfRecordType(event: any) { this.recordType = event.value; - + this.checkSubmitDisabledButton(); console.log(this.recordType); } @@ -152,45 +158,84 @@ export class CallAllocationComponent implements OnInit, DoCheck { } onClickOfAgentType() { - const agentTypeValue = this.callAllocationForm.controls["agentType"].value; - this.checkAllocateDisabledButton(); - - - -this.allocatesTo = []; -this.callAllocationForm.controls.allocateTo.patchValue(null); - this.masterService.getAgentMasterByRoleId(agentTypeValue).subscribe((response:any)=>{ - if(response){ - this.allocatesTo = response; + const agentTypeValue = this.callAllocationForm.controls["agentType"].value; + const selectedLanguage = this.callAllocationForm.controls["preferredLanguage"].value; + + if (this.callAllocationForm.controls["preferredLanguage"].value !== "None") { + this.checkAllocateDisabledButton(); + this.allocatesTo = []; + this.callAllocationForm.controls.allocateTo.patchValue(null); + if (this.enableLanguage) { + const recordType = this.callAllocationForm.controls.recordType.value; + const phoneNoType = this.callAllocationForm.controls.phoneNoType.value; + const psmId = this.sessionstorage.getItem('providerServiceMapID'); + const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); + const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); + this.supervisorService.getLowRiskRecordsByLanguage(psmId, phoneNoType, recordType, fromDate, toDate, selectedLanguage, this.selectedRoleName).subscribe((resp: any) => { + if (resp) { + if (this.selectedRoleName.toLowerCase() === "anm") { + this.callAllocationForm.controls.numericValue.patchValue(resp.totalLowRiskRecord); + this.allocateNoOfRecords = resp.totalLowRiskRecord; + } + else { + this.callAllocationForm.controls.numericValue.patchValue(resp.totalIntroductoryRecord); + this.allocateNoOfRecords = resp.totalIntroductoryRecord; + } + this.masterService.getAgentMasterByRoleIdAndLanguage(agentTypeValue, selectedLanguage).subscribe((response: any) => { + if (response) { + this.allocatesTo = response; + } + }); + } + }); + } else { + this.masterService.getAgentMasterByRoleId(agentTypeValue).subscribe((response: any) => { + if (response) { + this.allocatesTo = response; + } + }) } - }) - + } else { + this.callAllocationForm.controls["preferredLanguage"].reset(); + if(this.selectedRoleName.toLowerCase() === "anm"){ + this.allocateNoOfRecords = this.recordsData?.totalLowRiskRecord; + this.callAllocationForm.controls.numericValue.patchValue(this.recordsData?.totalLowRiskRecord); + } else { + this.allocateNoOfRecords = this.recordsData?.totalIntroductoryRecord; + this.callAllocationForm.controls.numericValue.patchValue(this.recordsData?.totalIntroductoryRecord); + } + this.checkAllocateDisabledButton(); + this.masterService.getAgentMasterByRoleId(agentTypeValue).subscribe((response: any) => { + if (response) { + this.allocatesTo = response; + } + }); + } } - setSelectedRoleName(roleName:any) { + setSelectedRoleName(roleName: any) { this.selectedRoleName = roleName; } onClickOfAllocateTo(event: any) { - - if(this.callAllocationForm.controls.allocateTo.value !== undefined && this.callAllocationForm.controls.allocateTo.value !== null && + if (this.callAllocationForm.controls.allocateTo.value !== undefined && this.callAllocationForm.controls.allocateTo.value !== null && this.callAllocationForm.controls.allocateTo.value.length > 0) { - this.currentMaxAllocatedRecords = this.allocateNoOfRecords / this.callAllocationForm.controls.allocateTo.value.length; - } - else { - this.currentMaxAllocatedRecords = 0; - } - this.currentMaxAllocatedRecords = Math.trunc(this.currentMaxAllocatedRecords); - this.callAllocationForm.controls.numericValue.patchValue(this.currentMaxAllocatedRecords); + this.currentMaxAllocatedRecords = this.allocateNoOfRecords / this.callAllocationForm.controls.allocateTo.value.length; + } + else { + this.currentMaxAllocatedRecords = 0; + } + this.currentMaxAllocatedRecords = Math.trunc(this.currentMaxAllocatedRecords); + this.callAllocationForm.controls.numericValue.patchValue(this.currentMaxAllocatedRecords); const allocateToValue = event.value; this.checkAllocateDisabledButton(); console.log(event.value); } checkSubmitDisabledButton() { - if (this.callAllocationForm.controls.recordType.value && - this.callAllocationForm.controls.phoneNoType.value && - this.range.controls.start.value && + if (this.callAllocationForm.controls.recordType.value && + this.callAllocationForm.controls.phoneNoType.value && + this.range.controls.start.value && this.range.controls.end.value) { this.isSubmitDisabled = false; } else { @@ -199,112 +244,110 @@ this.callAllocationForm.controls.allocateTo.patchValue(null); } checkAllocateDisabledButton() { - let numValue = false; - if((this.callAllocationForm.controls.numericValue.value !== undefined && this.callAllocationForm.controls.numericValue.value !== null - && parseInt(this.callAllocationForm.controls.numericValue.value) > 0 && + if ((this.callAllocationForm.controls.numericValue.value !== undefined && this.callAllocationForm.controls.numericValue.value !== null + && parseInt(this.callAllocationForm.controls.numericValue.value) > 0 && this.callAllocationForm.controls.numericValue.value <= this.currentMaxAllocatedRecords)) { numValue = true; - } - else { + } + else { numValue = false; - } - - - if (this.callAllocationForm.controls.agentType.value !== null && this.callAllocationForm.controls.allocateTo.value !== null && numValue) { + } + if ((!this.enableLanguage || + (this.enableLanguage && this.selectedRoleName.toLowerCase() === "associate") || + (this.enableLanguage && this.selectedRoleName.toLowerCase() === "anm" && this.callAllocationForm.controls.preferredLanguage.value !== null)) && this.callAllocationForm.controls.agentType.value !== null && this.callAllocationForm.controls.allocateTo.value !== null && this.callAllocationForm.controls.allocateTo.value.length > 0 && numValue) { this.isAllocateDisabled = false; - } else { + } + else { this.isAllocateDisabled = true; } - } getMasterData() { - const psmId = sessionStorage.getItem('providerServiceMapID'); - this.masterService.getRoleMaster(psmId).subscribe((res:any)=>{ - if(res){ + const psmId = this.sessionstorage.getItem('providerServiceMapID'); + this.masterService.getRoleMaster(psmId).subscribe((res: any) => { + if (res) { this.roles = res; } }) - const roleId = sessionStorage.getItem('roleId'); - if (roleId !== null) { - this.userRoles = JSON.parse(roleId); - } + const roleId = this.sessionstorage.getItem('roleId'); + if (roleId !== null) { + this.userRoles = JSON.parse(roleId); + } console.log('userPrivileges', this.userRoles); - } onSubmit() { - const recordType= this.callAllocationForm.controls.recordType.value; - const phoneNoType= this.callAllocationForm.controls.phoneNoType.value; - - - - const psmId= sessionStorage.getItem('providerServiceMapID'); + const recordType = this.callAllocationForm.controls.recordType.value; + const phoneNoType = this.callAllocationForm.controls.phoneNoType.value; + const psmId = this.sessionstorage.getItem('providerServiceMapID'); // let fromDate = moment(fDate).toISOString(); // let toDate = moment(tDate).toISOString(); - const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); - const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); - this.supervisorService.getUnallocatedCalls(psmId, phoneNoType, recordType, fromDate, toDate).subscribe((res: any) => - { - if(res && res !== null) { - this.recordsData = res; - this.enableAllocate = true; - - if(this.recordType === "Mother") { - this.enableMotherData = true; - } else { - this.enableMotherData = false; - } - this.enableAgentAllocation = false; - } else { - this.confirmationService.openDialog(this.currentLanguageSet.noDataFound, `info`); - this.enableAllocate = false; + const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); + const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); + this.supervisorService.getUnallocatedCalls(psmId, phoneNoType, recordType, fromDate, toDate).subscribe((res: any) => { + if (res && res !== null) { + this.recordsData = res; + this.enableAllocate = true; + if (this.recordType === "Mother") { + this.enableMotherData = true; + } else { + this.enableMotherData = false; } + this.enableAgentAllocation = false; + } else { + this.confirmationService.openDialog(this.currentLanguageSet.noDataFound, `info`); + this.enableAllocate = false; + } }) } - onAllocate(value: any, noOfRecords:any) { - + onAllocate(value: any, noOfRecords: any) { this.allocateNoOfRecords = noOfRecords; this.currentMaxAllocatedRecords = noOfRecords; this.enableAgentAllocation = true; this.isSubmitDisabled = false; + this.callAllocationForm.controls['preferredLanguage'].clearValidators(); + this.callAllocationForm.controls["preferredLanguage"].patchValue(null); + this.enableLanguage = false; this.resetInnerAllocateForm(); - if(value === 'introductory') { + if (value === 'introductory') { this.rolesArr = []; - this.isIntroductory = true; - this.roles.filter((values:any) => { - if (values.roleName.toLowerCase() === "associate") { + this.isIntroductory = true; + this.roles.filter((values: any) => { + if (values.roleName.toLowerCase() === "associate") { this.rolesArr.push(values); this.callAllocationForm.controls["agentType"].patchValue(values.roleId); this.onClickOfAgentType(); this.setSelectedRoleName(values.roleName); - } - }); + } + }); + this.enableLanguage = true; + this.callAllocationForm.controls['preferredLanguage'].clearValidators(); } else { this.rolesArr = []; - if(value === "low risk") { - this.roles.filter((values:any) => { - if (values.roleName.toLowerCase() === "anm") { + if (value === "low risk") { + this.roles.filter((values: any) => { + if (values.roleName.toLowerCase() === "anm") { this.rolesArr.push(values); this.callAllocationForm.controls["agentType"].patchValue(values.roleId); - this.onClickOfAgentType(); this.setSelectedRoleName(values.roleName); - } - }); - } - else { - this.roles.filter((values:any) => { - if (values.roleName.toLowerCase() === "mo") { + } + }); + this.enableLanguage = true; + this.callAllocationForm.controls['preferredLanguage'].setValidators([Validators.required]); + } + else { + this.roles.filter((values: any) => { + if (values.roleName.toLowerCase() === "mo") { this.rolesArr.push(values); this.callAllocationForm.controls["agentType"].patchValue(values.roleId); this.onClickOfAgentType(); this.setSelectedRoleName(values.roleName); - } + } }); - } + } this.isIntroductory = false; } this.callAllocationForm.controls.numericValue.patchValue(this.allocateNoOfRecords); @@ -313,7 +356,7 @@ this.callAllocationForm.controls.allocateTo.patchValue(null); console.log("allocate Agents"); } - resetInnerAllocateForm() { + resetInnerAllocateForm() { this.allocatesTo = []; this.callAllocationForm.controls.agentType.patchValue(null); this.callAllocationForm.controls.agentType.patchValue(null); @@ -323,12 +366,8 @@ this.callAllocationForm.controls.allocateTo.patchValue(null); } onClickOfAllocate() { - - - - const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); - const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); - + const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); + const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); const allocateReqObj = { "fromUserIds": [ @@ -340,39 +379,53 @@ this.callAllocationForm.controls.allocateTo.patchValue(null); "roleName": this.selectedRoleName, "recordType": this.callAllocationForm.controls.recordType.value, "phoneNoType": this.callAllocationForm.controls.phoneNoType.value, - "psmId": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName"), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName'), "isIntroductory": this.isIntroductory, "tdate": toDate, - "fdate": fromDate + "fdate": fromDate, + "preferredLanguage": this.callAllocationForm.controls.preferredLanguage.value }; - - - this.supervisorService.saveAllocateCalls(allocateReqObj).subscribe( (response: any) => { - - if(response !== null && response.response !== null) { - this.confirmationService.openDialog(response.response, `success`); - // this.confirmationService.openDialog(this.currentLanguageSet.callsAllocatedSuccessfully, `success`); - this.callAllocationForm.reset(); - this.range.reset(); - this.enableAgentAllocation = false; - this.isSubmitDisabled = false; - this.selectedRoleName = null; - this.recordsData = []; - - } - else { - this.confirmationService.openDialog(response.errorMessage, 'error'); + + if (response && response.response) { + this.confirmationService.openDialog(response.response, `success`); + // this.confirmationService.openDialog(this.currentLanguageSet.callsAllocatedSuccessfully, `success`); + this.callAllocationForm.reset(); + this.range.reset(); + this.enableAgentAllocation = false; + this.isSubmitDisabled = true; + this.selectedRoleName = null; + this.recordsData = []; + this.enableLanguage = false; + + } + else { + this.confirmationService.openDialog(response.errorMessage, 'error'); + } + }, + (err: any) => { + if (err && err.error) + this.confirmationService.openDialog(err.error, 'error'); + else + this.confirmationService.openDialog(err.title + err.detail, 'error') + }); + + } + + + getLanguageMaster() { + this.masterService.getLanguageMaster().subscribe((response: any) => { + if (response && response.length > 0) { + this.languages = [{ languageName: 'None' }, ...response]; + } else { + this.confirmationService.openDialog(this.currentLanguageSet.noLanguagesFound, 'error'); } }, - (err: any) => { - if(err && err.error) - this.confirmationService.openDialog(err.error, 'error'); - else - this.confirmationService.openDialog(err.title + err.detail, 'error') - }); - + (err: any) => { + this.confirmationService.openDialog(err.error, 'error'); + } + ); } } diff --git a/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.html b/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.html index 40faf22..00fcf13 100644 --- a/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.html +++ b/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.html @@ -29,7 +29,7 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    currentLanguageSet?.role }} @@ -43,6 +43,15 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    + + {{ currentLanguageSet?.preferredLanguage }} + + + {{ language.languageName }} + + + + {{ currentLanguageSet?.reallocateCallsToAgents }}

    currentLanguageSet?.agentName }} @@ -71,7 +80,7 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    currentLanguageSet?.recordType }} @@ -92,7 +101,7 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    currentLanguageSet?.phoneNumberType }} @@ -115,11 +124,13 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    matStartDate formControlName="start" placeholder="{{ currentLanguageSet?.startDate }}" + (dateChange)="resetReallocateForm()" /> MM/DD/YYYY – MM/DD/YYYY @@ -138,16 +149,22 @@

    {{ currentLanguageSet?.reallocateCallsToAgents }}

    }} +
    + {{currentLanguageSet?.stickyAgentRecords}} +
    +
    + mat-raised-button + class="buttonColor full-width buttonWidth" + type="submit" + style="float: right; margin: 20px;" + [disabled]="isSubmitDisabled || !callReallocationForm.valid" + (click)="onSubmit()" + > + {{ currentLanguageSet?.submit }} + +
    + diff --git a/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.ts b/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.ts index 73bd65f..5b58135 100644 --- a/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.ts +++ b/src/app/app-modules/supervisor/activities/call-reallocation/call-reallocation/call-reallocation.component.ts @@ -21,6 +21,7 @@ */ +import { P } from '@angular/cdk/keycodes'; import { Component, DoCheck, Input, OnInit } from '@angular/core'; import { FormControl, FormGroup, Validators } from '@angular/forms'; import * as moment from 'moment'; @@ -28,6 +29,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ @@ -68,6 +70,7 @@ export class CallReallocationComponent implements OnInit, DoCheck { agentRoles:any; maxDate = new Date(); + recordData = [ { id: 1, @@ -100,11 +103,14 @@ export class CallReallocationComponent implements OnInit, DoCheck { selectedRoleName: any; agentArr: any = []; isDisableUnallocateButton = true; + enableLanguage = false; + languages : any = []; constructor( private supervisorService: SupervisorService, private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService) { } ngOnInit(): void { @@ -113,6 +119,8 @@ export class CallReallocationComponent implements OnInit, DoCheck { this.range.valueChanges.subscribe(() => { this.checkSubmitDisabledButton(); }); + + this.getLanguageMaster(); } ngDoCheck(){ @@ -138,9 +146,11 @@ export class CallReallocationComponent implements OnInit, DoCheck { callReallocationForm = new FormGroup({ selectedRadioButton: new FormControl('', [Validators.required]), agentTypes: new FormControl('', [Validators.required]), + preferredLanguage: new FormControl(null), agentName: new FormControl('', [Validators.required]), recordType: new FormControl('', [Validators.required]), phoneNoType: new FormControl('', [Validators.required]), + isStickyAgent: new FormControl(false) }); callReallocateForm = new FormGroup({ @@ -149,8 +159,8 @@ export class CallReallocationComponent implements OnInit, DoCheck { }); getMasterData() { - const psmId = sessionStorage.getItem('providerServiceMapID'); - // var psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); + // var psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(psmId).subscribe((res:any)=>{ if(res){ this.agentList = res; @@ -172,15 +182,21 @@ export class CallReallocationComponent implements OnInit, DoCheck { this.agentRoles= event.value; this.checkSubmitDisabledButton(); + const selectedRole = this.rolesArr.find((values: any) => values.roleId === this.agentRoles); + this.agentNames = []; this.allocatesTo = []; this.callReallocationForm.controls.agentName.patchValue(null); + + if(selectedRole !== undefined && selectedRole !== null && selectedRole.roleName !== undefined && selectedRole.roleName !== null && selectedRole.roleName.toLowerCase() !== "anm" ) { + this.masterService.getAgentMasterByRoleId(this.agentRoles).subscribe((response:any)=>{ if(response){ this.agentNames = response; this.allocatesTo = response; } }) + } } @@ -218,7 +234,25 @@ export class CallReallocationComponent implements OnInit, DoCheck { } setAgentRoleName(roleName:any) { -this.selectedRoleName = roleName; + this.enableLanguage = false; + this.callReallocationForm.controls["preferredLanguage"].clearValidators(); + this.selectedRoleName = roleName; + + if(this.selectedRoleName !== undefined && this.selectedRoleName !== null && this.selectedRoleName.toLowerCase() === 'associate') { + this.callReallocationForm.patchValue({isStickyAgent : false}); + this.enableLanguage = true; + } + + if(this.selectedRoleName !== undefined && this.selectedRoleName !== null && this.selectedRoleName.toLowerCase() === 'anm') { + this.enableLanguage = true; + this.callReallocationForm.controls["preferredLanguage"].addValidators(Validators.required); + } + else { + this.callReallocationForm.controls["preferredLanguage"].clearValidators(); + this.callReallocationForm.controls["preferredLanguage"].patchValue(null); + } + + } onSubmit() { @@ -241,10 +275,12 @@ this.selectedRoleName = roleName; "roleName": this.selectedRoleName, "recordType": this.callReallocationForm.controls.recordType.value, "phoneNoType": this.callReallocationForm.controls.phoneNoType.value, - "psmId": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName"), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName'), "tdate": toDate, - "fdate": fromDate + "fdate": fromDate, + "isStickyAgent" : this.callReallocationForm.controls.isStickyAgent.value, + "preferredLanguage": this.callReallocationForm.controls.preferredLanguage.value }; this.supervisorService.getAllocatedCounts(reqObj).subscribe((res: any) => { @@ -299,9 +335,9 @@ this.selectedRoleName = roleName; const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); - const userIdString = sessionStorage.getItem('userId'); - const roleIdString = sessionStorage.getItem('roleId'); - const psmIdString = sessionStorage.getItem('providerServiceMapID'); + const userIdString = this.sessionstorage.getItem('userID'); + const roleIdString = this.sessionstorage.getItem('roleId'); + const psmIdString = this.sessionstorage.getItem('providerServiceMapID'); @@ -316,19 +352,19 @@ this.selectedRoleName = roleName; "roleName": this.selectedRoleName, "recordType": this.callReallocationForm.controls.recordType.value, "phoneNoType": this.callReallocationForm.controls.phoneNoType.value, - "psmId": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName"), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName'), "tdate": toDate, - "fdate": fromDate + "fdate": fromDate, + "isStickyAgent" : this.callReallocationForm.controls.isStickyAgent.value, + "preferredLanguage": this.callReallocationForm.controls.preferredLanguage.value }; this.supervisorService.updateReallocateCalls(reqObj).subscribe((res: any) => { if(res && res.response !== null) { this.isSubmitDisabled = false; this.confirmationService.openDialog(res.response, `success`); - // this.confirmationService.openDialog(this.currentLanguageSet.callsReallocatedSuccessfully, `success`); - this.callReallocateForm.reset(); - this.enableAgentAllocation = false; + this.resetReallocateForm(); // this.selectedRoleName = null; } else { @@ -349,12 +385,6 @@ this.selectedRoleName = roleName; const fromDate = moment(this.range.controls.start.value).format('YYYY-MM-DDThh:mm:ssZ'); const toDate = moment(this.range.controls.end.value).format('YYYY-MM-DDThh:mm:ssZ'); - - - - - - const reqObj = { "fromUserIds": [ 0 @@ -368,20 +398,19 @@ this.selectedRoleName = roleName; "roleName": this.selectedRoleName, "recordType": this.callReallocationForm.controls.recordType.value, "phoneNoType": this.callReallocationForm.controls.phoneNoType.value, - "psmId": sessionStorage.getItem('providerServiceMapID'), - "createdBy": sessionStorage.getItem("userName"), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), + "createdBy": this.sessionstorage.getItem('userName'), "isIntroductory": this.selectedRoleName.toLowerCase() === 'associate' ? true : false, "tdate": toDate, - "fdate": fromDate + "fdate": fromDate, + "isStickyAgent" : this.callReallocationForm.controls.isStickyAgent.value, + "preferredLanguage": this.callReallocationForm.controls.preferredLanguage.value }; this.supervisorService.deleteReallocatedCalls(reqObj).subscribe((res: any) => { if(res && res.response !== null) { this.confirmationService.openDialog(res.response, `success`); - // this.confirmationService.openDialog(this.currentLanguageSet.recordsDeletedSuccessfully, `success`); - this.callReallocateForm.reset(); - this.enableAgentAllocation = false; - this.isDisableUnallocateButton = true; + this.resetReallocateForm(); // this.selectedRoleName = null; } else { @@ -401,9 +430,14 @@ this.selectedRoleName = roleName; this.reallocateEnabled = false; this.unallocateEnabled = false; this.enableAgentAllocation = false; + this.selectedRoleName = null; this.callReallocationForm.reset(); this.callReallocateForm.reset(); this.range.reset(); + this.enableLanguage = false; + this.callReallocationForm.controls["preferredLanguage"].clearValidators(); + + this.callReallocationForm.patchValue({isStickyAgent : false}); } enableUnallocateReallocateButton() { if(this.callReallocateForm.controls.numericValue.value !== null && parseInt(this.callReallocateForm.controls.numericValue.value) > 0 && parseInt(this.callReallocateForm.controls.numericValue.value) <= this.currentMaxAllocatedRecords) { @@ -415,4 +449,45 @@ enableUnallocateReallocateButton() { } } +getLanguageMaster(){ + + this.masterService.getLanguageMaster().subscribe((response: any) => { + if(response && response.length > 0){ + this.languages = response; + }else { + this.confirmationService.openDialog(this.currentLanguageSet.noLanguagesFound, 'error'); + } + }, + (err: any) => { + this.confirmationService.openDialog(err.error, 'error'); + } + ); +} + +onSelectionOfLanguage() { + this.agentRoles= this.callReallocationForm.controls.agentTypes.value; + const selectedLanguage = this.callReallocationForm.controls.preferredLanguage.value; + this.checkSubmitDisabledButton(); + + + this.agentNames = []; + this.allocatesTo = []; + this.callReallocationForm.controls.agentName.patchValue(null); + + this.masterService.getAgentMasterByRoleIdAndLanguage(this.agentRoles,selectedLanguage).subscribe((response:any)=>{ + if(response){ + this.agentNames = response; + this.allocatesTo = response; + } + }) + + +} + +resetReallocateForm() { + this.callReallocateForm.reset(); + this.enableAgentAllocation = false; + this.isDisableUnallocateButton = true; +} + } diff --git a/src/app/app-modules/supervisor/activities/force-logout/force-logout.component.ts b/src/app/app-modules/supervisor/activities/force-logout/force-logout.component.ts index d81286f..35cfe0b 100644 --- a/src/app/app-modules/supervisor/activities/force-logout/force-logout.component.ts +++ b/src/app/app-modules/supervisor/activities/force-logout/force-logout.component.ts @@ -27,6 +27,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { environment } from 'src/environments/environment'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-force-logout', @@ -37,7 +38,7 @@ export class ForceLogoutComponent implements OnInit { currentLanguageSet: any; languageData: any; - constructor(private setLanguageService: SetLanguageService,private fb: FormBuilder,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } + constructor(readonly sessionstorage:SessionStorageService,private setLanguageService: SetLanguageService,private fb: FormBuilder,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } kickoutForm = this.fb.group({ userName: ['',Validators.required] @@ -54,7 +55,7 @@ export class ForceLogoutComponent implements OnInit { kickoutUsername(){ const reqObj = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), userName : this.kickoutForm.controls.userName.value, } this.supervisorService.getUserLogout(reqObj).subscribe((res:any)=>{ diff --git a/src/app/app-modules/supervisor/activities/notification-supervisor/create-notification/create-notification.component.ts b/src/app/app-modules/supervisor/activities/notification-supervisor/create-notification/create-notification.component.ts index 6fba4d7..086644e 100644 --- a/src/app/app-modules/supervisor/activities/notification-supervisor/create-notification/create-notification.component.ts +++ b/src/app/app-modules/supervisor/activities/notification-supervisor/create-notification/create-notification.component.ts @@ -32,6 +32,7 @@ import { SupervisorNotificationComponent } from '../supervisor-notification/supe import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-notification', @@ -69,14 +70,14 @@ export class CreateNotificationComponent implements OnInit, DoCheck { Stime = ''; Etime = ''; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService,private masterService: MasterService) { } + constructor(readonly sessionstorage:SessionStorageService, private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService,private masterService: MasterService) { } ngOnInit(): void { this.getSelectedLanguage(); this.getNotificationType(); this.getRolesForAlert(); this.getLocationsForAlert(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); } createAlertForm = this.fb.group({ @@ -97,7 +98,7 @@ export class CreateNotificationComponent implements OnInit, DoCheck { } getRolesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ res.filter((role: any) => { @@ -109,7 +110,7 @@ export class CreateNotificationComponent implements OnInit, DoCheck { }) } getOfficesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getOfficesMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ this.offices = res; @@ -118,7 +119,7 @@ export class CreateNotificationComponent implements OnInit, DoCheck { } getLocationsForAlert() { - const providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); const roleID = this.createAlertForm.controls.roleType.value; this.masterService.getLocationsMaster(providerServiceMapID, roleID).subscribe((res: any) => { if (res !== undefined && res.data !== undefined) { @@ -129,7 +130,7 @@ export class CreateNotificationComponent implements OnInit, DoCheck { getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -216,7 +217,7 @@ export class CreateNotificationComponent implements OnInit, DoCheck { notification: this.createAlertForm.controls.subject.value, notificationDesc: this.createAlertForm.controls.message.value, notificationTypeID : this.communicationTypeId, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), roleID : this.createAlertForm.controls.roleType.value, workingLocationID : workLocationId[i], validFrom: new Date( diff --git a/src/app/app-modules/supervisor/activities/notification-supervisor/edit-notification/edit-notification.component.ts b/src/app/app-modules/supervisor/activities/notification-supervisor/edit-notification/edit-notification.component.ts index 5ed4ca4..94a32fd 100644 --- a/src/app/app-modules/supervisor/activities/notification-supervisor/edit-notification/edit-notification.component.ts +++ b/src/app/app-modules/supervisor/activities/notification-supervisor/edit-notification/edit-notification.component.ts @@ -31,6 +31,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { SupervisorNotificationComponent } from '../supervisor-notification/supervisor-notification.component'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-notification', @@ -70,7 +71,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { Stime = ''; Etime = ''; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } + constructor(readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } ngOnInit(): void { let startDate = new Date(this.data.validFrom); @@ -90,7 +91,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { this.getSelectedLanguage(); this.getNotificationType(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); this.range.controls.start.setValue(startDate); this.range.controls.end.setValue(endDate); this.editNotifyForm.controls.startTime.patchValue(startTime); @@ -119,7 +120,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { getRolesForAlert(){ const reqObj = { - providerServiceMapId: sessionStorage.getItem('providerServiceMapID') + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getRoles(reqObj).subscribe((res:any)=>{ if(res.data !== undefined && res.data !== null && res.statusCode === 200 ){ @@ -130,7 +131,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -145,7 +146,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { } getOfficesForAlert(){ const reqObj = { - providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), roleID: this.roleID } this.supervisorService.getOffices(reqObj).subscribe((res:any)=>{ @@ -230,7 +231,7 @@ export class EditNotificationComponent implements OnInit, DoCheck { // validTill += 'T' + endTime + ':00Z'; const reqObj = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID:this.communicationTypeId, roleID: this.data.role.RoleID, notificationID:this.data.notificationID, diff --git a/src/app/app-modules/supervisor/activities/notification-supervisor/supervisor-notification/supervisor-notification.component.ts b/src/app/app-modules/supervisor/activities/notification-supervisor/supervisor-notification/supervisor-notification.component.ts index 5c340a4..ffb82dd 100644 --- a/src/app/app-modules/supervisor/activities/notification-supervisor/supervisor-notification/supervisor-notification.component.ts +++ b/src/app/app-modules/supervisor/activities/notification-supervisor/supervisor-notification/supervisor-notification.component.ts @@ -34,6 +34,7 @@ import { CreateNotificationComponent } from '../create-notification/create-notif import * as moment from 'moment'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-supervisor-notification', @@ -72,13 +73,13 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService, private masterService: MasterService,) { } + constructor( readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService, private masterService: MasterService,) { } ngOnInit(): void { this.getSelectedLanguage(); this.getNotificationType(); this.getRolesForAlert(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); // this.getRolesForAlert(); } @@ -98,7 +99,7 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi const validStartDate = moment(startDate).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const validEndDate = moment(endDate).endOf('day').format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID : this.communicationTypeId, roleIDs : this.allRoleIDs, validEndDate : validEndDate , @@ -136,7 +137,7 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi } getRolesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if (res.length !== 0) { this.roles = res.filter((item : any) => { @@ -177,7 +178,7 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi // } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -206,7 +207,7 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi .subscribe((response) => { if (response) { const reqObj: any = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID: this.communicationTypeId, notificationID: element.notificationID , roleID: element.roleID, @@ -215,7 +216,7 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi notification: element.notification, notificationDesc: element.notificationDesc, deleted: type === 'activate' ? 'false' : 'true', - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; this.supervisorService.saveEditAlert(reqObj).subscribe( @@ -250,8 +251,8 @@ export class SupervisorNotificationComponent implements OnInit, DoCheck, AfterVi } // onPublish(){ // let reqObj= { - // providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), - // modifiedBy: sessionStorage.getItem('userName'), + // providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), + // modifiedBy: this.sessionstorage.getItem('userName'), // } // this.supervisorService.publishNotification(reqObj).subscribe((res:any)=>{ // if(res.data !== undefined && res.data !== null){ diff --git a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/create-location-message/create-location-message.component.ts b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/create-location-message/create-location-message.component.ts index 5552551..6fd4853 100644 --- a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/create-location-message/create-location-message.component.ts +++ b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/create-location-message/create-location-message.component.ts @@ -32,6 +32,7 @@ import { LocationMessagesComponent } from '../location-messages/location-message import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-create-location-message', @@ -64,13 +65,13 @@ export class CreateLocationMessageComponent implements OnInit, DoCheck { Stime = ''; Etime = ''; - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService,private masterService: MasterService) { } + constructor( readonly sessionstorage:SessionStorageService,private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService,private masterService: MasterService) { } ngOnInit(): void { this.getSelectedLanguage(); this.getOfficesForAlert(); this.getNotificationType(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); } createLocationForm = this.fb.group({ @@ -92,7 +93,7 @@ export class CreateLocationMessageComponent implements OnInit, DoCheck { } getOfficesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getOfficeMasterData(providerServiceMapId).subscribe((res:any)=>{ if(res !== undefined && res.data !== undefined){ this.offices = res.data; @@ -183,7 +184,7 @@ export class CreateLocationMessageComponent implements OnInit, DoCheck { notification: this.createLocationForm.controls.subject.value, notificationDesc: this.createLocationForm.controls.message.value, notificationTypeID : this.communicationTypeId, - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), workingLocationID : this.createLocationForm.controls.officeType.value, validFrom: new Date( startDate.valueOf() - 1 * startDate.getTimezoneOffset() * 60 * 1000 @@ -227,7 +228,7 @@ export class CreateLocationMessageComponent implements OnInit, DoCheck { } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ diff --git a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/edit-location-message/edit-location-message.component.ts b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/edit-location-message/edit-location-message.component.ts index 8fa0c30..6ef64cf 100644 --- a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/edit-location-message/edit-location-message.component.ts +++ b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/edit-location-message/edit-location-message.component.ts @@ -31,6 +31,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { LocationMessagesComponent } from '../location-messages/location-messages.component'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-edit-location-message', @@ -63,7 +64,12 @@ export class EditLocationMessageComponent implements OnInit, DoCheck { minDate = new Date(); dateFilter = (date: Date) => date.getTime() >= this.minDate.getTime(); - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService) { } + constructor( + private fb: FormBuilder, + private setLanguageService: SetLanguageService, + private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, + private confirmationService: ConfirmationService) { } ngOnInit(): void { let startDate = new Date(this.data.validFrom); @@ -89,7 +95,7 @@ export class EditLocationMessageComponent implements OnInit, DoCheck { this.editLocationForm.controls.message.patchValue(this.data.notificationDesc); this.getSelectedLanguage(); this.getNotificationType(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); } editLocationForm = this.fb.group({ @@ -110,7 +116,7 @@ export class EditLocationMessageComponent implements OnInit, DoCheck { getOfficesForAlert(){ const reqObj = { - providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), roleID: this.roleID } this.supervisorService.getOffices(reqObj).subscribe((res:any)=>{ @@ -121,7 +127,7 @@ export class EditLocationMessageComponent implements OnInit, DoCheck { } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -200,7 +206,7 @@ export class EditLocationMessageComponent implements OnInit, DoCheck { endDate.setMilliseconds(0); const reqObj = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID:this.communicationTypeId, notificationID:this.data.notificationID, validFrom: new Date( diff --git a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/location-messages/location-messages.component.ts b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/location-messages/location-messages.component.ts index 1793fc5..f7940ac 100644 --- a/src/app/app-modules/supervisor/activities/supervisor-locationMessages/location-messages/location-messages.component.ts +++ b/src/app/app-modules/supervisor/activities/supervisor-locationMessages/location-messages/location-messages.component.ts @@ -34,7 +34,7 @@ import { CreateLocationMessageComponent } from '../create-location-message/creat import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import * as moment from 'moment'; import { MatPaginator } from '@angular/material/paginator'; - +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-location-messages', @@ -66,13 +66,19 @@ export class LocationMessagesComponent implements OnInit, DoCheck, AfterViewInit - constructor(private fb: FormBuilder,private setLanguageService: SetLanguageService,private supervisorService: SupervisorService,private confirmationService: ConfirmationService, private masterService: MasterService) { } + constructor( + private fb: FormBuilder, + private setLanguageService: SetLanguageService, + private supervisorService: SupervisorService, + private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, + private masterService: MasterService) { } ngOnInit(): void { this.getSelectedLanguage(); this.getNotificationType(); this.getOfficesForAlert(); - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); // this.getRolesForAlert(); // this.dataSource.data = this.locationData; @@ -93,7 +99,7 @@ export class LocationMessagesComponent implements OnInit, DoCheck, AfterViewInit const validStartDate = moment(startDate).format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const validEndDate = moment(endDate).endOf('day').format('YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); const reqObj = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID: this.communicationTypeId, workingLocationIDs:this.allOfficeIDs, validStartDate : validStartDate, @@ -168,7 +174,7 @@ export class LocationMessagesComponent implements OnInit, DoCheck, AfterViewInit .subscribe((response) => { if (response) { const reqObj: any = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID'), notificationTypeID: this.communicationTypeId, notificationID: element.notificationID , validFrom : element.validFrom, @@ -176,7 +182,7 @@ export class LocationMessagesComponent implements OnInit, DoCheck, AfterViewInit notification: element.notification, notificationDesc: element.notificationDesc, deleted: type === 'activate' ? 'false' : 'true', - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), }; this.supervisorService.saveEditAlert(reqObj).subscribe( @@ -211,7 +217,7 @@ export class LocationMessagesComponent implements OnInit, DoCheck, AfterViewInit } getNotificationType(){ const reqObj = { - providerServiceMapID : sessionStorage.getItem('providerServiceMapID') + providerServiceMapID : this.sessionstorage.getItem('providerServiceMapID') } this.supervisorService.getNotificationType(reqObj).subscribe((res:any)=>{ if(res.statusCode === 200){ @@ -235,8 +241,8 @@ getNotificationType(){ // onPublish(){ // let reqObj= { - // providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), - // modifiedBy: sessionStorage.getItem('userName'), + // providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), + // modifiedBy: this.sessionstorage.getItem('userName'), // } // this.supervisorService.publishLocationMessages(reqObj).subscribe((res:any)=>{ // if(res.data !== undefined && res.data !== null){ @@ -248,7 +254,7 @@ getNotificationType(){ // } // getOfficesForAlert(){ // let reqObj = { - // providerServiceMapId: sessionStorage.getItem('providerServiceMapID'), + // providerServiceMapId: this.sessionstorage.getItem('providerServiceMapID'), // roleID: this.roleID // } // this.supervisorService.getOffices(reqObj).subscribe((res:any)=>{ @@ -258,7 +264,7 @@ getNotificationType(){ // }) // } getOfficesForAlert(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getOfficeMasterData(providerServiceMapId).subscribe((res:any)=>{ if(res !== undefined && res.data !== undefined){ this.offices = res.data.filter((item : any) => { diff --git a/src/app/app-modules/supervisor/activities/uploadexcel/uploadexcel.component.ts b/src/app/app-modules/supervisor/activities/uploadexcel/uploadexcel.component.ts index 8eca54e..a170784 100644 --- a/src/app/app-modules/supervisor/activities/uploadexcel/uploadexcel.component.ts +++ b/src/app/app-modules/supervisor/activities/uploadexcel/uploadexcel.component.ts @@ -30,6 +30,7 @@ import { saveAs } from 'file-saver'; import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import * as FileSaver from 'file-saver'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-uploadexcel', templateUrl: './uploadexcel.component.html', @@ -73,6 +74,7 @@ export class UploadexcelComponent implements OnInit { private http: HttpClient, private confirmationService: ConfirmationService, private fb: FormBuilder, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) { } @@ -106,9 +108,9 @@ export class UploadexcelComponent implements OnInit { this.fileTypeID =this.uploadForm.value.choice === "Mother" ? "Mother Data" : "Child Data"; const file: File = this.fileList[0]; const requestData = { - providerServiceMapID: sessionStorage.getItem('providerServiceMapID'), - userID: sessionStorage.getItem('userId'), - createdBy: sessionStorage.getItem("userName"), + providerServiceMapID: this.sessionstorage.getItem('providerServiceMapID'), + userID: this.sessionstorage.getItem('userID'), + createdBy: this.sessionstorage.getItem('userName'), fieldFor: this.fileTypeID, fileName: this.file !== undefined ? this.file.name : "", fileExtension: @@ -279,7 +281,7 @@ export class UploadexcelComponent implements OnInit { downloadTemplate(){ const reqObj = { fileTypeID : this.uploadForm.value.choice === "Mother" ? "Mother Data" : "Child Data", - providerServiceMapID:sessionStorage.getItem('providerServiceMapID'), + providerServiceMapID:this.sessionstorage.getItem('providerServiceMapID'), }; this.supervisorService.getDownloadData(reqObj).subscribe((res:any)=>{ if(res !== undefined && res !== null) @@ -330,9 +332,9 @@ export class UploadexcelComponent implements OnInit { this.fileTypeID =this.uploadTemplateForm.value.choice === "Mother" ? "Mother Data" : "Child Data"; const file: File = this.fileList[0]; const requestData = { - psmId: sessionStorage.getItem('providerServiceMapID'), - // userID: sessionStorage.getItem('userId'), - createdBy: sessionStorage.getItem("userName"), + psmId: this.sessionstorage.getItem('providerServiceMapID'), + // userID: this.sessionstorage.getItem('userID'), + createdBy: this.sessionstorage.getItem('userName'), fileType: this.fileTypeID, fileName: this.file !== undefined ? this.file.name : "", // fileExtension: this.file !== undefined ? "." + this.file.name.split(".")[1] : "", diff --git a/src/app/app-modules/supervisor/configurations/call-configurations/call-configuration/call-configuration.component.ts b/src/app/app-modules/supervisor/configurations/call-configurations/call-configuration/call-configuration.component.ts index aa9d309..55c1620 100644 --- a/src/app/app-modules/supervisor/configurations/call-configurations/call-configuration/call-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/call-configurations/call-configuration/call-configuration.component.ts @@ -33,6 +33,7 @@ import { CallSectionQuestionaireMappingComponent } from '../call-section-questio import { CreateCallConfigurationComponent } from '../create-call-configuration/create-call-configuration.component'; import { EditCallConfigurationComponent } from '../edit-call-configuration/edit-call-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -68,6 +69,7 @@ export class CallConfigurationComponent implements OnInit, DoCheck { private router: Router, private supervisorService: SupervisorService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private confirmationService: ConfirmationService ) { } @@ -116,7 +118,7 @@ export class CallConfigurationComponent implements OnInit, DoCheck { getCallConfigurations(){ this.callConfigList = []; - const reqObj = sessionStorage.getItem("providerServiceMapID"); + const reqObj = this.sessionstorage.getItem("providerServiceMapID"); this.supervisorService.getCallConfigurations(reqObj).subscribe((res: any) => { if(res && res.length > 0){ this.filterConfigData(res); @@ -194,9 +196,9 @@ export class CallConfigurationComponent implements OnInit, DoCheck { const dataArray = [...element.configurations].map(element => ({ ...element, deleted: true, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), })); const reqObj = dataArray; console.log("reqObj", reqObj) diff --git a/src/app/app-modules/supervisor/configurations/call-configurations/call-section-questionaire-mapping/call-section-questionaire-mapping.component.ts b/src/app/app-modules/supervisor/configurations/call-configurations/call-section-questionaire-mapping/call-section-questionaire-mapping.component.ts index 6f617ff..abcca0f 100644 --- a/src/app/app-modules/supervisor/configurations/call-configurations/call-section-questionaire-mapping/call-section-questionaire-mapping.component.ts +++ b/src/app/app-modules/supervisor/configurations/call-configurations/call-section-questionaire-mapping/call-section-questionaire-mapping.component.ts @@ -31,6 +31,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { CallConfigurationComponent } from '../call-configuration/call-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -66,6 +67,7 @@ export class CallSectionQuestionaireMappingComponent implements OnInit, AfterVie private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, private changeDetectorRefs: ChangeDetectorRef, + readonly sessionstorage:SessionStorageService, ) { } @@ -135,7 +137,7 @@ export class CallSectionQuestionaireMappingComponent implements OnInit, AfterVie getSectionMasters(){ this.sectionMasters = []; - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.supervisorService.getSectionConfigurations(psmId).subscribe((res: any) => { if(res && res.length > 0){ res.filter((item: any) => { @@ -159,7 +161,7 @@ export class CallSectionQuestionaireMappingComponent implements OnInit, AfterVie getAddedSections(){ let addedSectionsData = []; this.sectionMappedData = []; - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const callConfigId = this.callSectionQuestionaireMappingForm.controls.callConfigId.value; this.supervisorService.getMappedSections(psmId, callConfigId).subscribe((res: any) => { if(res){ @@ -293,16 +295,16 @@ export class CallSectionQuestionaireMappingComponent implements OnInit, AfterVie sectionRank: value.sectionRank, isChecked: value.isChecked, callConfigId: this.callSectionQuestionaireMappingForm.controls.callConfigId.value, - psmId: sessionStorage.getItem('providerServiceMapID'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: (value.isChecked === true) ? false : true, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: (value.id !== undefined && value.id !== null) ? sessionStorage.getItem('userName') : null, + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: (value.id !== undefined && value.id !== null) ? this.sessionstorage.getItem('userName') : null, })); const reqObj = { callConfigId: this.callSectionQuestionaireMappingForm.controls.callConfigId.value, outboundCallType: this.callSectionQuestionaireMappingForm.controls.callType.value, - psmId: sessionStorage.getItem('providerServiceMapID'), - createdBy: sessionStorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), sections: sections } console.log('reqObj for section mapping', reqObj) diff --git a/src/app/app-modules/supervisor/configurations/call-configurations/create-call-configuration/create-call-configuration.component.ts b/src/app/app-modules/supervisor/configurations/call-configurations/create-call-configuration/create-call-configuration.component.ts index cd60b87..47dabfa 100644 --- a/src/app/app-modules/supervisor/configurations/call-configurations/create-call-configuration/create-call-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/call-configurations/create-call-configuration/create-call-configuration.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { CallConfigurationComponent } from '../call-configuration/call-configuration.component'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -71,7 +72,7 @@ export class CreateCallConfigurationComponent implements OnInit, DoCheck, OnDest private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, - + readonly sessionstorage:SessionStorageService, ) { } createcallconfigurationform = this.fb.group({ @@ -191,8 +192,8 @@ export class CreateCallConfigurationComponent implements OnInit, DoCheck, OnDest configTerms: this.createcallconfigurationform.controls.configTerms.value, noOfAttempts: this.createcallconfigurationform.controls.noOfAttempts.value ? (this.createcallconfigurationform.controls.noOfAttempts.value) : 0, nextAttemptPeriod: this.createcallconfigurationform.controls.nextCallAttempt.value, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), })); const reqObj = dataArray; console.log("reqObj", reqObj) diff --git a/src/app/app-modules/supervisor/configurations/call-configurations/edit-call-configuration/edit-call-configuration.component.ts b/src/app/app-modules/supervisor/configurations/call-configurations/edit-call-configuration/edit-call-configuration.component.ts index 097dadf..10a4d5c 100644 --- a/src/app/app-modules/supervisor/configurations/call-configurations/edit-call-configuration/edit-call-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/call-configurations/edit-call-configuration/edit-call-configuration.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { CallConfigurationComponent } from '../call-configuration/call-configuration.component'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -67,6 +68,7 @@ export class EditCallConfigurationComponent implements OnInit, DoCheck { private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, private route: ActivatedRoute, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) { } @@ -395,9 +397,9 @@ export class EditCallConfigurationComponent implements OnInit, DoCheck { noOfAttempts: this.editcallconfigurationform.controls.noOfAttempts.value, nextAttemptPeriod: this.editcallconfigurationform.controls.nextCallAttempt.value, deleted: false, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), })); const reqObj = dataArray; console.log("reqObj", reqObj) diff --git a/src/app/app-modules/supervisor/configurations/dial-preference/dial-preference/dial-preference.component.ts b/src/app/app-modules/supervisor/configurations/dial-preference/dial-preference/dial-preference.component.ts index 7484efa..5730db2 100644 --- a/src/app/app-modules/supervisor/configurations/dial-preference/dial-preference/dial-preference.component.ts +++ b/src/app/app-modules/supervisor/configurations/dial-preference/dial-preference/dial-preference.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-dial-preference', @@ -83,6 +84,7 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { private fb: FormBuilder, private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) { } @@ -129,7 +131,7 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { } getAutoPreviewDialingData() { - const psmId= sessionStorage.getItem('providerServiceMapID'); + const psmId= this.sessionstorage.getItem('providerServiceMapID'); this.preferenceList.controls = []; this.preferDupList.controls = []; this.sectionsData.data = []; @@ -250,8 +252,8 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { userId: element.userId, isDialPreference: true, previewWindowTime: element.previewWindowTime, - createdBy: sessionStorage.getItem("userName"), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.supervisorService.saveDialPreference(reqObj).subscribe((res:any)=>{ console.log(res); @@ -288,8 +290,8 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { userId: element.userId, isDialPreference: false, previewWindowTime: null, - createdBy: sessionStorage.getItem("userName"), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.supervisorService.saveDialPreference(reqObj).subscribe((res:any)=>{ if(res && res !== null){ @@ -320,8 +322,7 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { item.value.previewWindowTime <= 60){ item.get('selected')?.enable(); } - if (item.value.previewWindowTime <= 0 || item.value.previewWindowTime > 60) { - item.value.previewWindowTime = null; + else { item.get('selected').disable(); let newIndexes: any; this.preferenceList.controls.forEach((sourceValue: any, index) => { @@ -333,7 +334,6 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { ) newIndexes = index; }); - this.preferenceList.controls[newIndexes].patchValue({ previewWindowTime: null }); item.value.selected = false; this.preferenceList.controls[newIndexes].patchValue({ selected: null, @@ -348,7 +348,6 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { ) newIndexes = index; }); - this.preferDupList.controls[newIndexes].patchValue({ previewWindowTime: null }); item.value.selected = false; this.preferDupList.controls[newIndexes].patchValue({ selected: null, @@ -356,7 +355,9 @@ export class DialPreferenceComponent implements OnInit, AfterViewInit, DoCheck { if ( item.value.previewWindowTime === null || item.value.previewWindowTime === undefined || - item.value.previewWindowTime === '' + item.value.previewWindowTime === '' || + item.value.previewWindowTime < 15 || + item.value.previewWindowTime > 60 ) { let newIndex: any; this.preferenceList.controls.forEach((sourceValue: any, index) => { diff --git a/src/app/app-modules/supervisor/configurations/question-Mapping/create-question-mapping/create-question-mapping.component.ts b/src/app/app-modules/supervisor/configurations/question-Mapping/create-question-mapping/create-question-mapping.component.ts index 9dc4934..e31bf06 100644 --- a/src/app/app-modules/supervisor/configurations/question-Mapping/create-question-mapping/create-question-mapping.component.ts +++ b/src/app/app-modules/supervisor/configurations/question-Mapping/create-question-mapping/create-question-mapping.component.ts @@ -5,6 +5,7 @@ import {Observable} from 'rxjs'; import {map, startWith} from 'rxjs/operators'; import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; import { MapQuestionaireConfigurationComponent } from '../map-questionaire-configuration/map-questionaire-configuration.component'; @Component({ selector: 'app-create-question-mapping', @@ -28,6 +29,7 @@ export class CreateQuestionMappingComponent implements OnInit, DoCheck { private fb: FormBuilder, private confirmationService: ConfirmationService, private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, ) { } createQuestionaireMappingForm = this.fb.group({ parentQuestion:[''], @@ -41,7 +43,7 @@ export class CreateQuestionMappingComponent implements OnInit, DoCheck { mappedId:any=[]; getQuestionnaires() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const alreadyMappedId:any=[]; if(this.mappedQuestionaireId.length>0){ for(let i=0;i0){ for(let i=0;i { @@ -186,10 +188,10 @@ export class MapQuestionaireConfigurationComponent implements OnInit, DoCheck, A parentQuestionId: element.parentQuestionId, answer:element.answer, childQuestionId: element.childQuestionId, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: status === 'activate' ? false : true, - modifiedBy: sessionStorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), } console.log("vaibhav",reqObj) diff --git a/src/app/app-modules/supervisor/configurations/questionnaire-config/create-questionnaire/create-questionnaire.component.ts b/src/app/app-modules/supervisor/configurations/questionnaire-config/create-questionnaire/create-questionnaire.component.ts index fce7f10..be17062 100644 --- a/src/app/app-modules/supervisor/configurations/questionnaire-config/create-questionnaire/create-questionnaire.component.ts +++ b/src/app/app-modules/supervisor/configurations/questionnaire-config/create-questionnaire/create-questionnaire.component.ts @@ -34,6 +34,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { QuestionnaireConfigurationComponent } from '../questionnaire-configuration/questionnaire-configuration.component'; import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 25-01-2023 @@ -80,6 +81,7 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -423,9 +425,9 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI "id": null, "options": value.trim(), "questionId": this.editQuestionnaireForm.controls['questionnaireId'].value, - "psmId": sessionStorage.getItem('providerServiceMapID'), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), "deleted": false, - "createdBy": sessionStorage.getItem("userName"), + "createdBy": this.sessionstorage.getItem('userName'), }; this.finalOptionList.push(optionObj); this.editQuestionnaireForm.markAsDirty(); @@ -473,8 +475,8 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI : null, questionnaireValues: this.enableOption === true ? this.finalOptionList : null, options: this.enableOption === true ? this.optionList : null, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID') + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID') }; const isDuplicate = this.checkDuplicateValues(questionnaireObj); @@ -563,8 +565,8 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI console.log(this.dataSource.data); // let reqObj: any = { // questionnaireDetail: this.dataSource.data, - // createdBy: sessionStorage.getItem('userName'), - // psmId: sessionStorage.getItem('providerServiceMapID'), + // createdBy: this.sessionstorage.getItem('userName'), + // psmId: this.sessionstorage.getItem('providerServiceMapID'), // }; this.supervisorService.saveQuestionnaire(this.dataSource.data).subscribe( (response: any) => { @@ -649,10 +651,10 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI "id": null, "options": optionVal, "questionId": editValue.questionnaireId, - "psmId": sessionStorage.getItem('providerServiceMapID'), + "psmId": this.sessionstorage.getItem('providerServiceMapID'), "deleted": false, - "createdBy": sessionStorage.getItem("userName"), - // "modifiedBy": sessionStorage.getItem("userName"), + "createdBy": this.sessionstorage.getItem('userName'), + // "modifiedBy": this.sessionstorage.getItem('userName'), }; optionReq.push(req); @@ -663,7 +665,7 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI if(this.optionList.length > 0 && !(this.optionList.includes(newQuestionOptionValue.options))) { newQuestionOptionValue.deleted = true; - newQuestionOptionValue.modifiedBy = sessionStorage.getItem("userName"); + newQuestionOptionValue.modifiedBy = this.sessionstorage.getItem('userName'); optionReq.push(newQuestionOptionValue); } @@ -673,7 +675,7 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI this.selectedQuestionnaireList.questionnaireValues.filter((newQuestionOptionValue:any) => { newQuestionOptionValue.deleted = true; - newQuestionOptionValue.modifiedBy = sessionStorage.getItem("userName"); + newQuestionOptionValue.modifiedBy = this.sessionstorage.getItem('userName'); optionReq.push(newQuestionOptionValue); }); @@ -695,9 +697,9 @@ export class CreateQuestionnaireComponent implements OnInit, DoCheck, AfterViewI answerType: editValue.answerType, questionnaireValues: optionReq, deleted: false, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; const isDuplicateFromMainList = diff --git a/src/app/app-modules/supervisor/configurations/questionnaire-config/questionnaire-configuration/questionnaire-configuration.component.ts b/src/app/app-modules/supervisor/configurations/questionnaire-config/questionnaire-configuration/questionnaire-configuration.component.ts index 61db98e..c1f3f39 100644 --- a/src/app/app-modules/supervisor/configurations/questionnaire-config/questionnaire-configuration/questionnaire-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/questionnaire-config/questionnaire-configuration/questionnaire-configuration.component.ts @@ -31,6 +31,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { CreateQuestionnaireComponent } from '../create-questionnaire/create-questionnaire.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 25-01-2023 @@ -65,6 +66,7 @@ export class QuestionnaireConfigurationComponent implements OnInit, DoCheck, Aft private router: Router, private confirmationService: ConfirmationService, private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, private loginService: LoginserviceService ) {} @@ -92,7 +94,7 @@ export class QuestionnaireConfigurationComponent implements OnInit, DoCheck, Aft getSectionQuestionnairesMapDetails() { - const providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); this.supervisorService .getSectionQuestionnaireMap(providerServiceMapID) .subscribe( @@ -118,7 +120,7 @@ export class QuestionnaireConfigurationComponent implements OnInit, DoCheck, Aft */ getQuestionnaires() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.supervisorService.getQuestionnaires(psmId).subscribe( (response: any) => { @@ -223,9 +225,9 @@ export class QuestionnaireConfigurationComponent implements OnInit, DoCheck, Aft answerType: tableValue.answerType, questionnaireValues: tableValue.questionnaireValues, deleted: type === 'activate' ? 'false' : 'true', - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID') + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID') }; this.supervisorService.updateQuestionnaire(reqObj).subscribe( diff --git a/src/app/app-modules/supervisor/configurations/section-configurations/create-section-configuration/create-section-configuration.component.ts b/src/app/app-modules/supervisor/configurations/section-configurations/create-section-configuration/create-section-configuration.component.ts index 572ae7e..b1b9dbf 100644 --- a/src/app/app-modules/supervisor/configurations/section-configurations/create-section-configuration/create-section-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-configurations/create-section-configuration/create-section-configuration.component.ts @@ -30,6 +30,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { SectionConfigurationComponent } from '../section-configuration/section-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -54,6 +55,7 @@ export class CreateSectionConfigurationComponent implements OnInit, AfterViewIni private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, ) { } sectionconfigurationform = this.fb.group({ @@ -131,8 +133,8 @@ export class CreateSectionConfigurationComponent implements OnInit, AfterViewIni createSectionConfiguration(){ const dataArray = [...this.addSection.data].map(element => ({ ...element, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID') + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID') })); const reqObj = dataArray; console.log('reqObj', reqObj); diff --git a/src/app/app-modules/supervisor/configurations/section-configurations/edit-section-configuration/edit-section-configuration.component.ts b/src/app/app-modules/supervisor/configurations/section-configurations/edit-section-configuration/edit-section-configuration.component.ts index 08396d8..fc4a23f 100644 --- a/src/app/app-modules/supervisor/configurations/section-configurations/edit-section-configuration/edit-section-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-configurations/edit-section-configuration/edit-section-configuration.component.ts @@ -26,6 +26,7 @@ import { FormBuilder, Validators, FormControl } from '@angular/forms'; import { ConfirmationService } from 'src/app/app-modules/services/confirmation/confirmation.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; import { SectionConfigurationComponent } from '../section-configuration/section-configuration.component'; /** @@ -49,6 +50,7 @@ export class EditSectionConfigurationComponent implements OnInit, DoCheck { private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, ) { } editsectionconfigurationform = this.fb.group({ @@ -111,9 +113,9 @@ export class EditSectionConfigurationComponent implements OnInit, DoCheck { sectionId: this.editsectionconfigurationform.controls.sectionId.value, sectionName: this.editsectionconfigurationform.controls.sectionName.value, sectionDesc: this.editsectionconfigurationform.controls.sectionDescription.value, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), - modifiedBy: sessionStorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), + modifiedBy: this.sessionstorage.getItem('userName'), deleted: false } this.supervisorService.updateSectionConfiguration(reqObj).subscribe((res: any) => { diff --git a/src/app/app-modules/supervisor/configurations/section-configurations/section-configuration/section-configuration.component.ts b/src/app/app-modules/supervisor/configurations/section-configurations/section-configuration/section-configuration.component.ts index a34ccc6..855506d 100644 --- a/src/app/app-modules/supervisor/configurations/section-configurations/section-configuration/section-configuration.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-configurations/section-configuration/section-configuration.component.ts @@ -30,6 +30,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { CreateSectionConfigurationComponent } from '../create-section-configuration/create-section-configuration.component'; import { EditSectionConfigurationComponent } from '../edit-section-configuration/edit-section-configuration.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * KA40094929 @@ -63,6 +64,7 @@ export class SectionConfigurationComponent implements OnInit, DoCheck, AfterView private supervisorService: SupervisorService, private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, ) { } @@ -84,7 +86,7 @@ export class SectionConfigurationComponent implements OnInit, DoCheck, AfterView } getSectionConfigurations(){ - const reqObj = sessionStorage.getItem('providerServiceMapID'); + const reqObj = this.sessionstorage.getItem('providerServiceMapID'); this.supervisorService.getSectionConfigurations(reqObj).subscribe((res: any) => { if(res && res.length > 0){ this.sectionList = res; @@ -134,8 +136,8 @@ export class SectionConfigurationComponent implements OnInit, DoCheck, AfterView sectionId: element.sectionId, sectionName: element.sectionName, sectionDesc: element.sectionDesc, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), deleted: status === 'activate' ? false : true } this.supervisorService.updateSectionConfiguration(reqObj).subscribe((res: any) => { @@ -162,7 +164,7 @@ export class SectionConfigurationComponent implements OnInit, DoCheck, AfterView getMappedSections(){ this.mappedSectionsData = []; - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); const callConfigId = 0; this.supervisorService.getMappedSections(psmId, callConfigId).subscribe((res: any) => { if(res && res.length > 0 ){ diff --git a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/create-section-questionnaire-mapping/create-section-questionnaire-mapping.component.ts b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/create-section-questionnaire-mapping/create-section-questionnaire-mapping.component.ts index 8f12419..93ea8ca 100644 --- a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/create-section-questionnaire-mapping/create-section-questionnaire-mapping.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/create-section-questionnaire-mapping/create-section-questionnaire-mapping.component.ts @@ -32,6 +32,7 @@ import { SetLanguageService } from 'src/app/app-modules/services/set-language/se import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; import { SectionQuestionnaireMappingComponent } from '../section-questionnaire-mapping/section-questionnaire-mapping.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 02-02-2023 @@ -94,6 +95,7 @@ export class CreateSectionQuestionnaireMappingComponent implements OnInit, DoChe private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, private fb: FormBuilder, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -161,7 +163,7 @@ export class CreateSectionQuestionnaireMappingComponent implements OnInit, DoChe getSectionMaster() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getSectionMaster(psmId).subscribe( (response: any) => { @@ -185,7 +187,7 @@ export class CreateSectionQuestionnaireMappingComponent implements OnInit, DoChe * @param sectionId */ getUnMappedQuestionnaireMaster(sectionId: any) { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.questionnaireList.controls = []; this.quesDupList.controls = []; this.dataSource.data.filter((quesValues: any) => { @@ -567,8 +569,8 @@ export class CreateSectionQuestionnaireMappingComponent implements OnInit, DoChe questionIds: this.selectedQuestionnaires, sectionId: this.sectionQuestionnaireMapForm.controls['sectionid'].value, // sectionName:this.sectionQuestionnaireMapForm.controls['sectionName'].value, - createdBy: sessionStorage.getItem('userName'), - psmId: sessionStorage.getItem('providerServiceMapID'), + createdBy: this.sessionstorage.getItem('userName'), + psmId: this.sessionstorage.getItem('providerServiceMapID'), }; this.supervisorService.saveQuestionnaireSectionMapping(reqObj).subscribe( @@ -648,7 +650,7 @@ export class CreateSectionQuestionnaireMappingComponent implements OnInit, DoChe } getRolesForQuestionare(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ res.filter((role: any) => { diff --git a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/edit-section-questionnaire-mapping/edit-section-questionnaire-mapping.component.ts b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/edit-section-questionnaire-mapping/edit-section-questionnaire-mapping.component.ts index a7cb777..bc83a99 100644 --- a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/edit-section-questionnaire-mapping/edit-section-questionnaire-mapping.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/edit-section-questionnaire-mapping/edit-section-questionnaire-mapping.component.ts @@ -27,6 +27,7 @@ import { ConfirmationService } from 'src/app/app-modules/services/confirmation/c import { MasterService } from 'src/app/app-modules/services/masterService/master.service'; import { SetLanguageService } from 'src/app/app-modules/services/set-language/set-language.service'; import { SupervisorService } from 'src/app/app-modules/services/supervisor/supervisor.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; import { SectionQuestionnaireMappingComponent } from '../section-questionnaire-mapping/section-questionnaire-mapping.component'; /** * DE40034072 @@ -50,6 +51,7 @@ export class EditSectionQuestionnaireMappingComponent implements OnInit, DoCheck private confirmationService: ConfirmationService, private setLanguageService: SetLanguageService, private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, private masterService: MasterService ) {} @@ -178,10 +180,10 @@ export class EditSectionQuestionnaireMappingComponent implements OnInit, DoCheck // ].value, rank: editValue.sectionQuestionRank, roles: editValue.roleType, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), deleted: false, - psmId: sessionStorage.getItem('providerServiceMapID') + psmId: this.sessionstorage.getItem('providerServiceMapID') }; console.log('reole',this.editQuestionnaireSectionMappingForm.controls.roleType.value); const isDuplicateFromMainList = @@ -245,7 +247,7 @@ export class EditSectionQuestionnaireMappingComponent implements OnInit, DoCheck return isDuplicate; } getRolesForQuestionare(){ - const providerServiceMapId = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(providerServiceMapId).subscribe((res:any)=>{ if(res){ res.filter((role: any) => { diff --git a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/section-questionnaire-mapping/section-questionnaire-mapping.component.ts b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/section-questionnaire-mapping/section-questionnaire-mapping.component.ts index d7f84c6..f8e3298 100644 --- a/src/app/app-modules/supervisor/configurations/section-questionnaire-map/section-questionnaire-mapping/section-questionnaire-mapping.component.ts +++ b/src/app/app-modules/supervisor/configurations/section-questionnaire-map/section-questionnaire-mapping/section-questionnaire-mapping.component.ts @@ -30,6 +30,7 @@ import { SupervisorService } from 'src/app/app-modules/services/supervisor/super import { CreateSectionQuestionnaireMappingComponent } from '../create-section-questionnaire-mapping/create-section-questionnaire-mapping.component'; import { EditSectionQuestionnaireMappingComponent } from '../edit-section-questionnaire-mapping/edit-section-questionnaire-mapping.component'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; /** * DE40034072 * 02-02-2023 @@ -59,6 +60,7 @@ export class SectionQuestionnaireMappingComponent implements OnInit, DoCheck, Af constructor( private setLanguageService: SetLanguageService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) {} @@ -89,7 +91,7 @@ export class SectionQuestionnaireMappingComponent implements OnInit, DoCheck, Af getSectionQuestionnairesMapDetails() { let quesData: any = null; - const providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); this.supervisorService .getSectionQuestionnaireMap(providerServiceMapID) .subscribe( @@ -176,7 +178,7 @@ export class SectionQuestionnaireMappingComponent implements OnInit, DoCheck, Af console.log(response); if (response) { tableValue.deleted = type === 'activate' ? false : true; - tableValue.modifiedBy= sessionStorage.getItem('userName') + tableValue.modifiedBy= this.sessionstorage.getItem('userName') const reqObj: any = { id: tableValue.id, questionId: tableValue.questionid, @@ -184,10 +186,10 @@ export class SectionQuestionnaireMappingComponent implements OnInit, DoCheck, Af // sectionName: tableValue.sectionName, rank: tableValue.sectionQuestionRank, role: tableValue.role, - createdBy: sessionStorage.getItem('userName'), - modifiedBy: sessionStorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), + modifiedBy: this.sessionstorage.getItem('userName'), deleted: type === 'activate' ? false : true, - psmId: sessionStorage.getItem('providerServiceMapID') + psmId: this.sessionstorage.getItem('providerServiceMapID') }; diff --git a/src/app/app-modules/supervisor/configurations/sms-template/sms-template/sms-template.component.ts b/src/app/app-modules/supervisor/configurations/sms-template/sms-template/sms-template.component.ts index a3454ef..cc9782e 100644 --- a/src/app/app-modules/supervisor/configurations/sms-template/sms-template/sms-template.component.ts +++ b/src/app/app-modules/supervisor/configurations/sms-template/sms-template/sms-template.component.ts @@ -31,6 +31,7 @@ import { SmsTemplateService } from 'src/app/app-modules/services/smsTemplate/sms import { LoginserviceService } from 'src/app/app-modules/services/loginservice/loginservice.service'; import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/material/legacy-table'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-sms-template', @@ -87,11 +88,12 @@ export class SmsTemplateComponent implements OnInit, DoCheck, AfterViewInit { private loginService: LoginserviceService, private fb: FormBuilder, private supervisorService: SupervisorService, + readonly sessionstorage:SessionStorageService, ) {} ngOnInit() { this.getSelectedLanguage(); - this.providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + this.providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); this.serviceID = this.loginService.currentServiceId; this.getSMStemplates(); this.getSMSparameters(); @@ -151,7 +153,7 @@ export class SmsTemplateComponent implements OnInit, DoCheck, AfterViewInit { } getSMStemplates() { - const providerServiceMapID = sessionStorage.getItem('providerServiceMapID'); + const providerServiceMapID = this.sessionstorage.getItem('providerServiceMapID'); this.smsTemplateService.getSMSTemplates(providerServiceMapID).subscribe( (response: any) => { if (response !== undefined && response.data !== undefined && response.data.length >= 0) { @@ -232,7 +234,7 @@ export class SmsTemplateComponent implements OnInit, DoCheck, AfterViewInit { ActivateDeactivate(object: { deleted: any; modifiedBy: any; }, flag: any) { object.deleted = flag; - object.modifiedBy = sessionStorage.getItem('userName'), + object.modifiedBy = this.sessionstorage.getItem('userName'), this.smsTemplateService.updateSMStemplate(object).subscribe( (response) => { if (response) { @@ -349,8 +351,8 @@ export class SmsTemplateComponent implements OnInit, DoCheck, AfterViewInit { add(form_values: any) { if (form_values !== undefined && form_values !== null) { const reqObj:any = { - 'createdBy': sessionStorage.getItem('userName'), - 'modifiedBy': sessionStorage.getItem('userName'), + 'createdBy': this.sessionstorage.getItem('userName'), + 'modifiedBy': this.sessionstorage.getItem('userName'), 'smsParameterName': form_values.parameter, 'smsParameterType': form_values.parameterValue.smsParameterType, 'smsParameterID': form_values.parameterValue.smsParameterID, @@ -411,7 +413,7 @@ export class SmsTemplateComponent implements OnInit, DoCheck, AfterViewInit { saveSMStemplate(form_values: any) { const requestObject = { - createdBy: sessionStorage.getItem('userName'), + createdBy: this.sessionstorage.getItem('userName'), providerServiceMapID: this.providerServiceMapID, smsParameterMaps: this.smsParameterMaps, smsTemplate: (form_values.smsTemplate !== undefined && form_values.smsTemplate !== null) ? form_values.smsTemplate.trim() : null , diff --git a/src/app/app-modules/supervisor/supervisor-reports/supervisor-reports/supervisor-reports.component.ts b/src/app/app-modules/supervisor/supervisor-reports/supervisor-reports/supervisor-reports.component.ts index 35856f0..6a10002 100644 --- a/src/app/app-modules/supervisor/supervisor-reports/supervisor-reports/supervisor-reports.component.ts +++ b/src/app/app-modules/supervisor/supervisor-reports/supervisor-reports/supervisor-reports.component.ts @@ -33,6 +33,7 @@ import { MatLegacyTableDataSource as MatTableDataSource } from '@angular/materia import * as moment from 'moment'; import { saveAs } from 'file-saver'; import { MatPaginator } from '@angular/material/paginator'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-supervisor-reports', @@ -62,6 +63,7 @@ export class SupervisorReportsComponent implements OnInit, DoCheck, AfterViewIni private fb: FormBuilder, private masterService: MasterService, private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, private supervisorService: SupervisorService ) { } reportForm = this.fb.group({ @@ -147,7 +149,7 @@ export class SupervisorReportsComponent implements OnInit, DoCheck, AfterViewIni this.currentLanguageSet = this.setLanguageService.languageData; } getRoles() { - const psmId = sessionStorage.getItem('providerServiceMapID'); + const psmId = this.sessionstorage.getItem('providerServiceMapID'); this.masterService.getRoleMaster(psmId).subscribe( (response: any) => { if (response) { @@ -222,7 +224,7 @@ export class SupervisorReportsComponent implements OnInit, DoCheck, AfterViewIni role:formData.roleName, agentId:(formData.agentId !== undefined) ? formData.agentId : null, fileName:report.value, - psmId:sessionStorage.getItem('providerServiceMapID'), + psmId:this.sessionstorage.getItem('providerServiceMapID'), }; console.log(reqObj); if(report.value==="cumulative_report"){ diff --git a/src/app/app-modules/user-login/captcha/captcha.component.html b/src/app/app-modules/user-login/captcha/captcha.component.html new file mode 100644 index 0000000..bb19a91 --- /dev/null +++ b/src/app/app-modules/user-login/captcha/captcha.component.html @@ -0,0 +1 @@ +
    \ No newline at end of file diff --git a/src/app/app-modules/user-login/captcha/captcha.component.ts b/src/app/app-modules/user-login/captcha/captcha.component.ts new file mode 100644 index 0000000..4c05445 --- /dev/null +++ b/src/app/app-modules/user-login/captcha/captcha.component.ts @@ -0,0 +1,63 @@ +import { + Component, + ElementRef, + AfterViewInit, + Output, + EventEmitter, + Inject, + OnDestroy, + ViewChild, +} from '@angular/core'; +import { CaptchaService } from '../../services/captcha-service/captcha.service'; +import { environment } from 'src/environments/environment'; + +declare const turnstile: any; + +@Component({ + selector: 'app-captcha', + templateUrl: './captcha.component.html', +}) +export class CaptchaComponent implements AfterViewInit, OnDestroy { + @Output() tokenResolved = new EventEmitter(); + @ViewChild('captchaContainer') captchaRef!: ElementRef; + private widgetId: string | null = null; + + constructor( + private el: ElementRef, + private captchaService: CaptchaService + ) {} + + async ngAfterViewInit() { + try { + await this.captchaService.loadScript(); + + const captchaElement = this.captchaRef?.nativeElement; + if (!captchaElement) { + console.error('CAPTCHA container element not found'); + return; + } + + if (!this.widgetId) { + this.widgetId = turnstile.render(captchaElement, { + sitekey: environment.siteKey, + theme: 'light', + callback: (token: string) => this.tokenResolved.emit(token), + }); + } + } catch (error) { + console.error('Failed to initialize CAPTCHA:', error); + } + } + + public reset() { + if (this.widgetId && typeof turnstile !== 'undefined') { + turnstile.reset(this.widgetId); + } + } + + ngOnDestroy() { + if (this.widgetId && typeof turnstile !== 'undefined' && turnstile.remove) { + turnstile.remove(this.widgetId); + } + } +} \ No newline at end of file diff --git a/src/app/app-modules/user-login/login/login.component.css b/src/app/app-modules/user-login/login/login.component.css index 7ae059b..d97ebf8 100644 --- a/src/app/app-modules/user-login/login/login.component.css +++ b/src/app/app-modules/user-login/login/login.component.css @@ -94,6 +94,30 @@ position: relative; padding: 5px !important; } */ +.loginCard { + height: auto; +} + +/* .sr-only is a visually hidden class but useful for screen readers */ +.sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; + white-space: nowrap; +} + +.disabledLoginButton { + background-color: #ccc !important; + color: #666 !important; + cursor: not-allowed; + box-shadow: none !important; +} + diff --git a/src/app/app-modules/user-login/login/login.component.html b/src/app/app-modules/user-login/login/login.component.html index 7e00710..7c9f873 100644 --- a/src/app/app-modules/user-login/login/login.component.html +++ b/src/app/app-modules/user-login/login/login.component.html @@ -6,7 +6,7 @@
    - +

    @@ -76,19 +76,17 @@ {{ currentLanguageSet?.forgotPassword }}

    + +
    + + +
    + +
    + +
    +
    +
    - -
    +
    + - + \ No newline at end of file diff --git a/src/app/app-modules/user-login/set-security-questions/set-security-questions.component.ts b/src/app/app-modules/user-login/set-security-questions/set-security-questions.component.ts index 952b00b..f2b897d 100644 --- a/src/app/app-modules/user-login/set-security-questions/set-security-questions.component.ts +++ b/src/app/app-modules/user-login/set-security-questions/set-security-questions.component.ts @@ -26,6 +26,7 @@ import { FormBuilder, Validators } from '@angular/forms'; import { Router } from '@angular/router'; import { ConfirmationService } from '../../services/confirmation/confirmation.service'; import { LoginserviceService } from '../../services/loginservice/loginservice.service'; +import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ selector: 'app-set-security-questions', @@ -51,14 +52,20 @@ export class SetSecurityQuestionsComponent implements OnInit { - constructor(public loginService: LoginserviceService, private router : Router,private fb: FormBuilder,private confirmationService: ConfirmationService,) { } + constructor( + public loginService: LoginserviceService, + private router : Router, + private fb: FormBuilder, + private confirmationService: ConfirmationService, + readonly sessionstorage:SessionStorageService, + ) { } ngOnInit(): void { this.getSecurityQuestions(); this.filteredQuestions = this.questions; this.filteredQuestions2 = this.questions; this.filteredQuestions3 = this.questions; - this.uname = sessionStorage.getItem("userName"); + this.uname = this.sessionstorage.getItem('userName'); } getSecurityQuestions(){ @@ -103,21 +110,21 @@ questionForm = this.fb.group({ setSecurityQuestions(){ this.dataArray = [ { - 'userID': sessionStorage.getItem('userId'), + 'userID': sessionStorage.getItem('userID'), 'questionID': this.questionForm.controls.question1.value, 'answers': ((this.questionForm.controls.answer1.value !== null && this.questionForm.controls.answer1.value !== undefined) ? this.questionForm.controls.answer1.value.trim() : ''), 'mobileNumber': '1234567890', 'createdBy': this.uname }, { - 'userID': sessionStorage.getItem('userId'), + 'userID': sessionStorage.getItem('userID'), 'questionID': this.questionForm.controls.question2.value, 'answers': ((this.questionForm.controls.answer2.value !== null && this.questionForm.controls.answer2.value !== undefined) ? this.questionForm.controls.answer2.value.trim() : ''), 'mobileNumber': '1234567890', 'createdBy': this.uname }, { - 'userID': sessionStorage.getItem('userId'), + 'userID': sessionStorage.getItem('userID'), 'questionID': this.questionForm.controls.question3.value, 'answers': ((this.questionForm.controls.answer3.value !== null && this.questionForm.controls.answer3.value !== undefined) ? this.questionForm.controls.answer3.value.trim() : ''), 'mobileNumber': '1234567890', @@ -129,7 +136,7 @@ setSecurityQuestions(){ updatePassword(){ this.loginService.saveSecurityQuesAns(this.dataArray).subscribe((res:any)=>{ - if(res.statuscode === 200){ + if(res.statusCode === 200){ if(res.data !== undefined && res.data !== null){ this.loginService.transactionId = res.data.transactionId; this.router.navigate(['/set-password']); diff --git a/src/app/app-modules/user-login/user-login.module.ts b/src/app/app-modules/user-login/user-login.module.ts index 78a352f..0149e9e 100644 --- a/src/app/app-modules/user-login/user-login.module.ts +++ b/src/app/app-modules/user-login/user-login.module.ts @@ -30,9 +30,10 @@ import { RoleSelectionComponent } from './role-selection/role-selection.componen import { ForgotPasswordComponent } from './forgot-password/forgot-password.component'; import { SetPasswordComponent } from './set-password/set-password.component'; import { SetSecurityQuestionsComponent } from './set-security-questions/set-security-questions.component'; +import { CaptchaComponent } from './captcha/captcha.component'; @NgModule({ - declarations: [LoginComponent, RoleSelectionComponent, ForgotPasswordComponent, SetPasswordComponent, SetSecurityQuestionsComponent], + declarations: [LoginComponent, RoleSelectionComponent, ForgotPasswordComponent, SetPasswordComponent, SetSecurityQuestionsComponent,CaptchaComponent], imports: [CommonModule, FormsModule, ReactiveFormsModule, MaterialModule], exports: [LoginComponent], }) diff --git a/src/assets/English.json b/src/assets/English.json index 83f9763..a59cd7c 100644 --- a/src/assets/English.json +++ b/src/assets/English.json @@ -460,5 +460,12 @@ "reasonForNoFurtherCalls":"Reason For No FurtherCalls", "nextAttemptDate":"Next Attempt Date", "childID":"Child ID", - "isFatalQues": "Fatal Questionnaire" + "isFatalQues": "Fatal Questionnaire", + "stickyAgentRecords" : "Sticky Agent Records", + "close" : "close", + "openAsPdf" : "Open As PDF", + "viewCasesheet" : "View Case Sheet", + "isCallWrongNumber": "Is Wrong Number", + "preferredLanguage" : "Preferred Language", + "enterCorrectPhoneNumber": "Enter Correct Phone Number" } diff --git a/src/assets/Hindi.json b/src/assets/Hindi.json index 384abfa..bd2e230 100644 --- a/src/assets/Hindi.json +++ b/src/assets/Hindi.json @@ -457,5 +457,12 @@ "reasonForNoFurtherCalls":"Reason For No FurtherCalls", "nextAttemptDate":"Next Attempt Date", "childID":"Child ID", - "isFatalQues": "Fatal Questionnaire" + "isFatalQues": "Fatal Questionnaire", + "stickyAgentRecords" : "Sticky Agent Records", + "close" : "close", + "openAsPdf" : "Open As PDF", + "viewCasesheet" : "View Case Sheet", + "isCallWrongNumber": "Is Wrong Number", + "preferredLanguage" : "Preferred Language", + "enterCorrectPhoneNumber": "Enter Correct Phone Number" } \ No newline at end of file diff --git a/src/environments/environment.ci.ts.template b/src/environments/environment.ci.ts.template index 2b25414..2748ad6 100644 --- a/src/environments/environment.ci.ts.template +++ b/src/environments/environment.ci.ts.template @@ -24,9 +24,15 @@ const COMMON_API = '<%= COMMON_API_BASE %>'; const ADMIN_API = '<%= ADMIN_API_BASE %>'; const ECD_API = '<%= ECD_API_BASE %>'; const biologicalScreeningDeviceAPI = `${ADMIN_API}diagnostics/biologicalScreeningDevice`; +const sessionStorageEncKey = '<%= SESSION_STORAGE_ENC_KEY %>'; +const TELEPHONY_SERVER = '<%= TELEPHONY_SERVER %>'; +const siteKey = '<%= SITE_KEY %>'; +const captchaChallengeURL = '<%= CAPTCHA_CHALLENGE_URL %>'; +const enableCaptcha = <%= ENABLE_CAPTCHA %>; export const environment = { production: true, + encKey: sessionStorageEncKey, ioturl: `${biologicalScreeningDeviceAPI}`, extendSessionUrl: `${ECD_API}common/extend/redisSession`, language: 'English', @@ -49,6 +55,7 @@ export const environment = { createCallConfigurationUrl: `${ECD_API}callConfiguration/create`, updateCallConfigurationUrl: `${ECD_API}callConfiguration/update`, getUnallocatedCallsUrl: `${ECD_API}callAllocation/getEligibleRecordsInfo`, + getLowRiskRecordsByLanguageUrl: `${ECD_API}callAllocation/getEligibleRecordsLanguageInfo`, getAllocateCallsUrl: `${ECD_API}callAllocation/allocateCalls`, deleteReallocationUrl: `${ECD_API}callAllocation/moveToBin`, getAllocatedCountUrl: `${ECD_API}callAllocation/getAllocatedCallCountUser`, @@ -152,6 +159,7 @@ export const environment = { getMappedCycleURL:`${ECD_API}sampleSelectionConfiguration/getByPSMId`, updateCycleConfigurationURL:`${ECD_API}sampleSelectionConfiguration/update`, getAgentMastersUrl:`${ECD_API}master/getAgentsByRoleId`, + getAgentMasterByRoleIdAndLanguageUrl:`${ECD_API}master/getAgentsByRoleIdAndPreferredLanguage`, getCaseSheetDataURL:`${ECD_API}qualityAudit/getBeneficiaryCasesheet`, /** Associate-anm-mo Urls */ getAgentAuditScoreUrl: `${ECD_API}autoPreviewDialing/getRatingsByUserIdAndPsmId`, @@ -179,7 +187,7 @@ export const environment = { getBeneficiaryCallHistoryUrl:`${ECD_API}callHistory/getBeneficiaryCallHistory`, getCallHistoryDetailsUrl:`${ECD_API}callHistory/getBeneficiaryCallDetails`, /**CTI Urls */ - ctiUrl: `http://192.168.45.55/`, + ctiUrl: TELEPHONY_SERVER, ctiEventUrl: `bar/cti_handler.php?e=`, getLoginKeyUrl:`${COMMON_API}cti/getLoginKey`, getAgentsDataUrl: `${ECD_API}master/getAgentsByRoleId`, @@ -244,4 +252,10 @@ downloadBabyDeathReportURL:`${ECD_API}ecdReportController/getECDBabyDeathReport` downloadNotConnectedReportURL:`${ECD_API}ecdReportController/getECDNotConnectedPhonelistDiffformatReport`, downloadJsyReportURL: `${ECD_API}ecdReportController/getECDJSYRelatedComplaintsReport`, downloadMiscarriageReportURL:`${ECD_API}ecdReportController/getECDMiscarriageReport`, +generateVideoLinkURL :`${COMMON_API}video-consultation/generate-link`, +sendSMSAPI: `${COMMON_API}video-consultation/send-link`, +updateCallStatusAPI: `${COMMON_API}video-consultation/update-call-status`, +siteKey: siteKey, +captchaChallengeURL: captchaChallengeURL, +enableCaptcha: enableCaptcha }; \ No newline at end of file diff --git a/src/environments/environment.ts b/src/environments/environment.local.ts similarity index 94% rename from src/environments/environment.ts rename to src/environments/environment.local.ts index df847c6..e2b60bb 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.local.ts @@ -24,16 +24,23 @@ // This file can be replaced during build by using the `fileReplacements` array. // `ng build` replaces `environment.ts` with `environment.prod.ts`. // The list of file replacements can be found in `angular.json`. -const ecdIP = 'http://amritwprdev.piramalswasthya.org:8080/'; -const commonIP = 'http://amritwprdev.piramalswasthya.org:8080/'; -const adminIP = 'http://amritwprdev.piramalswasthya.org:8080/'; + +const ecdIP = 'https://amritwprdev.piramalswasthya.org/'; +const commonIP = 'https://amritwprdev.piramalswasthya.org/'; +const adminIP = 'https://amritwprdev.piramalswasthya.org/'; const COMMON_API = `${commonIP}commonapi-ecd/`; +const COMMON_API1 = `https://commonurl.loca.lt/`; const ADMIN_API = `${adminIP}adminapi-v1.0/`; const ECD_API = `${ecdIP}ecdapi-v1.0/`; const biologicalScreeningDeviceAPI = `${ADMIN_API}diagnostics/biologicalScreeningDevice`; +const sessionStorageEncKey = ''; +const siteKey = ''; +const captchaChallengeURL = ''; +const enableCaptcha = false; export const environment = { production: false, + encKey: sessionStorageEncKey, ioturl: `${biologicalScreeningDeviceAPI}`, extendSessionUrl: `${ECD_API}common/extend/redisSession`, language: 'English', @@ -56,6 +63,7 @@ export const environment = { createCallConfigurationUrl: `${ECD_API}callConfiguration/create`, updateCallConfigurationUrl: `${ECD_API}callConfiguration/update`, getUnallocatedCallsUrl: `${ECD_API}callAllocation/getEligibleRecordsInfo`, + getLowRiskRecordsByLanguageUrl: `${ECD_API}callAllocation/getEligibleRecordsLanguageInfo`, getAllocateCallsUrl: `${ECD_API}callAllocation/allocateCalls`, deleteReallocationUrl: `${ECD_API}callAllocation/moveToBin`, getAllocatedCountUrl: `${ECD_API}callAllocation/getAllocatedCallCountUser`, @@ -159,6 +167,7 @@ export const environment = { getMappedCycleURL:`${ECD_API}sampleSelectionConfiguration/getByPSMId`, updateCycleConfigurationURL:`${ECD_API}sampleSelectionConfiguration/update`, getAgentMastersUrl:`${ECD_API}master/getAgentsByRoleId`, + getAgentMasterByRoleIdAndLanguageUrl:`${ECD_API}master/getAgentsByRoleIdAndPreferredLanguage`, getCaseSheetDataURL:`${ECD_API}qualityAudit/getBeneficiaryCasesheet`, /** Associate-anm-mo Urls */ getAgentAuditScoreUrl: `${ECD_API}autoPreviewDialing/getRatingsByUserIdAndPsmId`, @@ -251,6 +260,16 @@ downloadBabyDeathReportURL:`${ECD_API}ecdReportController/getECDBabyDeathReport` downloadNotConnectedReportURL:`${ECD_API}ecdReportController/getECDNotConnectedPhonelistDiffformatReport`, downloadJsyReportURL: `${ECD_API}ecdReportController/getECDJSYRelatedComplaintsReport`, downloadMiscarriageReportURL:`${ECD_API}ecdReportController/getECDMiscarriageReport`, + +//video call +generateVideoLinkURL :`${COMMON_API1}video-consultation/generate-link`, +sendSMSAPI: `${COMMON_API1}video-consultation/send-link`, +updateCallStatusAPI: `${COMMON_API1}video-consultation/update-call-status`, + +siteKey: siteKey, +captchaChallengeURL: captchaChallengeURL, +enableCaptcha: enableCaptcha + }; diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 77007a9..95df140 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -21,16 +21,21 @@ */ -const ecdIP = 'http://183.82.107.186:8080/'; -const commonIP = 'http://183.82.107.186:8080/'; -const adminIP = 'http://183.82.107.186:8080/'; +const ecdIP = 'https://amritwprdev.piramalswasthya.org/'; +const commonIP = 'https://amritwprdev.piramalswasthya.org/'; +const adminIP = 'https://amritwprdev.piramalswasthya.org/'; const COMMON_API = `${commonIP}commonapi-ecd/`; const ADMIN_API = `${adminIP}adminapi-v1.0/`; const ECD_API = `${ecdIP}ecdapi-v1.0/`; const biologicalScreeningDeviceAPI = `${ADMIN_API}diagnostics/biologicalScreeningDevice`; +const sessionStorageEncKey = ''; +const siteKey = ''; +const captchaChallengeURL = ''; +const enableCaptcha = false; export const environment = { production: true, + encKey: sessionStorageEncKey, ioturl: `${biologicalScreeningDeviceAPI}`, extendSessionUrl: `${ECD_API}common/extend/redisSession`, language: 'English', @@ -53,6 +58,7 @@ export const environment = { createCallConfigurationUrl: `${ECD_API}callConfiguration/create`, updateCallConfigurationUrl: `${ECD_API}callConfiguration/update`, getUnallocatedCallsUrl: `${ECD_API}callAllocation/getEligibleRecordsInfo`, + getLowRiskRecordsByLanguageUrl: `${ECD_API}callAllocation/getEligibleRecordsLanguageInfo`, getAllocateCallsUrl: `${ECD_API}callAllocation/allocateCalls`, deleteReallocationUrl: `${ECD_API}callAllocation/moveToBin`, getAllocatedCountUrl: `${ECD_API}callAllocation/getAllocatedCallCountUser`, @@ -156,6 +162,7 @@ export const environment = { getMappedCycleURL:`${ECD_API}sampleSelectionConfiguration/getByPSMId`, updateCycleConfigurationURL:`${ECD_API}sampleSelectionConfiguration/update`, getAgentMastersUrl:`${ECD_API}master/getAgentsByRoleId`, + getAgentMasterByRoleIdAndLanguageUrl:`${ECD_API}master/getAgentsByRoleIdAndPreferredLanguage`, getCaseSheetDataURL:`${ECD_API}qualityAudit/getBeneficiaryCasesheet`, /** Associate-anm-mo Urls */ getAgentAuditScoreUrl: `${ECD_API}autoPreviewDialing/getRatingsByUserIdAndPsmId`, @@ -183,7 +190,7 @@ export const environment = { getBeneficiaryCallHistoryUrl:`${ECD_API}callHistory/getBeneficiaryCallHistory`, getCallHistoryDetailsUrl:`${ECD_API}callHistory/getBeneficiaryCallDetails`, /**CTI Urls */ - ctiUrl: `http://192.168.45.55/`, + ctiUrl: `https://uatcz.piramalswasthya.org/`, ctiEventUrl: `bar/cti_handler.php?e=`, getLoginKeyUrl:`${COMMON_API}cti/getLoginKey`, getAgentsDataUrl: `${ECD_API}master/getAgentsByRoleId`, @@ -249,4 +256,12 @@ downloadNotConnectedReportURL:`${ECD_API}ecdReportController/getECDNotConnectedP downloadJsyReportURL: `${ECD_API}ecdReportController/getECDJSYRelatedComplaintsReport`, downloadMiscarriageReportURL:`${ECD_API}ecdReportController/getECDMiscarriageReport`, +//video call +generateVideoLinkURL :`${COMMON_API}video-consultation/generate-link`, +sendSMSAPI: `${COMMON_API}video-consultation/send-link`, +updateCallStatusAPI: `${COMMON_API}video-consultation/update-call-status`, + +siteKey: siteKey, +captchaChallengeURL: captchaChallengeURL, +enableCaptcha: enableCaptcha }; \ No newline at end of file diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index a872660..04ddb5f 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -21,16 +21,21 @@ */ -const ecdIP = 'http://183.82.107.186:8080/'; -const commonIP = 'http://183.82.107.186:8080/'; -const adminIP = 'http://183.82.107.186:8080/'; +const ecdIP = 'https://amritwprdev.piramalswasthya.org/'; +const commonIP = 'https://amritwprdev.piramalswasthya.org/'; +const adminIP = 'https://amritwprdev.piramalswasthya.org/'; const COMMON_API = `${commonIP}commonapi-ecd/`; const ADMIN_API = `${adminIP}adminapi-v1.0/`; const ECD_API = `${ecdIP}ecdapi-v1.0/`; const biologicalScreeningDeviceAPI = `${ADMIN_API}diagnostics/biologicalScreeningDevice`; +const sessionStorageEncKey = ''; + +const fhirIP = 'http://amritwprdev.piramalswasthya.org:8080/'; +const FHIR_API = `${fhirIP}:8085/`; export const environment = { production: true, + encKey: sessionStorageEncKey, ioturl: `${biologicalScreeningDeviceAPI}`, extendSessionUrl: `${ECD_API}common/extend/redisSession`, language: 'English', @@ -53,6 +58,7 @@ export const environment = { createCallConfigurationUrl: `${ECD_API}callConfiguration/create`, updateCallConfigurationUrl: `${ECD_API}callConfiguration/update`, getUnallocatedCallsUrl: `${ECD_API}callAllocation/getEligibleRecordsInfo`, + getLowRiskRecordsByLanguageUrl: `${ECD_API}callAllocation/getEligibleRecordsLanguageInfo`, getAllocateCallsUrl: `${ECD_API}callAllocation/allocateCalls`, deleteReallocationUrl: `${ECD_API}callAllocation/moveToBin`, getAllocatedCountUrl: `${ECD_API}callAllocation/getAllocatedCallCountUser`, @@ -156,6 +162,7 @@ export const environment = { getMappedCycleURL:`${ECD_API}sampleSelectionConfiguration/getByPSMId`, updateCycleConfigurationURL:`${ECD_API}sampleSelectionConfiguration/update`, getAgentMastersUrl:`${ECD_API}master/getAgentsByRoleId`, + getAgentMasterByRoleIdAndLanguageUrl:`${ECD_API}master/getAgentsByRoleIdAndPreferredLanguage`, getCaseSheetDataURL:`${ECD_API}qualityAudit/getBeneficiaryCasesheet`, /** Associate-anm-mo Urls */ getAgentAuditScoreUrl: `${ECD_API}autoPreviewDialing/getRatingsByUserIdAndPsmId`, @@ -183,7 +190,7 @@ export const environment = { getBeneficiaryCallHistoryUrl:`${ECD_API}callHistory/getBeneficiaryCallHistory`, getCallHistoryDetailsUrl:`${ECD_API}callHistory/getBeneficiaryCallDetails`, /**CTI Urls */ - ctiUrl: `http://192.168.45.55/`, + ctiUrl: `https://uatcz.piramalswasthya.org/`, ctiEventUrl: `bar/cti_handler.php?e=`, getLoginKeyUrl:`${COMMON_API}cti/getLoginKey`, getAgentsDataUrl: `${ECD_API}master/getAgentsByRoleId`, @@ -211,6 +218,10 @@ export const environment = { getSMSValuesURL: `${ECD_API}master/getSMSValues`, getListOfMapQuestionaireConfigurationUrl:`${ECD_API}questionnaireConfiguration/getByPSMId`, + // Customization APIs + getAllRegistrationData: `${COMMON_API}customization/fetchAllData`, + getBenIdForhealthID: `${FHIR_API}healthID/getBenIdForhealthID`, + /**Demographic Masters */ getStatesMasterUrl: `${COMMON_API}location/states`, @@ -248,4 +259,10 @@ downloadBabyDeathReportURL:`${ECD_API}ecdReportController/getECDBabyDeathReport` downloadNotConnectedReportURL:`${ECD_API}ecdReportController/getECDNotConnectedPhonelistDiffformatReport`, downloadJsyReportURL: `${ECD_API}ecdReportController/getECDJSYRelatedComplaintsReport`, downloadMiscarriageReportURL:`${ECD_API}ecdReportController/getECDMiscarriageReport`, + +//video call +generateVideoLinkURL :`${COMMON_API}video-consultation/generate-link`, +sendSMSAPI: `${COMMON_API}video-consultation/send-link`, +updateCallStatusAPI: `${COMMON_API}video-consultation/update-call-status`, + }; \ No newline at end of file diff --git a/src/index.html b/src/index.html index 05a947d..c99a76c 100644 --- a/src/index.html +++ b/src/index.html @@ -35,6 +35,8 @@ rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" /> --> + + Loading... diff --git a/src/styles.css b/src/styles.css index fddba0c..34e1a71 100644 --- a/src/styles.css +++ b/src/styles.css @@ -132,6 +132,13 @@ input.mat-input-element { color: #ffffff; border-radius: 10px !important; } + +.buttonColorYellow { + font-family: 'Lato', sans-serif; + background-color: #ffb800 !important; + color: #ffffff; + border-radius: 10px !important; +} .buttonColorRed:disabled { font-family: 'Lato', sans-serif; background-color: #0000001f !important;