Skip to content

Commit

Permalink
refactor(InventoryTable): Deprecate unused actions (#2128)
Browse files Browse the repository at this point in the history
* refactor(InventoryTable): Deprecate CONFIG_CHANGED action

* refactor(InventoryTable): Deprecate GROUPS_FOR_ENTITIES
  • Loading branch information
gkarat authored Jan 4, 2024
1 parent a18b479 commit e19520c
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 32 deletions.
2 changes: 0 additions & 2 deletions src/store/action-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ export const asyncInventory = [
'OPERATING_SYSTEMS',
'GROUPS',
'GROUP_DETAIL',
'GROUPS_FOR_ENTITIES',
];

export const systemIssues = [
Expand Down Expand Up @@ -70,7 +69,6 @@ export const FILTER_SELECT = 'FILTER_SELECT';
export const ENTITIES_LOADING = 'ENTITIES_LOADING';
export const CLEAR_FILTERS = 'CLEAR_FILTERS';
export const TOGGLE_TAG_MODAL = 'TOGGLE_TAG_MODAL';
export const CONFIG_CHANGED = 'CONFIG_CHANGED';
export const TOGGLE_DRAWER = 'TOGGLE_INVENTORY_DRAWER';
export const CLEAR_ENTITIES = 'CLEAR_ENTITIES';
export const CLEAR_ERRORS = 'CLEAR_ERRORS';
15 changes: 0 additions & 15 deletions src/store/entities.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
CLEAR_ENTITIES,
CLEAR_ERRORS,
CLEAR_FILTERS,
CONFIG_CHANGED,
ENTITIES_LOADING,
FILTER_SELECT,
SELECT_ENTITY,
Expand Down Expand Up @@ -278,13 +277,6 @@ function changeSort(state, { payload: { key, direction } }) {
};
}

function groupsLoaded(state, { payload }) {
return {
...state,
groups: payload.results,
};
}

function selectFilter(
state,
{
Expand Down Expand Up @@ -430,13 +422,6 @@ export default {
loaded: !isLoading,
}),
[TOGGLE_TAG_MODAL]: toggleTagModalReducer,
[CONFIG_CHANGED]: (state, { payload }) => ({ ...state, invConfig: payload }),
[CLEAR_ENTITIES]: clearEntities,
[ACTION_TYPES.GROUPS_FOR_ENTITIES_PENDING]: (state) => ({
...state,
groups: [],
}),
[ACTION_TYPES.GROUPS_FOR_ENTITIES_FULFILLED]: (state, action) =>
groupsLoaded(state, { payload: { ...action.payload } }),
[CLEAR_ERRORS]: (state) => ({ ...state, error: null }),
};
15 changes: 0 additions & 15 deletions src/store/inventory-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ACTION_TYPES,
CHANGE_SORT,
CLEAR_FILTERS,
CONFIG_CHANGED,
ENTITIES_LOADING,
FILTER_ENTITIES,
FILTER_SELECT,
Expand All @@ -18,7 +17,6 @@ import {
getEntitySystemProfile,
getOperatingSystems,
getTags,
groupsApi,
hosts,
} from '../api';
import {
Expand Down Expand Up @@ -247,20 +245,7 @@ export const deleteEntity = (systems, displayName) => ({
},
});

export const configChanged = (config) => ({
type: CONFIG_CHANGED,
payload: config,
});

export const toggleDrawer = (isOpened) => ({
type: TOGGLE_DRAWER,
payload: { isOpened },
});

export const fetchGroupsForEntities = (params) => ({
type: ACTION_TYPES.GROUPS_FOR_ENTITIES,
payload: groupsApi.apiGroupGetGroupList(params),
meta: {
noError: true, // turns of automatic notification
},
});

0 comments on commit e19520c

Please sign in to comment.