Commit Graph
11 Commits
Author SHA1 Message Date
Jack Franklin 51ffa992c9 Migrate component docs data grid example to TS file
Writing the component docs example inline makes it easier to quickly
through an example together but means we lose any type checking on the
examples.

This CL migrates one example to TS and updates the ES Modules Import
lint rule to allow component docs files to import the test helpers -
which we do to allow them to emulate a full DevTools environment if
required.

This change caught some invalid config in the component doc example so I
think if we can make this migration across all the component doc
examples it will help ensure our examples are up to date and valid.

Bug: 1144106
Change-Id: I32cf0e09bfe158ae5ba9b57dbc535e14a9985a5f
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2613206
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2021-01-07 10:05:36 +00:00
Jack Franklin 90b6613019 Reland "Add header context menu to data grid"
This reverts commit c2ad98d783.

Reason for revert: fixed flakey test

Original change's description:
> Revert "Add header context menu to data grid"
>
> This reverts commit 6bdb3622bd.
>
> Reason for revert: Interaction tests started failing on mac.
>
> https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/2514/overview
>
> Original change's description:
> > Add header context menu to data grid
> >
> > This CL adds a default header context menu to the data grid that lists visible
> > and sortable columns much like the legacy data grid.
> >
> > Bug: 1150793
> > Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
> > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
> > Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> > Reviewed-by: Paul Lewis <aerotwist@chromium.org>
>
> TBR=aerotwist@chromium.org,jacktfranklin@chromium.org
>
> Change-Id: Ic8ef16044716d922d3a37b6a8fb32e13a75dee72
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 1150793
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601962
> Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
> Commit-Queue: Jan Scheffler <janscheffler@chromium.org>

TBR=aerotwist@chromium.org,szuend@chromium.org,janscheffler@chromium.org,jacktfranklin@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1150793
Change-Id: Ibd352be261d2cefee6fccc4b18b438faaad57631
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2610596
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2021-01-05 11:56:39 +00:00
Jan Scheffler c2ad98d783 Revert "Add header context menu to data grid"
This reverts commit 6bdb3622bd.

Reason for revert: Interaction tests started failing on mac.

https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/2514/overview

Original change's description:
> Add header context menu to data grid
>
> This CL adds a default header context menu to the data grid that lists visible
> and sortable columns much like the legacy data grid.
>
> Bug: 1150793
> Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>

TBR=aerotwist@chromium.org,jacktfranklin@chromium.org

Change-Id: Ic8ef16044716d922d3a37b6a8fb32e13a75dee72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1150793
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601962
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
2020-12-23 07:27:30 +00:00
Jack Franklin 6bdb3622bd Add header context menu to data grid
This CL adds a default header context menu to the data grid that lists visible
and sortable columns much like the legacy data grid.

Bug: 1150793
Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-22 15:43:47 +00:00
Jack Franklin d034512dc4 Component docs can load test helpers
Most of the time we won't need this fully fledged environment, but for
some things (such as context menus, guess what I'm working on right now
:D) we do need a faked out environment to enable these features to run
when we run the component in isolation in the component docs.

Note: while this CL contains no component docs changes that take
advantage of it, I've tested locally with context menus in the data grid
and this change does work.

Fixed: 1148323
Change-Id: Ic8c508840a20b6d0f0e72fd7019a16271f04bea6
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2597313
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-21 09:59:36 +00:00
Jack Franklin 4747e2779d [DataGrid] allow columns to be resized by the mouse
Bug: 1153066
Change-Id: Ica1b2f23479b091182507a8629e8f2ccb6eea901
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2560753
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
2020-12-14 16:25:11 +00:00
Jack Franklin 72a257f2e0 Fix incorrect import in DataGrid examples.
They snuck in mistakenly and break the examples. The import was unused
and left over.

TBR=aerotwist@chromium.org

Change-Id: I48e49e24134f70146d441e6d83686ad6f3a51213
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562714
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-27 12:46:26 +00:00
Jack Franklin cfda4f910c [DataGrid]: swap hidden flag to visible + hideable
One of the features we need to support in the new DataGrid is a context
menu to hide/show columns. Therefore in preparation this CL updates the
API for a `column` from just the `hidden` field to `visible` and
`hideable`. The former denotes if the column is visible or not, and
`hideable` denotes if the user can hide/show it via the context menu.

There's no user facing change here, just type changes in preparation for
future work.

Bug: 1150793, 1125968
Change-Id: Idfa95a27aab741388548e10ff83263c6b7338724
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2550075
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-20 12:03:56 +00:00
Alfonso Castaño 405815877a Add title to DataGrid cells
This CL adds a title field to Cell. Title will be used in
stringValueForCell, as a replacement for cell.value or the renderer output.

Bug: chromium:1148760
Change-Id: I566276b5bb0536ee262d51fb70bae2a74b26390a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2536407
Commit-Queue: Alfonso Castaño <alcastano@google.com>
Reviewed-by: Jack Franklin <jacktfranklin@chromium.org>
2020-11-16 10:55:39 +00:00
Jack Franklin fe956997e9 Fix new data-grid empty state.
Before + after: https://imgur.com/a/w42MESX

Bug: 1125968
Change-Id: Ibe75e6fcc4c7f747879cb035c915442dc80a60ce
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2532241
Auto-Submit: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
2020-11-11 14:48:23 +00:00
Jack Franklin f3ebb1429d New DataGrid component.
This CL introduces the new DataGrid component, and is split into two:

- DataGrid, which is a "plain" component that takes data and renders it.
- DataGridController, which is a "smart" component that can take the
data and manipulate it (e.g. sorting), before passing it into a DataGrid
to be rendered.

These components are not feature complete in that they do not support
all features of the incumbent `DataGrid.js` but they are not designed
to. The goal here is to land the initial data-grid components, and then
work on using them in DevTools (as part of the protocol monitor). At
that point we can extend functionality by seeing what is missing and
testing in DevTools, rather than testing in isolation.

This CL includes the implementation, unit tests and component
documentation examples of the functionality that does exist, along with
a README explaining the two components and when to use each one.

Bug: 1125966
Change-Id: I1b5c9a0174c4563be64b5b4adcc8251d1498b55d
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2461772
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
Reviewed-by: Andres Olivares <andoli@chromium.org>
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
2020-11-05 15:40:11 +00:00