Skip to content

Commit 0251a6d

Browse files
committed
fix(FR-2491): preserve project selection when closing Fair Share settings modal without changes (#6508)
Resolves #6478 (FR-2491) ## Summary - Fixed a bug where closing the Fair Share weight settings modal without making changes would clear the project (and domain/user) row selection in the table. - The `onRequestClose` handler in `FairShareList.tsx` was unconditionally calling `setSelectedRows([])` on modal close, even when the modal was opened for a single-row settings edit. Now `selectedRows` is only cleared when the save was successful or when the bulk edit modal (opened via the bulk edit button) is cancelled. ## Root Cause When a user clicked the settings icon on a single row, `selectedSingleRow` was set to open the modal. On modal close (cancel), `setSelectedRows([])` wiped the checkbox selections even though those were unrelated to the single-row edit. ## Test plan - [ ] Select multiple projects via checkboxes in Fair Share project step - [ ] Click the settings icon on a single project row to open the weight setting modal - [ ] Close the modal without making changes - [ ] Verify the checkbox selections are preserved - [ ] Open the bulk edit modal (via the bulk edit button in the toolbar) and cancel - [ ] Verify the checkbox selections are cleared (expected behavior for bulk edit cancel) - [ ] Make a successful edit and verify selections are cleared after save 🤖 Generated with [Claude Code](https://claude.com/claude-code)
1 parent 23c1110 commit 0251a6d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

react/src/components/FairShareItems/FairShareList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -873,8 +873,8 @@ const FairShareList: React.FC = () => {
873873
onRequestClose={(success) => {
874874
if (success) {
875875
updateFetchKey();
876+
setSelectedRows([]);
876877
}
877-
setSelectedRows([]);
878878
setSelectedSingleRow(null);
879879
setOpenWeightSettingModal(false);
880880
}}

0 commit comments

Comments
 (0)