Skip to content

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

Merged
merged 14 commits into from
Jun 11, 2018
Merged

Schematic improvements #11191

merged 14 commits into from
Jun 11, 2018

Conversation

amcdnl
Copy link
Contributor

@amcdnl amcdnl commented May 6, 2018

Addresses #10833

@amcdnl amcdnl self-assigned this May 6, 2018
@amcdnl amcdnl requested a review from jelbourn May 6, 2018 18:44
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 6, 2018
Copy link
Member

@jelbourn jelbourn left a 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?

@@ -3,3 +3,6 @@ A collection of Schematics for Angular Material.

## Collection
- [Shell](shell/README.md)
Copy link
Member

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": {
Copy link
Member

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
Copy link
Member

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(
Copy link
Member

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

@@ -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`);
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

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...

Copy link
Member

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">
Copy link
Member

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?

Copy link
Contributor Author

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`
Copy link
Member

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 .
Copy link
Member

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 {
Copy link
Member

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.

# Nav
Creates a navigation component with responsive sidenav.

Command: `ng g @angular/material:materialNav --name nav`
Copy link
Member

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?

@@ -0,0 +1,5 @@
# Nav
Creates a navigation component with responsive sidenav.
Copy link
Member

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;
Copy link
Member

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.

Copy link
Contributor Author

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.

Command: `ng g @angular/material:materialTable --name table`
Copy link
Member

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?

@crisbeto
Copy link
Member

crisbeto commented May 7, 2018

Also needs a rebase.

@ngbot
Copy link

ngbot bot commented May 8, 2018

Hi @amcdnl! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

Copy link
Contributor Author

@amcdnl amcdnl left a 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">
Copy link
Contributor Author

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;
Copy link
Contributor Author

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.

@@ -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`);
Copy link
Contributor Author

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...

@ngbot
Copy link

ngbot bot commented May 22, 2018

Hi @amcdnl! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

Copy link
Member

@jelbourn jelbourn left a 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

@jelbourn jelbourn added pr: lgtm target: patch This PR is targeted for the next patch release labels May 22, 2018
@ngbot
Copy link

ngbot bot commented May 22, 2018

Hi @amcdnl! This PR has merge conflicts due to recent upstream merges.
Please help to unblock it by resolving these conflicts. Thanks!

@jelbourn
Copy link
Member

jelbourn commented Jun 4, 2018

CI is all red now

@amcdnl
Copy link
Contributor Author

amcdnl commented Jun 10, 2018

@jelbourn Fixed.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added action: merge The PR is ready for merge by the caretaker pr: merge safe labels Jun 11, 2018
@jelbourn jelbourn merged commit 6bd2775 into angular:master Jun 11, 2018
@amcdnl amcdnl deleted the schematic-improvements branch June 12, 2018 13:45
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants