Skip to content

extend Diagnostics column for statements page#31

Merged
koorosh merged 4 commits intocockroachdb:masterfrom
koorosh:diagnostics-prev-bundles
Oct 15, 2020
Merged

extend Diagnostics column for statements page#31
koorosh merged 4 commits intocockroachdb:masterfrom
koorosh:diagnostics-prev-bundles

Conversation

@koorosh
Copy link
Copy Markdown
Contributor

@koorosh koorosh commented Oct 2, 2020

Related to cockroachdb/cockroach#50824

Previously, statement diagnostics could only be triggered from
Statements page and it wasn't possible to download. Also when
first diagnostics report is generated, then Activate button
wasn't available at all.

Now, Diagnostics column allows users to request diagnostics
reports when all previous reports are generated and allow
to download all previously generated reports from the list.

Screen Shot 2020-10-01 at 4 55 32 PM

With rewritten Dropdown component, it is necessary to
adjust its usage across the current package.
Currently, it is used only in one place so this changes
aren't global.

Screen Shot 2020-10-01 at 4 55 16 PM

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@koorosh koorosh changed the title Diagnostics prev bundles extend Diagnostics column for statements page Oct 2, 2020
@vladlos
Copy link
Copy Markdown
Contributor

vladlos commented Oct 12, 2020

@koorosh, trying it out locally, keep getting such error:
Screenshot 2020-10-12 at 17 28 40

Copy link
Copy Markdown
Contributor

@nathanstilwell nathanstilwell left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, 9 of 9 files at r4.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dhartunian, @elkmaster, and @koorosh)

a discussion (no related file):
I guess there's not great time to start this conversation, but is it possible to replace the Button component in admin-ui-components with Button from cockroachdb/ui? That should ensure we are consistent with latest designs. If some functionality is missing or inadequate I would at least like to know.

There are also some instances where I think we could begin integrating the values found in our design tokens. I'm only going to leave this feedback as a comment for now, as I don't want to hold up this work. But this is making me realize that we should discuss how we can start consolidating components in our work going forward.


@koorosh
Copy link
Copy Markdown
Contributor Author

koorosh commented Oct 14, 2020

Reviewed 3 of 3 files at r1, 5 of 5 files at r2, 1 of 1 files at r3, 9 of 9 files at r4.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dhartunian, @elkmaster, and @koorosh)

a discussion (no related file):
I guess there's not great time to start this conversation, but is it possible to replace the Button component in admin-ui-components with Button from cockroachdb/ui? That should ensure we are consistent with latest designs. If some functionality is missing or inadequate I would at least like to know.

There are also some instances where I think we could begin integrating the values found in our design tokens. I'm only going to leave this feedback as a comment for now, as I don't want to hold up this work. But this is making me realize that we should discuss how we can start consolidating components in our work going forward.

@nathanstilwell , you're absolutely right cockroachdb/ui has to be the primary source for components and design tokens!
In this case, Button component (from admin-ui-components repo) has extended functionality to handle rendering of icons, rest of logic looks mostly the same.
I will check if it's possible to use cockroachdb/ui component here without extra changes in component, otherwise keep current implementation.

Buttons that rendered with icons didn't
set correct icon style depending on
button type and state.

Now, color of icon is updated in the same
way as Button colors.

In addition `icon` prop is changed to accept
`ReactNode` now, because function call with
returning ReactNode is redundant in current
component.
The main reason to rewrite entirely Dropdown component is
that it was very difficult to maintain, extend to current
needs. Lots of custom logic was added inside so it felt like
very custom component.

Current component is designed to easily customize it by
overriding values via props and predefined options satisfy
custom designs.
With rewritten Dropdown component, it is necessary to
adjust its usage across current package.
Currently, it is used only in one place so this changes
aren't global.
Previously, statement diagnostics could only be triggered from
Statements page and it wasn't possible to download. Also when
first diagnostics report is generated, then `Activate` button
wasn't available at all.

Now, Diagnostics column allows users to request diagnostics
reports when all previous reports are generated and allows
to download all previously generated reports from the list.

Resolves: #50824
@koorosh koorosh merged commit 95d229a into cockroachdb:master Oct 15, 2020
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Oct 20, 2020
55164: ui: extend diagnostics column to allow activate and download reports r=koorosh a=koorosh

Resolves #50824
~~Depends on cockroachdb/admin-ui-components#31
~~Depends on cockroachdb/yarn-vendored#42

Previously, Statements table had a Diagnostics column which allowed
users to request diagnostics reports for the first time and then
displayed status for requested report only. As result it wasn't
possible to download already generated report or request new one
report from the statements table.

With current changes, Diagnostics column allows requesting new
reports every time when previous reports are generated.
Also, it provides a list with links to download previous reports.

The main change is to provide a list of available (or requested)
reports for every statement (instead of a single, most recent
report as it was before). Then extracted `StatementsPage` component
(from `admin-ui-components` package) handles all rendering logic
for this list of reports.

Minor changes:
- `WAITING FOR QUERY` status is renamed to `WAITING` for new design
- `getDiagnosticsStatus` utility function is reused to reduce code
duplication

Release note (admin ui change): Diagnostics column (on statements table)
has been changed and includes `Activate` button and dropdown list to
download completed reports. Also, diagnostics badge status is changed from
`WAITING FOR QUERY` to `WAITING`

![Screen Shot 2020-10-01 at 4 55 32 PM](https://user-images.githubusercontent.com/3106437/94915373-77c62c80-04b5-11eb-8fef-4b33db15613b.png)


Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com>
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Oct 22, 2020
55499: ui: update styles for session details page r=koorosh a=koorosh

resolves #54513 
depends on cockroachdb/admin-ui-components#31
depends on cockroachdb/admin-ui-components#34
depends on cockroachdb/admin-ui-components#35

Current fix is quite complex and touches a lot of places because most of the issues with styles were common for all pages (Statements, Jobs, Node Overview).
Also many style duplicates required to get rid of duplicates and unify single version of proper components to use across entire app.

It's easier to review this PR per commit. Each commit describes in details what changes were made and their purpose.
 
![Screen Shot 2020-10-13 at 3 18 18 PM](https://user-images.githubusercontent.com/3106437/95859522-690a3000-0d67-11eb-94bb-1cccaac1d816.png)

![Screen Shot 2020-10-13 at 1 43 23 PM](https://user-images.githubusercontent.com/3106437/95856423-a9b37a80-0d62-11eb-8ade-54e8ed5b895c.png)


Co-authored-by: Andrii Vorobiov <and.vorobiov@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants