Skip to content

Commit 8b92c60

Browse files
committed
Fixes #38760 - Add loading skeleton to Change host group modal
The BulkReassignHostgroupModal now displays a skeleton loader while fetching hostgroup data, improving user experience by providing visual feedback during the loading state. The Save button is also disabled while data is loading to prevent premature submission.
1 parent b8b0f40 commit 8b92c60

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

webpack/assets/javascripts/react_app/components/HostsIndex/BulkActions/reassignHostGroup/BulkReassignHostgroupModal.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
import { foremanUrl } from '../../../../common/helpers';
2727
import { APIActions } from '../../../../redux/API';
2828
import HostGroupSelect from './HostGroupSelect';
29+
import SkeletonLoader from '../../../common/SkeletonLoader';
2930
import {
3031
HOSTS_API_PATH,
3132
API_REQUEST_KEY,
@@ -197,7 +198,10 @@ const BulkReassignHostgroupModal = ({
197198
ouiaId="bulk-reassign-hg-modal-add-button"
198199
variant="primary"
199200
onClick={handleSave}
200-
isDisabled={hostUpdateStatus === STATUS.PENDING}
201+
isDisabled={
202+
hostUpdateStatus === STATUS.PENDING ||
203+
hostgroupStatus !== STATUS.RESOLVED
204+
}
201205
isLoading={hostUpdateStatus === STATUS.PENDING}
202206
>
203207
{__('Save')}
@@ -249,7 +253,7 @@ const BulkReassignHostgroupModal = ({
249253
/>
250254
</Text>
251255
</TextContent>
252-
{hostgroups && hostgroupStatus === STATUS.RESOLVED && (
256+
<SkeletonLoader status={hostgroupStatus} skeletonProps={{ count: 3 }}>
253257
<HostGroupSelect
254258
onClear={handleClear}
255259
headerText={__('Select host group')}
@@ -270,7 +274,7 @@ const BulkReassignHostgroupModal = ({
270274
);
271275
})}
272276
</HostGroupSelect>
273-
)}
277+
</SkeletonLoader>
274278
<hr />
275279
</Modal>
276280
);

0 commit comments

Comments
 (0)