Link release to Release component

feature/appm-store/pbac
Jayasanka 6 years ago
parent ccc7021d1e
commit 1d14bc39c4

@ -1,6 +1,7 @@
import React from "react"; import React from "react";
import {Modal, Typography,List, Avatar} from 'antd'; import {Modal, Typography,List, Avatar} from 'antd';
import {connect} from 'react-redux'; import {connect} from 'react-redux';
import {Link} from "react-router-dom";
// connecting state.releaseView with the component // connecting state.releaseView with the component
const mapStateToProps = state => { const mapStateToProps = state => {
@ -60,12 +61,12 @@ class ConnectedReleaseModal extends React.Component {
<List <List
itemLayout="horizontal" itemLayout="horizontal"
dataSource={app.applicationReleases} dataSource={app.applicationReleases}
renderItem={item => ( renderItem={release => (
<List.Item> <List.Item>
<List.Item.Meta <List.Item.Meta
avatar={<Avatar src={item.iconPath} />} avatar={<Avatar src={release.iconPath} />}
title={<a href="https://ant.design">Title</a>} title={<Link to={"/publisher/apps/releases/"+release.uuid}>{release.version}</Link>}
description={item.description} description={release.description}
/> />
</List.Item> </List.Item>
)} )}

@ -5,6 +5,7 @@ import App from "./App";
import Login from "./pages/Login"; import Login from "./pages/Login";
import Dashboard from "./pages/dashboard/Dashboard"; import Dashboard from "./pages/dashboard/Dashboard";
import Apps from "./pages/dashboard/apps/Apps"; import Apps from "./pages/dashboard/apps/Apps";
import Release from "./pages/dashboard/apps/release/Release";
import AddNewApp from "./pages/dashboard/add-new-app/AddNewApp"; import AddNewApp from "./pages/dashboard/add-new-app/AddNewApp";
import './index.css'; import './index.css';
import store from "./js/store/index"; import store from "./js/store/index";
@ -31,6 +32,11 @@ const routes = [
path: '/publisher/apps/new-app', path: '/publisher/apps/new-app',
component: AddNewApp, component: AddNewApp,
exact: true exact: true
},
{
path: '/publisher/apps/releases/:uuid',
exact: true,
component: Release
} }
] ]
} }
@ -39,7 +45,7 @@ const routes = [
ReactDOM.render( ReactDOM.render(
<Provider store={store}> <Provider store={store}>
<App routes={routes}/> <App routes={routes}/>
</Provider>, </Provider>,
document.getElementById('root')); document.getElementById('root'));

@ -0,0 +1,63 @@
import React from "react";
import "antd/dist/antd.css";
import {PageHeader, Typography, Input, Button, Row, Col} from "antd";
const Search = Input.Search;
const routes = [
{
path: 'index',
breadcrumbName: 'Publisher',
},
{
path: 'first',
breadcrumbName: 'Dashboard',
},
{
path: 'second',
breadcrumbName: 'Apps',
},
];
class Release extends React.Component {
routes;
constructor(props) {
super(props);
this.routes = props.routes;
}
componentDidMount() {
}
render() {
const {uuid} = this.props.match.params;
return (
<div>
<PageHeader
breadcrumb={{routes}}
/>
<div style={{background: '#f0f2f5', padding: 24, minHeight: 780}}>
<Row style={{padding: 10}}>
<Col span={6} offset={18}>
<Search
placeholder="search"
onSearch={value => console.log(value)}
style={{width: 200}}
/>
<Button style={{margin: 5}}>Advanced Search</Button>
</Col>
</Row>
</div>
</div>
);
}
}
export default Release;
Loading…
Cancel
Save