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

Fiori3 compliant left navigation collapse #624

Conversation

marynaKhromova
Copy link
Contributor

Description

Changes proposed in this pull request:

  • Semi-collapsed mode for left navigation
  • scss mixins for transition, border-radius, box-shadow
  • Rework fd-app__sidebar and lui-side-nav__footer based on flexbox
  • Remove class sap-icon--lui-blank as it's not been used

How to test it

  • Go to luigi-sample-angular/src/luigi-config/extended/settings.js and set semiCollapsible for responsiveNavigation
  • To test all functionality please add collapsible: true to some nodes in luigi-sample-angular/src/luigi-config/extended/projectDetailNav.js

@maxmarkus maxmarkus self-assigned this Jul 3, 2019
@maxmarkus maxmarkus changed the title 453 fiori3 compliant left navigation collapse feature Fiori3 compliant left navigation collapse Jul 3, 2019
$topNavHeight: 48px;
$leftNavWidth: 320px;
$leftNavWidthCollapsed: 40px;
$desktop-min-width: 600px;
Copy link
Contributor

Choose a reason for hiding this comment

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

I know you didn't write it, but please change $desktop-min-width to be also camelCased.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@@ -781,8 +783,12 @@
</script>

<style type="text/scss">
/*Mixins*/
Copy link
Contributor

Choose a reason for hiding this comment

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

Guess that comment is not 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.

done

>
{#if isOpenUIiconName(nodes.metaInfo.icon)}
<span
class="fd-side-nav__icon {'sap-icon--' + nodes.metaInfo.icon} {isSemiCollapsed && !nodes.metaInfo.icon ? 'sap-icon--rhombus-milestone-2' : ''} sap-icon--l"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be cool to add alt attribute of {key} to that span and img tags, so one can hover over it in collapsed mode to see what is written if he does not recognize the icon? @hardl do you agree?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good idea 👍 done.

document
.getElementsByClassName('fd-side-nav')[0]
.setAttribute('style', 'overflow-y:auto;');
}, 50);
Copy link
Contributor

Choose a reason for hiding this comment

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

Why 50? If you want to have in the next tick, you can just leave the number empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

selectedCategory = nodeOrNodes.metaInfo.label;
} else {
selectedCategory =
(nodeOrNodes.category && nodeOrNodes.category.label) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

Due to the babel plugin, we can use now (nodeOrNodes.category?.label)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Contributor Author

@marynaKhromova marynaKhromova Jul 4, 2019

Choose a reason for hiding this comment

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

I had to revert it because integration tests were failing with this change

let selectedCategory;
let sideBar = document.getElementsByClassName('fd-app__sidebar')[0];

if (nodeOrNodes.metaInfo && nodeOrNodes.metaInfo.label) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Due to the babel plugin, we can use now (nodeOrNodes.metaInfo?.label).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

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 had to revert it because integration tests were failing with this change

//Calculate top/bottom position for flyout sublist
let parent = el.closest('.fd-side-nav__group');
let parentTopPosition = parent.offsetTop;
let shellbarHeight = Luigi.elements().getShellbar().offsetHeight;
Copy link
Contributor

Choose a reason for hiding this comment

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

Internally we should not rely on the window.Luigi object, since you already added import { LuigiElements } from '../core-api'; you can use that one.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point! done)

});

StateHelpers.doOnStoreChange(this.store, () => {
this.set({
footerText: LuigiConfig.getConfigValue('settings.sideNavFooterText')
});
});

// set isSemiCollapsed to true for mobile
Copy link
Contributor

Choose a reason for hiding this comment

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

Check with @hardl if the responsiveNav setting should be able to be changed during runtime. If yes, the following code should be moved into the onStoreChange block.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@hardl said he sees no usecase where you would change that on runtime.

core/src/navigation/LeftNav.html Outdated Show resolved Hide resolved
marynaKhromova and others added 2 commits July 3, 2019 18:25
…ettings.js

Co-Authored-By: Markus <1720843+maxmarkus@users.noreply.github.com>
@JohannesDoberer JohannesDoberer self-assigned this Jul 3, 2019
@JohannesDoberer
Copy link
Contributor

good job!!

@marynaKhromova marynaKhromova merged commit e52c1b4 into SAP:master Jul 4, 2019
@marynaKhromova marynaKhromova deleted the 453-Fiori3-compliant-left-navigation-collapse-feature branch July 30, 2019 14:02
stanleychh pushed a commit to stanleychh/luigi that referenced this pull request Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants