Commit Graph

586 Commits

Author SHA1 Message Date
Anton Kastritskiy
6c4c579f27 Increase max width for resizable sidebar
Reviewed By: LukeDefeo

Differential Revision: D51305977

fbshipit-source-id: 03fbdba01d01aaecdd182538aed64ae396818f4d
2023-11-14 08:14:37 -08:00
Andrey Goncharov
9910807826 Fix power search for slogs
Reviewed By: antonk52

Differential Revision: D51232391

fbshipit-source-id: 6501f60ee4168c62d1d4efefcfcc698d4954e7ac
2023-11-14 06:28:11 -08:00
Luke De Feo
437e67cd7f Remove uneeded operators from simplified config
Summary:
The single value == / contains are covered by the setlike oper /ators.

Less operators is better as less overwhelming. Plus with the group operators you can add futher options or'ed togther which is a complain from the user.

Reviewed By: aigoncharov

Differential Revision: D51255253

fbshipit-source-id: 72f909319fd3d8034ebe4725a5a5254ecfeb074b
2023-11-13 06:02:32 -08:00
Andrey Goncharov
cd9db40e4f Support occasionally stringified null and undefined in enums
Reviewed By: LukeDefeo

Differential Revision: D51202685

fbshipit-source-id: 74d0a3d7ed956f3fafc393f180b30cd2fcc55384
2023-11-10 09:08:28 -08:00
Andrey Goncharov
2d28ca2c37 Support enum label inferral for simplified config
Reviewed By: LukeDefeo

Differential Revision: D51199436

fbshipit-source-id: c611f0d5a21d7500447342d3e2a5e12c55e9b67d
2023-11-10 09:08:28 -08:00
Andrey Goncharov
a1070b8cea Add regex support
Reviewed By: LukeDefeo

Differential Revision: D51198464

fbshipit-source-id: 445cc47f90c2730f3b0728e5bf667330274d103d
2023-11-10 04:34:09 -08:00
Andrey Goncharov
b5cb7fcce2 Support simplified power search config
Summary: It is quite cumbersome to list all of the operators. Much simpler to use a predefined set of power search operators we set up for each specific filed type

Reviewed By: lblasa

Differential Revision: D51116029

fbshipit-source-id: 5dd0b7f4176097109666107dfc3cab996379b818
2023-11-09 05:08:16 -08:00
Andrey Goncharov
284dee0460 Extend default list of operators for unconfigured columns
Summary:
It does not make too much sense to keep the unknown value conversion behind a flag. It is relatively cheap. Let's do it for all strings.
Also, let's extend the list of default string operators

Reviewed By: lblasa

Differential Revision: D51115573

fbshipit-source-id: a62c08a90d8ddf6f23f59412c3fd981e19225e47
2023-11-09 05:08:16 -08:00
Luke De Feo
e461229075 Enum dropdown width matches content rather than parent input
Reviewed By: aigoncharov

Differential Revision: D51112879

fbshipit-source-id: e3647df81ce7bbed91a606e68d44a503c367c948
2023-11-08 10:30:55 -08:00
Andrey Goncharov
3dc9cc5d3d Skip unknown values during filtering by default
Reviewed By: LukeDefeo

Differential Revision: D51078471

fbshipit-source-id: b3a005f31eebd77e9ff77349640133032f4b0164
2023-11-08 02:13:47 -08:00
Andrey Goncharov
a8f5fecc2b Infer enum labels
Reviewed By: LukeDefeo

Differential Revision: D51067952

fbshipit-source-id: ed39d3ab037a2169120187bf20bf4a023488c025
2023-11-08 02:08:25 -08:00
Andrey Goncharov
d9ecac4bc2 Track legacy manager API access
Summary:
We swap legacy MasterDetail and DataTable with the new ones that have power search.
The new ones have partially incompatible table manager API.
This diff adds a warning, a migration guide and  tracking for these cases.

Reviewed By: LukeDefeo

Differential Revision: D50969831

fbshipit-source-id: ef4153fec9720ea5d7ae1cb4df3528c5d6bca2bb
2023-11-03 08:03:50 -07:00
Andrey Goncharov
9c5df1516f Export legacy MasterDetail and DataTable
Summary: Allow plugin developers to force old search for migration purposes

Reviewed By: LukeDefeo

Differential Revision: D50969832

fbshipit-source-id: 7fe5c3e65680d628bced2cd09823f7f3c132d33a
2023-11-03 08:03:50 -07:00
Anton Kastritskiy
99dbcfa079 casing convension
Summary:
[eslint-typescript/naming-convension rule docs](https://typescript-eslint.io/rules/naming-convention/)

Initially looked into it to enforce UPPER_CASE for top most constants like `const DELAY = 10` which is a standard in js ecosystem, which turned to be more difficuilt(we will still get there).

Turns out we had casing checks disabled for everything but typeLike names. What I did in this diff

- use default setting for eslint rule
    `✖ 9890 problems`
- with any propery names
    `✖ 8229 problems`
- without checking properies at all
    `✖ 3683 problems`
- without checking enum members
    `✖ 3231 problems`
- without checking object properties/methods
    `✖ 2978 problems`
- allowing PascalCase for variables
    `✖ 1657 problems
- allowing PascalCase for functions
    `✖ 975 problems
- not checking typeMethod and parameters
    `✖ 916 problems`
- allow double underscore before after variable
    `✖ 461 problems`
- allow snake_case variables
    `✖ 49 problems`

Fix remaining problems.

Future plans. Ban usage of PascalCase for variables that are not components

Reviewed By: LukeDefeo

Differential Revision: D50970193

fbshipit-source-id: d9f3abe6b02c9f7822598c8fa5382f58d067f70e
2023-11-03 06:16:18 -07:00
Andrey Goncharov
b4f77da11a Fix unexpected unkown options recognition
Summary:
#thanks LukeDefeo for helping to debug power search

Before:
 https://pxl.cl/3JFqq

Reviewed By: LukeDefeo, lblasa

Differential Revision: D50884084

fbshipit-source-id: 4cf76a73704cda3627b3bb5ab170d6e76df977cf
2023-11-01 07:55:57 -07:00
Andrey Goncharov
3706be8b2f Fix power search metrics
Summary: Move them from programmatic API that is barely used to a central place that handles state updates

Reviewed By: lblasa

Differential Revision: D50841152

fbshipit-source-id: 7938ae08629ba05736cb7acba5ca2014e2827acc
2023-10-31 09:51:13 -07:00
Andrey Goncharov
2c1e814264 Allow power search to be controlled externally
Reviewed By: LukeDefeo

Differential Revision: D50732883

fbshipit-source-id: a19932b5a3f319fd1dc45572fef251369283cc61
2023-10-27 05:45:28 -07:00
Luke De Feo
f3449a5641 Make panel adhere to Figma design
Summary: css to change the header styling

Reviewed By: lblasa

Differential Revision: D50595982

fbshipit-source-id: 836ea7881426e95abb449c085fca39606cd8cfdd
2023-10-26 05:24:30 -07:00
Luke De Feo
1b0eb31bd9 Default to first tab if active tab not available
Summary:
This is only really an issue in theUIDebugger where we have a dynamic number of tabs. on some nodes you have 3 tabs, on others you have 2. if you select the 3rd tab and move to a node with 2 tabs nothing will be selected.

With this fix we will fallback to the first tab

Reviewed By: lblasa

Differential Revision: D50595977

fbshipit-source-id: 25c36a5609f774c2d3fd650eb6520104864fbe95
2023-10-26 05:24:30 -07:00
Pascal Hartig
50b06f2efd Remove unused eventemitter 3
Summary: This seems to be (no longer) in use.

Reviewed By: lblasa

Differential Revision: D50659072

fbshipit-source-id: 0fde643711ee4859a5d270a878d858694337d6a5
2023-10-26 03:05:02 -07:00
Andrey Goncharov
efdcaee302 Make enum term length dynamic
Reviewed By: mweststrate

Differential Revision: D50551626

fbshipit-source-id: f180252782244aaa5bc8c90521664f6bcbe6b9b7
2023-10-23 06:51:06 -07:00
Anton Kastritskiy
663380e721 mark unused vars as errors
Reviewed By: lblasa

Differential Revision: D50500690

fbshipit-source-id: 6f739fe25c232ecfe842337af4399681e85f6a13
2023-10-20 12:44:58 -07:00
Anton Kastritskiy
30100989f4 fix tabs + localStorage
Summary:
Key fix is
```diff
-    'Tabs:' + localStorageKeyOverride ?? keys.join(','),
+    'Tabs:' + (localStorageKeyOverride ?? keys.join(',')),
```

Previously it worked like `('Tabs:' + localStorageKeyOverride) ?? keys.join(','),` which always evaluated to `"Tabs:undefined"`. This means that all tabs that were not using localStorageKeyOverride were reusing the same localstorage key. If you open some tabs with A, B, and C tabs. And open tab B. Then open other tabs with D, E, and F. No tab would be selected as the default value would be B.

The second part it extracing keys from `items` prop instead of children.

Reviewed By: lblasa

Differential Revision: D50411422

fbshipit-source-id: 30f70c4347649f29e8c8ff1f2f38fdca7e826198
2023-10-18 09:33:48 -07:00
Andrey Goncharov
a0a9465c0b Fix dark theme support
Reviewed By: lblasa

Differential Revision: D50406262

fbshipit-source-id: eda5c73efcd50dbe572cab078d3c04a4cd845601
2023-10-18 04:15:05 -07:00
Andrey Goncharov
82487be96e Handle paste
Summary: When a user pastes anything, it is treated as an input for a search through the entire row

Reviewed By: lblasa

Differential Revision: D49948975

fbshipit-source-id: 2dd23d4ee0819623549d88eb077c7b2d2fdf604f
2023-10-05 03:54:29 -07:00
Andrey Goncharov
c8fc3e6b82 If not option is matched, treat it as a whole row search predicate
Summary: See prev diffs

Reviewed By: lblasa

Differential Revision: D49948976

fbshipit-source-id: 177fd4b90449c78975b6a21c50a781789425b34e
2023-10-05 03:54:29 -07:00
Andrey Goncharov
c4fbd10e68 Allow handling arbitrary text
Summary:
When a user enters any arbitrary text, we will treat as an input for the search through the entire row.
Based on feedback from https://fb.workplace.com/groups/flippersupport/permalink/1703929480087703/

Reviewed By: lblasa

Differential Revision: D49911868

fbshipit-source-id: 4c569e4b01e468f0ca112ea4b00fe143b30bed2a
2023-10-05 03:54:29 -07:00
Andrey Goncharov
0346dc1120 Add an predicate to search a whole row
Summary:
Allow users to search through the entire row.
Based on feedback from https://fb.workplace.com/groups/flippersupport/permalink/1703929480087703/

Reviewed By: lblasa

Differential Revision: D49911869

fbshipit-source-id: 7bb9816c91b9168d657314b289e3ecc3c237c8d8
2023-10-05 03:54:29 -07:00
Pascal Hartig
4905446697 Update deps
Summary: Update a few selected patch-level deps.

Reviewed By: antonk52

Differential Revision: D49779877

fbshipit-source-id: 5f8da30a3802f4ca516ad20ac223cafce5120ba0
2023-10-03 10:58:10 -07:00
Andrey Goncharov
1e81fe636a Add extraActions fallback to MasterDetai and DataTable
Summary: Old MasterDetail and DataTable (pre-power search) are using `extraActions` prop which no longer exists in teh new components. This diff adds a fallback.

Reviewed By: ivanmisuno

Differential Revision: D49869730

fbshipit-source-id: 4c1a658aa94acc770836f9bf296a3df7d6cdcb3e
2023-10-03 09:13:02 -07:00
Andrey Goncharov
72e6ba2705 Add dedicated operators to handle seriazable objects
Reviewed By: lblasa

Differential Revision: D49828114

fbshipit-source-id: 6846ce7360697806a6a770c1c6f864d162eee528
2023-10-02 08:27:37 -07:00
Andrey Goncharov
010de365fa Allow using whole row for power search
Reviewed By: lblasa

Differential Revision: D49827828

fbshipit-source-id: 93219146ba59074be305eb9a963550223a5abd18
2023-10-02 08:27:37 -07:00
Andrey Goncharov
c27f9c7916 Fallback for empty titles
Summary: Some columns set title to an empty string

Reviewed By: lblasa

Differential Revision: D49826852

fbshipit-source-id: 3661394323dade813295420a1186d9297a8be153
2023-10-02 08:27:37 -07:00
Andrey Goncharov
84bb47655e Hide unknown value processing behind a GK
Reviewed By: antonk52

Differential Revision: D49822509

fbshipit-source-id: 2228883f8ef16013a63c0d6d69697e32b55cec68
2023-10-02 08:27:37 -07:00
Andrey Goncharov
76918ae4fe Handle unknown values when adding power search to unconfigured columns
Reviewed By: antonk52

Differential Revision: D49822513

fbshipit-source-id: a9c5c6ddc91ac6e7284af045ec673144d9c64906
2023-10-02 08:27:37 -07:00
Andrey Goncharov
4165a1b272 Handle unknown values in string operators
Reviewed By: antonk52

Differential Revision: D49822510

fbshipit-source-id: 4fc22df7af282e93af28bb0e69f70acd805e620b
2023-10-02 08:27:37 -07:00
Andrey Goncharov
8a591a7855 Support handleUnknownValues in default operators
Summary: We treat every column without the power search config as if it contains strings. Sometimes that might bite us, for instance, when the column contains an object.

Reviewed By: lblasa

Differential Revision: D49822511

fbshipit-source-id: 18dadb5abe624fae510663fc26668b2b594899c3
2023-10-02 08:27:37 -07:00
Andrey Goncharov
446147b9fe Split SimpleOperatorConfig
Reviewed By: lblasa

Differential Revision: D49822512

fbshipit-source-id: 82fc6a72cd5ff3b5f9d577baea49367b4f2521fd
2023-10-02 08:27:37 -07:00
Anton Kastritskiy
a37b04737c Move default actions and extra actions next to the search
Summary: Having default and extra actions at the bottom is not actionable. Users are used to haveing table controls on the top.

Reviewed By: LukeDefeo, aigoncharov

Differential Revision: D49538205

fbshipit-source-id: 724a31dc44de79cb0e09efae48dd2135450b34ae
2023-09-22 08:25:24 -07:00
Anton Kastritskiy
947cc819e3 remove unneccessary console.log
Reviewed By: lblasa

Differential Revision: D49502424

fbshipit-source-id: 674eb165871da43427ea5605b4aa74ec3297dd33
2023-09-21 09:43:22 -07:00
Andrey Goncharov
a35708989c Add metrics
Reviewed By: antonk52

Differential Revision: D49455605

fbshipit-source-id: 00b4de3106d2497b43708623c410ca262e931059
2023-09-20 05:39:33 -07:00
Andrey Goncharov
fc5fa4a349 Fix styles of non-interactive elements
Summary: Make non-interactive elements non-focusable and disable hover styles for them

Reviewed By: LukeDefeo

Differential Revision: D49455532

fbshipit-source-id: a047e1a149ab4131feef70b80a4995b455441701
2023-09-20 05:39:33 -07:00
Andrey Goncharov
f3bff735cc Simplify search term renderer matching
Summary: Each search term renderer handles its "editing" state internally now. As a result, we can simplify switch-case

Reviewed By: antonk52

Differential Revision: D49454252

fbshipit-source-id: 297ce73f53772b0112ed338c6aac0583f3807ec8
2023-09-20 04:36:57 -07:00
Andrey Goncharov
e031032b93 Make date term editable
Reviewed By: lblasa

Differential Revision: D49453947

fbshipit-source-id: b6959c6ac74d8966e21fb91f7dcbdf186253b93b
2023-09-20 04:36:57 -07:00
Andrey Goncharov
e180a1ed4b Make float term editable
Summary: For the purposes of the demo I added power search config for a float field to the summary field

Reviewed By: lblasa

Differential Revision: D49452844

fbshipit-source-id: 26aaadd07a1a8a67dfcf3cb9d8e487f8f4ee2214
2023-09-20 04:36:57 -07:00
Andrey Goncharov
31e93ff3fe Make integer term editable
Summary: For the purposes of the demo I added power search config for an integer field to the summary field

Reviewed By: lblasa

Differential Revision: D49452729

fbshipit-source-id: 78b8fdccfd799a0f71f652d90d10e11db237cbae
2023-09-20 04:36:57 -07:00
Andrey Goncharov
b3fe4c9650 Make enum term editable
Reviewed By: lblasa

Differential Revision: D49452483

fbshipit-source-id: e9bef3c5499a91231f6025e403c132b924491def
2023-09-20 04:36:57 -07:00
Andrey Goncharov
09cb48a3e3 Make string term editable
Summary:
At the end of the stack we are going to unify two branches of the switch-case in PowerSearchTerm.tsx.
Each search term is going to handle the finalized and "editing" mode internally

Reviewed By: lblasa

Differential Revision: D49451975

fbshipit-source-id: 587ba332d1fbfbaefb368e37965543575e64062f
2023-09-20 04:36:57 -07:00
Andrey Goncharov
1163769b83 Change layout for power search enabled data table
Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: antonk52

Differential Revision: D49411939

fbshipit-source-id: 0ca8b69ac7eaad1ece88caa5a220203fe54ad946
2023-09-19 08:19:25 -07:00
Andrey Goncharov
f6ffbfe3e2 Fix filtering bugs
Summary: Doc: https://docs.google.com/document/d/1miofxds9DJgWScj0zFyBbdpRH5Rj0T9FqiCapof5-vU/edit#heading=h.pg8svtdjlx7

Reviewed By: antonk52

Differential Revision: D49411941

fbshipit-source-id: 530b0abcbba57e2503da4641d17fd1a507955b45
2023-09-19 08:19:25 -07:00