Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

console: fix "Cannot read property 'foldable'" runtime error in Browse Rows page (fix #4907) #5016

Merged
merged 5 commits into from
Jun 8, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Read more about the session argument for computed fields in the [docs](https://h
- console: fix visiting view modify page overwriting raw sql content (fix #4798) (#4810)
- console: add help button and move about page to settings (#4848)
- console: add new sidebar icon that separates enums from tables (fix #4984) (#4992)
- console: fix runtime error when accessing a table in `Browse Rows` page (fix #4907) (#5016)
- cli: list all available commands in root command help (fix #4623) (#4628)
- cli: fix bug with squashing event triggers (close #4883)
- cli: add support for skipping execution while generating migrations through the migrate REST API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default ReactTable => {
};

applyFoldableForColumns = columns => {
return columns.map((col, index) => {
return columns.filter(Boolean).map((col, index) => {
if (!col.foldable) return col;

//If col don't have id then generate id based on index
Expand Down
12 changes: 9 additions & 3 deletions console/src/components/Common/Tooltip/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,20 @@ import React from 'react';
import OverlayTrigger from 'react-bootstrap/lib/OverlayTrigger';
import Tooltip from 'react-bootstrap/lib/Tooltip';
import styles from './Tooltip.scss';

const tooltipGen = (message: string) => {
return <Tooltip id={message}>{message}</Tooltip>;
};export interface TooltipProps extends React.ComponentProps<'i'> {
};
export interface TooltipProps extends React.ComponentProps<'i'> {
message: string;
placement?: 'right' | 'left' | 'top' | 'bottom';
className?: string;
}
const ToolTip: React.FC<TooltipProps> = ({ message, placement = 'right', children }) => (
const ToolTip: React.FC<TooltipProps> = ({
message,
placement = 'right',
children,
}) => (
<OverlayTrigger placement={placement} overlay={tooltipGen(message)}>
{children || (
<i
Expand All @@ -19,4 +25,4 @@ const ToolTip: React.FC<TooltipProps> = ({ message, placement = 'right', childre
)}
</OverlayTrigger>
);
export default ToolTip;
export default ToolTip;