Skip to content

Commit

Permalink
Change suffix js -> jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
tacigar authored and abesto committed Sep 10, 2019
1 parent 6c10a54 commit 1b453f5
Show file tree
Hide file tree
Showing 52 changed files with 1,286 additions and 1,150 deletions.
67 changes: 67 additions & 0 deletions zipkin-lens/src/components/App/App.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';

import Layout from './Layout';
import BrowserContainer from '../../containers/Browser/BrowserContainer';
import TracePageContainer from '../../containers/TracePage/TracePageContainer';
import DependenciesContainer from '../../containers/Dependencies/DependenciesContainer';
import TraceViewerContainer from '../../containers/TraceViewer/TraceViewerContainer';
import configureStore from '../../store/configure-store';

const applicationTitle = 'Zipkin';

class App extends React.Component {
componentDidMount() {
document.title = applicationTitle;
}

render() {
return (
<Provider store={configureStore()}>
<BrowserRouter>
<Layout>
<Route
exact
path="/zipkin/"
component={BrowserContainer}
/>
<Route
exact
path="/zipkin/traces/:traceId"
component={TracePageContainer}
/>
<Route
exact
path="/zipkin/dependency"
component={DependenciesContainer}
/>
<Route
exact
path="/zipkin/traceViewer"
render={TraceViewerContainer}
/>
</Layout>
</BrowserRouter>
</Provider>
);
}
}

export default App;
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';
import { shallow } from 'enzyme';

import App from './index';
import App from './App';
import Layout from './Layout';

describe('<App />', () => {
Expand Down
File renamed without changes.
99 changes: 99 additions & 0 deletions zipkin-lens/src/components/App/Sidebar/Sidebar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import PropTypes from 'prop-types';
import React from 'react';
import { withRouter } from 'react-router';
import Cookies from 'js-cookie';

import SidebarPageOption from './SidebarPageOption';
import Logo from '../../../img/zipkin-logo.svg';

const propTypes = {
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired,
history: PropTypes.shape({ push: PropTypes.func.isRequired }).isRequired,
};

class Sidebar extends React.Component {
constructor(props) {
super(props);
this.goBackToClassic = this.goBackToClassic.bind(this);
}

goBackToClassic(event) {
const { location, history } = this.props;

Cookies.remove('lens');
if (location.pathname === '/zipkin') {
history.push('/zipkin/');
} else {
history.push(`${location.pathname}`);
}
window.location.reload(true);
event.preventDefault();
}

render() {
const { location } = this.props;
return (
<div className="sidebar">
<div
to={{ pathname: '' }}
className="sidebar__brand-link"
>
<Logo className="sidebar__brand-logo" />
</div>
<div className="sidebar__menu">
<SidebarPageOption location={location} pageName="browser" />
<SidebarPageOption location={location} pageName="dependencies" />
</div>
{
Cookies.get('lens')
? (
<div className="sidebar__go-back-to-classic-button-wrapper">
<button
type="button"
className="sidebar__go-back-to-classic-button"
onClick={this.goBackToClassic}
>
Go back to classic Zipkin
</button>
</div>
)
: null
}
<div className="sidebar__other-links">
<a href="https://zipkin.apache.org/" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fas fa-home" />
</a>
<a href="https://github.com/openzipkin/zipkin" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-github" />
</a>
<a href="https://twitter.com/zipkinproject" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-twitter" />
</a>
<a href="https://gitter.im/openzipkin/zipkin/" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-gitter" />
</a>
</div>
</div>
);
}
}

Sidebar.propTypes = propTypes;

export default withRouter(Sidebar);
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React from 'react';
import { shallow } from 'enzyme';
import Cookies from 'js-cookie';

import Sidebar from './index';
import Sidebar from './Sidebar';

describe('<Sidebar />', () => {
it('should have proper classes', () => {
Expand Down
84 changes: 1 addition & 83 deletions zipkin-lens/src/components/App/Sidebar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,86 +14,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import PropTypes from 'prop-types';
import React from 'react';
import { withRouter } from 'react-router';
import Cookies from 'js-cookie';

import SidebarPageOption from './SidebarPageOption';
import Logo from '../../../img/zipkin-logo.svg';

const propTypes = {
location: PropTypes.shape({ pathname: PropTypes.string }).isRequired,
history: PropTypes.shape({ push: PropTypes.func.isRequired }).isRequired,
};

class Sidebar extends React.Component {
constructor(props) {
super(props);
this.goBackToClassic = this.goBackToClassic.bind(this);
}

goBackToClassic(event) {
const { location, history } = this.props;

Cookies.remove('lens');
if (location.pathname === '/zipkin') {
history.push('/zipkin/');
} else {
history.push(`${location.pathname}`);
}
window.location.reload(true);
event.preventDefault();
}

render() {
const { location } = this.props;
return (
<div className="sidebar">
<div
to={{ pathname: '' }}
className="sidebar__brand-link"
>
<Logo className="sidebar__brand-logo" />
</div>
<div className="sidebar__menu">
<SidebarPageOption location={location} pageName="browser" />
<SidebarPageOption location={location} pageName="dependencies" />
</div>
{
Cookies.get('lens')
? (
<div className="sidebar__go-back-to-classic-button-wrapper">
<button
type="button"
className="sidebar__go-back-to-classic-button"
onClick={this.goBackToClassic}
>
Go back to classic Zipkin
</button>
</div>
)
: null
}
<div className="sidebar__other-links">
<a href="https://zipkin.apache.org/" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fas fa-home" />
</a>
<a href="https://github.com/openzipkin/zipkin" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-github" />
</a>
<a href="https://twitter.com/zipkinproject" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-twitter" />
</a>
<a href="https://gitter.im/openzipkin/zipkin/" target="_blank" rel="noopener noreferrer">
<div className="sidebar__other-link fab fa-gitter" />
</a>
</div>
</div>
);
}
}

Sidebar.propTypes = propTypes;

export default withRouter(Sidebar);
export { default } from './Sidebar';
52 changes: 1 addition & 51 deletions zipkin-lens/src/components/App/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,54 +14,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React from 'react';
import { Provider } from 'react-redux';
import { BrowserRouter, Route } from 'react-router-dom';

import Layout from './Layout';
import BrowserContainer from '../../containers/Browser/BrowserContainer';
import TracePageContainer from '../../containers/TracePage/TracePageContainer';
import DependenciesContainer from '../../containers/Dependencies/DependenciesContainer';
import TraceViewerContainer from '../../containers/TraceViewer/TraceViewerContainer';
import configureStore from '../../store/configure-store';

const applicationTitle = 'Zipkin';

class App extends React.Component {
componentDidMount() {
document.title = applicationTitle;
}

render() {
return (
<Provider store={configureStore()}>
<BrowserRouter>
<Layout>
<Route
exact
path="/zipkin/"
component={BrowserContainer}
/>
<Route
exact
path="/zipkin/traces/:traceId"
component={TracePageContainer}
/>
<Route
exact
path="/zipkin/dependency"
component={DependenciesContainer}
/>
<Route
exact
path="/zipkin/traceViewer"
render={TraceViewerContainer}
/>
</Layout>
</BrowserRouter>
</Provider>
);
}
}

export default App;
export { default } from './App';
Loading

0 comments on commit 1b453f5

Please sign in to comment.