Skip to content
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

ui: finish short-term enhancements to cluster overview #20669

Merged
merged 4 commits into from
Dec 13, 2017

Conversation

couchand
Copy link
Contributor

This fixes everything from #19512, leaving #20540 and #19945 for future work.

screen shot 2017-12-12 at 6 47 07 pm

@couchand couchand requested a review from a team December 12, 2017 23:47
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@vilterp
Copy link
Contributor

vilterp commented Dec 13, 2017

:lgtm: with a minor nit


Review status: 0 of 2 files reviewed at latest revision, 1 unresolved discussion, some commit checks failed.


pkg/ui/src/views/cluster/containers/clusterOverview/index.tsx, line 17 at r1 (raw file):

// tslint:disable-next-line:no-var-requires
const spinner = require<string>("assets/spinner.gif");

does import spinner from "assets/spinner.gif" work?


Comments from Reviewable

@couchand
Copy link
Contributor Author

Well look at that, your nit made me learn something.


Review status: 0 of 6 files reviewed at latest revision, 2 unresolved discussions.


pkg/ui/src/views/cluster/containers/clusterOverview/index.tsx, line 17 at r1 (raw file):

Previously, vilterp (Pete Vilter) wrote…

does import spinner from "assets/spinner.gif" work?

TBH I just cargo-culted that 😳.

Tried it out. Builds fine (Webpack gets it), but tslint (and maybe tsc) doesn't get it:
Cannot find module 'assets/spinner.gif'.

...

UPDATE: after reading through microsoft/TypeScript#2709 I've found a solution!

I'm not exactly clear on how the import "*.styl" was already working, but perhaps because it was just imported for the side-effect, TS doesn't bother checking for it?


Comments from Reviewable

@couchand couchand force-pushed the feature/finish-cluster-overview branch from 9b81e20 to 1cd32d6 Compare December 13, 2017 15:52
@vilterp
Copy link
Contributor

vilterp commented Dec 13, 2017

Nice 👍 LGTM

@couchand
Copy link
Contributor Author

whoops, missed the file with the important part

@couchand couchand force-pushed the feature/finish-cluster-overview branch 2 times, most recently from 16451c9 to 26ebba7 Compare December 13, 2017 16:48
@mrtracy
Copy link
Contributor

mrtracy commented Dec 13, 2017

Review status: 0 of 7 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


pkg/ui/src/views/cluster/containers/clusterOverview/index.tsx, line 17 at r1 (raw file):

Previously, couchand (Andrew Couch) wrote…

TBH I just cargo-culted that 😳.

Tried it out. Builds fine (Webpack gets it), but tslint (and maybe tsc) doesn't get it:
Cannot find module 'assets/spinner.gif'.

...

UPDATE: after reading through microsoft/TypeScript#2709 I've found a solution!

I'm not exactly clear on how the import "*.styl" was already working, but perhaps because it was just imported for the side-effect, TS doesn't bother checking for it?

RE: Side effect imports, yes, that is correct.


Comments from Reviewable

@mrtracy
Copy link
Contributor

mrtracy commented Dec 13, 2017

:lgtm:


Review status: 0 of 7 files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


Comments from Reviewable

Previously, require was used to get around TypeScript's checking
of imported modules.  But this is ugly, and fortunately we can
avoid it by declaring a module for anything in the assets dir.

Release note: None
@couchand couchand force-pushed the feature/finish-cluster-overview branch from 26ebba7 to ede0950 Compare December 13, 2017 21:26
@couchand couchand merged commit 16118b5 into cockroachdb:master Dec 13, 2017
@couchand couchand deleted the feature/finish-cluster-overview branch December 13, 2017 21:52
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