Permalink
Browse files

Linting issues

  • Loading branch information...
justinwilaby committed May 23, 2018
1 parent 4bcef23 commit 374b98f331056a0feea0d3a05801405f2fcaeb72
Showing with 2,262 additions and 6,816 deletions.
  1. +1 −1 .gitignore
  2. +1 −1 lerna.json
  3. +1 −0 package.json
  4. +1 −1 packages/app/client/package.json
  5. +11 −16 packages/app/client/src/commands.ts
  6. +2 −2 packages/app/client/src/data/action/botActions.ts
  7. +3 −3 packages/app/client/src/data/action/chatActions.ts
  8. +4 −4 packages/app/client/src/data/botHelpers.ts
  9. +4 −4 packages/app/client/src/data/editorHelpers.ts
  10. +8 −8 packages/app/client/src/data/reducer/bot.ts
  11. +2 −2 packages/app/client/src/data/reducer/presentation.ts
  12. +6 −6 packages/app/client/src/data/sagas/azureBotServiceSagas.ts
  13. +6 −6 packages/app/client/src/data/sagas/dispatchSagas.ts
  14. +6 −6 packages/app/client/src/data/sagas/endpointSagas.ts
  15. +43 −33 packages/app/client/src/data/sagas/luisSagas.ts
  16. +6 −6 packages/app/client/src/data/sagas/qnaMakerSagas.ts
  17. +56 −37 packages/app/client/src/extensions.ts
  18. +3 −3 packages/app/client/src/hyperlinkHandler.ts
  19. +4 −4 packages/app/client/src/index.tsx
  20. +2 −2 packages/app/client/src/ipc.ts
  21. +7 −7 packages/app/client/src/platform/commands/{commandService.ts → commandServiceImpl.ts}
  22. +6 −6 packages/app/client/src/platform/log/logService.ts
  23. +2 −2 packages/app/client/src/platform/settings/settingsService.ts
  24. +71 −72 packages/app/client/src/ui/dialogs/botCreationDialog.tsx
  25. +0 −1 packages/app/client/src/ui/dialogs/service/index.ts
  26. +9 −9 packages/app/client/src/ui/editor/appSettingsEditor.tsx
  27. +20 −20 packages/app/client/src/ui/editor/botSettingsEditor.tsx
  28. +6 −6 packages/app/client/src/ui/editor/emulator/detailPanel.tsx
  29. +5 −5 packages/app/client/src/ui/editor/emulator/emulator.tsx
  30. +3 −3 packages/app/client/src/ui/editor/emulator/parts/chat.tsx
  31. +2 −2 packages/app/client/src/ui/editor/emulator/parts/detail.tsx
  32. +2 −2 packages/app/client/src/ui/editor/emulator/parts/inspector.tsx
  33. +7 −7 packages/app/client/src/ui/editor/emulator/parts/log.tsx
  34. +6 −6 packages/app/client/src/ui/editor/welcomePage.tsx
  35. +16 −16 packages/app/client/src/ui/helpers/activeBotHelper.ts
  36. +1 −4 packages/app/client/src/ui/shell/explorer/botExplorerBar.tsx
  37. +3 −3 packages/app/client/src/ui/shell/explorer/dispatchExplorer/dispatchEditor/dispatchEditorContainer.ts
  38. +3 −3 packages/app/client/src/ui/shell/explorer/luisExplorer/luisEditor/luisEditorContainer.ts
  39. +1 −1 ...app/client/src/ui/shell/explorer/luisExplorer/luisModelsViewerDialog/luisModelsViewerContainer.ts
  40. +3 −3 packages/app/client/src/ui/shell/explorer/qnaMakerExplorer/qnaMakerEditor/qnaMakerEditorContainer.ts
  41. +1 −1 packages/app/client/src/ui/shell/explorer/servicesExplorerBar/servicesExplorerBarContainer.ts
  42. +16 −16 packages/app/client/src/ui/shell/explorer/transcriptExplorer/transcriptExplorer.tsx
  43. +0 −15 packages/app/client/src/ui/shell/main.spec.tsx
  44. +6 −5 packages/app/client/src/ui/shell/navBar/navBar.tsx
  45. +3 −2 packages/app/client/tsconfig.json
  46. +0 −6 packages/app/client/tsconfig.test.json
  47. +2 −1 packages/app/main/package.json
  48. +11 −12 packages/app/main/src/OpenIdMetadata.ts
  49. +2 −4 packages/app/main/src/activityHelpers.ts
  50. +45 −38 packages/app/main/src/appMenuBuilder.ts
  51. +9 −10 packages/app/main/src/appUpdater.ts
  52. +4 −2 packages/app/main/src/botFrameworkService.ts
  53. +21 −18 packages/app/main/src/botHelpers.ts
  54. +7 −8 packages/app/main/src/botProjectFileWatcher.ts
  55. +2 −2 packages/app/main/src/commandLine.ts
  56. +125 −103 packages/app/main/src/commands.ts
  57. +2 −3 packages/app/main/src/data-v2/action/bot.ts
  58. +9 −9 packages/app/main/src/data-v2/createStore.ts
  59. +29 −28 packages/app/main/src/data-v2/reducer/bot.ts
  60. +4 −4 packages/app/main/src/data-v2/state.ts
  61. +13 −14 packages/app/main/src/emulator.ts
  62. +123 −85 packages/app/main/src/extensions.ts
  63. +5 −4 packages/app/main/src/globals.ts
  64. +4 −4 packages/app/main/src/ipc/electron.ts
  65. +35 −30 packages/app/main/src/main.ts
  66. +238 −234 packages/app/main/src/ngrok.ts
  67. +36 −20 packages/app/main/src/ngrokService.ts
  68. +2 −2 packages/app/main/src/platform/log/logService.ts
  69. +9 −9 packages/app/main/src/platform/window/index.ts
  70. +34 −32 packages/app/main/src/protocolHandler.ts
  71. +6 −8 packages/app/main/src/reducers/botReducer.ts
  72. +19 −19 packages/app/main/src/reducers/frameworkReducer.ts
  73. +39 −37 packages/app/main/src/reducers/usersReducer.ts
  74. +33 −33 packages/app/main/src/reducers/windowStateReducer.ts
  75. +82 −75 packages/app/main/src/registryUtils.ts
  76. +19 −14 packages/app/main/src/restServer.ts
  77. +8 −6 packages/app/main/src/services/luisAuthWorkflowService.ts
  78. +27 −33 packages/app/main/src/settings.ts
  79. +12 −15 packages/app/main/src/squirrelEvents.ts
  80. +32 −18 packages/app/main/src/utils.ts
  81. +31 −29 packages/app/main/src/versionManager.ts
  82. +133 −132 packages/app/main/src/windowManager.ts
  83. +1 −1 packages/app/main/tslint.json
  84. +2 −2 packages/app/shared/package.json
  85. +33 −19 packages/app/shared/src/activityVisitor.ts
  86. +4 −4 packages/app/shared/src/paymentEncoder.ts
  87. +28 −29 packages/app/shared/src/platform/log/index.ts
  88. +9 −9 packages/app/shared/src/types/botTypes.ts
  89. +2 −3 packages/app/shared/src/types/commandLineArgsTypes.ts
  90. +6 −7 packages/app/shared/src/types/conversationTypes.ts
  91. +24 −24 packages/app/shared/src/types/responseTypes.ts
  92. +46 −46 packages/app/shared/src/types/serverSettingsTypes.ts
  93. +2 −2 packages/app/shared/src/types/speechTypes.ts
  94. +22 −17 packages/app/shared/src/utils.ts
  95. +1 −1 packages/app/shared/tslint.json
  96. +0 −2 packages/custom-botframework-directlinejs/dist/directLine.js
  97. +0 −1 packages/custom-botframework-directlinejs/package.json
  98. +1 −1 packages/custom-botframework-webchat/built/ActivityView.js.map
  99. +1 −1 packages/custom-botframework-webchat/built/AdaptiveCardContainer.js.map
  100. +1 −1 packages/custom-botframework-webchat/built/Attachment.js.map
  101. +1 −1 packages/custom-botframework-webchat/built/CardBuilder.js.map
  102. +1 −1 packages/custom-botframework-webchat/built/Carousel.js.map
  103. +1 −1 packages/custom-botframework-webchat/built/Chat.js.map
  104. +1 −1 packages/custom-botframework-webchat/built/CognitiveServices/SpeechRecognition.js.map
  105. +1 −1 packages/custom-botframework-webchat/built/CognitiveServices/SpeechSynthesis.js.map
  106. +0 −2 packages/custom-botframework-webchat/built/FormattedText.js
  107. +1 −1 packages/custom-botframework-webchat/built/FormattedText.js.map
  108. +1 −1 packages/custom-botframework-webchat/built/HScroll.js.map
  109. +1 −1 packages/custom-botframework-webchat/built/History.js.map
  110. +1 −1 packages/custom-botframework-webchat/built/Konsole.js.map
  111. +1 −1 packages/custom-botframework-webchat/built/Shell.js.map
  112. +1 −1 packages/custom-botframework-webchat/built/SpeechModule.js.map
  113. +1 −1 packages/custom-botframework-webchat/built/Store.js.map
  114. +1 −1 packages/custom-botframework-webchat/built/Strings.js.map
  115. +1 −1 packages/custom-botframework-webchat/built/SuggestedActions.js.map
  116. +1 −1 packages/custom-botframework-webchat/built/getTabIndex.js.map
  117. +1 −673 packages/custom-botframework-webchat/dist/CognitiveServices.js
  118. +37 −3,876 packages/custom-botframework-webchat/dist/botchat.js
  119. +1 −1 packages/emulator/core/src/emulator/middleware/removeUsers.ts
  120. +0 −147 packages/emulator/core/src/facility/conversation.spec.js
  121. +3 −3 packages/emulator/core/src/facility/conversation.ts
  122. +1 −1 packages/emulator/core/src/utils/createResponse/apiException.ts
  123. +0 −50 packages/emulator/core/src/utils/statusCodeFamily.spec.js
  124. +1 −1 packages/extensions/debug/main/package.json
  125. +4 −4 packages/extensions/debug/main/src/index.ts
  126. +3 −3 packages/extensions/luis/client/src/Adapters/AppStateAdapter.tsx
  127. +5 −4 packages/extensions/luis/client/src/App.tsx
  128. +3 −3 packages/extensions/qnamaker/client/src/App.tsx
  129. +3 −3 packages/extensions/qnamaker/client/src/AppStateAdapter.tsx
  130. +2 −2 packages/extensions/qnamaker/client/src/Models/QnAMakerTraceInfo.ts
  131. +2 −2 packages/sdk/client/package.json
  132. +3 −3 packages/sdk/client/src/extensions/host.ts
  133. +1 −1 packages/sdk/client/tslint.json
  134. +3 −2 packages/sdk/main/package.json
  135. +2 −2 packages/sdk/main/src/ipc/process.ts
  136. +2 −2 packages/sdk/main/src/ipc/websocket.ts
  137. +1 −1 packages/sdk/main/tslint.json
  138. +2 −2 packages/sdk/shared/package.json
  139. +7 −7 packages/sdk/shared/src/command/index.ts
  140. +17 −14 packages/sdk/shared/src/command/registry.ts
  141. +11 −11 packages/sdk/shared/src/command/service.ts
  142. +26 −26 packages/sdk/shared/src/extensions/config.ts
  143. +7 −7 packages/sdk/shared/src/ipc/channel.ts
  144. +18 −10 packages/sdk/shared/src/ipc/index.ts
  145. +1 −1 packages/sdk/shared/src/ipc/sender.ts
  146. +11 −14 packages/sdk/shared/src/lifecycle/{disposable.ts → disposableImpl.ts}
  147. +1 −1 packages/sdk/shared/src/lifecycle/index.ts
  148. +6 −6 packages/sdk/shared/src/types/accountTypes.ts
  149. +79 −80 packages/sdk/shared/src/types/activityTypes.ts
  150. +105 −102 packages/sdk/shared/src/types/attachmentTypes.ts
  151. +5 −5 packages/sdk/shared/src/types/botConfigWithPathTypes.ts
  152. +2 −2 packages/sdk/shared/src/types/eTagTypes.ts
  153. +2 −2 packages/sdk/shared/src/types/entityTypes.ts
  154. +10 −11 packages/sdk/shared/src/types/msbotTypes.ts
  155. +73 −73 packages/sdk/shared/src/types/paymentTypes.ts
  156. +3 −4 packages/sdk/shared/src/types/userTypes.ts
  157. +1 −1 packages/sdk/shared/src/utils/index.ts
  158. +1 −1 packages/sdk/shared/tslint.json
  159. +1 −1 packages/sdk/ui-react/package.json
  160. +1 −1 packages/sdk/ui-react/tslint.json
  161. +15 −0 testSetup.js
View
@@ -1,5 +1,5 @@
.DS_Store
lerna-debug.log
lerna-debug.log*
node_modules
npm-debug.log
Thumbs.db
View
@@ -1,5 +1,5 @@
{
"lerna": "2.10.0",
"lerna": "2.11.0",
"packages": [
"packages/app/client",
"packages/app/main",
View
@@ -1,6 +1,7 @@
{
"scripts": {
"bootstrap": "lerna bootstrap --hoist",
"build": "lerna run --scope @bfemulator/**shared build && lerna run --scope !@bfemulator/**shared build",
"test": "jest",
"test:coveralls": "jest --coverage --coverageReporters=text-lcov | coveralls"
},
@@ -14,7 +14,7 @@
"build": "run-s build:vendors build:shared build:app copy:external",
"clean": "rimraf build",
"copy:external": "gulp copy",
"prepare": "npm run clean && npm run build",
"prepare": "npm run clean",
"lint": "tslint --project tsconfig.json",
"start": "run-s copy:external build:vendors:dev build:shared:dev webpackdevServer:dev",
"webpackdevServer:dev": "webpack-dev-server --mode development --hot --inline --progress --colors --content-base ./public",
@@ -31,11 +31,10 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { getBotDisplayName, IBotInfo } from '@bfemulator/app-shared';
import { getBotDisplayName, BotInfo } from '@bfemulator/app-shared';
import { CommandRegistry as CommReg, uniqueId } from '@bfemulator/sdk-shared';
import { BotConfigWithPath, CommandRegistryImpl as CommReg, uniqueId } from '@bfemulator/sdk-shared';
import { IBotConfig, IEndpointService } from 'msbot/bin/schema';
import { IBotConfigWithPath } from '@bfemulator/sdk-shared';
import * as Constants from './constants';
import * as BotActions from './data/action/botActions';
import * as ChatActions from './data/action/chatActions';
@@ -46,14 +45,10 @@ import { pathExistsInRecentBots } from './data/botHelpers';
import { getTabGroupForDocument, showWelcomePage } from './data/editorHelpers';
import store from './data/store';
import { ExtensionManager } from './extensions';
import { CommandService } from './platform/commands/commandService';
import { CommandServiceImpl } from './platform/commands/commandServiceImpl';
import * as LogService from './platform/log/logService';
import * as SettingsService from './platform/settings/settingsService';
import {
BotCreationDialog,
SecretPromptDialog,
DialogService
} from './ui/dialogs';
import { BotCreationDialog, DialogService, SecretPromptDialog } from './ui/dialogs';
import { ActiveBotHelper } from './ui/helpers/activeBotHelper';
// =============================================================================
@@ -110,7 +105,7 @@ export function registerCommands() {
// ---------------------------------------------------------------------------
// Completes the client side sync of the bot:load command on the server side
// (NOTE: should NOT be called by itself; call server side instead)
CommandRegistry.registerCommand('bot:load', (bot: IBotConfigWithPath): void => {
CommandRegistry.registerCommand('bot:load', (bot: BotConfigWithPath): void => {
if (!pathExistsInRecentBots(bot.path)) {
// create and switch bots
ActiveBotHelper.confirmAndCreateBot(bot, '');
@@ -121,9 +116,9 @@ export function registerCommands() {
// ---------------------------------------------------------------------------
// Syncs the client side list of bots with bots arg (usually called from server side)
CommandRegistry.registerCommand('bot:list:sync', async (bots: IBotInfo[]): Promise<void> => {
CommandRegistry.registerCommand('bot:list:sync', async (bots: BotInfo[]): Promise<void> => {
store.dispatch(BotActions.load(bots));
CommandService.remoteCall('menu:update-recent-bots');
CommandServiceImpl.remoteCall('menu:update-recent-bots');
});
// ---------------------------------------------------------------------------
@@ -215,10 +210,10 @@ export function registerCommands() {
}
],
};
CommandService.remoteCall('shell:showOpenDialog', dialogOptions)
CommandServiceImpl.remoteCall('shell:showOpenDialog', dialogOptions)
.then(filename => {
if (filename && filename.length) {
CommandService.call('transcript:open', filename);
CommandServiceImpl.call('transcript:open', filename);
}
})
.catch(err => console.error(err));
@@ -239,8 +234,8 @@ export function registerCommands() {
CommandRegistry.registerCommand('bot:set-active', (bot: IBotConfig, botDirectory: string) => {
store.dispatch(BotActions.setActive(bot));
store.dispatch(FileActions.setRoot(botDirectory));
CommandService.remoteCall('menu:update-recent-bots');
CommandService.remoteCall('electron:set-title-bar', getBotDisplayName(bot));
CommandServiceImpl.remoteCall('menu:update-recent-bots');
CommandServiceImpl.remoteCall('electron:set-title-bar', getBotDisplayName(bot));
});
// ---------------------------------------------------------------------------
@@ -31,7 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { IBotInfo } from '@bfemulator/app-shared';
import { BotInfo } from '@bfemulator/app-shared';
import { IBotConfig } from 'msbot/bin/schema';
import { BotAction } from '../reducer/bot';
@@ -52,7 +52,7 @@ export function create(bot: IBotConfig, botFilePath: string, secret: string): Bo
};
}
export function load(bots: IBotInfo[]): BotAction {
export function load(bots: BotInfo[]): BotAction {
// prune bad bots
bots = bots.filter(bot => !!bot);
@@ -31,7 +31,7 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { ILogEntry } from '@bfemulator/app-shared';
import { LogEntry } from '@bfemulator/app-shared';
import { createStore as createWebChatStore } from '@bfemulator/custom-botframework-webchat';
export const NEW_CHAT_DOCUMENT = 'CHAT/DOCUMENT/NEW';
@@ -73,7 +73,7 @@ export type ChatAction = {
type: 'CHAT/LOG/APPEND',
payload: {
documentId: string,
entry: ILogEntry
entry: LogEntry
}
} | {
type: 'CHAT/LOG/CLEAR',
@@ -200,7 +200,7 @@ export function newConversation(documentId: string, options: any): ChatAction {
};
}
export function appendToLog(documentId: string, entry: ILogEntry): ChatAction {
export function appendToLog(documentId: string, entry: LogEntry): ChatAction {
return {
type: LOG_APPEND,
payload: {
@@ -31,15 +31,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { IBotInfo } from '@bfemulator/app-shared';
import { IBotConfigWithPath } from '@bfemulator/sdk-shared';
import { BotInfo } from '@bfemulator/app-shared';
import { BotConfigWithPath } from '@bfemulator/sdk-shared';
import store from './store';
export function getActiveBot(): IBotConfigWithPath {
export function getActiveBot(): BotConfigWithPath {
return store.getState().bot.activeBot;
}
export function getBotInfoByPath(path: string): IBotInfo {
export function getBotInfoByPath(path: string): BotInfo {
const state = store.getState();
return state.bot.botFiles.find(bot => bot && bot.path === path);
}
@@ -34,9 +34,9 @@
import store from './store';
import * as EditorActions from './action/editorActions';
import * as Constants from '../constants';
import { IEditor } from '../data/reducer/editor';
import { Editor } from '../data/reducer/editor';
export function hasNonGlobalTabs(tabGroups?: { [editorKey: string]: IEditor }): number {
export function hasNonGlobalTabs(tabGroups?: { [editorKey: string]: Editor }): number {
tabGroups = tabGroups || store.getState().editor.editors;
let count = 0;
for (let key in tabGroups) {
@@ -50,7 +50,7 @@ export function hasNonGlobalTabs(tabGroups?: { [editorKey: string]: IEditor }):
}
// @returns: name of editor group, or undefined if doc is not open.
export function getTabGroupForDocument(documentId: string, tabGroups?: { [editorKey: string]: IEditor }): string {
export function getTabGroupForDocument(documentId: string, tabGroups?: { [editorKey: string]: Editor }): string {
tabGroups = tabGroups || store.getState().editor.editors;
for (let key in tabGroups) {
if (tabGroups[key] && tabGroups[key].documents) {
@@ -75,6 +75,6 @@ export function showAppSettingsPage(): void {
store.dispatch(EditorActions.open(Constants.CONTENT_TYPE_APP_SETTINGS, Constants.DOCUMENT_ID_APP_SETTINGS, true));
}
export function tabGroupHasDocuments(tabGroup: IEditor): boolean {
export function tabGroupHasDocuments(tabGroup: Editor): boolean {
return Object.keys(tabGroup.documents).length ? true : false;
}
@@ -31,15 +31,15 @@
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
import { IBotConfigWithPath } from '@bfemulator/sdk-shared';
import { BotConfigWithPath } from '@bfemulator/sdk-shared';
import * as BotActions from '../action/botActions';
import { getBotDisplayName, IBotInfo } from '@bfemulator/app-shared';
import { getBotDisplayName, BotInfo } from '@bfemulator/app-shared';
import { IBotConfig } from 'msbot/bin/schema';
import { getBotInfoByPath } from '../botHelpers';
export interface BotState {
activeBot: IBotConfig;
botFiles: IBotInfo[];
botFiles: BotInfo[];
}
export type BotAction = {
@@ -52,18 +52,18 @@ export type BotAction = {
} | {
type: 'BOT/LOAD',
payload: {
bots: IBotInfo[]
bots: BotInfo[]
}
} | {
type: 'BOT/PATCH',
payload: {
bot: IBotConfigWithPath,
bot: BotConfigWithPath,
secret?: string
}
} | {
type: 'BOT/SET_ACTIVE',
payload: {
bot: IBotConfigWithPath
bot: BotConfigWithPath
}
} | {
type: 'BOT/CLOSE',
@@ -79,7 +79,7 @@ const DEFAULT_STATE: BotState = {
export default function bot(state: BotState = DEFAULT_STATE, action: BotAction) {
switch (action.type) {
case BotActions.CREATE: {
const newBot: IBotInfo = {
const newBot: BotInfo = {
path: action.payload.botFilePath,
displayName: getBotDisplayName(action.payload.bot),
secret: action.payload.secret
@@ -142,7 +142,7 @@ function setActiveBot(botConfig: IBotConfig, state: BotState): BotState {
return newState;
}
function setBotFilesState(botFilesState: IBotInfo[], state: BotState): BotState {
function setBotFilesState(botFilesState: BotInfo[], state: BotState): BotState {
let newState = Object.assign({}, state);
newState.botFiles = botFilesState;
@@ -33,7 +33,7 @@
import * as PresentationActions from '../action/presentationActions';
import { PresentationAction } from '../action/presentationActions';
import { CommandService } from '../../platform/commands/commandService';
import { CommandServiceImpl } from '../../platform/commands/commandServiceImpl';
export interface PresentationState {
enabled: boolean;
@@ -65,7 +65,7 @@ function setEnabled(enabled: boolean, state: PresentationState): PresentationSta
let newState = Object.assign({}, state);
newState.enabled = enabled;
CommandService.remoteCall('electron:set-fullscreen', enabled);
CommandServiceImpl.remoteCall('electron:set-fullscreen', enabled);
return newState;
}
@@ -34,7 +34,7 @@
import { IAzureBotService, ServiceType } from 'msbot/bin/schema';
import { ComponentClass } from 'react';
import { call, ForkEffect, takeEvery, takeLatest } from 'redux-saga/effects';
import { CommandService } from '../../platform/commands/commandService';
import { CommandServiceImpl } from '../../platform/commands/commandServiceImpl';
import { DialogService } from '../../ui/dialogs/service';
import {
AzureBotServiceEditor
@@ -54,7 +54,7 @@ function* launchAzureBotServiceEditor(action: AzureBotServiceAction<AzureBotServ
const result = yield DialogService
.showDialog<ComponentClass<AzureBotServiceEditor>>(azureBotServiceEditorComponent, { azureBotService });
if (result) {
yield CommandService.remoteCall('bot:add-or-update-service', ServiceType.AzureBotService, result);
yield CommandServiceImpl.remoteCall('bot:add-or-update-service', ServiceType.AzureBotService, result);
}
}
@@ -65,7 +65,7 @@ function* openAzureBotServiceContextMenu
{ label: 'Open in web portal', id: 'open' },
{ label: 'Remove', id: 'forget' }
];
const response = yield call(CommandService.remoteCall.bind(CommandService), 'electron:displayContextMenu', menuItems);
const response = yield call(CommandServiceImpl.remoteCall.bind(CommandServiceImpl), 'electron:displayContextMenu', menuItems);
switch (response.id) {
case 'edit':
yield* launchAzureBotServiceEditor(action);
@@ -88,20 +88,20 @@ function* openAzureBotServiceDeepLink(action: AzureBotServiceAction<AzureBotServ
const { tenantId, subscriptionId, resourceGroup, id } = action.payload.azureBotService;
const thankYouTsLint = `https://ms.portal.azure.com/#@${tenantId}/resource/subscriptions/${subscriptionId}`;
const link = `${thankYouTsLint}/resourceGroups/${resourceGroup}/providers/Microsoft.BotService/botServices/${id}`;
yield CommandService.remoteCall('electron:openExternal', link + '/channels');
yield CommandServiceImpl.remoteCall('electron:openExternal', link + '/channels');
}
function* removeAzureBotServiceFromActiveBot(azureBotService: IAzureBotService): IterableIterator<any> {
// TODO - localization
const result = yield CommandService.remoteCall('shell:show-message-box', true, {
const result = yield CommandServiceImpl.remoteCall('shell:show-message-box', true, {
type: 'question',
buttons: ['Cancel', 'OK'],
defaultId: 1,
message: `Remove QnA service ${azureBotService.name}. Are you sure?`,
cancelId: 0,
});
if (result) {
yield CommandService.remoteCall('bot:remove-service', ServiceType.AzureBotService, azureBotService.id);
yield CommandServiceImpl.remoteCall('bot:remove-service', ServiceType.AzureBotService, azureBotService.id);
}
}
@@ -34,7 +34,7 @@
import { IDispatchService, ServiceType } from 'msbot/bin/schema';
import { ComponentClass } from 'react';
import { call, ForkEffect, takeEvery, takeLatest } from 'redux-saga/effects';
import { CommandService } from '../../platform/commands/commandService';
import { CommandServiceImpl } from '../../platform/commands/commandServiceImpl';
import { DialogService } from '../../ui/dialogs/service';
import { DispatchEditor } from '../../ui/shell/explorer/dispatchExplorer/dispatchEditor/dispatchEditor';
import {
@@ -49,7 +49,7 @@ import {
function* openDispatchDeepLink(action: DispatchServiceAction<DispatchServicePayload>): IterableIterator<any> {
const { appId, version } = action.payload.dispatchService;
const link = `https://www.dispatch.ai/applications/${appId}/versions/${version}/build`;
yield CommandService.remoteCall('electron:openExternal', link);
yield CommandServiceImpl.remoteCall('electron:openExternal', link);
}
function* openDispatchContextMenu(action: DispatchServiceAction<DispatchServicePayload>): IterableIterator<any> {
@@ -58,7 +58,7 @@ function* openDispatchContextMenu(action: DispatchServiceAction<DispatchServiceP
{ label: 'Edit settings', id: 'edit' },
{ label: 'Remove', id: 'forget' }
];
const response = yield call(CommandService.remoteCall.bind(CommandService), 'electron:displayContextMenu', menuItems);
const response = yield call(CommandServiceImpl.remoteCall.bind(CommandServiceImpl), 'electron:displayContextMenu', menuItems);
switch (response.id) {
case 'open':
yield* openDispatchDeepLink(action);
@@ -78,15 +78,15 @@ function* openDispatchContextMenu(action: DispatchServiceAction<DispatchServiceP
}
function* removeDispatchServiceFromActiveBot(dispatchService: IDispatchService): IterableIterator<any> {
const result = yield CommandService.remoteCall('shell:show-message-box', true, {
const result = yield CommandServiceImpl.remoteCall('shell:show-message-box', true, {
type: 'question',
buttons: ['Cancel', 'OK'],
defaultId: 1,
message: `Remove Dispatch service ${dispatchService.name}. Are you sure?`,
cancelId: 0,
});
if (result) {
yield CommandService.remoteCall('bot:remove-service', ServiceType.Dispatch, dispatchService.id);
yield CommandServiceImpl.remoteCall('bot:remove-service', ServiceType.Dispatch, dispatchService.id);
}
}
@@ -95,7 +95,7 @@ function* launchDispatchEditor(action: DispatchServiceAction<DispatchEditorPaylo
const result = yield DialogService
.showDialog<ComponentClass<DispatchEditor>>(dispatchEditorComponent, { dispatchService });
if (result) {
yield CommandService.remoteCall('bot:add-or-update-service', ServiceType.Dispatch, result);
yield CommandServiceImpl.remoteCall('bot:add-or-update-service', ServiceType.Dispatch, result);
}
}
Oops, something went wrong.

0 comments on commit 374b98f

Please sign in to comment.