From 97fa6d943c57a784a52462aaacb329ce93cf42d6 Mon Sep 17 00:00:00 2001 From: Herbert Eiselt Date: Wed, 3 Apr 2019 17:12:30 +0200 Subject: SDN-R odlux configuration Add odlux configuration app Change-Id: Ifecd3f6e1e3060a1fd1008f1f625a70cb2475a8a Issue-ID: SDNC-584 Signed-off-by: Herbert Eiselt --- sdnr/wt/odlux/apps/connectApp/src/plugin.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'sdnr/wt/odlux/apps/connectApp/src/plugin.tsx') diff --git a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx index 4da33e0af..c9c11820e 100644 --- a/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/connectApp/src/plugin.tsx @@ -9,7 +9,8 @@ import ConnectApplication from './views/connectView'; import { addMountedNetworkElementAsyncActionCreator, - updateMountedNetworkElementAsyncActionCreator + updateMountedNetworkElementAsyncActionCreator, + loadAllMountedNetworkElementsAsync } from './actions/mountedNetworkElementsActions'; import { AddSnackbarNotification } from '../../../framework/src/actions/snackbarActions'; @@ -30,14 +31,15 @@ export function register() { menuEntry: "Connect" }); + applicationApi.applicationStoreInitialized.then(applicationStore => { applicationStore.dispatch(loadAllMountedNetworkElementsAsync); }); // subscribe to the websocket notifications - subscribe(["ObjectCreationNotification", "ObjectDeletionNotification","AttributeValueChangedNotification"], (msg => { - const store = applicationApi && applicationApi.applicationStore; + subscribe(["ObjectCreationNotification", "ObjectDeletionNotification", "AttributeValueChangedNotification"], (msg => { + const store = applicationApi.applicationStore; if (msg && msg.notifType === "ObjectCreationNotification" && store) { store.dispatch(addMountedNetworkElementAsyncActionCreator(msg.objectId)); - store.dispatch(new AddSnackbarNotification({ message: `Adding network element [${ msg.objectId }]`, options: { variant: 'info' } })); + store.dispatch(new AddSnackbarNotification({ message: `Adding network element [${msg.objectId}]`, options: { variant: 'info' } })); } else if (msg && (msg.notifType === "ObjectDeletionNotification" || msg.notifType === "AttributeValueChangedNotification") && store) { - store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${ msg.objectId }]`, options: { variant: 'info' } })); + store.dispatch(new AddSnackbarNotification({ message: `Updating network element [${msg.objectId}]`, options: { variant: 'info' } })); store.dispatch(updateMountedNetworkElementAsyncActionCreator(msg.objectId)); } })); -- cgit 1.2.3-korg