From a2673aaa87fd4dde1a2291e67ef4f969f9f41b2e Mon Sep 17 00:00:00 2001 From: vicky-primathon <67091118+vicky-primathon@users.noreply.github.com> Date: Fri, 24 Jul 2020 16:02:31 +0530 Subject: [PATCH 1/2] Fix-Open image in new tab on clicking it in table widget. (#119) * Added Button component in Table widget for actions * Action button state loading added for Table widget * Action button font-weight made as normal * Created header for common functionalities in Table Widget * Client side searching added in Table Widget. Action created for server side searching also. * Columns visibility feature initial commit * Column visibility list added in Table Widget * Changed pagination designs in accordance with new layout. This enable user to jump page as well. * Using colors values from constants * Table widget pagination, numeric input page number clamped between 1 and total pages * Adding tool tip to truncated values in table widget. Added AutoToolTipComponent that adds tooltip when text is truncated. * Table data download changes. Added downlaod icon and button to table widget. * Table data download changes * Table button loading state fixed. Table code refactored, rendering from props instead of state in ReactTableComponent * Table widget action button alignment fixed * Handled actions column changes * added proper keys to useMemo for react table widget * Download table data as CSV implemented * table data download, unused code removed * Code refactors and added dependency map with meta props and table data for computing columns * Table UI breakages on scroll and empty cells fixed * Handled empty rows in table widget * Fixed last row cut issue * Code review changes * Code review changes * Added table widget component heights as enum * code review changes * Search component in Table widget updated with support for clearing data, renamed properties * Opening image in new tab on clicking in table widget * Fixed table craching due to empty data filtering * Empty extra space on loading removed in table widget * Removed stopping of event propagation on table widget action button click * Table header UI overflow fixed * Clearing selected row on searching data in table widget * fix for cypress test Co-authored-by: Arpit Mohan --- .../appsmith/SearchComponent.tsx | 1 + .../appsmith/TableStyledWrappers.tsx | 5 +++- .../designSystems/appsmith/TableUtilities.tsx | 23 +++++++------- .../propertyControls/StyledControls.tsx | 1 + app/client/src/widgets/TableWidget.tsx | 30 +++++++++++-------- 5 files changed, 36 insertions(+), 24 deletions(-) diff --git a/app/client/src/components/designSystems/appsmith/SearchComponent.tsx b/app/client/src/components/designSystems/appsmith/SearchComponent.tsx index 4c201271ed..fc96005365 100644 --- a/app/client/src/components/designSystems/appsmith/SearchComponent.tsx +++ b/app/client/src/components/designSystems/appsmith/SearchComponent.tsx @@ -33,6 +33,7 @@ const SearchComponent = (props: SearchProps) => { return ( ` display: flex; justify-content: space-between; flex-direction: column; + overflow: hidden; .tableWrap { height: 100%; display: block; @@ -22,7 +23,8 @@ export const TableWrapper = styled.div<{ width: number; height: number }>` color: ${Colors.BLUE_BAYOUX}; position: relative; overflow-y: auto; - height: ${props => props.height - TABLE_SIZES.TABLE_HEADER_HEIGHT}px; + /* Subtracting 9px to handling widget padding */ + height: ${props => props.height - TABLE_SIZES.TABLE_HEADER_HEIGHT - 9}px; .thead, .tbody { overflow: hidden; @@ -255,6 +257,7 @@ export const TableHeaderWrapper = styled.div` align-items: center; width: 100%; border-bottom: 1px solid ${Colors.GEYSER_LIGHT}; + min-width: 700px; `; export const CommonFunctionsMenuWrapper = styled.div` diff --git a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx index e4e6efc9ea..bb7de29097 100644 --- a/app/client/src/components/designSystems/appsmith/TableUtilities.tsx +++ b/app/client/src/components/designSystems/appsmith/TableUtilities.tsx @@ -334,11 +334,18 @@ export const renderCell = ( .map((item: string, index: number) => { if (imageRegex.test(item)) { return ( -
+ e.stopPropagation()} + target="_blank" + rel="noopener noreferrer" + href={item} + > +
+ ); } else { return
Invalid Image
; @@ -401,11 +408,7 @@ const TableAction = (props: { setLoading(false); }; return ( - { - e.stopPropagation(); - }} - > +