diff --git a/frontend/src/actions/commonActions.js b/frontend/src/actions/commonActions.js index 02c98e0e..60976963 100644 --- a/frontend/src/actions/commonActions.js +++ b/frontend/src/actions/commonActions.js @@ -15,7 +15,7 @@ export const sortTable = (currState) => (dispatch, getState) => { const { activeSortDir, activeSortIndex, tableColumns } = getState()[currState]; try { - if (activeSortIndex) { + if (activeSortIndex !== null && typeof activeSortIndex !== "undefined") { const sortedResults = results.sort((a, b) => { const aValue = getSortableRowValues(a, tableColumns)[activeSortIndex]; const bValue = getSortableRowValues(b, tableColumns)[activeSortIndex]; @@ -31,7 +31,7 @@ export const sortTable = (currState) => (dispatch, getState) => { return bValue.localeCompare(aValue); } }); - sortedTableRows(currState, sortedResults); + dispatch(sortedTableRows(currState, sortedResults)); } } catch (error) { console.log(error); @@ -41,7 +41,7 @@ export const sortTable = (currState) => (dispatch, getState) => { const sortedTableRows = (currState, sortedResults) => (dispatch) => { if (currState === "cpt") { dispatch({ - type: TYPES.SET_CPT_JOBS_DATA, + type: TYPES.SET_FILTERED_DATA, payload: sortedResults, }); dispatch(sliceTableRows(0, DEFAULT_PER_PAGE)); @@ -49,7 +49,7 @@ const sortedTableRows = (currState, sortedResults) => (dispatch) => { } if (currState === "ocp") { dispatch({ - type: TYPES.SET_OCP_JOBS_DATA, + type: TYPES.SET_OCP_FILTERED_DATA, payload: sortedResults, }); dispatch(sliceOCPTableRows(0, DEFAULT_PER_PAGE)); diff --git a/frontend/src/actions/homeActions.js b/frontend/src/actions/homeActions.js index 4925e5f1..d050b494 100644 --- a/frontend/src/actions/homeActions.js +++ b/frontend/src/actions/homeActions.js @@ -84,7 +84,7 @@ export const buildFilterData = () => (dispatch, getState) => { let obj = { name: filter.name, key, - value: [...new Set(results.map((item) => item[key]))], + value: [...new Set(results.map((item) => item[key]?.toLowerCase()))], }; filterData.push(obj); } diff --git a/frontend/src/assets/constants/SidemenuConstants.js b/frontend/src/assets/constants/SidemenuConstants.js index b4c1f631..bc04fd52 100644 --- a/frontend/src/assets/constants/SidemenuConstants.js +++ b/frontend/src/assets/constants/SidemenuConstants.js @@ -1,3 +1,4 @@ export const HOME_NAV = "home"; export const QUAY_NAV = "quay"; export const OCP_NAV = "ocp"; +export const TELCO_NAV = "telco"; diff --git a/frontend/src/components/molecules/SideMenuOptions/index.jsx b/frontend/src/components/molecules/SideMenuOptions/index.jsx index 9117345b..48bed8de 100644 --- a/frontend/src/components/molecules/SideMenuOptions/index.jsx +++ b/frontend/src/components/molecules/SideMenuOptions/index.jsx @@ -23,6 +23,11 @@ const sideMenuOptions = [ key: "quay", displayName: "Quay", }, + { + id: CONSTANTS.TELCO_NAV, + key: "telco", + displayName: "Telco", + }, ]; const MenuOptions = () => {