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: Styling issues on nested and directly included components in angular project #1428

Closed
Carlfjord opened this issue Aug 11, 2023 · 4 comments · Fixed by #1480
Closed

NG: Styling issues on nested and directly included components in angular project #1428

Carlfjord opened this issue Aug 11, 2023 · 4 comments · Fixed by #1480
Assignees
Labels
team: m3 type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci)

Comments

@Carlfjord
Copy link

Describe the bug
I'm having some styling related issues occurring while nesteing components. This also occurs with components included outside of <router-outlet> in angular applications.

To Reproduce
In any angular application simply take the sample code from the ids-wc-examples and use it in a new component. Take said component and import in in the top level template file next to your router outlet.

I created a clean angular application using "ng new" and then installed the ids-enterprise-wc. Then I created a new AppMenuComponent and added the sample code from the wc app-menu demo. Then I added the component to be rendered on the top level path. So far it works well and good.

However after I include the same <app-menu> component straight in my app.component template instead of using the router-outlet it no longer has the proper styling.

Here's a side-by-side view of the different implementations:

image

image

image

Note that similar problems occur if we say break out the accordion part of the app-menu to a new component and reference said component in the app-menu template. So nesting components by splitting them in different angular components also causes inconsistencies.

Steps to reproduce the behavior:

  1. new ng app with ids-enterprise-wc
  2. create new app menu component and add ids app-menu sample code
  3. add component to routing
  4. include component directly in app.component template
  5. notice 2 copies of the component but one not looking as expected.

Expected behavior
Nested components or template included components should apply the accurate theming.

Version
v1.0.0-beta.13

Platform

  • Infor Application/Team Name: M3 Portals
@tmcconechy tmcconechy added type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci) team: m3 labels Aug 14, 2023
@tmcconechy
Copy link
Member

@Carlfjord would you be able to post that test repo so we dont have to recreate this all (or zip it up without node_modules and upload if that works)

Some initial thoughts?

Will need some chunk of time to investigate this one

@tmcconechy tmcconechy changed the title Styling issues on nested and directly included components in angular project NG: Styling issues on nested and directly included components in angular project Aug 14, 2023
@Carlfjord
Copy link
Author

@tmcconechy Yea sure! There's no difference in the component itself between the working and non working scenario so the structure is the same. So the issue occurs with template included components in general with or without nesting.

Here's a .zip with a basic angular project and the side by side view of the component like above screenshots.
theme-explorer.zip

@tmcconechy
Copy link
Member

@Carlfjord fixed this you will see a PR attached soon but wanted to note a couple things:

  1. You need the font (i add to index.html) -> <link href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600&amp;display=swap" rel="stylesheet">
  2. Its probably weird to have multiple containers now but i assume its part of the example
  3. The new module-nav will deprecate app-nav https://main.wc.design.infor.com/ids-module-nav/ so may want to try that.

I only fixed app nav and i think module-nav but if you run into more issues like this in more components let me know. As the fix requires refactoring that may or may not be required. I think i fixed module-nav but did not verify.

Attached update zip (with node_modules included) just for testing on the PR.

@jbrcna
Copy link
Contributor

jbrcna commented Oct 16, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team: m3 type: bug 🐛 Something isn't working [3] Velocity rating (Fibonacci)
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants