Skip to content

Commit c0b807a

Browse files
authored
[Upgrade assistant] Hide delete button in ES table when index reindexing is in progress (#229260)
## Summary Fixes a bug in the ES deprecations table. When index reindexing was in progress, we were showing the delete button, but only the reindexing button should be available. #### Before <img width="661" height="195" alt="Screenshot 2025-07-24 at 10 04 18" src="https://github.com/user-attachments/assets/3046ebc2-21d1-48f1-a564-ded3000dd708" /> #### After <img width="554" height="203" alt="Screenshot 2025-07-24 at 10 42 26" src="https://github.com/user-attachments/assets/7545e3c2-4272-45d8-8848-f96317fc5265" />
1 parent b9f5c90 commit c0b807a

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

x-pack/platform/plugins/private/upgrade_assistant/__jest__/client_integration/es_deprecations/deprecations_list.test.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -813,6 +813,40 @@ describe('ES deprecations table', () => {
813813
expect(exists('deprecation-reindex-reindex')).toBe(false);
814814
expect(exists('deprecation-reindex-delete')).toBe(true);
815815
});
816+
it('it only displays reindexing button if reindex in progress', async () => {
817+
httpRequestsMockHelpers.setReindexStatusResponse(
818+
esDeprecationsMockResponse.migrationsDeprecations[3].index!,
819+
{
820+
reindexOp: {
821+
status: ReindexStatus.inProgress,
822+
lastCompletedStep: ReindexStep.readonly,
823+
reindexTaskPercComplete: null,
824+
},
825+
warnings: [],
826+
hasRequiredPrivileges: true,
827+
meta: {
828+
indexName: 'foo',
829+
reindexName: 'reindexed-foo',
830+
aliases: [],
831+
isFrozen: false,
832+
isReadonly: false,
833+
isInDataStream: false,
834+
isFollowerIndex: false,
835+
},
836+
}
837+
);
838+
839+
await act(async () => {
840+
testBed = await setupElasticsearchPage(httpSetup);
841+
});
842+
testBed.component.update();
843+
const { find, exists } = testBed;
844+
expect(find('reindexTableCell-actions').length).toBe(1);
845+
846+
expect(exists('deprecation-reindex-readonly')).toBe(false);
847+
expect(exists('deprecation-reindex-reindex')).toBe(true);
848+
expect(exists('deprecation-reindex-delete')).toBe(false);
849+
});
816850
});
817851
});
818852
describe('datastreams', () => {

x-pack/platform/plugins/private/upgrade_assistant/public/application/components/es_deprecations/deprecation_types/indices/actions_table_cell.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ const ReindexActionButtons: React.FunctionComponent<{
158158

159159
const canDisplayDelete = !!(
160160
reindexState.hasRequiredPrivileges &&
161+
!reindexingInProgressOrCompleted &&
161162
!isSettingReadOnly &&
162163
deprecation.level === 'critical'
163164
);

0 commit comments

Comments
 (0)