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

feat: show deprecated related information in material/tooltip #1274

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

naaajii
Copy link
Contributor

@naaajii naaajii commented Oct 14, 2024

previously we weren't showing any other information other than breaking-change for deprecated fields, this commit adds a component that protrays information regarding deprecation in tooltips rather than title attribute

closes angular/components#29839

Copy link

google-cla bot commented Oct 14, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@naaajii
Copy link
Contributor Author

naaajii commented Oct 14, 2024

image
image

@naaajii
Copy link
Contributor Author

naaajii commented Oct 24, 2024

(apologies for ping)

@crisbeto @devversion can we land this since angular/components#29873 is merged?

Copy link
Member

@devversion devversion left a comment

Choose a reason for hiding this comment

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

Ty. This looks great. A few minors nits, but otherwise that's great.

(Sorry for slow responses; we've been on a full day summit)

})
export class DeprecatedFieldComponent {
/** Message regarding the deprecation */
@Input() message!: string;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: consider using input.required

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'm not sure how will i set the value for this input dynamically via ComponentPortal if we use signal based input.

Copy link
Member

Choose a reason for hiding this comment

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

Ohh. It doesn't need to be an input at all then, I think 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, true. I missed that! 😄

// all of the deprecated markers end with `deprecated-marker`
// in their class name
const deprecatedElements =
this._elementRef.nativeElement.querySelectorAll(`[class$=deprecated-marker]`);
Copy link
Member

Choose a reason for hiding this comment

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

Is the $= needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its shorter for like:

querySelectorAll('.docs-api-deprecated-marker, .docs-api-class-deprecated-marker, .docs-api-class-interface-marker, .some-more')

Copy link
Member

Choose a reason for hiding this comment

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

I see. How about adding a small comment illustrating the pattern + using -deprecated-marker as suffix test?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should be good now, lemme know if it needs rewording cause my english isn't so good.

previously we weren't showing any other information other than `breaking-change` for deprecated fields, this commit adds a component that protrays information regarding deprecation in tooltips rather than `title` attribute

closes angular/components#29839
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.

docs-bug(common): The way deprecated symbols are rendered
2 participants