aboutsummaryrefslogtreecommitdiffstats
path: root/sdnr/wt/odlux/framework
diff options
context:
space:
mode:
authorRavi Pendurty <ravi.pendurty@highstreet-technologies.com>2021-02-03 16:10:57 +0100
committerDan Timoney <dtimoney@att.com>2021-02-05 22:58:04 +0000
commit0f28ecccb0dbd7c2f39e2c4676e17ca0c38464a2 (patch)
treeae4ac3eac568a78eb5539d0bbc0bbd912d071e4a /sdnr/wt/odlux/framework
parent95cae7ce9aa09198bd46eee556da468a57657017 (diff)
Migrate odlux
Migrate odlux to Aluminium Issue-ID: CCSDK-3136 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> Change-Id: I3200a809a31e87021c95fe103a9c95e03011f503 Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/odlux/framework')
-rw-r--r--sdnr/wt/odlux/framework/pom.xml6
-rw-r--r--sdnr/wt/odlux/framework/src/app.tsx11
-rw-r--r--sdnr/wt/odlux/framework/src/assets/version.json5
-rw-r--r--sdnr/wt/odlux/framework/src/components/material-table/tableToolbar.tsx1
-rw-r--r--sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx7
-rw-r--r--sdnr/wt/odlux/framework/src/components/navigationMenu.tsx41
-rw-r--r--sdnr/wt/odlux/framework/src/services/notificationService.ts2
7 files changed, 53 insertions, 20 deletions
diff --git a/sdnr/wt/odlux/framework/pom.xml b/sdnr/wt/odlux/framework/pom.xml
index f1f73b1c0..daedd9d3c 100644
--- a/sdnr/wt/odlux/framework/pom.xml
+++ b/sdnr/wt/odlux/framework/pom.xml
@@ -26,7 +26,7 @@
<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent</artifactId>
- <version>2.1.0</version>
+ <version>2.1.1-SNAPSHOT</version>
<relativePath/>
</parent>
@@ -46,7 +46,7 @@
<properties>
<buildtime>${maven.build.timestamp}</buildtime>
<distversion>ONAP Frankfurt (Neon, mdsal ${odl.mdsal.version})</distversion>
- <buildno>86.51a94bd(20/11/17)</buildno>
+ <buildno>88.1c38886(20/12/04)</buildno>
<odlux.version>ONAP SDN-R | ONF Wireless for ${distversion} - Build: ${buildtime} ${buildno} ${project.version}</odlux.version>
</properties>
@@ -183,7 +183,7 @@
<token>##odlux.version##</token>
<value>${odlux.version}</value>
</replacement>
- <replacement>
+ <replacement>
<token>##buildno##</token>
<value>${buildno}</value>
</replacement>
diff --git a/sdnr/wt/odlux/framework/src/app.tsx b/sdnr/wt/odlux/framework/src/app.tsx
index 791f46d0a..6a24bfb2a 100644
--- a/sdnr/wt/odlux/framework/src/app.tsx
+++ b/sdnr/wt/odlux/framework/src/app.tsx
@@ -57,6 +57,8 @@ declare module '@material-ui/core/styles/createMuiTheme' {
}
}
+export const transportPCEUrl = "transportPCEUrl";
+
export const runApplication = () => {
const applicationStore = applicationStoreCreator();
@@ -79,6 +81,7 @@ export const runApplication = () => {
startHistoryListener(applicationStore);
startForceLogoutService(applicationStore);
startNotificationService(applicationStore);
+ addTransportPCEUrl();
const App = (): JSX.Element => (
<ApplicationStoreProvider applicationStore={applicationStore} >
@@ -91,3 +94,11 @@ export const runApplication = () => {
ReactDOM.render(<App />, document.getElementById('app'));
};
+
+const addTransportPCEUrl = () =>{
+ const url = window.localStorage.getItem(transportPCEUrl);
+ if(url === null){
+ window.localStorage.setItem(transportPCEUrl, "http://10.20.6.32:18082/");
+ console.log("set transport url :D")
+ }
+}
diff --git a/sdnr/wt/odlux/framework/src/assets/version.json b/sdnr/wt/odlux/framework/src/assets/version.json
index 7720cb969..260aec4ea 100644
--- a/sdnr/wt/odlux/framework/src/assets/version.json
+++ b/sdnr/wt/odlux/framework/src/assets/version.json
@@ -1,5 +1,4 @@
{
- "version":"86.51a94bd(20/11/17)",
- "build":"2020-11-17T11:13:24Z"
-
+ "version":"88.1c38886(20/12/04)",
+ "build":"2020-12-04T06:06:24Z"
} \ No newline at end of file
diff --git a/sdnr/wt/odlux/framework/src/components/material-table/tableToolbar.tsx b/sdnr/wt/odlux/framework/src/components/material-table/tableToolbar.tsx
index 96bcbf375..3b2f8e0a8 100644
--- a/sdnr/wt/odlux/framework/src/components/material-table/tableToolbar.tsx
+++ b/sdnr/wt/odlux/framework/src/components/material-table/tableToolbar.tsx
@@ -29,6 +29,7 @@ import MenuItem from '@material-ui/core/MenuItem';
import Menu from '@material-ui/core/Menu';
import { lighten } from '@material-ui/core/styles/colorManipulator';
import { SvgIconProps } from '@material-ui/core/SvgIcon/SvgIcon';
+import { Button } from '@material-ui/core';
const styles = (theme: Theme) => createStyles({
root: {
diff --git a/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx b/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
index 8c4b740a0..8828ac3fc 100644
--- a/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
+++ b/sdnr/wt/odlux/framework/src/components/material-ui/listItemLink.tsx
@@ -36,11 +36,14 @@ export interface IListItemLinkProps extends WithStyles<typeof styles> {
secondary?: React.ComponentType;
to: string;
exact?: boolean;
+ external?: boolean;
}
export const ListItemLink = withStyles(styles)((props: IListItemLinkProps) => {
- const { icon, primary: Primary, secondary: Secondary, classes, to, exact = false } = props;
- const renderLink = (itemProps: any): JSX.Element => (<NavLink exact={ exact } to={ to } activeClassName={ classes.active } { ...itemProps } />);
+ const { icon, primary: Primary, secondary: Secondary, classes, to, exact = false, external=false } = props;
+ const renderLink = (itemProps: any): JSX.Element => (
+ props.external ? <a target="_blank" href={to} { ...itemProps }></a> :
+ <NavLink exact={ exact } to={ to } activeClassName={ classes.active } { ...itemProps } />);
const ariaLabel = typeof Primary === 'string' ? "link-to-"+Primary.toLowerCase().replace(/\s/g, "-") : "link-to-"+Primary.displayName?.toLowerCase();
return (
diff --git a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
index 790677ae3..437ba1b3a 100644
--- a/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
+++ b/sdnr/wt/odlux/framework/src/components/navigationMenu.tsx
@@ -26,12 +26,14 @@ import List from '@material-ui/core/List';
import Divider from '@material-ui/core/Divider';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
+import { faProjectDiagram } from '@fortawesome/free-solid-svg-icons';
import ListItemLink from '../components/material-ui/listItemLink';
import connect, { Connect } from '../flux/connect';
import { MenuAction } from '../actions/menuAction';
import * as classNames from 'classnames';
+import { transportPCEUrl } from '../app';
const drawerWidth = 240;
@@ -125,6 +127,33 @@ export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, di
window.dispatchEvent(new Event('menu-resized'));
}, [isOpen])
+ let menuItems = state.framework.applicationRegistraion && Object.keys(state.framework.applicationRegistraion).map(key => {
+ const reg = state.framework.applicationRegistraion[key];
+ return reg && (
+ <ListItemLink
+ key={reg.name}
+ to={reg.path || `/${reg.name}`}
+ primary={reg.menuEntry || reg.name}
+ secondary={reg.subMenuEntry}
+ icon={reg.icon && <FontAwesomeIcon icon={reg.icon} /> || null} />
+ ) || null;
+ }) || null;
+
+ const transportPCELink = <ListItemLink
+ key={"transportPCE"}
+ to={window.localStorage.getItem(transportPCEUrl)!}
+ primary={"TransportPCE"}
+ icon={<FontAwesomeIcon icon={faProjectDiagram}/>}
+ external/>;
+
+ const linkFound = menuItems.find(obj=>obj.key === "linkCalculation");
+ if(linkFound){
+ const index = menuItems.indexOf(linkFound);
+ menuItems.splice(index+1,0,transportPCELink);
+ }else{
+ menuItems.push(transportPCELink);
+ }
+
return (
<Drawer
variant="permanent"
@@ -145,17 +174,7 @@ export const NavigationMenu = withStyles(styles)(connect()(({ classes, state, di
<ListItemLink exact to="/" primary="Home" icon={<FontAwesomeIcon icon={faHome} />} />
<Divider />
{
- state.framework.applicationRegistraion && Object.keys(state.framework.applicationRegistraion).map(key => {
- const reg = state.framework.applicationRegistraion[key];
- return reg && (
- <ListItemLink
- key={reg.name}
- to={reg.path || `/${reg.name}`}
- primary={reg.menuEntry || reg.name}
- secondary={reg.subMenuEntry}
- icon={reg.icon && <FontAwesomeIcon icon={reg.icon} /> || null} />
- ) || null;
- }) || null
+ menuItems
}
<Divider />
<ListItemLink to="/about" primary="About" icon={<FontAwesomeIcon icon={faAddressBook} />} />
diff --git a/sdnr/wt/odlux/framework/src/services/notificationService.ts b/sdnr/wt/odlux/framework/src/services/notificationService.ts
index 4bcc05cc3..30091b574 100644
--- a/sdnr/wt/odlux/framework/src/services/notificationService.ts
+++ b/sdnr/wt/odlux/framework/src/services/notificationService.ts
@@ -19,7 +19,7 @@ import * as X2JS from 'x2js';
import { ApplicationStore } from '../store/applicationStore';
import { SetWebsocketAction } from '../actions/websocketAction';
-const socketUrl = [location.protocol === 'https:' ? 'wss://' : 'ws://', 'admin', ':', 'admin', '@', location.hostname, ':', location.port, '/websocket'].join('');
+const socketUrl = [location.protocol === 'https:' ? 'wss://' : 'ws://', location.hostname, ':', location.port, '/websocket'].join('');
const subscriptions: { [scope: string]: SubscriptionCallback[] } = {};
let socketReady: Promise<WebSocket>;
let userLoggedOut = false;