Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

added paginate params for KPI list and changed fornt size in paginati… #946

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/DashboardForm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const DashboardForm = ({ setText, setModal, onboarding }) => {
} = useSelector((state) => state.DashboardHome);

useEffect(() => {
dispatch(getAllKpiExplorer());
dispatch(getAllKpiExplorer({ paginate: false }));
if (path[2] === 'edit') {
dispatch(getEditDashboard({ dashboard_id: dashboardId }));
} // eslint-disable-next-line react-hooks/exhaustive-deps
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ const KpiAlertConfigurationForm = ({
}, [kpiAlertEditData]);

const dispatchGetAllKpiExplorer = () => {
dispatch(getAllKpiExplorer());
dispatch(getAllKpiExplorer({ paginate: false }));
};

useEffect(() => {
Expand Down
26 changes: 14 additions & 12 deletions frontend/src/components/Pagination/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,18 +123,20 @@ const Pagination = ({
}}>
{'>'}
</button>
<select
className="per-page-select"
onChange={handleSelectClick}
value={per_page.value}>
{per_page_options.map((option, index) => {
return (
<option key={index} value={option.value}>
{option.label}
</option>
);
})}
</select>
<div className="select-container">
<select
className="per-page-select"
onChange={handleSelectClick}
value={per_page.value}>
{per_page_options.map((option, index) => {
return (
<option key={index} value={option.value}>
{option.label}
</option>
);
})}
</select>
</div>
</div>
)}
</div>
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/Pagination/pagination.scss
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,14 @@
width: 32px;
height: 32px;
}
.per-page-select {
.select-container .per-page-select {
border: 1px solid #e2e2ea;
box-sizing: border-box;
border-radius: 8px;
width: 61px;
height: 32px;
background: none;
font-size: 14px;
}
.per-page-select * {
background-color: white;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/containers/Dashboard/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const Dashboard = () => {
}, []);

const getAllDashboardSidebar = () => {
dispatch(getDashboardSidebar({ dashboard_id: dashboard }));
dispatch(getDashboardSidebar({ dashboard_id: dashboard, paginate: false }));
};

const getAnomalySetting = (id) => {
Expand Down
6 changes: 4 additions & 2 deletions frontend/src/containers/KpiSetting/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@ const Kpisetting = ({ onboarding, setModal, setText }) => {

const getAllDashboardSidebar = () => {
if (dashboardId !== null && dashboardId !== undefined) {
dispatch(getDashboardSidebar({ dashboard_id: dashboardId }));
dispatch(
getDashboardSidebar({ dashboard_id: dashboardId, paginate: false })
);
} else {
dispatch(getDashboardSidebar({ dashboard_id: 0 }));
dispatch(getDashboardSidebar({ dashboard_id: 0, paginate: false }));
}
};

Expand Down