Commit Graph

13 Commits

Author SHA1 Message Date
Luke De Feo
e07d5c5bfe Added support for dotted key paths in Data table column
Summary:
This adds support for the key of DataTableColumn to be a dotted path into a nested object, e.g foo.bar. Currently the typescript types only allow a top level key to be set, making this feature currently unusuable from plugin code.

While this could be addressed in a future commit the intention of this is to allow the user to add custom fields into their table columns at run time

Note there is a side effect to free text search from this commit. Previously it would search all top keys in the object. Now it will only search in columns that are in the table.

changelog: Searching data table will now only search columns in the table, rather than all top level attributes of the object

Reviewed By: mweststrate

Differential Revision: D36663929

fbshipit-source-id: 3688e9f26aa7e1828f8e9ee69f8e6f86268c8a54
2022-05-30 04:37:25 -07:00
Michel Weststrate
b77b234e98 fix table header column widths deviating from rows
Summary:
changelog: Improved column widths in data tables

This diff fixes two issues:
1) dynamic width columns became invisible if there is too much else, and therefor it was hard to make them bigger or even notice them
2) column headers could be out of sync with the actually rendered rows, due to minor styling differences

Reviewed By: cekkaewnumchai

Differential Revision: D33364781

fbshipit-source-id: c3d47bb8db4af521859a5cbdf525d8ce39c71d00
2022-01-04 04:08:23 -08:00
Andres Suarez
79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00
dependabot[bot]
34a09a3096 Bump react-virtual from 2.8.0 to 2.8.2 in /desktop (#2999)
Summary:
Bumps [react-virtual](https://github.com/tannerlinsley/react-virtual) from 2.8.0 to 2.8.2.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/tannerlinsley/react-virtual/releases">react-virtual's releases</a>.</em></p>
<blockquote>
<h2>v2.8.2</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.1...v2.8.2">2.8.2</a> (2021-09-30)</h2>
<h3>Performance Improvements</h3>
<ul>
<li>reuse already measure items, include key into virtualItem (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/179">https://github.com/facebook/flipper/issues/179</a>) (<a href="8cb22fb46f">8cb22fb</a>)</li>
</ul>
<h2>v2.8.1</h2>
<h2><a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.0...v2.8.1">2.8.1</a> (2021-08-05)</h2>
<h3>Bug Fixes</h3>
<ul>
<li>Page Title (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/177">https://github.com/facebook/flipper/issues/177</a>) (<a href="38726c8a7d">38726c8</a>)</li>
<li>range calculated only on scroll (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/166">https://github.com/facebook/flipper/issues/166</a>) (<a href="adf60b3f31">adf60b3</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="8cb22fb46f"><code>8cb22fb</code></a> perf: reuse already measure items, include key into virtualItem (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/179">https://github.com/facebook/flipper/issues/179</a>)</li>
<li><a href="433d9663ce"><code>433d966</code></a> Update CarbonAds.js</li>
<li><a href="121a5dfad7"><code>121a5df</code></a> docs(index): Fix typo in 'dyanmically' (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/176">https://github.com/facebook/flipper/issues/176</a>)</li>
<li><a href="adf60b3f31"><code>adf60b3</code></a> fix: range calculated only on scroll (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/166">https://github.com/facebook/flipper/issues/166</a>)</li>
<li><a href="38726c8a7d"><code>38726c8</code></a> fix: Page Title (<a href="https://github-redirect.dependabot.com/tannerlinsley/react-virtual/issues/177">https://github.com/facebook/flipper/issues/177</a>)</li>
<li><a href="80207b716a"><code>80207b7</code></a> Update index.js</li>
<li><a href="7c2501ee08"><code>7c2501e</code></a> new gh header</li>
<li><a href="36d57d323c"><code>36d57d3</code></a> Update README.md</li>
<li><a href="b72c0291a5"><code>b72c029</code></a> Update overview.md</li>
<li><a href="31ed0e323a"><code>31ed0e3</code></a> docs: fix links</li>
<li>Additional commits viewable in <a href="https://github.com/tannerlinsley/react-virtual/compare/v2.8.0...v2.8.2">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=react-virtual&package-manager=npm_and_yarn&previous-version=2.8.0&new-version=2.8.2)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

 ---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `dependabot rebase` will rebase this PR
- `dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `dependabot merge` will merge this PR after your CI passes on it
- `dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `dependabot cancel merge` will cancel a previously requested merge and block automerging
- `dependabot reopen` will reopen this PR if it is closed
- `dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>

Pull Request resolved: https://github.com/facebook/flipper/pull/2999

Reviewed By: passy

Differential Revision: D31991577

Pulled By: mweststrate

fbshipit-source-id: b81c96b80478c4ae92aac26e809eabec8dbe90e9
2021-11-11 12:21:58 -08:00
Michel Weststrate
6c7b69803f Add support for negative filters
Summary:
Changelog: Add support for negative filters in data tables

As requested per somewhere on workplace but couldn't find it back :)

Reviewed By: nikoant

Differential Revision: D29486096

fbshipit-source-id: 467c8598f6d09afc9a5ed85affb6c51840afe00c
2021-06-30 10:42:32 -07:00
Michel Weststrate
2127dea447 Fix initialisation error
Summary: There was an initialisation error possible if the crash reporter tried to start with an initial selection (after coming from a deeplink or the notification pane), which would cause an unending update loop.

Reviewed By: passy

Differential Revision: D29331127

fbshipit-source-id: 14e75e483c232039e6a80aa131fa5ce7c105b670
2021-06-24 01:37:09 -07:00
Michel Weststrate
7e4df00138 Implement context menu
Summary:
Re-introduced context menu to DataTable, due to popular demand.

Originally it wasn't there to better align with ant design principles, but in an app like Flipper it makes just too much sense to have it

See e.g. https://fb.workplace.com/groups/flippersupport/permalink/1138285579985432/

changelog: Restored context menu in data tables

Reviewed By: passy

Differential Revision: D28996137

fbshipit-source-id: 16ef4c90997c9313efa62da7576fd453a7853761
2021-06-10 12:57:47 -07:00
Michel Weststrate
84e2646909 Reorganise for easier extraction
Summary:
To make the DataSource abstraction reusable for other teams and an upcoming talk, this diff moves all DataSource storage & virtualization logic in one folder.

Will set up a build process and demo project in later diffs.

Reviewed By: nikoant

Differential Revision: D28056700

fbshipit-source-id: 7cfe5b40bbbe387da711f765a604a45029d451c7
2021-05-10 07:03:39 -07:00
Michel Weststrate
e3cb16d870 Fixed layout issue with undefined column widths
Summary: This fixes an earlier reported issue with Messages plugin, if no column widths are set values can jump around per row

Reviewed By: passy

Differential Revision: D28090807

fbshipit-source-id: be124b94f507584cf177710816035cd280a5ef01
2021-04-29 07:31:54 -07:00
Michel Weststrate
bbcb16d8fb Make DataTable / DataInspector unit tests predictable
Summary: Having time / async / non-blocking behavior in components in unit tests is really annoying, as it makes unit tests async without an easy way to determine 'done'. This diff makes sure that DataTable & DataInspector don't break down their work in smaller tasks, but do everything block if they are running in a unit test.

Reviewed By: nikoant

Differential Revision: D28054487

fbshipit-source-id: 72c3b519e092ad69ed71eb1731e1fed80022f91f
2021-04-28 06:33:04 -07:00
Michel Weststrate
d6c74c4e2f Support natural sizing
Summary:
Introduced the `scrollable={false}` option to DataTable, that gives the table its natural size, while still having all the other gimmicks of DataTable, like search, filter, etc etc.

To implement this, a non-virtualizing rendering is needed, which is handled by the `StaticDataSourceRenderer`

Also introduced the option to hide the searchbar.

Reviewed By: nikoant

Differential Revision: D28036469

fbshipit-source-id: 633c4f7f3fabfa99efa2839059aaa59b0a407ada
2021-04-28 05:48:20 -07:00
Michel Weststrate
faf8588097 Minor improvements
Summary:
Some styling fixes and minor improvements in DataTable, used by network plugin:

- be able to customise the context menu
- be able to customise how entire rows are copied and presented on the clipboard to be able to deviate from the standard JSON
- deeplink handling was made async, this gives the plugin the opportunity to first handle initial setup and rendering before trying to jump somewhere which is a typical use case for deeplinking

Reviewed By: passy

Differential Revision: D27947186

fbshipit-source-id: a56f081d60520c4bc2ad3c547a8ca5b9357e71a1
2021-04-23 09:29:59 -07:00
Michel Weststrate
cd27e4c010 Folder rename datatable -> data-table
Summary: just a rename, as we will have `data-inspector` folder as well in next diffs.

Reviewed By: passy

Differential Revision: D27591891

fbshipit-source-id: b1fe92cbf4be1633e623e59b694efc3f687c3413
2021-04-07 07:55:12 -07:00