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

ng: functional settings dialog #2794

Merged
merged 3 commits into from
Oct 21, 2019
Merged

Conversation

stephanwlee
Copy link
Contributor

Note that this does not have the user experience we ultimately want.
This change only contains functional improvements.

image

Note that this does not have the user experience we ultimately want.
This change only contains functional improvements.
selector: 'settings-button',
template: `
<button mat-button (click)="openDialog()">
<mat-icon>more_vert</mat-icon>
Copy link
Contributor

Choose a reason for hiding this comment

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

Locally, I can't get this icon to appear. Are we including material icons fonts somewhere?
[1] makes it sound like "You will still need to include the HTML to load the font"

[1] https://material.angular.io/components/icon/overview

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I opted out of using icon fonts but instead use the svg variant of mat-icon. I've not done the set up all correctly just yet. I was going to revisit this later.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack. Maybe add a TODO somewhere? Up to you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because how it looks is self-evident of its TODO-ness, I will omit a code TODO.

name = "settings",
srcs = [
"dialog.component.ts",
"settings.component.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

"settings.component.ts" > "settingsUI.component.ts" or "button.component.ts" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to settings_button.component.ts. This is an "entry point" from other component/module's point of view so I decided to not use very generic name like button.component.ts (kinda like how material components are prefixed with Mat)

Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks!

MatCheckboxModule,
MatDialogModule,
MatIconModule,
MatInputModule,
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a way for me to know:

  • Which Component uses a specific module?
  • Which Directives from module X are used?

I can't easily check for unused imported modules without understanding the context of each one. Just curious whether that's the intended Angular approach

Copy link
Contributor Author

Choose a reason for hiding this comment

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

AFAIK, nope. I can imagine writing tool that checks for strict immediate deps and have such check but we do not have one by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ack, thanks

private readonly reloadPeriodInSec$ = this.store.pipe(
select(getReloadPeriodInSec)
);
readonly reloadPeriodControl = new FormControl(15, [
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the default value be the store's value, instead of '15'? Or 'null', if it doesn't matter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

view should not know anything about store. null sounds good but it would fail the condition on initial render so I made it the min value.

Copy link
Contributor

Choose a reason for hiding this comment

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

Stepping via debugger, it seems like the initial render takes the initial value from the store (ngOnInit and the setValue fire before the first render). Either sounds fine, though

Copy link
Contributor

@psybuzz psybuzz left a comment

Choose a reason for hiding this comment

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

lgtm

@stephanwlee stephanwlee merged commit 418fb93 into tensorflow:master Oct 21, 2019
@stephanwlee stephanwlee deleted the ngphase7 branch October 21, 2019 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants