diff options
Diffstat (limited to 'sdnr/wt/odlux/apps/configurationApp/src')
5 files changed, 28 insertions, 12 deletions
diff --git a/sdnr/wt/odlux/apps/configurationApp/src/actions/configurationActions.ts b/sdnr/wt/odlux/apps/configurationApp/src/actions/configurationActions.ts index 82055a761..b0ffc4c19 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/actions/configurationActions.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/actions/configurationActions.ts @@ -96,7 +96,7 @@ export const updateLpIdAsyncActionCreator = (lpId: string | undefined) => async export const updateViewDataAsyncActionCreator = (viewId: string | undefined, indexValues: string[] = []) => async (dispatch: Dispatch, getState: () => IApplicationStoreState) => { const { configuration: { nodeId, lpId, capability, conditionalPackage, viewSpecifications } } = getState(); if (!viewId || !capability || !nodeId || !lpId || !conditionalPackage) { - dispatch(new AddSnackbarNotification({ message: `Error invalid parameter !${JSON.stringify({viewId ,capability ,nodeId ,lpId ,conditionalPackage}, null,2)}`, options: { variant: 'error' } })); + // dispatch(new AddSnackbarNotification({ message: `Error invalid parameter !${JSON.stringify({capability ,nodeId ,lpId ,conditionalPackage}, null,2)}`, options: { variant: 'error' } })); dispatch(new UpdateViewData()); return; } @@ -131,7 +131,7 @@ export const updateViewDataAsyncActionCreator = (viewId: string | undefined, ind viewData = viewData[path]; } - return viewData ? + return viewData != null ? dispatch(new UpdateViewData(viewId, indexValues.length > 0 ? indexValues.join("/") : "", viewData)) : dispatch(new UpdateViewData()); }
\ No newline at end of file diff --git a/sdnr/wt/odlux/apps/configurationApp/src/handlers/configurationAppRootHandler.ts b/sdnr/wt/odlux/apps/configurationApp/src/handlers/configurationAppRootHandler.ts index 4b982149a..f82d08a1b 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/handlers/configurationAppRootHandler.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/handlers/configurationAppRootHandler.ts @@ -44,7 +44,14 @@ export const configurationAppRootHandler: IActionHandler<IConfigurationAppStoreS state = { ...state, nodeId: action.nodeId, - coreModel: action.coreModel + coreModel: action.coreModel, + lpId: undefined, + capability: undefined, + conditionalPackage: undefined, + viewSpecifications: [], + viewData: { }, + indexValues: undefined, + viewId: undefined, }; } else if (action instanceof UpdateLp) { state = { @@ -52,7 +59,10 @@ export const configurationAppRootHandler: IActionHandler<IConfigurationAppStoreS lpId: action.lpId, capability: action.capability, conditionalPackage: action.conditionalPackage, - viewSpecifications: action.viewSpecifications + viewSpecifications: action.viewSpecifications, + viewData: { }, + indexValues: undefined, + viewId: undefined, }; } else if (action instanceof UpdateViewData) { state = { diff --git a/sdnr/wt/odlux/apps/configurationApp/src/plugin.tsx b/sdnr/wt/odlux/apps/configurationApp/src/plugin.tsx index b7d44f70b..d2b18ea21 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/plugin.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/plugin.tsx @@ -51,14 +51,14 @@ const ConfigurationApplicationRouteAdapter = connect(mapProps, mapDisp)((props: currentLpId = props.match.params.lpId || undefined; currentViewId = null; currentIndex = null; - currentLpId && await props.updateLpId(currentLpId); + currentMountId && await props.updateLpId(currentLpId); } // check if the viewId or the indices has changed if (currentViewId !== props.match.params.viewId || currentIndex !== props.match.params[0]) { currentViewId = props.match.params.viewId || undefined; currentIndex = props.match.params[0] || undefined; - currentViewId && await props.updateViewData(currentViewId || '', currentIndex && currentIndex.split("/") || [] ); + currentLpId && await props.updateViewData(currentViewId || '', currentIndex && currentIndex.split("/") || [] ); } }); diff --git a/sdnr/wt/odlux/apps/configurationApp/src/services/configurationService.ts b/sdnr/wt/odlux/apps/configurationApp/src/services/configurationService.ts index 707fed833..0802be59e 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/services/configurationService.ts +++ b/sdnr/wt/odlux/apps/configurationApp/src/services/configurationService.ts @@ -26,8 +26,8 @@ class ConfigurationService { /** Gets the UI description object for a capability of a network element. */ public async getUIDescriptionByCapability(capability: string, revision: string | null): Promise<ViewSpecification[] | null> { const capFile = capability && revision && `${capability}@${revision}.json`; - const coreModelResponse = capFile && await requestRest<{ views: ViewSpecification[] } >(`assets/${capFile}`, { method: "GET" }); - return coreModelResponse && coreModelResponse.views || null; + const coreModelResponse = capFile && await requestRest<{ views: ViewSpecification[] }>(`assets/${capFile}`, { method: "GET" }, false, true); + return coreModelResponse && coreModelResponse.views || null; } } diff --git a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx index 5865c10e5..65fbd70a5 100644 --- a/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx +++ b/sdnr/wt/odlux/apps/configurationApp/src/views/configurationApplication.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import { MaterialTable, ColumnType, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; +import { MaterialTable, MaterialTableCtorType } from '../../../../framework/src/components/material-table'; import connect, { Connect, IDispatcher } from '../../../../framework/src/flux/connect'; import { IApplicationStoreState } from '../../../../framework/src/store/applicationStore'; import { IConnectAppStoreState } from '../../../connectApp/src/handlers/connectAppRootHandler'; @@ -70,11 +70,12 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp </> ); } else if (!this.props.lpId) { - return ( + return this.props.coreModel && this.props.coreModel.ltp && this.props.coreModel.ltp.length + ? ( <> <h2>Please select an existing LP first !</h2> <ul> - { this.props.coreModel && this.props.coreModel.ltp.map(ltp => { + { this.props.coreModel.ltp.map(ltp => { return <li key={ltp.uuid}> <Link component="a" variant="body2" color="secondary" onClick={() => { this.props.changeLp(ltp.lp[0].uuid); @@ -83,6 +84,11 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp }) || null} </ul> </> + ) + : ( + <> + <h2>No LTP / LP found !</h2> + </> ); } else if (!this.props.capability && !this.props.viewId) { return ( @@ -113,7 +119,7 @@ class ConfigurationApplicationComponent extends React.Component<ConfigurationApp </div> </> ) - : <h2>View Not Found</h2>; + : <h2>View [{this.props.viewId || this.props.conditionalPackage}] Not Found ! {this.props.viewSpecifications.length} </h2>; } private static keyPropertyParser = /\$\$INDEX:(\d+):?([a-z\-]+)?\$\$$/; |