Skip to content

Commit

Permalink
Merge branch 'master' into toanzian/acc-#1773
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhitten committed Oct 8, 2019
2 parents 5b65b62 + 19a9b3b commit 931e041
Show file tree
Hide file tree
Showing 70 changed files with 4,103 additions and 20,784 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [1880](https://github.com/microsoft/BotFramework-Emulator/pull/1880)
- [1883](https://github.com/microsoft/BotFramework-Emulator/pull/1883)
- [1902](https://github.com/microsoft/BotFramework-Emulator/pull/1902)
- [1893](https://github.com/microsoft/BotFramework-Emulator/pull/1893)
- [1916](https://github.com/microsoft/BotFramework-Emulator/pull/1916)
- [1917](https://github.com/microsoft/BotFramework-Emulator/pull/1917)

- [client] Fixed an issue with the transcripts path input inside of the resource settings dialog in PR [1836](https://github.com/microsoft/BotFramework-Emulator/pull/1836)
- [client] Implemented HTML app menu for Windows in PR [1893](https://github.com/microsoft/BotFramework-Emulator/pull/1893)


## v4.5.2 - 2019 - 07 - 17
Expand Down
1 change: 1 addition & 0 deletions packages/app/client/src/state/actions/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,6 @@ export * from './botActions';
export * from './frameworkSettingsActions';
export * from './protocolActions';
export * from './savedBotUrlsActions';
export * from './updateActions';
export * from './userActions';
export * from './windowStateActions';
42 changes: 42 additions & 0 deletions packages/app/client/src/state/actions/updateActions.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import { UpdateStatus } from '@bfemulator/app-shared';

import { setUpdateStatus, SET_UPDATE_STATUS } from './updateActions';

describe('updateActions', () => {
it('should create a setUpdateStatus action', () => {
expect(setUpdateStatus(UpdateStatus.Idle)).toEqual({ type: SET_UPDATE_STATUS, payload: UpdateStatus.Idle });
});
});
51 changes: 51 additions & 0 deletions packages/app/client/src/state/actions/updateActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import { UpdateStatus } from '@bfemulator/app-shared';

export const SET_UPDATE_STATUS = 'UPDATE/SET_STATUS';
export type UpdateActionType = 'UPDATE/SET_STATUS';

export interface UpdateAction<P> {
type: UpdateActionType;
payload: P;
}

export type UpdateActionPayload = UpdateStatus;

export function setUpdateStatus(status: UpdateStatus): UpdateAction<UpdateStatus> {
return {
type: SET_UPDATE_STATUS,
payload: status,
};
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,12 @@ describe('Window state actions', () => {
payload: zoomState,
});
});

test('setAvailableThemes action', () => {
const themes = [{ name: 'light', href: './light.css' }, { name: 'dark', href: './dark.css' }];
expect(windowStateActions.setAvailableThemes(themes)).toEqual({
type: windowStateActions.SET_AVAILABLE_THEMES,
payload: { availableThemes: themes },
});
});
});
25 changes: 23 additions & 2 deletions packages/app/client/src/state/actions/windowStateActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,24 @@ import { Action } from 'redux';
export const REMEMBER_THEME = 'REMEMBER_THEME';
export const REMEMBER_BOUNDS = 'REMEMBER_BOUNDS';
export const REMEMBER_ZOOM_LEVEL = 'REMEMBER_ZOOM_LEVEL';
export const SET_AVAILABLE_THEMES = 'SET_AVAILABLE_THEMES';

export interface WindowStateAction<P> extends Action {
type: WindowStateActionType;
payload?: P;
}

export declare type WindowStateActionType =
| 'DEBUG_MODE_CHANGED'
| 'REMEMBER_THEME'
| 'REMEMBER_BOUNDS'
| 'REMEMBER_ZOOM_LEVEL'
| 'DEBUG_MODE_CHANGED';
export declare type WindowStatePayload = RememberZoomLevelPayload | RememberBoundsPayload | RememberThemePayload;
| 'SET_AVAILABLE_THEMES';
export declare type WindowStatePayload =
| RememberZoomLevelPayload
| RememberBoundsPayload
| RememberThemePayload
| SetAvailableThemesPayload;

export interface RememberThemePayload {
theme?: string;
Expand All @@ -65,6 +71,10 @@ export interface RememberZoomLevelPayload {
zoomLevel?: number;
}

export interface SetAvailableThemesPayload {
availableThemes?: { name: string; href: string }[];
}

export function rememberTheme(theme: string): WindowStateAction<RememberThemePayload> {
return {
type: REMEMBER_THEME,
Expand All @@ -87,3 +97,14 @@ export function rememberZoomLevel(state: WindowStateSettings): WindowStateAction
payload: state,
};
}

export function setAvailableThemes(
themes: { name: string; href: string }[]
): WindowStateAction<SetAvailableThemesPayload> {
return {
type: SET_AVAILABLE_THEMES,
payload: {
availableThemes: themes,
},
};
}
1 change: 1 addition & 0 deletions packages/app/client/src/state/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,6 @@ export * from './protocol';
export * from './resources';
export * from './savedBotUrls';
export * from './theme';
export * from './update';
export * from './users';
export * from './windowState';
50 changes: 50 additions & 0 deletions packages/app/client/src/state/reducers/update.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import { UpdateStatus } from '@bfemulator/app-shared';

import { setUpdateStatus } from '../actions/updateActions';

import { update } from './update';

describe('update reducer', () => {
it('should return the unchanged state on an unrecognized action', () => {
expect(update(undefined, { type: undefined, payload: undefined })).toEqual({ status: UpdateStatus.Idle });
});

it('should set the update status', () => {
const state = { status: UpdateStatus.UpdateDownloading };
const action = setUpdateStatus(UpdateStatus.UpdateReadyToInstall);
expect(update(state, action)).toEqual({ status: UpdateStatus.UpdateReadyToInstall });
});
});
54 changes: 54 additions & 0 deletions packages/app/client/src/state/reducers/update.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license.
//
// Microsoft Bot Framework: http://botframework.com
//
// Bot Framework Emulator Github:
// https://github.com/Microsoft/BotFramwork-Emulator
//
// Copyright (c) Microsoft Corporation
// All rights reserved.
//
// MIT License:
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED ""AS IS"", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//

import { UpdateStatus } from '@bfemulator/app-shared';

import { UpdateAction, UpdateActionPayload, SET_UPDATE_STATUS } from '../actions/updateActions';

const DEFAULT_STATE: UpdateState = {
status: UpdateStatus.Idle,
};

export interface UpdateState {
status: UpdateStatus;
}

export function update(state: UpdateState = DEFAULT_STATE, action: UpdateAction<UpdateActionPayload>): UpdateState {
switch (action.type) {
case SET_UPDATE_STATUS:
return { ...state, status: action.payload };

default:
return state;
}
}
10 changes: 9 additions & 1 deletion packages/app/client/src/state/reducers/windowState.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

import { windowStateDefault } from '@bfemulator/app-shared';

import { rememberBounds, rememberTheme, rememberZoomLevel } from '../actions/windowStateActions';
import { rememberBounds, rememberTheme, rememberZoomLevel, setAvailableThemes } from '../actions/windowStateActions';

import { windowState } from './windowState';

Expand Down Expand Up @@ -63,4 +63,12 @@ describe('windowState reducer', () => {

expect(state).toEqual({ theme: 'light' });
});

it('should handle a set available themes action', () => {
const themes = [{ name: 'light', href: './light.css' }, { name: 'dark', href: './dark.css' }];
const action = setAvailableThemes(themes);
const state = windowState({} as any, action);

expect(state.availableThemes).toEqual(themes);
});
});
7 changes: 7 additions & 0 deletions packages/app/client/src/state/reducers/windowState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ import {
RememberBoundsPayload,
RememberThemePayload,
RememberZoomLevelPayload,
SetAvailableThemesPayload,
WindowStateAction,
WindowStatePayload,
SET_AVAILABLE_THEMES,
} from '../actions/windowStateActions';

export function windowState(
Expand Down Expand Up @@ -71,6 +73,11 @@ export function windowState(
return { ...state, theme };
}

case SET_AVAILABLE_THEMES: {
const { availableThemes } = action.payload as SetAvailableThemesPayload;
return { ...state, availableThemes };
}

default:
return state;
}
Expand Down
6 changes: 5 additions & 1 deletion packages/app/client/src/state/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,9 @@ import {
resources,
savedBotUrls,
theme,
windowState,
update,
users,
windowState,
ChatState,
DialogState,
EditorState,
Expand All @@ -71,6 +72,7 @@ import {
ProgressIndicatorState,
ResourcesState,
ThemeState,
UpdateState,
} from './reducers';

export interface RootState {
Expand All @@ -90,6 +92,7 @@ export interface RootState {
resources?: ResourcesState;
settings?: Settings;
theme?: ThemeState;
update?: UpdateState;
}

const DEFAULT_STATE = {};
Expand Down Expand Up @@ -122,6 +125,7 @@ function initStore(): Store<RootState> {
resources,
settings: settingsReducer,
theme,
update,
}),
DEFAULT_STATE,
applyMiddleware(forwardToMain, sagaMiddleware)
Expand Down
Loading

0 comments on commit 931e041

Please sign in to comment.