* WIP: Performance improvements in entity explorer * WIP: Achieve feature parity for entity explorer with release * Update unit tests * Add sentry profiling to current page entity properties component * Fix page add/delete not showing up on entity explorer issue. Update memoization logic for pagegroup entity * Deal with the ban-ts-ignore eslint issues * Update unit tests * Fix widget entity children visibility * Fix tests and code * Fix tests for scenarios where the collapsed entities are unmount, as this is a part of the performance optimization * Filter undefined children when generating structureDSL * Remove rule from eslintrc Consolidate createPage test command * Update CreatePage tests to remove redundant dsl updates * Revert CreatePage test changes, as adding more checks within this command globally causes other tests to have issues. * re-enable eslint rule, as without it CI tests fail * Revert to ban-ts-comment * Fix typescript ban-ts-ignore issue by upgrading react-scripts and fixing typescript issue across the application * Typescript errors handled Co-authored-by: vicky-primathon.in <vicky.bansal@primathon.in>
79 lines
1.8 KiB
TypeScript
79 lines
1.8 KiB
TypeScript
/* eslint-disable @typescript-eslint/ban-types */
|
|
// TODO(vikcy): Fix the banned types in this file
|
|
import React from "react";
|
|
import { Icon, IconName } from "@blueprintjs/core";
|
|
import styled from "styled-components";
|
|
|
|
const PagerContainer = styled.div`
|
|
&&& {
|
|
height: 49px;
|
|
}
|
|
`;
|
|
function PagerIcon(props: {
|
|
icon: IconName;
|
|
onClick: Function;
|
|
className: string;
|
|
}) {
|
|
return (
|
|
<Icon
|
|
className={props.className}
|
|
style={{
|
|
padding: 14,
|
|
marginTop: 5,
|
|
}}
|
|
icon={props.icon}
|
|
iconSize={14}
|
|
onClick={props.onClick as any}
|
|
></Icon>
|
|
);
|
|
}
|
|
interface PagerProps {
|
|
pageNo: number;
|
|
prevPageClick: Function;
|
|
nextPageClick: Function;
|
|
}
|
|
|
|
const PageWrapper = styled.div`
|
|
&& {
|
|
width: 140px;
|
|
display: flex;
|
|
margin: 0 auto;
|
|
}
|
|
`;
|
|
|
|
export function TablePagination(props: PagerProps) {
|
|
return (
|
|
<PagerContainer className={"e-control e-pager e-lib"}>
|
|
<PageWrapper>
|
|
<PagerIcon
|
|
icon={"chevron-left"}
|
|
onClick={props.prevPageClick}
|
|
className={
|
|
props.pageNo <= 1
|
|
? "e-prev e-icons e-icon-prev e-prevpagedisabled e-disable"
|
|
: "e-prev e-icons e-icon-prev e-prevpage"
|
|
}
|
|
></PagerIcon>
|
|
<div
|
|
className={"e-numericcontainer"}
|
|
style={{
|
|
marginTop: 12,
|
|
marginLeft: 6,
|
|
}}
|
|
>
|
|
<button
|
|
className={"e-link e-numericitem e-spacing e-currentitem e-active"}
|
|
>
|
|
{props.pageNo}
|
|
</button>
|
|
</div>
|
|
<PagerIcon
|
|
className={"e-next e-icons e-icon-next e-nextpage"}
|
|
icon={"chevron-right"}
|
|
onClick={props.nextPageClick}
|
|
></PagerIcon>
|
|
</PageWrapper>
|
|
</PagerContainer>
|
|
);
|
|
}
|