Skip to content

fix(overlay): overlay class audits #6372 - #8056

Merged
mmalerba merged 3 commits into
angular:masterfrom
amcdnl:panel-class-6372
Oct 30, 2017
Merged

mmalerba merged 3 commits into
angular:masterfrom
amcdnl:panel-class-6372

Conversation

@amcdnl

@amcdnl amcdnl commented Oct 26, 2017

Copy link
Copy Markdown
Contributor

Clean cut of #7454 that only changes names

@amcdnl amcdnl self-assigned this Oct 26, 2017
@amcdnl
amcdnl requested a review from jelbourn October 26, 2017 19:28
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Oct 26, 2017
Comment thread src/lib/snack-bar/snack-bar-config.ts Outdated

/** Extra CSS classes to be added to the snack bar container. */
extraClasses?: string[];
panelClass?: string[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I have two concerns with this,

  1. This adds the class to the snackbar container, not the overlay panel. So it's slightly misleading and inconsistent with dialogs in that regard.

  2. More importantly, I think panelClass implies that a single string would be sufficient. Since string[] is req'd, the snackbar container will convert panelClass: "my-class" to

    <snack-bar-container class="m y - c l a s">...</snack-bar-container>
    

    I think the MatSnackBar#_createOverlay could use the overlay-ref logic to automatically handle this .

I know this PR is trying to only change the names, but I think this name change is misrepresenting unless it's also met with a change in functionality.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed; I didn't realize snackbar was string[] only right now. @amcdnl let's just change this one to string | string[] as well

Comment thread src/lib/datepicker/datepicker.ts Outdated
@Output() selectedChanged = new EventEmitter<D>();

/** Classes to be passed to the date picker panel. Supports the same syntax as `ngClass`. */
@Input() panelClass: string|string[]|Set<string>|{[key: string]: any};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think Set<string>|{[key: string]: any} is a bit overkill. I'd rather stick with string | string[] for the time being.

Comment thread src/lib/menu/menu-directive.ts Outdated
* @deprecated Use `panelClass` instead.
* @param classes list of class names
*/
@Input() classList = this.panelClass;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This needs a getter/setter that delegates to panelClass; this will only set the initial value

Comment thread src/lib/snack-bar/snack-bar-config.ts Outdated

/** Extra CSS classes to be added to the snack bar container. */
extraClasses?: string[];
panelClass?: string[];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed; I didn't realize snackbar was string[] only right now. @amcdnl let's just change this one to string | string[] as well

Comment thread src/lib/snack-bar/snack-bar-config.ts Outdated
* Extra CSS classes to be added to the snack bar container.
* @deprecated Use `panelClass` instead.
*/
extraClasses?: string[] = this.panelClass;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This leaves the option here, but it will still break because it doesn't do anything now; the snack-bar needs to combine both until we remove this one.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done. Checkout what I did there, open to suggestions for better ideas.

@jelbourn jelbourn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/lib/menu/menu-directive.ts Outdated
* menu template that displays in the overlay container. Otherwise, it's difficult
* to style the containing menu from outside the component.
* @deprecated Use `panelClass` instead.
* @param classes list of class names

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Setter doesn't take @param

@jelbourn jelbourn added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful pr: lgtm action: merge The PR is ready for merge by the caretaker labels Oct 30, 2017
@mmalerba
mmalerba merged commit cd05b54 into angular:master Oct 30, 2017
@amcdnl
amcdnl deleted the panel-class-6372 branch November 1, 2017 15:42
@angular-automatic-lock-bot

Copy link
Copy Markdown

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 7, 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 P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants