-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Schematic improvements #11191
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
Schematic improvements #11191
Conversation
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.
Could you squash your commits into one with a single description that describes the changes made?
src/lib/schematics/README.md
Outdated
@@ -3,3 +3,6 @@ A collection of Schematics for Angular Material. | |||
|
|||
## Collection | |||
- [Shell](shell/README.md) |
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.
Can you change "Shell" to "Install"?
// Create a dashboard component | ||
"materialDashboard": { | ||
"dashboard": { |
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.
We should keep the old name as an alias
@@ -0,0 +1,5 @@ | |||
# Dashboard |
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 create a separate file for each one?
{ title: 'Card 4', cols: 1, rows: 1 } | ||
]; | ||
/** Based on the screen size, switch from standard to one column per row */ | ||
cards = this.breakpointObserver.observe(Breakpoints.Handset).pipe( |
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.
The cols
property of the grid-list itself should probably also change
src/lib/schematics/shell/index.ts
Outdated
@@ -78,7 +78,7 @@ function addBodyMarginToStyles(options: Schema) { | |||
const buffer = host.read(stylesPath); | |||
if (buffer) { | |||
const src = buffer.toString(); | |||
const insertion = new InsertChange(stylesPath, src.length, `\nbody { margin: 0; }\n`); | |||
const insertion = new InsertChange(stylesPath, src.length, `\nbody { margin: 0; font-family: 'Roboto', sans-serif; }\n`); |
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.
I'm not sure this should happen by default. The install schematic currently makes things available without changing the existing app, and I think it's best to preserve that. We can add something like a --typography
option, though.
@crisbeto would setting .mat-body
be the more appropriate thing to do here?
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.
We don't have a mat-body
, but setting mat-typography
would propagate all the typography styles.
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.
@jelbourn - You told me to add this in the original issue.
We should add a style to make the font Roboto...
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.
Ha, I'm apparently fickle. Today I'm on board with it being there by default, but think we should do it with a css class rather than adding a new style on the body directly. I'm fine with that being in a follow-up PR, though.
@@ -1,21 +1,20 @@ | |||
<div class="mat-elevation-z8"> | |||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements"> | |||
|
|||
<table mat-table #table [dataSource]="dataSource" matSort aria-label="Elements"> |
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.
Didn't @andrewseguin already change this?
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.
He changed the one in the component, not the one in the html file.
# Dashboard | ||
Creates a responive card grid list component . | ||
|
||
Command: `ng g @angular/material:materialDashboard --name dashboard` |
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.
Shouldn't it be ng g @angular/material:dashboard
?
@@ -0,0 +1,5 @@ | |||
# Dashboard | |||
Creates a responive card grid list component . |
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.
Extra space before the dot.
{ title: 'Card 3', cols: 2, rows: 1 }, | ||
{ title: 'Card 4', cols: 2, rows: 1 } | ||
]; | ||
} else { |
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.
You don't need the else
here, you can just return at the bottom.
src/lib/schematics/nav/README.md
Outdated
# Nav | ||
Creates a navigation component with responsive sidenav. | ||
|
||
Command: `ng g @angular/material:materialNav --name nav` |
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.
Should it be ng g @angular/material:nav
?
src/lib/schematics/nav/README.md
Outdated
@@ -0,0 +1,5 @@ | |||
# Nav | |||
Creates a navigation component with responsive sidenav. |
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.
"with responsive" -> "with a responsive"
} | ||
|
||
.mat-toolbar.mat-primary { | ||
position: sticky; |
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.
Should we really be using position: sticky
? The browser support isn't great and fixed
should be able to get the job done for an example.
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.
We actually use position sticky on the material docs site. Supports seems decent just missing IE11.
src/lib/schematics/table/README.md
Outdated
Command: `ng g @angular/material:materialTable --name table` |
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.
Shouldn't it be ng g @angular/material:table
?
Also needs a rebase. |
Hi @amcdnl! This PR has merge conflicts due to recent upstream merges. |
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.
Addressed feedback
@@ -1,21 +1,20 @@ | |||
<div class="mat-elevation-z8"> | |||
<mat-table #table [dataSource]="dataSource" matSort aria-label="Elements"> | |||
|
|||
<table mat-table #table [dataSource]="dataSource" matSort aria-label="Elements"> |
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.
He changed the one in the component, not the one in the html file.
} | ||
|
||
.mat-toolbar.mat-primary { | ||
position: sticky; |
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.
We actually use position sticky on the material docs site. Supports seems decent just missing IE11.
src/lib/schematics/shell/index.ts
Outdated
@@ -78,7 +78,7 @@ function addBodyMarginToStyles(options: Schema) { | |||
const buffer = host.read(stylesPath); | |||
if (buffer) { | |||
const src = buffer.toString(); | |||
const insertion = new InsertChange(stylesPath, src.length, `\nbody { margin: 0; }\n`); | |||
const insertion = new InsertChange(stylesPath, src.length, `\nbody { margin: 0; font-family: 'Roboto', sans-serif; }\n`); |
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.
@jelbourn - You told me to add this in the original issue.
We should add a style to make the font Roboto...
# Conflicts: # src/lib/schematics/install/index.ts
Hi @amcdnl! This PR has merge conflicts due to recent upstream merges. |
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 needs rebase
Hi @amcdnl! This PR has merge conflicts due to recent upstream merges. |
CI is all red now |
@jelbourn Fixed. |
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
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Addresses #10833