message: frontend: Fixes collapsing of side nav headers
diff: @@ -38,7 +38,16 @@ const logout = e => {
  authSvc.logout();
  };
  -export const Nav = () => {
  +export class Nav extends React.Component {
  + constructor(props) {
  + super(props);
  + this.state = {
  + isClusterNavVisible: true,
  + isAdminNavVisible: true
  + };
  + }
  +
  + render() {
  const pathname = history.getCurrentLocation().pathname;
  return <div id="sidebar" className="co-img-bg-cells">
  @@ -48,10 +57,11 @@ export const Nav = () => {
  </div>
  <div className="navigation-container__section">
  - <div className="navigation-container__section__title">
  + <div className="navigation-container__section__title"
  + onClick={() => {this.setState({isClusterNavVisible : !this.state.isClusterNavVisible});}}>
  <i className="fa fa-folder-open-o navigation-container__section__title__icon"></i>Browse Cluster
  </div>
  - <ul className="navigation-container__list no-margin collapse in" key={pathname}>
  + {this.state.isClusterNavVisible && <ul className="navigation-container__list no-margin" key={pathname}>
  <NavLink resource="deployments" name="Deployments"/>
  <NavLink resource="services" name="Services"/>
  <NavLink resource="jobs" name="Jobs"/>
  @@ -66,14 +76,15 @@ export const Nav = () => {
  <NavLink resource="events" name="Events" />
  <NavLink resource="search" name="Search" />
  <NavLink resource="ingresses" name="Ingress" />
  - </ul>
  + </ul>}
  </div>
  <div className="navigation-container__section">
  - <div className="navigation-container__section__title">
  + <div className="navigation-container__section__title"
  + onClick={() => {this.setState({isAdminNavVisible : !this.state.isAdminNavVisible});}}>
  <i className="fa fa-cog navigation-container__section__title__icon"></i>Administration
  </div>
  - <ul className="navigation-container__list no-margin collapse in" id="admin-tab" key={pathname}>
  + {this.state.isAdminNavVisible && <ul className="navigation-container__list no-margin" id="admin-tab" key={pathname}>
  <NavLink href="namespaces" name="Namespaces" />
  <NavLink href="nodes" name="Nodes" />
  <NavLink href="settings/cluster" name="Cluster Settings" />
  @@ -81,7 +92,7 @@ export const Nav = () => {
  <NavLink resource="rolebindings" required="RBAC" name="Role Bindings" />
  <NavLink href="clusterroles" required="RBAC" name="Cluster Roles" />
  <NavLink href="clusterrolebindings" required="RBAC" name="Cluster Role Bindings" />
  - </ul>
  + </ul>}
  </div>
  { authSvc.userID() &&
  @@ -98,4 +109,5 @@ export const Nav = () => {
  }
  </div>
  </div>;
  -};
  + }
  +}
  