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

Migrate Table visualization to React Part 1: Renderer #3963

Merged
merged 25 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
3f10ab2
Migrate Table visualization (Renderer) to React
kravets-levko Jul 8, 2019
e909f80
Restore all column types except of JSON
kravets-levko Jul 8, 2019
c9f09eb
Restore JSON column + fix proptypes
kravets-levko Jul 8, 2019
eb3323c
Restore JSON column: refine code and fix bugs
kravets-levko Jul 8, 2019
5048e4d
Refine code
kravets-levko Jul 10, 2019
ca8bcc5
Restore search in data
kravets-levko Jul 16, 2019
91fd16f
Restore column sorting
kravets-levko Jul 16, 2019
66f8265
Cleanup: remove angular components (incl. <dynamic-table>)
kravets-levko Jul 17, 2019
d9117a4
Minor fixes
kravets-levko Jul 17, 2019
a0c56dd
Merge branch 'master' into migrate-visualization-table
kravets-levko Jul 17, 2019
31b3a4e
Fix tests
kravets-levko Jul 17, 2019
e662803
Fixes: pagination alignment; re-render visualization on tab change (a…
kravets-levko Jul 18, 2019
cd8fb4a
Add tests
kravets-levko Jul 18, 2019
64afeec
Fix search in table: force cast value to string
kravets-levko Jul 18, 2019
6401afa
When visualization options change, compare them deeply to avoid unnec…
kravets-levko Jul 23, 2019
4547ca5
Merge branch 'master' into migrate-visualization-table
kravets-levko Jul 24, 2019
c045003
Make tests more stable
kravets-levko Jul 24, 2019
c0aad9d
CR1: UI tweaks
kravets-levko Jul 30, 2019
bfe02e7
Better align tooltip on table header cells
kravets-levko Jul 30, 2019
fdfb760
Add link to GH discussion
kravets-levko Jul 30, 2019
11628f6
Tweak table headings
kravets-levko Jul 31, 2019
61730f6
Merge branch 'master' into migrate-visualization-table
kravets-levko Jul 31, 2019
b47ea55
Update to reflect changes in new Ant version
kravets-levko Jul 31, 2019
5b80f43
Fix search input
kravets-levko Jul 31, 2019
675ea83
Increase min width of table headings
kravets-levko Jul 31, 2019
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
8 changes: 7 additions & 1 deletion client/app/assets/less/inc/ant-variables.less
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@
@font-size-base: 13px;


/* --------------------------------------------------------
Borders
-----------------------------------------------------------*/
@border-color-split: #f0f0f0;


/* --------------------------------------------------------
Typograpgy
-----------------------------------------------------------*/
Expand Down Expand Up @@ -77,4 +83,4 @@
Notification
-----------------------------------------------------------*/
@notification-padding: @notification-padding-vertical 48px @notification-padding-vertical 17px;
@notification-width: auto;
@notification-width: auto;
20 changes: 20 additions & 0 deletions client/app/components/HtmlContent.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import PropTypes from 'prop-types';
import { $sanitize } from '@/services/ng';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do it in this PR, but:

  1. We need a non Angular alternative for this.
  2. Let's wrap Angular's $sanitize with our own function, so we can easily replace the implementation later.


export default function HtmlContent({ children, ...props }) {
return (
<div
{...props}
dangerouslySetInnerHTML={{ __html: $sanitize(children) }} // eslint-disable-line react/no-danger
/>
);
}

HtmlContent.propTypes = {
children: PropTypes.string,
};

HtmlContent.defaultProps = {
children: '',
};
6 changes: 2 additions & 4 deletions client/app/components/dashboards/TextboxDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Modal from 'antd/lib/modal';
import Input from 'antd/lib/input';
import Tooltip from 'antd/lib/tooltip';
import Divider from 'antd/lib/divider';
import HtmlContent from '@/components/HtmlContent';
import { wrap as wrapDialog, DialogPropType } from '@/components/DialogWrapper';
import notification from '@/services/notification';

Expand Down Expand Up @@ -100,10 +101,7 @@ class TextboxDialog extends React.Component {
<React.Fragment>
<Divider dashed />
<strong className="preview-title">Preview:</strong>
<p
dangerouslySetInnerHTML={{ __html: this.state.preview }} // eslint-disable-line react/no-danger
className="preview markdown"
/>
<HtmlContent className="preview markdown">{this.state.preview}</HtmlContent>
</React.Fragment>
)}
</div>
Expand Down
47 changes: 0 additions & 47 deletions client/app/components/dynamic-table/default-cell/index.js

This file was deleted.

This file was deleted.

66 changes: 0 additions & 66 deletions client/app/components/dynamic-table/default-cell/utils.js

This file was deleted.

30 changes: 0 additions & 30 deletions client/app/components/dynamic-table/dynamic-table-row.js

This file was deleted.

35 changes: 0 additions & 35 deletions client/app/components/dynamic-table/dynamic-table.html

This file was deleted.

64 changes: 0 additions & 64 deletions client/app/components/dynamic-table/dynamic-table.less

This file was deleted.

Loading