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(platform): Menu as a standalone component #1390

Merged
merged 20 commits into from
Oct 31, 2019
Merged

Conversation

kavya-b
Copy link
Contributor

@kavya-b kavya-b commented Oct 11, 2019

Please provide a link to the associated issue.

Fixes #1264

Please provide a brief summary of this pull request.

This PR contains code for development of Menu as a standalone component, with varying levels of customization. The design is documented here: https://github.com/SAP/fundamental-ngx/wiki/Platform:-Menu-component-Technical-Design

If this is a new feature, have you updated the documentation?

This is a new feature; documentation is pending.

@kavya-b kavya-b added the platform platform label Oct 11, 2019
@kavya-b kavya-b self-assigned this Oct 11, 2019
@netlify
Copy link

netlify bot commented Oct 11, 2019

Deploy preview for fundamental-ngx ready!

Built with commit 398db1d

https://deploy-preview-1390--fundamental-ngx.netlify.com

@KevinOkamoto KevinOkamoto added this to In Review in Platform Development via automation Oct 11, 2019
@fkolar
Copy link
Member

fkolar commented Oct 15, 2019

Can you please try to do rebase? we shoudl not see any Merge messgage in the commit

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 15, 2019

Can you please try to do rebase? we should not see any Merge messgage in the commit

Oops, forgot to do it this time. Currently branch is up-to-date with master, so it is not allowing me to rebase, Frank. I will do rebase as soon as someone pushes changes to ngx next time.

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 16, 2019

Can you please try to do rebase? we shoudl not see any Merge messgage in the commit

done.

@kavya-b kavya-b force-pushed the feat-menu-component branch 2 times, most recently from b21bdb7 to 52c84f2 Compare October 21, 2019 03:18
@fkolar
Copy link
Member

fkolar commented Oct 21, 2019

In general besides other comments we should follow the same path as core import scss from fundamental-style, and dont touch anything that is already define once, otherwise we will break theming.

When working with styles and in the component we have set viewencapsulation.none, lets be aware that it means Don't provide any template or style encapsulation, in other words that style from your menu-item scss will be put on top of the html file available for everybody and changing everything that other components sets (using the same styles).

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 21, 2019

In general besides other comments we should follow the same path as core import scss from fundamental-style, and dont touch anything that is already define once, otherwise we will break theming.

When working with styles and in the component we have set viewencapsulation.none, lets be aware that it means Don't provide any template or style encapsulation, in other words that style from your menu-item scss will be put on top of the html file available for everybody and changing everything that other components sets (using the same styles).

There is a huge gap between what our invision spec says and what fundamental-styles currently provides, Frank. I had already raised corresponding issues on fundamental-styles for this gap (styles Menu open issues) but only one has been addressed till now.

So, for now, what should be the way to proceed? Should I be dropping all css changes entirely?; this will break some unit and automation tests in addition to the entire look of the Menu component.

@KevinOkamoto
Copy link
Member

For most of our components, we should be trying to use the "core" directives and components in our templates - so we should be getting the styling automatically.

If there are gaps between our design and what fundamental-styles provides, then yes we need to add customized CSS rules to our components. We do need to be aware of theming however and try to use the CSS variable definitions of fundamental-styles, so that our color palate is the same.

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 22, 2019

For most of our components, we should be trying to use the "core" directives and components in our templates - so we should be getting the styling automatically.

If there are gaps between our design and what fundamental-styles provides, then yes we need to add customized CSS rules to our components. We do need to be aware of theming however and try to use the CSS variable definitions of fundamental-styles, so that our color palate is the same.

The "core" directives in Menu are mostly binding to the fundamental-styles classes such as fd-menu__item, fd-menu__group, fd-menu--addon-before, fd-menu__list etc. I am using these same classes directly in "platform" and wherever gaps are present, I am overriding them. I am also using the same CSS variable definitions wherever I can.

However, I am also adding additional classes for secondaryIcon such as fd-menu--addon-after which do not exist in fundamental-styles at all currently. Theming then could affect secondaryIcon and we should probably get fundamental-styles to also implement a secondaryIcon feature for consistency.

@kavya-b kavya-b force-pushed the feat-menu-component branch 2 times, most recently from b113cbd to e20077b Compare October 23, 2019 02:59
@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 23, 2019

@fkolar @KevinOkamoto changed name from MenuModule to FdpMenuModule.

@fkolar
Copy link
Member

fkolar commented Oct 24, 2019

For most of our components, we should be trying to use the "core" directives and components in our templates - so we should be getting the styling automatically.
If there are gaps between our design and what fundamental-styles provides, then yes we need to add customized CSS rules to our components. We do need to be aware of theming however and try to use the CSS variable definitions of fundamental-styles, so that our color palate is the same.

The "core" directives in Menu are mostly binding to the fundamental-styles classes such as fd-menu__item, fd-menu__group, fd-menu--addon-before, fd-menu__list etc. I am using these same classes directly in "platform" and wherever gaps are present, I am overriding them. I am also using the same CSS variable definitions wherever I can.

However, I am also adding additional classes for secondaryIcon such as fd-menu--addon-after which do not exist in fundamental-styles at all currently. Theming then could affect secondaryIcon and we should probably get fundamental-styles to also implement a secondaryIcon feature for consistency.

Even if they are just directive that adds class, we should still use them. The reason is that once styles do some new adjustments and some renamign, you dont want to change this on two places. Let;'s use core directives as wrapper for the target class. . YOu dont want to be using directly class if some other component is wrapping them.

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 25, 2019

For most of our components, we should be trying to use the "core" directives and components in our templates - so we should be getting the styling automatically.
If there are gaps between our design and what fundamental-styles provides, then yes we need to add customized CSS rules to our components. We do need to be aware of theming however and try to use the CSS variable definitions of fundamental-styles, so that our color palate is the same.

The "core" directives in Menu are mostly binding to the fundamental-styles classes such as fd-menu__item, fd-menu__group, fd-menu--addon-before, fd-menu__list etc. I am using these same classes directly in "platform" and wherever gaps are present, I am overriding them. I am also using the same CSS variable definitions wherever I can.
However, I am also adding additional classes for secondaryIcon such as fd-menu--addon-after which do not exist in fundamental-styles at all currently. Theming then could affect secondaryIcon and we should probably get fundamental-styles to also implement a secondaryIcon feature for consistency.

Even if they are just directive that adds class, we should still use them. The reason is that once styles do some new adjustments and some renamign, you dont want to change this on two places. Let;'s use core directives as wrapper for the target class. . YOu dont want to be using directly class if some other component is wrapping them.

Okay, yes, you're right. Made the changes accordingly. Please check.

@droshev
Copy link
Contributor

droshev commented Oct 25, 2019

@kavya-b if you think the colors are not correct I would suggest to do a fix in styles instead of adding custom css here

@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 25, 2019

@kavya-b if you think the colors are not correct I would suggest to do a fix in styles instead of adding custom css here

Hi Deno, are you suggesting to do this for only colors or any/all styling? What about adding new classes such as for a secondary icon?

Removed custom elements,
added some css aligning with spec,
made a MenuModule for using with demo app
- added scrolling and scrollingLimit attributes
- added some CSS to align with spec
- modified existing unit tests
- added optional separator line
such as:
disabled,
tooltip customization,
keyboard accessibility,
var colors to scss,

fixed compiler error issue
also,
rtl fixes for icon and text
secondary icon css fix
truncation with inline-flex issue resolved
Additionally,
1. scrollbar styling aligned with specs
2. state styling issues fixed
3. added id and childItems to MenuItem interface
4. added/modified unit tests
5. handled secondaryIcon
Removed custom elements,
added some css aligning with spec,
made a MenuModule for using with demo app
- added scrolling and scrollingLimit attributes
- added some CSS to align with spec
- modified existing unit tests
- added optional separator line
such as:
disabled,
tooltip customization,
keyboard accessibility,
var colors to scss,

fixed compiler error issue
also,
rtl fixes for icon and text
secondary icon css fix
truncation with inline-flex issue resolved
Additionally,
1. scrollbar styling aligned with specs
2. state styling issues fixed
3. added id and childItems to MenuItem interface
4. added/modified unit tests
5. handled secondaryIcon
Removing Highlightable and active classes, renaming customLabel to tooltipLabel
-fixed usage of method call in template as suggested
-added hardcoded color values to support IE11
-fixed failing testcases due to ang8 update not detecting @ViewChild properly
…yles

added MenuModule back into platform.module.ts after it got removed while merging conflicts
also provided fix for handling width in em or px and invalid width values.
@fkolar
Copy link
Member

fkolar commented Oct 30, 2019

Anything new on this PR ?

Platform Development automation moved this from In Review to Approved by Reviewer Oct 30, 2019
@kavya-b
Copy link
Contributor Author

kavya-b commented Oct 31, 2019

Anything new on this PR ?

nothing new added, only rebased multiple times

@kavya-b kavya-b merged commit 99ea344 into master Oct 31, 2019
@droshev droshev deleted the feat-menu-component branch November 17, 2019 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform platform
Projects
No open projects
Platform Development
  
Approved by Reviewer
Development

Successfully merging this pull request may close these issues.

Menu as standalone instantiable component
4 participants