-
Notifications
You must be signed in to change notification settings - Fork 26
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
db-console: statement details component #162
db-console: statement details component #162
Conversation
2a1c59d
to
a931e38
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor questions from me.
I don't like having a util
directory that accumulates lots of stuff. Could we put the nodes
and network
code just in src
?
@@ -99,7 +99,7 @@ export const Loading: React.FC<LoadingProps> = props => { | |||
|
|||
return ( | |||
<div className={cx("alerts-container", props.errorClassName)}> | |||
{errorAlerts} | |||
{React.Children.toArray(errorAlerts)} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It fixes React error about missing key
attribute for array of elements.
React.Children.toArray
accepts an array of react elements and allows to set automatically key
attribute if it's missed.
@@ -21,7 +21,7 @@ module.exports = { | |||
'node_modules', | |||
path.join(__dirname, 'src/fonts'), | |||
], | |||
extensions: [".ts", ".tsx", ".js", ".jsx", ".less"], | |||
extensions: [".ts", ".tsx", ".js", ".jsx", ".less", ".scss"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why did we need to add this now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm, this change looks useless, will revert it.
Agree |
a931e38
to
ff3fcb8
Compare
@@ -1 +1,5 @@ | |||
export * from "./barCharts"; | |||
export * from "./rowsBrealdown"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
ff3fcb8
to
a7a4488
Compare
a7a4488
to
6d8efa2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one small question.
@@ -98,6 +98,7 @@ module.exports = { | |||
test: /\.js$/, | |||
loader: "source-map-loader", | |||
}, | |||
{ test: /\.css$/, use: [ "style-loader", "css-loader" ] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are we loading raw CSS?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Components which depend on Antd styles, have to load its CSS styles explicitly and we have Table component which depends on it:
https://github.com/cockroachdb/ui/pull/162/files#diff-70a6adf902647bd71cee4e2b65f55a1a999736c39698aef2ba64f1a70aedbadaR6
This change extracts Statements details page and its dependent components and styles. - most of the components moved without any changes, only import paths were adjusted - styles converted from Styl to SCSS - modified route paths to ensure they start with "/" root path (it ensures that routes behave the same way regardless to current path). - `util` directory now contain `network` and `nodes` subdirectories with logic specific to particular entities. It allows avoid extra logic in redux layer and keep it independently.
6d8efa2
to
ee7c427
Compare
58701: ui: statement details import r=koorosh a=koorosh Related to #57372 Depends on cockroachdb/ui#162 Depends on cockroachdb/yarn-vendored#51 Statement details and Diagnostics view pages are moved out to `admin-ui-components` package and now they are imported back as a reusable components. In addition to changed imports, StatementDetails component now exposes additional props for Diagnostics view tab. Before, StatementDetails component used Diagnostics view connected to store and now it uses pure component. This change were made to provide single point of integration to redux store (the same way as other components connected). Tracking analytics functionality for Diagnostics view was initially called directly from components and now it's refactored out of component and involved with redux actions and sagas. It was necessary to exclude this logic from pure components and allow client apps which integrate Statement details to implement their own logic for tracking analytics if necessary. TODO: - [x] remove all exported components from this code base to avoid duplicates. - [x] update `admin-ui-components` package version in `package.json` Release note: None Co-authored-by: Andrii Vorobiov <[email protected]>
db-console // StatementDetails component
Related to cockroachdb/cockroach#57372
This change extracts Statements details page and its dependent
components and styles.
paths were adjusted
(it ensures that routes behave the same way regardless to current
path).
util
directory now containnetwork
andnodes
subdirectorieswith logic specific to particular entities. It allows avoid extra logic
in redux layer and keep it independently.
This change is