Skip to content

Commit

Permalink
Merge branch 'master' into jwilaby/#941-ABS-deep-linking
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Wilaby committed Oct 31, 2018
2 parents d2723c0 + a12e95c commit 969e983
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { IFileService } from 'botframework-config/lib/schema';
import * as React from 'react';
import { ChangeEvent, ComponentClass, KeyboardEvent, MouseEvent } from 'react';
import { ResourcesSettingsContainer } from '../../../dialogs';
import { ServicePane, ServicePaneProps, ServicePaneState } from '../servicePane/servicePane';
import { IFileService } from 'botframework-config/lib/schema';
import * as styles from './resourceExplorer.scss';

function simpleNameSort(a: IFileService, b: IFileService): 0 | 1 | -1 {
Expand Down
35 changes: 21 additions & 14 deletions packages/app/client/src/ui/shell/navBar/navBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
* height & length (0.5 * 16px = 8px) from that to center the badge on the top-right corner
* of the link icon. 12.5px - 8px = 4.5px
*/
background-color: var(--nav-link-badge-bg);
border-radius: 16px;
color: var(--nav-link-badge-color);
height: 16px;
line-height: 17px;
right: 0;
text-align: center;
top: 0;
width: 16px;
background-color: var(--nav-link-badge-bg);
border-radius: 16px;
color: var(--nav-link-badge-color);
height: 16px;
line-height: 17px;
right: 0;
text-align: center;
top: 0;
width: 16px;
}

&::before {
Expand All @@ -51,14 +51,14 @@
width: 2px;
height: 100%;
top: 0;
left: -9px;
left: -9px;
opacity: 0;
background-color: var(--nav-focused-tag-bg);
}

&.selected, &[aria-selected="true"] {
border: var(--nav-link-selected-border);

> div {
opacity: var(--nav-icon-color-hover-opacity);
}
Expand Down Expand Up @@ -118,7 +118,7 @@
}

&:hover {
border: var(--nav-link-hover-border);
border: var(--nav-link-hover-border);
> div {
opacity: var(--nav-icon-color-hover-opacity);
}
Expand All @@ -138,7 +138,14 @@
border: var(--nav-link-selected-border);
}

&.disabled, &[aria-disabled] {
opacity: 0.6;
&.disabled, &[aria-disabled], &[disabled] {
&:hover {
border: none;
> div {
opacity: 1;
}
opacity: 0.6;
cursor: not-allowed;
}
}
}
14 changes: 8 additions & 6 deletions packages/app/client/src/ui/shell/navBar/navBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@

import * as React from 'react';
import { SyntheticEvent } from 'react';
import * as styles from './navBar.scss';
import * as Constants from '../../../constants';
import { NotificationManager } from '../../../notificationManager';
import * as styles from './navBar.scss';

export interface NavBarProps {
selection?: string;
Expand All @@ -44,6 +44,7 @@ export interface NavBarProps {
openEmulatorSettings?: () => void;
notifications?: string[];
explorerIsVisible?: boolean;
botIsOpen?: boolean;
}

export interface NavBarState {
Expand Down Expand Up @@ -109,7 +110,7 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {

private get links(): JSX.Element[] {
const { selection } = this.state;
const { explorerIsVisible } = this.props;
const { explorerIsVisible, botIsOpen = false } = this.props;

return [
'Bot Explorer',
Expand All @@ -123,6 +124,7 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {
title={ title }
className={ styles.navLink }
key={ index }
disabled={ !botIsOpen && index === 1 }
onClick={ this.onLinkClick }>
<div/>
{ this.renderNotificationBadge(title) }
Expand All @@ -136,10 +138,10 @@ export class NavBarComponent extends React.Component<NavBarProps, NavBarState> {
if (navSelection === 'Notifications') {
const { notifications } = this.props;
const numUnreadNotifications = notifications
.map(notificationId => NotificationManager.get(notificationId))
.map(notification => notification.read)
.filter(notificationHasBeenRead => !notificationHasBeenRead)
.length;
.map(notificationId => NotificationManager.get(notificationId))
.map(notification => notification.read)
.filter(notificationHasBeenRead => !notificationHasBeenRead)
.length;

return numUnreadNotifications ? <span className={ styles.badge }>{ numUnreadNotifications }</span> : null;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/app/client/src/ui/shell/navBar/navBarContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import * as ExplorerActions from '../../../data/action/explorerActions';
import * as EditorActions from '../../../data/action/editorActions';

const mapStateToProps = (state: RootState): NavBarProps => ({
notifications: state.notification.allIds
notifications: state.notification.allIds,
botIsOpen: !!state.bot.activeBot
});

const mapDispatchToProps = (dispatch): NavBarProps => ({
Expand Down

0 comments on commit 969e983

Please sign in to comment.