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

Angular: Fix incomplete property metadata when using inheritance #15586

Merged
merged 3 commits into from Jul 28, 2021

Conversation

stefan-schweiger
Copy link
Contributor

Issue: #15580

What I did

If the component has a parent then also iterate the decorated property metadata of the parent and merge it (child metadata has a higher "priority" when merging).

@nx-cloud
Copy link

nx-cloud bot commented Jul 14, 2021

Nx Cloud Report

CI ran the following commands for commit e1963b1. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch

Status Command
#000000 nx run-many --target=prepare --all --parallel --max-parallel=15

Sent with 💌 from NxCloud.

@kroeder
Copy link
Member

kroeder commented Jul 20, 2021

Sounds reasonable to me. I wonder if there are possible regressions with this change but since child props overwrite parent props this should just work I think

@ThibaudAV I'm not too familiar with the changed code in the angular-beta renderer. What do you think? 🙂

@ThibaudAV
Copy link
Contributor

What about add some test to be sure future changes don't break this ? 🙏

I haven't looked yet but it seems to me that there is a function exported by angular core that does this job. I'll look into using it if I have time later.

Also LGTM :)

@shilman shilman added this to the 6.4 PRs milestone Jul 22, 2021
@shilman shilman requested a review from ThibaudAV July 26, 2021 09:39
@shilman shilman changed the title Fixed incomplete property metadata when using inheritance Angular: Fix incomplete property metadata when using inheritance Jul 26, 2021
@shilman
Copy link
Member

shilman commented Jul 26, 2021

@stefan-schweiger @kroeder @ThibaudAV does this snapshot diff look correct?

Snapshot name: `Storyshots Basics / Component / With Inheritance icon button 1`

<storybook-wrapper>
  <storybook-icon-button
     ng-reflect-icon="this is icon"
+    ng-reflect-label="this is label"
>
  <button>
    this is label - this is icon
  </button>
</storybook-icon-button>

@stefan-schweiger
Copy link
Contributor Author

@shilman I guess this happens because before the "default" value was not set because the docs didn't extract the property correctly. So I think this should be correct.

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

Ok, I've updated the snapshots & am going to call this done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants