2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END============================================
20 * ===================================================================
23 import React from 'react';
24 import Nav from 'react-bootstrap/Nav';
25 import Navbar from 'react-bootstrap/Navbar';
26 import NavDropdown from 'react-bootstrap/NavDropdown';
27 import LoopUI from '../../LoopUI';
28 import 'bootstrap-css-only/css/bootstrap.min.css';
29 import styled from 'styled-components';
30 import { Link } from 'react-router-dom';
32 const StyledLink = styled(Link)`
33 color: ${props => props.theme.menuFontColor};
34 background-color: ${props => props.theme.menuBackgroundColor};
38 padding: .25rem 1.5rem;
44 text-decoration: none;
45 background-color: ${props => props.theme.menuHighlightedBackgroundColor};
46 color: ${props => props.theme.menuHighlightedFontColor};
49 const StyledNavLink = styled(Nav.Link)`
50 color: ${props => props.theme.menuFontColor};
51 background-color: ${props => props.theme.menuBackgroundColor};
53 padding: .25rem 1.5rem;
55 background-color: ${props => props.theme.menuHighlightedBackgroundColor};
56 color: ${props => props.theme.menuHighlightedFontColor};
60 const StyledNavDropdown = styled(NavDropdown)`
61 color: ${props => props.theme.menuFontColor};
63 color: ${props => props.theme.menuFontColor};
64 background-color: ${props => props.theme.backgroundColor};
72 export default class MenuBar extends React.Component {
74 loopName: this.props.loopName,
78 componentWillReceiveProps(newProps) {
79 if (newProps.loopName !== LoopUI.defaultLoopName) {
80 this.setState({ disabled: false });
82 this.setState({ disabled: true });
90 <StyledNavDropdown title="Closed Loop">
91 <NavDropdown.Item as={StyledLink} to="/openLoop">Open CL</NavDropdown.Item>
92 <NavDropdown.Item as={StyledLink} to="/loopProperties" disabled={this.state.disabled}>Properties CL</NavDropdown.Item>
93 <NavDropdown.Item as={StyledLink} to="/closeLoop" disabled={this.state.disabled}>Close Model</NavDropdown.Item>
95 <StyledNavDropdown title="Manage">
96 <NavDropdown.Item as={StyledLink} to="/submit" disabled={this.state.disabled}>Submit</NavDropdown.Item>
97 <NavDropdown.Item as={StyledLink} to="/stop" disabled={this.state.disabled}>Stop</NavDropdown.Item>
98 <NavDropdown.Item as={StyledLink} to="/restart" disabled={this.state.disabled}>Restart</NavDropdown.Item>
99 <NavDropdown.Item as={StyledLink} to="/delete" disabled={this.state.disabled}>Delete</NavDropdown.Item>
100 <NavDropdown.Item as={StyledLink} to="/deploy" disabled={this.state.disabled}>Deploy</NavDropdown.Item>
101 <NavDropdown.Item as={StyledLink} to="/undeploy" disabled={this.state.disabled}>UnDeploy</NavDropdown.Item>
103 <StyledNavDropdown title="View">
104 <NavDropdown.Item as={StyledLink} to="/refreshStatus" disabled={this.state.disabled}>Refresh Status</NavDropdown.Item>
106 <StyledNavDropdown title="Help">
107 <StyledNavLink href="https://wiki.onap.org/" target="_blank">Wiki</StyledNavLink>
108 <StyledNavLink href="mailto:onap-discuss@lists.onap.org?subject=CLAMP&body=Please send us suggestions or feature enhancements or defect. If possible, please send us the steps to replicate any defect.">Contact Us</StyledNavLink>
109 <NavDropdown.Item as={StyledLink} to="/userInfo">User Info</NavDropdown.Item>