From: Lucas Di Pentima Date: Tue, 20 Aug 2019 14:44:17 +0000 (-0300) Subject: 15407: Adds user visible warning when websocket url is not set. X-Git-Tag: 2.0.0~40^2~2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/f159c2bb8e32579651942e8ba7a53c4d90a9b890 15407: Adds user visible warning when websocket url is not set. Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima --- diff --git a/.gitignore b/.gitignore index c18f27f6..45df030d 100644 --- a/.gitignore +++ b/.gitignore @@ -22,6 +22,7 @@ .env.development.local .env.test.local .env.production.local +.npm.local npm-debug.log* yarn-debug.log* diff --git a/src/websocket/websocket.ts b/src/websocket/websocket.ts index 4fd7cc2c..e7ea3016 100644 --- a/src/websocket/websocket.ts +++ b/src/websocket/websocket.ts @@ -13,6 +13,7 @@ import { loadContainers } from '~/store/processes/processes-actions'; import { LogEventType } from '~/models/log'; import { addProcessLogsPanelItem } from '../store/process-logs-panel/process-logs-panel-actions'; import { FilterBuilder } from "~/services/api/filter-builder"; +import { snackbarActions, SnackbarKind } from "~/store/snackbar/snackbar-actions"; export const initWebSocket = (config: Config, authService: AuthService, store: RootStore) => { if (config.websocketUrl) { @@ -20,7 +21,8 @@ export const initWebSocket = (config: Config, authService: AuthService, store: R webSocketService.setMessageListener(messageListener(store)); webSocketService.connect(); } else { - console.warn("WARNING: webSocketUrl is not configured on the API Server"); + console.warn("WARNING: Websocket ExternalURL is not set on the API Server"); + store.dispatch(snackbarActions.OPEN_SNACKBAR({ message: "Websocket URL missing on cluster config", kind: SnackbarKind.WARNING })); } };