Skip to content

Conversation

@5Amogh
Copy link
Member

@5Amogh 5Amogh commented Jan 9, 2026

πŸ“‹ Description

JIRA ID: amm-2061

admin work location mapping issue fixed


βœ… Type of Change

  • 🐞 Bug fix (non-breaking change which resolves an issue)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced work location block selection behavior to prevent unexpected updates triggered by background system processes and automatic selection changes. The interface now responds exclusively to your direct user interactions, eliminating unintended modifications and providing a more reliable, predictable experience when managing, configuring, and maintaining your work location mappings and related assignments.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 9, 2026

πŸ“ Walkthrough

Walkthrough

A click event handler on an edit block selection option is replaced with an onSelectionChange handler that includes a guard condition ($event.isUserInput) to ensure only user-initiated selections trigger the setUpdatedBlockName update, preventing unintended programmatic selection changes.

Changes

Cohort / File(s) Summary
Work Location Mapping Template
src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html
Replaced click event handler with onSelectionChange handler; added guard condition to filter out programmatic selections and only process user-initiated changes

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A guard stands tall at selection's gate,
User clicks flow through, programmatic ones wait,
isUserInput checks with care,
No unwanted updates in the air!
*~CodeRabbit

πŸš₯ Pre-merge checks | βœ… 3
βœ… Passed checks (3 passed)
Check name Status Explanation
Description Check βœ… Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check βœ… Passed The title clearly identifies the specific issue (amm-2061) and describes the main change (work location mapping issue fixed), directly relating to the changeset.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❀️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 9, 2026

@5Amogh 5Amogh changed the base branch from main to release-3.6.1 January 9, 2026 13:16
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html (1)

736-738: Good fix for preventing programmatic updates, but consider consolidating logic.

The $event.isUserInput guard correctly prevents setUpdatedBlockName from being called during programmatic selection changes, which addresses the bug. However, this splits the block selection logic between the mat-select (line 729) and individual mat-option elements.

♻️ Optional refactor to consolidate logic on mat-select

Consider moving the block name capture to the mat-select's selectionChange handler to centralize the logic:

At line 729, update the mat-select handler:

-                (selectionChange)="getEditVillageMaster(ServiceEditblock)"
+                (selectionChange)="
+                  getEditVillageMaster(ServiceEditblock);
+                  setUpdatedBlockName(
+                    editblocks.find(b => b.blockID === ServiceEditblock)?.blockName
+                  )
+                "

Then remove the onSelectionChange from mat-option:

                <mat-option
                  *ngFor="let item of editblocks"
                  [value]="item.blockID"
-                  (onSelectionChange)="
-                    $event.isUserInput && setUpdatedBlockName(item.blockName)
-                  "
                >

This centralizes selection handling and eliminates the need for the isUserInput guard since mat-select's selectionChange only fires for actual value changes.

πŸ“œ Review details

Configuration used: defaults

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 66872f4 and 25b2a07.

πŸ“’ Files selected for processing (1)
  • src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html
🧰 Additional context used
🧠 Learnings (1)
πŸ“š Learning: 2024-11-25T11:01:28.621Z
Learnt from: devikasuresh20
Repo: PSMRI/ADMIN-UI PR: 50
File: src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.ts:1981-1981
Timestamp: 2024-11-25T11:01:28.621Z
Learning: In the `filterComponentList` method of `WorkLocationMappingComponent` in `src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.ts`, retain the manual filtering implementation as it provides better control over the filtering logic.

Applied to files:

  • src/app/app-provider-admin/provider-admin/activities/work-location-mapping/work-location-mapping.component.html

@5Amogh 5Amogh merged commit 9c83693 into release-3.6.1 Jan 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants