diff --git a/pom.xml b/pom.xml index 2e04373..7c8e092 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ 4.0.0 com.iemr.aam-inventory-ui aam-inventory-ui - 3.4.1 + 3.6.0 AAM-Inventory-UI Piramal - inventory: Module ui war diff --git a/scripts/ci-prebuild.js b/scripts/ci-prebuild.js index 3561c5f..61039fd 100755 --- a/scripts/ci-prebuild.js +++ b/scripts/ci-prebuild.js @@ -47,6 +47,10 @@ const defaultEnvValues = { SITE_KEY:'', CAPTCHA_CHALLENGE_URL:'', ENABLE_CAPTCHA: false, + SITE_ID: '2', + TRACKER_URL: 'https://matomo.piramalswasthya.org/', + TRACKING_PLATFORM: 'ci', + TRACKING_ENABLED: 'true', }; // Generate output data diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.html b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.html index ae055f3..3fded14 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.html +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.html @@ -20,6 +20,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

id="requestDate" formControlName="requestDate" [disabled]="true" + (focus)="trackFieldInteraction('Indent Date')" /> {{ currentLanguageSet?.inventory?.indentRequest }} allowText="alphanumeric" maxlength="20" formControlName="referenceNumber" + (focus)="trackFieldInteraction('Reference No')" /> @@ -53,6 +55,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

allowText="alphanumericspace" maxlength="250" formControlName="indentReason" + (focus)="trackFieldInteraction('Reason')" /> @@ -101,6 +104,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

" [itemListForm]="element" required + (focus)="trackFieldInteraction('Item Name')" /> {{ currentLanguageSet?.inventory?.indentRequest }} name="qOH" formControlName="qOH" required + (focus)="trackFieldInteraction('Quantity On Hand')" /> @@ -165,6 +170,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

[attr.maxlength]="('' + element.qOH).length" (blur)="checkQuantity(element)" required + (focus)="trackFieldInteraction('Required Quantity')" /> @@ -189,6 +195,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

name="remarks" formControlName="remarks" allowText="alphanumericspace" + (focus)="trackFieldInteraction('Remarks')" /> @@ -224,7 +231,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

@@ -245,7 +252,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

mat-raised-button matTooltip="{{ currentLanguageSet?.inventory?.back }}" matTooltipPosition="right" - (click)="goBack()" + (click)="goBack(); trackFieldInteraction('Back Button')" > {{ currentLanguageSet?.inventory?.back }} @@ -259,7 +266,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

class="pull-right m-r-5 mat_green" *ngIf="!editMode" [disabled]="indentRequestForm.invalid" - (click)="submitIndentRequest(indentRequestForm)" + (click)="submitIndentRequest(indentRequestForm); trackFieldInteraction('Save Button')" > {{ currentLanguageSet?.common?.save }} @@ -270,7 +277,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

*ngIf="editMode" class="pull-right m-r-5 mat_green" [disabled]="indentRequestForm.invalid" - (click)="updateIndentRequest(indentRequestForm)" + (click)="updateIndentRequest(indentRequestForm); trackFieldInteraction('Update Button')" > {{ currentLanguageSet?.inventory?.update }} @@ -281,7 +288,7 @@

{{ currentLanguageSet?.inventory?.indentRequest }}

color="primary" class="pull-right m-r-5" [disabled]="indentRequestForm.pristine" - (click)="resetIndentRequestForm()" + (click)="resetIndentRequestForm(); trackFieldInteraction('Clear Button')" > {{ currentLanguageSet?.inventory?.clear }} diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.ts b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.ts index e970bef..0f8876d 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.ts +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/indent-request/indent-request.component.ts @@ -39,6 +39,7 @@ import { LanguageService } from 'src/app/app-modules/core/services/language.serv import { MatTableDataSource } from '@angular/material/table'; import { Subscription } from 'rxjs'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-indent-request', @@ -77,6 +78,7 @@ export class IndentRequestComponent implements OnInit, DoCheck { private confirmationService: ConfirmationService, private dataStorageService: DataStorageService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) { this.subs = this.inventoryService .getDialogClosedObservable() @@ -402,4 +404,8 @@ export class IndentRequestComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } // -----End------ + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Indent Request'); + } } diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.html b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.html index 1de2eec..d824373 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.html +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.html @@ -9,7 +9,7 @@

{{ currentLanguageSet?.inventory?.subStoreIndentOrderWorklist }}

class="pull-right button-full-width" type="button" color="primary" - (click)="routeToRaiseRequest()" + (click)="routeToRaiseRequest(); trackFieldInteraction('Raise Request Button')" > {{ currentLanguageSet?.inventory?.raiseRequest }} diff --git a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.ts b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.ts index cb7f3d1..a09f087 100644 --- a/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.ts +++ b/src/app/app-modules/inventory/indent/indent-order-worklist/sub-store-indent-order-worklist/sub-store-indent-order-worklist.component.ts @@ -31,6 +31,7 @@ import { LanguageService } from 'src/app/app-modules/core/services/language.serv import { MatPaginator } from '@angular/material/paginator'; import { MatTableDataSource } from '@angular/material/table'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-sub-store-indent-order-worklist', @@ -60,6 +61,7 @@ export class SubStoreIndentOrderWorklistComponent implements OnInit, DoCheck { private confirmationService: ConfirmationService, private dataStorageService: DataStorageService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} ngOnInit() { @@ -141,4 +143,8 @@ export class SubStoreIndentOrderWorklistComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } // -----End------ + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Sub Store Indent Order Worklist'); + } } diff --git a/src/app/app-modules/inventory/medicine-dispense/medicine-dispense.component.html b/src/app/app-modules/inventory/medicine-dispense/medicine-dispense.component.html index b0e9d47..c50d8d3 100644 --- a/src/app/app-modules/inventory/medicine-dispense/medicine-dispense.component.html +++ b/src/app/app-modules/inventory/medicine-dispense/medicine-dispense.component.html @@ -11,7 +11,7 @@

class="pull-right button-full-width m-l-5" type="button" color="primary" - (click)="openSearchDialog()" + (click)="openSearchDialog(); trackFieldInteraction('Advance Search Button')" > {{ currentLanguageSet?.bendetails?.advanceSearch }} @@ -21,6 +21,7 @@

type="button" color="primary" routerLink="View" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -44,6 +45,7 @@

id="beneficiaryID" formControlName="beneficiaryID" (keyup)="checkBeneficiary()" + (focus)="trackFieldInteraction('Beneficiary ID')" /> @@ -61,6 +63,9 @@

!beneficiaryDetailForm.get('beneficiaryID')?.value " (selectionChange)="getVisitDetail()" + (selectionChange)=" + trackFieldInteraction('Visit Code') + " > autocomplete="off" formControlName="visitDate" [readonly]="true" + (focus)="trackFieldInteraction('Visit Date')" /> id="beneficiaryName" formControlName="beneficiaryName" [readonly]="true" + (focus)="trackFieldInteraction('Patient Name')" /> @@ -118,6 +125,7 @@

id="beneficiaryAge" formControlName="beneficiaryAge" [readonly]="true" + (focus)="trackFieldInteraction('Age')" /> @@ -134,6 +142,7 @@

id="genderName" formControlName="genderName" [readonly]="true" + (focus)="trackFieldInteraction('Gender')" /> @@ -150,6 +159,7 @@

id="doctorName" formControlName="doctorName" [readonly]="true" + (focus)="trackFieldInteraction('Doctor Name')" /> @@ -167,6 +177,7 @@

formControlName="reference" maxlength="50" [readonly]="!dateBool" + (focus)="trackFieldInteraction('Remarks')" /> @@ -182,6 +193,7 @@

formControlName="medicineDispenseType" [disabled]="!beneficiaryDetailForm.get('visitCode')?.value" (change)="getBeneficiaryDetail()" + (change)="trackFieldInteraction('Type of Dispense')" > type="button" color="primary" routerLink="previousRecord" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -24,9 +25,7 @@

- + {{ currentLanguageSet?.inventory?.beneficiaryIDPhoneNumber }} @@ -38,6 +37,7 @@

name="beneficiaryIDOrPhoneNumber" formControlName="beneficiaryIDOrPhoneNumber" (keyup.enter)="identityQuickSearch(beneficiaryIDOrPhoneNumber)" + (focus)="trackFieldInteraction('Beneficiary ID / Phone Number')" /> style="display: flex; gap: 10px; margin-top: 30px" >
- + {{ currentLanguageSet?.bendetails?.beneficiaryID }} @@ -71,9 +69,7 @@

- + {{ currentLanguageSet?.bendetails?.beneficiaryName }} @@ -88,9 +84,7 @@

- + {{ currentLanguageSet?.bendetails?.age }} @@ -105,9 +99,7 @@

- + {{ currentLanguageSet?.bendetails?.gender }} type="button" color="primary" routerLink="View" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -22,7 +23,7 @@

{{ currentLanguageSet?.inventory?.referenceNumber @@ -35,6 +36,7 @@

formControlName="referenceNumber" #referenceNumber required + (focus)="trackFieldInteraction('Reference Number')" /> @@ -52,9 +54,7 @@

- + {{ currentLanguageSet?.inventory?.date }} [matDatepicker]="picker" name="stockEntryDate" [formControl]="stockEntryDate" + (focus)="trackFieldInteraction('Date')" /> formControlName="itemName" #itemName maxlength="100" + (focus)="trackFieldInteraction('Item Name')" /> [required]="true" [readonly]="!stock.value.itemID" [(ngModel)]="stock.quantity" + (focus)="trackFieldInteraction('Qty (In Lowest Unit)')" /> @@ -185,6 +188,7 @@

formControlName="totalCostPrice" [required]="true" [readonly]="!stock.value.itemID" + (focus)="trackFieldInteraction('Unit Cost Price')" /> @@ -213,6 +217,7 @@

[required]="true" [readonly]="!stock.value.itemID" (change)="checkForDuplicateBatch(stock, i)" + (focus)="trackFieldInteraction('Batch No')" /> @@ -248,6 +253,7 @@

name="expiryDate" formControlName="expiryDate" (keydown)="preventTyping($event)" + (focus)="trackFieldInteraction('Expiry Date')" /> class="cursorPointer" (click)="removeStock(i, stock)" matTooltip="{{ currentLanguageSet?.inventory?.delete }}" + (click)="trackFieldInteraction('Delete Button')" >delete @@ -290,7 +297,11 @@

style="margin-top: 15px" *ngIf="physicalStockEntryForm.controls['physicalStock'].valid" > -

@@ -307,7 +318,7 @@

color="primary" class="pull-right m-r-5" [disabled]="physicalStockEntryForm.pristine" - (click)="reset()" + (click)="reset(); trackFieldInteraction('Clear Button')" > {{ currentLanguageSet?.inventory?.clear }} @@ -318,7 +329,7 @@

mat-raised-button class="pull-right m-r-5" [disabled]="physicalStockEntryForm.invalid" - (click)="savePhysicalStock()" + (click)="savePhysicalStock(); trackFieldInteraction('Save Button')" > {{ currentLanguageSet?.common?.save }} diff --git a/src/app/app-modules/inventory/physical-stock-entry/physical-stock-entry.component.ts b/src/app/app-modules/inventory/physical-stock-entry/physical-stock-entry.component.ts index 3c73ff1..2d3d8fd 100644 --- a/src/app/app-modules/inventory/physical-stock-entry/physical-stock-entry.component.ts +++ b/src/app/app-modules/inventory/physical-stock-entry/physical-stock-entry.component.ts @@ -41,6 +41,7 @@ import { SetLanguageComponent } from '../../core/components/set-language.compone import { LanguageService } from '../../core/services/language.service'; import { MatTableDataSource } from '@angular/material/table'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-physical-stock-entry', @@ -87,7 +88,8 @@ export class PhysicalStockEntryComponent implements OnInit, OnChanges, DoCheck { private http_service: LanguageService, private dialogService: ConfirmationService, private fb: FormBuilder, - readonly sessionstorage:SessionStorageService, + readonly sessionstorage: SessionStorageService, + private trackingService: AmritTrackingService ) {} dataSource = new MatTableDataSource(); @@ -312,4 +314,8 @@ export class PhysicalStockEntryComponent implements OnInit, OnChanges, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Physical Stock Entry'); + } } diff --git a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.html b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.html index 761a2e5..6925390 100644 --- a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.html +++ b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.html @@ -24,6 +24,7 @@

{{ currentLanguageSet?.inventory?.beneficiaryDrugIssueReport }}

(change)="checkEndDate()" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.beneficiaryDrugIssueReport }}

[min]="minEndDate" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.beneficiaryDrugIssueReport }}

color="accent" type="submit" [disabled]="!beneficiaryDrugIssueForm.valid" - (click)="downloadReport(true)" + (click)="downloadReport(true); trackFieldInteraction('Download Button')" > {{ currentLanguageSet?.inventory?.download }} diff --git a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts index 52ad2cc..0bc8d9c 100644 --- a/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts +++ b/src/app/app-modules/inventory/reports/beneficiary-drug-issue-report/beneficiary-drug-issue-report.component.ts @@ -27,6 +27,7 @@ import { InventoryService } from '../../shared/service/inventory.service'; import { ConfirmationService } from '../../../core/services/confirmation.service'; import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; declare global { interface Navigator { @@ -50,6 +51,7 @@ export class BeneficiaryDrugIssueReportComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private http_service: LanguageService, private confirmationService: ConfirmationService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -295,4 +297,11 @@ export class BeneficiaryDrugIssueReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction( + fieldName, + 'Beneficiary Drug Issue Report', + ); + } } diff --git a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.html b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.html index e74e0cd..4615241 100644 --- a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.html +++ b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.html @@ -24,6 +24,7 @@

{{ currentLanguageSet?.inventory?.consumptionReport }}

(change)="checkEndDate()" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.consumptionReport }}

[disabled]="true" [min]="minEndDate" [max]="maxEndDate" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.consumptionReport }}

[style.width]="'100%'" class="input-full-width" formControlName="facilityName" + (selectionChange)="trackFieldInteraction('Facility')" > {{ item @@ -74,21 +77,19 @@

{{ currentLanguageSet?.inventory?.consumptionReport }}

-
+
- - diff --git a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts index 2cb1919..3865620 100644 --- a/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts +++ b/src/app/app-modules/inventory/reports/consumption-report/consumption-report.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-consumption-report', @@ -47,6 +48,7 @@ export class ConsumptionReportComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -321,4 +323,8 @@ export class ConsumptionReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Consumption Report'); + } } diff --git a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.html b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.html index 2e5c5b7..a6e19bf 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.html +++ b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.html @@ -24,6 +24,7 @@

{{ currentLanguageSet?.inventory?.dailyStockDetailsReport }}

formControlName="startDate" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.dailyStockDetailsReport }}

(dateChange)="checkStartDate($event)" [max]="maxEndDate" [disabled]="true" + (click)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.dailyStockDetailsReport }}

[style.width]="'100%'" class="input-full-width" formControlName="facilityName" + (selectionChange)="trackFieldInteraction('Facility')" > {{ item @@ -75,21 +78,19 @@

{{ currentLanguageSet?.inventory?.dailyStockDetailsReport }}

- -
- -
+
+ +
- diff --git a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts index 78ca9f4..392e4d9 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts +++ b/src/app/app-modules/inventory/reports/daily-stock-details-report/daily-stock-details-report.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-daily-stock-details-report', @@ -47,6 +48,7 @@ export class DailyStockDetailsReportComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -316,4 +318,8 @@ export class DailyStockDetailsReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Daily Stock Details Report'); + } } diff --git a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.html b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.html index c3e936c..9576a9c 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.html +++ b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.html @@ -23,6 +23,7 @@

{{ currentLanguageSet?.inventory?.dailyStockSummaryReport }}

(dateChange)="checkEndDate($event)" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.dailyStockSummaryReport }} (dateChange)="checkStartDate($event)" [min]="minEndDate" [max]="maxEndDate" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.dailyStockSummaryReport }}
- + {{ currentLanguageSet?.inventory?.facility }} - + {{ item }}
-
+
-
diff --git a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts index 0f96f09..ac9a52f 100644 --- a/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts +++ b/src/app/app-modules/inventory/reports/daily-stock-summary-report/daily-stock-summary-report.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-daily-stock-summary-report', templateUrl: './daily-stock-summary-report.component.html', @@ -46,6 +47,7 @@ export class DailyStockSummaryReportComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -313,4 +315,8 @@ export class DailyStockSummaryReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Daily Stock Summary Report'); + } } diff --git a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.html b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.html index 211d5d3..13be292 100644 --- a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.html +++ b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.html @@ -24,6 +24,7 @@

{{ currentLanguageSet?.inventory?.expiryReport }}

(change)="checkEndDate()" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.expiryReport }} [min]="minEndDate" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.expiryReport }} - -
- -
+
+ +
- diff --git a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts index a72ea60..535b13e 100644 --- a/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts +++ b/src/app/app-modules/inventory/reports/expiry-report/expiry-report.component.ts @@ -28,6 +28,7 @@ import { InventoryService } from '../../shared/service/inventory.service'; import { ConfirmationService } from '../../../core/services/confirmation.service'; import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-expiry-report', @@ -45,6 +46,7 @@ export class ExpiryReportComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private http_service: LanguageService, private confirmationService: ConfirmationService, + private trackingService: AmritTrackingService ) {} today!: Date; minEndDate!: Date; @@ -283,4 +285,8 @@ export class ExpiryReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Expiry Report'); + } } diff --git a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.html b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.html index 87357c9..ed0013d 100644 --- a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.html +++ b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.html @@ -10,7 +10,7 @@

{{ currentLanguageSet?.inventory?.inwardStockReport }}

{{ currentLanguageSet?.inventory?.startDate }} @@ -24,6 +24,7 @@

{{ currentLanguageSet?.inventory?.inwardStockReport }}

(change)="checkEndDate()" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.inwardStockReport }}
{{ currentLanguageSet?.inventory?.endDate }} @@ -48,6 +49,7 @@

{{ currentLanguageSet?.inventory?.inwardStockReport }}

[min]="minEndDate" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.inwardStockReport }}
{{ currentLanguageSet?.inventory?.facility }} - + {{ item }}
-
+
- diff --git a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts index a76b7e1..e3cbcc2 100644 --- a/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts +++ b/src/app/app-modules/inventory/reports/inward-stock-report/inward-stock-report.component.ts @@ -31,6 +31,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-inward-stock-report', @@ -49,6 +50,7 @@ export class InwardStockReportComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -317,4 +319,8 @@ export class InwardStockReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Inward Stock Report'); + } } diff --git a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.html b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.html index 5002ede..b86cec4 100644 --- a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.html +++ b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.html @@ -9,9 +9,7 @@

{{ currentLanguageSet?.inventory?.monthlyReport }}

- + {{ currentLanguageSet?.inventory?.selectmonth }} @@ -21,6 +19,7 @@

{{ currentLanguageSet?.inventory?.monthlyReport }}

id="month" formControlName="month" required + (selectionChange)="trackFieldInteraction('Select month')" > {{ month.name @@ -30,9 +29,7 @@

{{ currentLanguageSet?.inventory?.monthlyReport }}

- + {{ currentLanguageSet?.inventory?.selectyear }} @@ -42,6 +39,7 @@

{{ currentLanguageSet?.inventory?.monthlyReport }}

id="year" formControlName="year" required + (selectionChange)="trackFieldInteraction('Select year')" > {{ year @@ -50,34 +48,34 @@

{{ currentLanguageSet?.inventory?.monthlyReport }}

- + {{ currentLanguageSet?.inventory?.facility }} - + {{ item }}
-
+
- -
diff --git a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts index bfece5f..26a7ea5 100644 --- a/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts +++ b/src/app/app-modules/inventory/reports/monthly-report/monthly-report.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-monthly-report', @@ -47,6 +48,7 @@ export class MonthlyReportComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -311,4 +313,8 @@ export class MonthlyReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Monthly Report'); + } } diff --git a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.html b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.html index 893a8ee..7c99011 100644 --- a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.html +++ b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.html @@ -22,6 +22,7 @@

{{ currentLanguageSet?.inventory?.shortExpiryReport }}

[max]="maxEndDate" formControlName="startDate" [readonly]="true" + (focus)="trackFieldInteraction('Date')" /> {{ currentLanguageSet?.inventory?.shortExpiryReport }} color="accent" class="mat_green" type="submit" - (click)="downloadReport(true)" + (click)="downloadReport(true); trackFieldInteraction('Download Button')" > {{ currentLanguageSet?.inventory?.download }} diff --git a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts index 45bd914..7ee6c25 100644 --- a/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts +++ b/src/app/app-modules/inventory/reports/short-expiry-report/short-expiry-report.component.ts @@ -28,6 +28,7 @@ import { InventoryService } from '../../shared/service/inventory.service'; import { ConfirmationService } from '../../../core/services/confirmation.service'; import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; @Component({ @@ -46,6 +47,7 @@ export class ShortExpiryReportComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private http_service: LanguageService, private confirmationService: ConfirmationService, + private trackingService: AmritTrackingService private sessionstorage: SessionStorageService ) {} @@ -249,4 +251,11 @@ export class ShortExpiryReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction( + fieldName, + 'Short Expiry Report', + ); + } } diff --git a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.html b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.html index b562c33..562426d 100644 --- a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.html +++ b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.html @@ -23,6 +23,7 @@

{{ currentLanguageSet?.inventory?.transitReport }}

(change)="checkEndDate()" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('Start Date')" /> {{ currentLanguageSet?.inventory?.transitReport }} [min]="minEndDate" [max]="maxEndDate" [disabled]="true" + (focus)="trackFieldInteraction('End Date')" /> {{ currentLanguageSet?.inventory?.transitReport }} class="mat_green" type="submit" [disabled]="!transitForm.valid" - (click)="downloadReport(true)" + (click)="downloadReport(true); trackFieldInteraction('Download Button')" > {{ currentLanguageSet?.inventory?.download }} diff --git a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts index 3a489ec..b999f4e 100644 --- a/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts +++ b/src/app/app-modules/inventory/reports/transit-report/transit-report.component.ts @@ -28,6 +28,7 @@ import { InventoryService } from '../../shared/service/inventory.service'; import { ConfirmationService } from '../../../core/services/confirmation.service'; import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-transit-report', @@ -45,6 +46,7 @@ export class TransitReportComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private http_service: LanguageService, private confirmationService: ConfirmationService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -285,4 +287,8 @@ export class TransitReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Transit Report'); + } } diff --git a/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.html b/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.html index 963bfd7..89b31b9 100644 --- a/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.html +++ b/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.html @@ -9,9 +9,7 @@

{{ currentLanguageSet?.inventory?.yearlyReport }}

- + {{ currentLanguageSet?.inventory?.selectyear }} @@ -21,6 +19,7 @@

{{ currentLanguageSet?.inventory?.yearlyReport }}

id="year" formControlName="year" required + (selectionChange)="trackFieldInteraction('Select year')" > {{ year @@ -29,9 +28,7 @@

{{ currentLanguageSet?.inventory?.yearlyReport }}

- + {{ currentLanguageSet?.inventory?.facility }} @@ -39,6 +36,7 @@

{{ currentLanguageSet?.inventory?.yearlyReport }}

[style.width]="'100%'" class="input-full-width" formControlName="facilityName" + (selectionChange)="trackFieldInteraction('Facility')" > {{ item @@ -53,7 +51,7 @@

{{ currentLanguageSet?.inventory?.yearlyReport }}

class="mat_green" type="submit" [disabled]="!yearlyForm.valid" - (click)="downloadReport(true)" + (click)="downloadReport(true); trackFieldInteraction('Download Button')" > {{ currentLanguageSet?.inventory?.download }} diff --git a/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.ts b/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.ts index c666d51..d6d1e85 100644 --- a/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.ts +++ b/src/app/app-modules/inventory/reports/yearly-report/yearly-report.component.ts @@ -29,6 +29,7 @@ import { ConfirmationService } from '../../../core/services/confirmation.service import { SetLanguageComponent } from 'src/app/app-modules/core/components/set-language.component'; import { LanguageService } from 'src/app/app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-yearly-report', @@ -47,6 +48,7 @@ export class YearlyReportComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} today!: Date; @@ -280,4 +282,8 @@ export class YearlyReportComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Yearly Report'); + } } diff --git a/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.html b/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.html index b1daf9c..7093ec2 100644 --- a/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.html +++ b/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.html @@ -14,6 +14,7 @@

type="button" color="primary" routerLink="View" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -21,9 +22,7 @@

-
+
{{ currentLanguageSet?.inventory?.referenceNumber @@ -36,6 +35,7 @@

name="referenceNumber" formControlName="referenceNumber" #referenceNumber + (focus)="trackFieldInteraction('Reference Number')" /> @@ -52,9 +52,7 @@

- + {{ currentLanguageSet?.inventory?.consumptionReason }} @@ -65,6 +63,7 @@

maxlength="100" name="dispenseReason" formControlName="dispenseReason" + (focus)="trackFieldInteraction('Consumption Reason')" />

@@ -118,6 +117,7 @@

required name="itemName" formControlName="itemName" + (focus)="trackFieldInteraction('Item Name')" /> name="batchNo" formControlName="batchNo" readonly + (focus)="trackFieldInteraction('Batch No')" /> @@ -177,6 +178,7 @@

name="quantityInHand" formControlName="quantityInHand" readonly + (focus)="trackFieldInteraction('QOH')" /> @@ -208,6 +210,7 @@

('' + element.value?.quantityInHand).length " (blur)="validateRequestedQuantity(element)" + (focus)="trackFieldInteraction('Quantity')" /> @@ -224,7 +227,7 @@

delete @@ -245,7 +248,7 @@

type="button" class="pull-right" color="primary" - (click)="addDispensedStock()" + (click)="addDispensedStock(); trackFieldInteraction('Add Button')" > add @@ -262,7 +265,7 @@

mat-raised-button class="pull-right m-r-5" [disabled]="storeSelfConsumptionForm.invalid" - (click)="saveSelfConsumptionStock()" + (click)="saveSelfConsumptionStock(); trackFieldInteraction('Save Button')" > {{ currentLanguageSet?.common?.save }} @@ -271,7 +274,7 @@

mat-raised-button class="pull-right m-r-5" [disabled]="storeSelfConsumptionForm.pristine" - (click)="reset()" + (click)="reset(); trackFieldInteraction('Clear Button')" > {{ currentLanguageSet?.inventory?.clear }} diff --git a/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.ts b/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.ts index 860f3b9..2711a8d 100644 --- a/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.ts +++ b/src/app/app-modules/inventory/store-self-consumption/store-self-consumption.component.ts @@ -35,6 +35,7 @@ import { SetLanguageComponent } from '../../core/components/set-language.compone import { MatTableDataSource } from '@angular/material/table'; import { Subscription } from 'rxjs'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; export interface PeriodicElement { itemName: string; @@ -75,6 +76,7 @@ export class StoreSelfConsumptionComponent implements OnInit, DoCheck { private inventoryService: InventoryService, private alertService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) { this.subs = this.inventoryService .getDialogClosedObservable() @@ -277,4 +279,8 @@ export class StoreSelfConsumptionComponent implements OnInit, DoCheck { this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Store Self Consumption'); + } } diff --git a/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.html b/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.html index e7c7a94..f3b6825 100644 --- a/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.html +++ b/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.html @@ -14,6 +14,7 @@

type="button" color="primary" routerLink="/inventory/storeStockAdjustment/view" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -25,6 +26,7 @@

type="button" color="primary" routerLink="/inventory/storeStockAdjustmentDraft/view" + (click)="trackFieldInteraction('Previous Draft Records Button')" > {{ currentLanguageSet?.inventory?.previousDraftRecords }} @@ -35,6 +37,7 @@

class="pull-right button-full-width" type="button" color="primary" + (click)="trackFieldInteraction('Add E-Aushadhi Stock Button')" > Add E-Aushadhi Stock @@ -51,11 +54,9 @@

-
+
- + {{ currentLanguageSet?.inventory?.adjustmentDate }} @@ -65,6 +66,7 @@
autocomplete="off" name="adjustmentDate" formControlName="adjustmentDate" + (focus)="trackFieldInteraction('Adjustment Date')" />
{{ currentLanguageSet?.inventory?.referenceNumber @@ -87,6 +89,7 @@
name="refNo" formControlName="refNo" required + (focus)="trackFieldInteraction('Reference Number')" />
@@ -144,6 +147,7 @@
formControlName="itemName" maxlength="100" required + (focus)="trackFieldInteraction('Item Name')" /> formControlName="batchID" required readonly + (focus)="trackFieldInteraction('Batch ID')" /> @@ -206,6 +211,7 @@
formControlName="quantityInHand" required readonly + (focus)="trackFieldInteraction('QOH')" /> @@ -230,6 +236,9 @@
name="adjustmentType" formControlName="adjustmentType" (selectionChange)="calculateQOHAfterAdjustment(stock)" + (selectionChange)=" + trackFieldInteraction('Adjustment Type') + " required > (input)="calculateQOHAfterAdjustment(stock)" allowMax="item.value.quantityInHand" required + (focus)="trackFieldInteraction('Adjustment Quantity')" /> @@ -285,6 +295,7 @@
(input)="calculateQOHAfterAdjustment(stock)" allowMax="9999" required + (focus)="trackFieldInteraction('Adjustment Quantity')" /> @@ -311,6 +322,7 @@
formControlName="qohAfterAdjustment" required readonly + (focus)="trackFieldInteraction('QOH After Adjustment')" /> @@ -335,6 +347,7 @@
name="reason" formControlName="reason" required + (focus)="trackFieldInteraction('Reason')" /> @@ -353,7 +366,7 @@
delete @@ -376,7 +389,7 @@
mat-mini-fab type="button" color="primary" - (click)="addToStockAdjustmentList()" + (click)="addToStockAdjustmentList(); trackFieldInteraction('Add Button')" > add @@ -396,7 +409,7 @@
mat-raised-button matTooltip="{{ currentLanguageSet?.inventory?.back }}" matTooltipPosition="right" - (click)="goBack()" + (click)="goBack(); trackFieldInteraction('Back Button')" > {{ currentLanguageSet?.inventory?.back }} @@ -405,7 +418,7 @@
mat-raised-button class="pull-right m-r-5" [disabled]="storeStockAdjustmentForm.invalid" - (click)="submitStockAdjustmentFinal(storeStockAdjustmentForm)" + (click)="submitStockAdjustmentFinal(storeStockAdjustmentForm); trackFieldInteraction('Save Button')" > {{ currentLanguageSet?.common?.save }} @@ -414,7 +427,7 @@
mat-raised-button class="pull-right m-r-5" [disabled]="storeStockAdjustmentForm.invalid" - (click)="submitStockAdjustmentDraft(storeStockAdjustmentForm)" + (click)="submitStockAdjustmentDraft(storeStockAdjustmentForm); trackFieldInteraction('Save Draft Button')" > {{ currentLanguageSet?.inventory?.saveDraft }} diff --git a/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.ts b/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.ts index 14fffc4..7abdebd 100644 --- a/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.ts +++ b/src/app/app-modules/inventory/store-stock-adjustment/store-stock-adjustment.component.ts @@ -36,6 +36,7 @@ import { InventoryService } from '../shared/service/inventory.service'; import { MatTableDataSource } from '@angular/material/table'; import { Subscription } from 'rxjs'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-store-stock-adjustment', @@ -77,6 +78,7 @@ export class StoreStockAdjustmentComponent private confirmationService: ConfirmationService, private inventoryService: InventoryService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) { this.subs = this.inventoryService .getDialogClosedObservable() @@ -469,4 +471,8 @@ export class StoreStockAdjustmentComponent }, ); } + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Store Stock Adjustment'); + } } diff --git a/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.html b/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.html index 9cb7232..5109bf2 100644 --- a/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.html +++ b/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.html @@ -12,6 +12,7 @@

type="button" color="primary" routerLink="View" + (click)="trackFieldInteraction('Previous Records Button')" > {{ currentLanguageSet?.inventory?.previousRecords }} @@ -21,18 +22,18 @@

- + {{ currentLanguageSet?.inventory?.date }} - +
- + {{ currentLanguageSet?.inventory?.referenceNumber }} @@ -42,6 +43,7 @@

allowText="alphanumeric" maxlength="20" formControlName="referenceNumber" + (focus)="trackFieldInteraction('Reference Number')" />

@@ -55,6 +57,7 @@

required="true" formControlName="transferTo" (selectionChange)="resetItemArray()" + (selectionChange)="trackFieldInteraction('Transfer To')" > {{ store.facilityName }} @@ -348,7 +351,7 @@

class="pull-right m-r-5" type="button" [disabled]="!stockTransferForm.touched" - (click)="resetForm()" + (click)="resetForm(); trackFieldInteraction('Clear Button')" > {{ currentLanguageSet?.inventory?.clear }} @@ -358,7 +361,7 @@

class="pull-right m-r-5" type="button" [disabled]="!stockTransferForm.valid" - (click)="submitTransfers()" + (click)="submitTransfers(); trackFieldInteraction('Save Button')" > {{ currentLanguageSet?.common?.save }} diff --git a/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.ts b/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.ts index d3f7869..337119b 100644 --- a/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.ts +++ b/src/app/app-modules/inventory/store-stock-transfer/store-stock-transfer.component.ts @@ -36,6 +36,7 @@ import { LanguageService } from '../../core/services/language.service'; import * as moment from 'moment'; import { MatTableDataSource } from '@angular/material/table'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-store-stock-transfer', templateUrl: './store-stock-transfer.component.html', @@ -77,7 +78,8 @@ export class StoreStockTransferComponent implements OnInit, DoCheck { private router: Router, private http_service: LanguageService, private confirmationService: ConfirmationService, - readonly sessionstorage:SessionStorageService, + readonly sessionstorage: SessionStorageService, + private trackingService: AmritTrackingService ) { this.checkFacility(); } @@ -319,4 +321,8 @@ createdBy: this.sessionstorage.getItem('username'), this.currentLanguageSet = this.languageComponent.currentLanguageObject; } //--End-- + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Stock Transfer'); + } } diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 06be132..59614d0 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,6 +1,7 @@ import { Component, OnInit } from '@angular/core'; import { Router, NavigationStart, NavigationEnd, NavigationError } from '@angular/router'; import { SpinnerService } from './app-modules/core/services/spinner.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; // import { SpinnerService } from './app-modules/core/services/spinner.service'; @Component({ @@ -12,7 +13,8 @@ export class AppComponent implements OnInit { constructor( private router: Router, - private spinnerService: SpinnerService + private spinnerService: SpinnerService, + private trackingService: AmritTrackingService ) { } ngOnInit() { diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 769d0b2..5768bb5 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -8,6 +8,7 @@ import { BrowserModule } from "@angular/platform-browser"; import { FormsModule, ReactiveFormsModule } from "@angular/forms"; import { AppRoutingModule } from "./app-routing.module"; import { CookieService } from 'ngx-cookie-service'; +import { TrackingModule } from "Common-UI/src/tracking"; // import { RouteReuseStrategy } from '@angular/router'; // import { CustomRouteReuseStrategy } from './custom-route-reuse-strategy'; @@ -115,6 +116,7 @@ import { CaptchaComponent } from "./captcha/captcha.component"; AppRoutingModule, CoreModule.forRoot(), // Ng2GoogleChartsModule + TrackingModule.forRoot(), ], providers: [ AuthenticationService, diff --git a/src/app/facility-selection/facility-selection.component.html b/src/app/facility-selection/facility-selection.component.html index b36166f..077be98 100644 --- a/src/app/facility-selection/facility-selection.component.html +++ b/src/app/facility-selection/facility-selection.component.html @@ -10,10 +10,13 @@

- +

{{currentLanguageSet?.inventory?.typeofStores}} - {{currentLanguageSet?.inventory?.mainStore}} - {{currentLanguageSet?.inventory?.subStore}} + {{currentLanguageSet?.inventory?.mainStore}} + {{currentLanguageSet?.inventory?.subStore}}

@@ -26,6 +29,7 @@

{{currentLanguageSet?.inventory?.typeofStores}} formControlName="facility" (selectionChange)="getSubFacility()" (selectionChange)="toContinue()" + (selectionChange)="trackFieldInteraction('Facility Dropdown')" > {{currentLanguageSet?.inventory?.typeofStores}} formControlName="subFacility" (selectionChange)='checkSubFacility()' (selectionChange)="toContinue()" + (selectionChange)="trackFieldInteraction('Sub Facility Dropdown')" [disabled]=" facilityForm.controls.isMainStore.value === 'true' ? true @@ -78,9 +83,9 @@

{{currentLanguageSet?.inventory?.typeofStores}}
+ (click)="proceedFurther(); trackFieldInteraction('Continue Button (Main Store)')">{{currentLanguageSet?.inventory?.continue}} + (click)="proceedFurther(); trackFieldInteraction('Continue Button (Sub Store)')">{{currentLanguageSet?.inventory?.continue}}
diff --git a/src/app/facility-selection/facility-selection.component.ts b/src/app/facility-selection/facility-selection.component.ts index 26611fd..175120d 100644 --- a/src/app/facility-selection/facility-selection.component.ts +++ b/src/app/facility-selection/facility-selection.component.ts @@ -7,6 +7,7 @@ import { ConfirmationService } from '../app-modules/core/services'; import { SetLanguageComponent } from '../app-modules/core/components/set-language.component'; import { LanguageService } from '../app-modules/core/services/language.service'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ @@ -33,6 +34,7 @@ export class FacilitySelectionComponent implements OnInit, DoCheck { private http_service: LanguageService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService ) {} facilityForm = this.fb.group({ @@ -219,4 +221,8 @@ export class FacilitySelectionComponent implements OnInit, DoCheck { // this.languageComponent.setLanguage(); // this.currentLanguageSet = this.languageComponent.currentLanguageObject; // } + + trackFieldInteraction(fieldName: string) { + this.trackingService.trackFieldInteraction(fieldName, 'Facility Selection'); + } } diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 5d10c71..8031bf2 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -7,6 +7,7 @@ import * as CryptoJS from 'crypto-js'; import { SessionStorageService } from 'Common-UI/src/registrar/services/session-storage.service'; import { CaptchaComponent } from '../captcha/captcha.component'; import { environment } from 'src/environments/environment'; +import { AmritTrackingService } from 'Common-UI/src/tracking'; @Component({ selector: 'app-login-cmp', @@ -34,6 +35,7 @@ export class LoginComponent implements OnInit { private authService: AuthenticationService, private confirmationService: ConfirmationService, readonly sessionstorage:SessionStorageService, + private trackingService: AmritTrackingService, private router: Router) { this._keySize = 256; this._ivSize = 128; @@ -122,7 +124,8 @@ export class LoginComponent implements OnInit { this.authService.login(this.userName, encryptPassword, true,this.enableCaptcha ? this.captchaToken : undefined).subscribe((userLoggedIn) => { if (userLoggedIn.statusCode == '200') { if (userLoggedIn.data.previlegeObj != null && userLoggedIn.data.previlegeObj != undefined && userLoggedIn.data.previlegeObj[0]) { - + this.sessionstorage.setItem('loginDataResponse', JSON.stringify(userLoggedIn.data)); + this.trackingService.setUserId(userLoggedIn.data.userID); this.checkRoleMapped(userLoggedIn.data); } else { this.resetCaptcha(); @@ -223,6 +226,7 @@ export class LoginComponent implements OnInit { //localStorage.setItem('userID', loginDataResponse.userID); // localStorage.setItem('userName', loginDataResponse.userName); this.sessionstorage.setItem('userID', loginDataResponse.userID); + this.trackingService.setUserId(loginDataResponse.userID); this.sessionstorage.setItem('userName', loginDataResponse.userName); // localStorage.setItem('username', this.userName); this.sessionstorage.setItem('username', loginDataResponse.userName); diff --git a/src/environments/environment.ci.ts.template b/src/environments/environment.ci.ts.template index 2980b0c..a6f6563 100644 --- a/src/environments/environment.ci.ts.template +++ b/src/environments/environment.ci.ts.template @@ -14,11 +14,20 @@ const siteKey = '<%= SITE_KEY %>'; const captchaChallengeURL = '<%= CAPTCHA_CHALLENGE_URL %>'; const enableCaptcha = <%= ENABLE_CAPTCHA %>; + export const environment = { production: true, countryId: 1, encKey: sessionStorageEncKey, + tracking: { + platform: 'matomo', + siteId: parseInt('<%= SITE_ID %>'), + trackerUrl: '<%= TRACKER_URL %>', + trackingPlatform: '<%= TRACKING_PLATFORM %>', + enabled: '<%= TRACKING_ENABLED %>' === 'true' + }, + getBeneficiaryDetail: `registrar/get/benDetailsByRegIDForLeftPanelNew`, getBeneficiaryImage: `registrar/getBenImage`, getPrescriptions: `${INVENTORY_API}RX/getPrescribedMedicines`, diff --git a/src/environments/environment.local.ts b/src/environments/environment.local.ts index 60aab52..15400f0 100644 --- a/src/environments/environment.local.ts +++ b/src/environments/environment.local.ts @@ -29,6 +29,14 @@ export const environment = { countryId: 1, encKey: sessionStorageEncKey, + tracking: { + platform: 'matomo', + siteId: 2, + trackerUrl: '//127.0.0.1/', + trackingPlatform: 'local', + enabled: true + }, + getBeneficiaryDetail: `registrar/get/benDetailsByRegIDForLeftPanelNew`, getBeneficiaryImage: `registrar/getBenImage`, getPrescriptions: `${INVENTORY_API}RX/getPrescribedMedicines`, diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts index 51e7053..bd52b42 100644 --- a/src/environments/environment.prod.ts +++ b/src/environments/environment.prod.ts @@ -30,6 +30,14 @@ export const environment = { countryId: 1, encKey: sessionStorageEncKey, + tracking: { + platform: 'matomo', + siteId: 2, + trackerUrl: 'https://matomo.piramalswasthya.org/', + trackingPlatform: 'production', + enabled: true + }, + getBeneficiaryDetail: `registrar/get/benDetailsByRegIDForLeftPanelNew`, getBeneficiaryImage: `registrar/getBenImage`, getPrescriptions: `${INVENTORY_API}RX/getPrescribedMedicines`, diff --git a/src/environments/environment.test.ts b/src/environments/environment.test.ts index 0edb0e8..e12747a 100644 --- a/src/environments/environment.test.ts +++ b/src/environments/environment.test.ts @@ -24,6 +24,14 @@ export const environment = { countryId: 1, encKey: sessionStorageEncKey, + tracking: { + platform: 'matomo', + siteId: 2, + trackerUrl: '//127.0.0.1/', + trackingPlatform: 'test', + enabled: true + }, + getBeneficiaryDetail: `registrar/get/benDetailsByRegIDForLeftPanelNew`, getBeneficiaryImage: `registrar/getBenImage`, getPrescriptions: `${INVENTORY_API}RX/getPrescribedMedicines`,