Block not visible in work location mapping - #157
Conversation
- Stop TB Create was hardcoding villageID/villageName to null, silently dropping the admin's village selection; it now saves them the same way Edit already does. - Old-style (pre-Nikshay) Stop TB users no longer get a guessed district auto-selected on Edit via AMRIT name-matching, and no longer inherit a stale AMRIT district ID into the Nikshay district field. District/TU/Facility/Village now come up blank for these rows so the admin picks fresh Nikshay values. - Edit's Stop TB Block/TU/Facility/Village dropdowns now have the same search box and Select All control Create already has. - MMU/TM's Edit Village dropdown was also missing search (had Select All only) - added for consistency. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Long comma-joined village lists (especially Stop TB's, sourced from an entire TU/facility) were either blowing out row height or, via the table-responsive wrapper, forcing the whole table to scroll horizontally past Edit/Deactivate. The Village cell now gets its own fixed-width, scrollable/draggable box with a hover tooltip showing the full list, so the rest of the columns stay on screen. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…mapping Stop TB's Select Block is a single-select quick-add convenience over the same TU list Select TU manages (see onNikshayBlockChange) — it isn't a separate saved value. loadNikshayTUsForEditContinued() restored selectedNikshayTUs (so Select TU showed correctly) but never wrote back to selectedNikshayBlock, so it rendered empty on Edit even though the TU/block was fully saved. Pre-fill it whenever exactly one TU is restored, the case for all live Stop TB rows. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The previous fix guessed selectedNikshayBlock off selectedNikshayTUs.length == 1, which left Block blank whenever a row had more than one TU (a real, observed case). blockID/blockName on m_userservicerolemapping ARE the saved Select Block value in their own right, stamped by onNikshayBlockChange() at save time independent of how many TUs later joined NikshayTUID. Use getNikshayUserMappingData's blockID directly to look up the matching entry in nikshayTUList instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Create's setWorkLocationObject and Edit's updateGroupedWorkLocation both wrote blockID/blockName from selectedNikshayTUs[0] — whichever TU happened to land first in the multi-select array — instead of the TU the admin actually picked in Select Block. That's order-dependent, not selection-dependent: adding a second TU after picking Block, or in a different order, silently changes what gets saved as the block with no relation to what Select Block showed on screen. Both paths now read selectedNikshayBlock.nikshayTUID/tUName directly, falling back to the first selected TU only when Block was never touched. Combined with the earlier edit-load fix (looking the saved blockID up in nikshayTUList), Select Block now round-trips correctly: whatever's picked is what's saved, and it's what shows back up next time the row is edited. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
getNikshayUserMappingData() (/admin-api/nikshay/location/userMapping) only returns nikshayTUID/nikshayFacilityID/districtID — verified against a live UAT response — it never carries blockID/blockName. The previous fix read data.blockID from exactly that response, so it was always undefined -> NaN -> the lookup silently no-op'd and Select Block stayed blank on every edit, regardless of what was actually saved. edit_Details already holds blockID/blockName intact — it's sourced from getUserRoleMapped (v_userservicerolemapping) when the row is opened for Edit, which does carry both columns. Pull savedBlockID from there instead. No backend change needed. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|



📋 Description
JIRA ID:
Please provide a summary of the change and the motivation behind it. Include relevant context and details.
✅ Type of Change
ℹ️ Additional Information
Please describe how the changes were tested, and include any relevant screenshots, logs, or other information that provides additional context.