Fix merge conflicts

feature/appm-store/pbac
lasanthaDLPDS 5 years ago
commit ed557fc510

@ -39,29 +39,15 @@
padding: 5px; padding: 5px;
} }
.logo-image {
/*width: 120px;*/
height: 31px;
margin: 0 5px 16px 24px;
float: left;
}
.logo-image img{
height: 35px;
}
.main-container{ .main-container{
background: #f0f2f5; background: #f0f2f5;
min-height: 780px min-height: 780px
} }
.profile{
float:right;
margin-right: 2%;
}
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.main-container{ .main-container{
padding: 24px; padding: 24px;
} }
} }

@ -33,6 +33,18 @@
width: 70%; width: 70%;
} }
@media screen and (max-width: 768px) {
.d-rating .bar-containers{
width: 100%;
}
.d-rating .numeric-data{
width: 50%;
}
}
.d-rating .bar-containers .bar-container{ .d-rating .bar-containers .bar-container{
color: #737373; color: #737373;
font-weight: 400; font-weight: 400;

@ -23,3 +23,11 @@
.release-card:hover { .release-card:hover {
background-color: rgba(15, 188, 249,0.1); background-color: rgba(15, 188, 249,0.1);
} }
@media screen and (max-width: 700px) {
.release-card{
width: 210%;
}
}

@ -32,13 +32,11 @@ import {
Icon, Icon,
Card Card
} from 'antd'; } from 'antd';
import "../../../../App.css";
import DetailedRating from "../../detailed-rating/DetailedRating"; import DetailedRating from "../../detailed-rating/DetailedRating";
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import axios from "axios"; import axios from "axios";
import ReactQuill from "react-quill"; import ReactQuill from "react-quill";
import ReactHtmlParser, {processNodes, convertNodeToElement, htmlparser2} from 'react-html-parser'; import ReactHtmlParser from 'react-html-parser';
import "./AppDetailsDrawer.css"; import "./AppDetailsDrawer.css";
import pSBC from "shade-blend-color"; import pSBC from "shade-blend-color";
import {withConfigContext} from "../../../../context/ConfigContext"; import {withConfigContext} from "../../../../context/ConfigContext";
@ -71,6 +69,8 @@ const formats = [
class AppDetailsDrawer extends React.Component { class AppDetailsDrawer extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const drawerWidth = window.innerWidth<=770 ? '80%' : '40%';
this.state = { this.state = {
loading: false, loading: false,
name: "", name: "",
@ -85,6 +85,8 @@ class AppDetailsDrawer extends React.Component {
isDescriptionEditEnabled: false, isDescriptionEditEnabled: false,
isCategoriesEditEnabled: false, isCategoriesEditEnabled: false,
isTagsEditEnabled: false, isTagsEditEnabled: false,
drawer: null,
drawerWidth
}; };
} }
@ -412,7 +414,6 @@ class AppDetailsDrawer extends React.Component {
} }
}; };
render() { render() {
const config = this.props.context; const config = this.props.context;
const {app, visible, onClose} = this.props; const {app, visible, onClose} = this.props;
@ -458,11 +459,12 @@ class AppDetailsDrawer extends React.Component {
<div> <div>
<Drawer <Drawer
placement="right" placement="right"
width={640} width={this.state.drawerWidth}
closable={false} closable={false}
onClose={onClose} onClose={onClose}
visible={visible} visible={visible}
> >
<Spin spinning={loading} delay={500}> <Spin spinning={loading} delay={500}>
<div style={{textAlign: "center"}}> <div style={{textAlign: "center"}}>
{avatar} {avatar}
@ -473,8 +475,12 @@ class AppDetailsDrawer extends React.Component {
<Text strong={true}>Releases </Text> <Text strong={true}>Releases </Text>
{/*display add new release only if app type is enterprise*/} {/*display add new release only if app type is enterprise*/}
<div className="releases-details">
{(app.type === "ENTERPRISE") && ( {(app.type === "ENTERPRISE") && (
<Link to={`/publisher/apps/${app.deviceType}/${app.id}/add-release`}><Button htmlType="button" size="small">Add <Link to={`/publisher/apps/${app.id}/add-release`}><Button htmlType="button"
size="small">Add
new release</Button></Link>)} new release</Button></Link>)}
<List <List
style={{paddingTop: 16}} style={{paddingTop: 16}}
@ -492,7 +498,7 @@ class AppDetailsDrawer extends React.Component {
description={ description={
<div style={{ <div style={{
fontSize: "0.7em" fontSize: "0.7em"
}}> }} className="description-view">
<IconText type="check" text={release.currentStatus}/> <IconText type="check" text={release.currentStatus}/>
<Divider type="vertical"/> <Divider type="vertical"/>
<IconText type="upload" text={release.releaseType}/> <IconText type="upload" text={release.releaseType}/>
@ -506,6 +512,9 @@ class AppDetailsDrawer extends React.Component {
</List.Item> </List.Item>
)} )}
/> />
</div>
<Divider dashed={true}/> <Divider dashed={true}/>
<Text strong={true}>Description </Text> <Text strong={true}>Description </Text>
@ -546,6 +555,7 @@ class AppDetailsDrawer extends React.Component {
)} )}
<Divider dashed={true}/> <Divider dashed={true}/>
<Text strong={true}>Categories </Text> <Text strong={true}>Categories </Text>
{!isCategoriesEditEnabled && (<Text {!isCategoriesEditEnabled && (<Text
style={{color: config.theme.primaryColor, cursor: "pointer"}} style={{color: config.theme.primaryColor, cursor: "pointer"}}
@ -590,8 +600,8 @@ class AppDetailsDrawer extends React.Component {
}</span> }</span>
)} )}
<Divider dashed={true}/> <Divider dashed={true}/>
<Text strong={true}>Tags </Text> <Text strong={true}>Tags </Text>
{!isTagsEditEnabled && (<Text {!isTagsEditEnabled && (<Text
style={{color: config.theme.primaryColor, cursor: "pointer"}} style={{color: config.theme.primaryColor, cursor: "pointer"}}
@ -636,8 +646,11 @@ class AppDetailsDrawer extends React.Component {
)} )}
<Divider dashed={true}/> <Divider dashed={true}/>
<div className="app-rate">
{app.applicationReleases.length > 0 && ( {app.applicationReleases.length > 0 && (
<DetailedRating type="app" uuid={app.applicationReleases[0].uuid} />)} <DetailedRating type="app" uuid={app.applicationReleases[0].uuid} />)}
</div>
</Spin> </Spin>
</Drawer> </Drawer>
</div> </div>

@ -25,7 +25,6 @@ import AppDetailsDrawer from "./AppDetailsDrawer/AppDetailsDrawer";
const {Title} = Typography; const {Title} = Typography;
const Search = Input.Search; const Search = Input.Search;
class ListApps extends React.Component { class ListApps extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
@ -67,7 +66,6 @@ class ListApps extends React.Component {
this.setState({ this.setState({
filters filters
}); });
console.log(filters);
}; };
render() { render() {
@ -88,7 +86,7 @@ class ListApps extends React.Component {
<Search <Search
placeholder="input search text" placeholder="input search text"
onSearch={this.setSearchText} onSearch={this.setSearchText}
style={{width: 200}} style={{width: 170}}
/> />
</Col> </Col>
</Row> </Row>

@ -19,3 +19,9 @@
.app-row{ .app-row{
cursor: pointer; cursor: pointer;
} }
.apps-table{
display: block;
overflow: auto;
width: 100%;
}

@ -132,7 +132,6 @@ class AppsTable extends React.Component {
componentDidUpdate(prevProps, prevState, snapshot) { componentDidUpdate(prevProps, prevState, snapshot) {
const {filters} = this.props; const {filters} = this.props;
if (prevProps.filters !== this.props.filters) { if (prevProps.filters !== this.props.filters) {
console.log("d", this.props.filters);
this.setState({ this.setState({
filters filters
}); });
@ -212,7 +211,7 @@ class AppsTable extends React.Component {
render() { render() {
return ( return (
<div className="apps-table">
<Table <Table
rowKey={record => record.id} rowKey={record => record.id}
dataSource={this.state.apps} dataSource={this.state.apps}
@ -228,6 +227,7 @@ class AppsTable extends React.Component {
}; };
}} }}
/> />
</div>
); );
} }

@ -0,0 +1,107 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.logo-image {
height: 31px;
margin: 0 5px 16px 24px;
float: left;
}
.logo-image img{
height: 35px;
}
.profile{
float:right;
margin-right: 2%;
}
.mobile-layout{
visibility: hidden;
position: absolute;
}
.mobile-menu-button{
margin-left: 4%;
position: fixed;
}
.bar-icon{
margin-top: 10%;
font-size: 27px;
}
@media screen and (max-width: 660px) {
.web-layout{
visibility: hidden;
}
.mobile-layout{
visibility: visible;
z-index: 1;
}
.mobile-menu-button{
margin-top: 4%;
}
Header{
position: fixed;
z-index: 1;
width: 100%;
}
.dashboard-body{
margin-top: 14%;
}
.logo-image {
margin-left: 20%;
}
}
@media screen and (max-height: 350px) {
.mobile-menu-button{
margin-top: 2%;
}
.dashboard-body{
margin-top: 9%;
}
}
@media only screen and (min-width: 760px) {
@media screen and (max-width: 1030px) {
Footer{
margin-bottom: 43%;
}
}
}
@media only screen and (min-width: 1030px) {
Footer{
margin-bottom: 5%;
}
}

@ -17,11 +17,11 @@
*/ */
import React from "react"; import React from "react";
import {Layout, Menu, Icon} from 'antd'; import {Layout, Menu, Icon, Drawer, Button} from 'antd';
import {Switch, Link} from "react-router-dom"; import {Switch, Link} from "react-router-dom";
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
import {Redirect} from 'react-router' import {Redirect} from 'react-router'
import "../../App.css"; import "./Dashboard.css";
import {withConfigContext} from "../../context/ConfigContext"; import {withConfigContext} from "../../context/ConfigContext";
import Logout from "./logout/Logout"; import Logout from "./logout/Logout";
@ -38,21 +38,44 @@ class Dashboard extends React.Component {
this.Logo = config.theme.logo; this.Logo = config.theme.logo;
} }
//functions for show the drawer
state = {
visible: false,
collapsed: false
};
showDrawer = () => {
this.setState({
visible: true,
collapsed: !this.state.collapsed
});
};
onClose = () => {
this.setState({
visible: false,
});
};
render() { render() {
return ( return (
<div> <div>
<Layout className="layout"> <Layout>
<Header style={{paddingLeft: 0, paddingRight: 0}}> <Header style={{paddingLeft: 0, paddingRight: 0, backgroundColor: "white"}}>
<div className="logo-image"> <div className="logo-image">
<img alt="logo" src={this.Logo}/> <Link to="/publisher/apps"><img alt="logo" src={this.Logo}/></Link>
</div> </div>
<div className="web-layout">
<Menu <Menu
theme="light" theme="light"
mode="horizontal" mode="horizontal"
defaultSelectedKeys={['1']} defaultSelectedKeys={['1']}
style={{lineHeight: '64px'}} style={{lineHeight: '64px'}}
> >
<Menu.Item key="1"><Link to="/publisher/apps"><Icon type="appstore"/>Apps</Link></Menu.Item> <Menu.Item key="1"><Link to="/publisher/apps"><Icon
type="appstore"/>Apps</Link></Menu.Item>
<SubMenu <SubMenu
title={ title={
<span className="submenu-title-wrapper"> <span className="submenu-title-wrapper">
@ -67,8 +90,6 @@ class Dashboard extends React.Component {
APP</Link></Menu.Item> APP</Link></Menu.Item>
<Menu.Item key="setting:3"><Link to="/publisher/add-new-app/web-clip">Web <Menu.Item key="setting:3"><Link to="/publisher/add-new-app/web-clip">Web
Clip</Link></Menu.Item> Clip</Link></Menu.Item>
<Menu.Item key="setting:4"><Link to="/publisher/add-new-app/custom-app">Custom
App</Link></Menu.Item>
</SubMenu> </SubMenu>
<Menu.Item key="2"><Link to="/publisher/manage"><Icon <Menu.Item key="2"><Link to="/publisher/manage"><Icon
type="control"/>Manage</Link></Menu.Item> type="control"/>Manage</Link></Menu.Item>
@ -83,12 +104,74 @@ class Dashboard extends React.Component {
> >
<Logout/> <Logout/>
</SubMenu> </SubMenu>
</Menu> </Menu>
</div>
</Header> </Header>
</Layout> </Layout>
<Layout>
<Layout className="mobile-layout">
<div className="mobile-menu-button">
<Button type="link" onClick={this.showDrawer}>
<Icon type={this.state.collapsed ? 'menu-fold' : 'menu-unfold'} className="bar-icon"/>
</Button>
</div>
<Drawer
title={<Link to="/publisher/apps"><img alt="logo" src={this.Logo} style={{marginLeft: 30}}
width={"60%"}/></Link>}
placement="left"
closable={false}
onClose={this.onClose}
visible={this.state.visible}
getContainer={false}
style={{position: 'absolute'}}
>
<Menu
theme="light"
mode="inline"
defaultSelectedKeys={['1']}
style={{lineHeight: '64px', width: 231}}
>
<Menu.Item key="1"><Link to="/publisher/apps"><Icon
type="appstore"/>Apps</Link></Menu.Item>
<SubMenu
title={
<span className="submenu-title-wrapper">
<Icon type="plus"/>
Add New App
</span>
}
>
<Menu.Item key="setting:1"><Link to="/publisher/add-new-app/public">Public
APP</Link></Menu.Item>
<Menu.Item key="setting:2"><Link to="/publisher/add-new-app/enterprise">Enterprise
APP</Link></Menu.Item>
<Menu.Item key="setting:3"><Link to="/publisher/add-new-app/web-clip">Web
Clip</Link></Menu.Item>
<Menu.Item key="setting:4"><Link to="/publisher/add-new-app/custom-app">Custom
App</Link></Menu.Item>
</SubMenu>
<Menu.Item key="2"><Link to="/publisher/manage"><Icon
type="control"/>Manage</Link></Menu.Item>
</Menu>
</Drawer>
<Menu
mode="horizontal"
defaultSelectedKeys={['1']}
style={{lineHeight: '63px', position: 'fixed', marginLeft: '80%'}}
>
<SubMenu
title={
<span className="submenu-title-wrapper">
<Icon type="user"/>
</span>
}
>
<Logout/>
</SubMenu>
</Menu>
</Layout>
<Layout className="dashboard-body">
<Content style={{marginTop: 2}}> <Content style={{marginTop: 2}}>
<Switch> <Switch>
<Redirect exact from="/publisher" to="/publisher/apps"/> <Redirect exact from="/publisher" to="/publisher/apps"/>

@ -1,33 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.logo {
width: 120px;
height: 31px;
margin: 16px 0 16px 20px;
float: left;
img{
height: 35px;
}
}
input{
min-height: 0;
}

@ -1,3 +1,21 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
module.exports = function (api) { module.exports = function (api) {
api.cache(true); api.cache(true);
const presets = [ "@babel/preset-env", const presets = [ "@babel/preset-env",

@ -39,29 +39,15 @@
padding: 5px; padding: 5px;
} }
.logo-image {
/*width: 120px;*/
height: 31px;
margin: 0 5px 16px 24px;
float: left;
}
.logo-image img{
height: 35px;
}
.main-container{ .main-container{
background: #f0f2f5; background: #f0f2f5;
min-height: 780px min-height: 780px
} }
.profile{
float:right;
margin-right: 2%;
}
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.main-container{ .main-container{
padding: 24px; padding: 24px;
} }
} }

@ -114,7 +114,6 @@ class DeviceInstall extends React.Component {
rowSelection = { rowSelection = {
onChange: (selectedRowKeys, selectedRows) => { onChange: (selectedRowKeys, selectedRows) => {
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
this.setState({ this.setState({
selectedRows: selectedRows selectedRows: selectedRows
}) })
@ -142,9 +141,12 @@ class DeviceInstall extends React.Component {
limit: 10, limit: 10,
status: "ACTIVE", status: "ACTIVE",
requireDeviceInfo: true, requireDeviceInfo: true,
type: deviceType
}; };
if (deviceType !== 'ANY') {
extraParams.type = deviceType;
}
// note: encode with '%26' not '&' // note: encode with '%26' not '&'
const encodedExtraParams = Object.keys(extraParams).map(key => key + '=' + extraParams[key]).join('&'); const encodedExtraParams = Object.keys(extraParams).map(key => key + '=' + extraParams[key]).join('&');

@ -0,0 +1,107 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.logo-image {
height: 31px;
margin: 0 5px 16px 24px;
float: left;
}
.logo-image img{
height: 35px;
}
.profile{
float:right;
margin-right: 2%;
}
.mobile-layout{
visibility: hidden;
position: absolute;
}
.mobile-menu-button{
margin-left: 4%;
position: fixed;
}
.bar-icon{
margin-top: 10%;
font-size: 27px;
}
@media screen and (max-width: 660px) {
.web-layout{
visibility: hidden;
}
.mobile-layout{
visibility: visible;
z-index: 1;
}
.mobile-menu-button {
margin-top: 4%;
}
Header{
position: fixed;
z-index: 1;
width: 100%;
}
.dashboard-body{
margin-top: 15%;
}
.logo-image {
margin-left: 20%;
}
}
@media only screen and (max-height: 350px) {
.mobile-menu-button{
margin-top: 2%;
}
.dashboard-body{
margin-top: 10%;
}
}
@media only screen and (min-width: 760px) {
@media screen and (max-width: 1030px) {
Footer{
margin-bottom: 45%;
}
}
}
@media only screen and (min-width: 1030px) {
Footer{
margin-bottom: 5%;
}
}

@ -17,14 +17,13 @@
*/ */
import React from "react"; import React from "react";
import {Layout, Menu, Icon} from 'antd'; import {Layout, Menu, Icon, Drawer, Button} from 'antd';
const {Header, Content, Footer} = Layout; const {Header, Content, Footer} = Layout;
import {Link} from "react-router-dom"; import {Link} from "react-router-dom";
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"; import RouteWithSubRoutes from "../../components/RouteWithSubRoutes";
import {Switch} from 'react-router'; import {Switch} from 'react-router';
import axios from "axios"; import axios from "axios";
import "../../App.css"; import "./Dashboard.css";
import {withConfigContext} from "../../context/ConfigContext"; import {withConfigContext} from "../../context/ConfigContext";
import Logout from "./logout/Logout"; import Logout from "./logout/Logout";
@ -81,25 +80,30 @@ class Dashboard extends React.Component {
}) })
}; };
//functions for show the drawer
state = {
visible: false,
collapsed: false
};
showDrawer = () => {
this.setState({
visible: true,
collapsed: !this.state.collapsed,
});
};
onClose = () => {
this.setState({
visible: false,
});
};
render() { render() {
const config = this.props.context; const config = this.props.context;
const {selectedKeys, deviceTypes} = this.state; const {selectedKeys, deviceTypes} = this.state;
return ( const DeviceTypesData = deviceTypes.map((deviceType) => {
<div>
<Layout className="layout">
<Header style={{paddingLeft: 0, paddingRight: 0}}>
<div className="logo-image">
<img alt="logo" src={this.logo}/>
</div>
<Menu
theme="light"
mode="horizontal"
defaultSelectedKeys={selectedKeys}
style={{lineHeight: '64px'}}
>
{
deviceTypes.map((deviceType) => {
const platform = deviceType.name; const platform = deviceType.name;
const defaultPlatformIcons = config.defaultPlatformIcons; const defaultPlatformIcons = config.defaultPlatformIcons;
let icon = defaultPlatformIcons.default.icon; let icon = defaultPlatformIcons.default.icon;
@ -116,8 +120,26 @@ class Dashboard extends React.Component {
</Link> </Link>
</Menu.Item> </Menu.Item>
); );
}) });
}
return (
<div>
<Layout>
<Header style={{paddingLeft: 0, paddingRight: 0, backgroundColor: "white"}}>
<div className="logo-image">
<Link to="/store/android"><img alt="logo" src={this.logo}/></Link>
</div>
<div className="web-layout">
<Menu
theme="light"
mode="horizontal"
defaultSelectedKeys={selectedKeys}
style={{lineHeight: '64px'}}
>
{DeviceTypesData}
<Menu.Item key="web-clip"><Link to="/store/web-clip"><Icon type="upload"/>Web <Menu.Item key="web-clip"><Link to="/store/web-clip"><Icon type="upload"/>Web
Clips</Link></Menu.Item> Clips</Link></Menu.Item>
@ -132,9 +154,60 @@ class Dashboard extends React.Component {
<Logout/> <Logout/>
</SubMenu> </SubMenu>
</Menu> </Menu>
</div>
</Header> </Header>
</Layout> </Layout>
<Layout>
<Layout className="mobile-layout">
<div className="mobile-menu-button">
<Button type="link" onClick={this.showDrawer}>
<Icon type={this.state.collapsed ? 'menu-fold' : 'menu-unfold'} className="bar-icon"/>
</Button>
</div>
<Drawer
title={<Link to="/store/android">
<img alt="logo" src={this.logo} style={{marginLeft: 30}} width={"60%"}/>
</Link>}
placement="left"
closable={false}
onClose={this.onClose}
visible={this.state.visible}
getContainer={false}
style={{position: 'absolute'}}
>
<Menu
theme="light"
mode="inline"
defaultSelectedKeys={selectedKeys}
style={{lineHeight: '64px', width: 231}}
>
{DeviceTypesData}
<Menu.Item key="web-clip"><Link to="/store/web-clip"><Icon type="upload"/>Web
Clips</Link></Menu.Item>
</Menu>
</Drawer>
<Menu
mode="horizontal"
defaultSelectedKeys={selectedKeys}
style={{lineHeight: '63px', position: 'fixed', marginLeft: '80%'}}
>
<SubMenu
title={
<span className="submenu-title-wrapper">
<Icon type="user"/>
</span>
}
>
<Logout/>
</SubMenu>
</Menu>
</Layout>
<Layout className="dashboard-body">
<Content style={{padding: '0 0'}}> <Content style={{padding: '0 0'}}>
<Switch> <Switch>
{this.state.routes.map((route) => ( {this.state.routes.map((route) => (
@ -145,6 +218,7 @@ class Dashboard extends React.Component {
</Switch> </Switch>
</Content> </Content>
<Footer style={{textAlign: 'center'}}> <Footer style={{textAlign: 'center'}}>
©2019 entgra.io ©2019 entgra.io
</Footer> </Footer>

@ -1,33 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.logo {
width: 120px;
height: 31px;
margin: 16px 0 16px 20px;
float: left;
img{
height: 35px;
}
}
input{
min-height: 0;
}

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- <!--
~ Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. ~ Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ ~
~ WSO2 Inc. licenses this file to you under the Apache License, ~ Entgra (pvt) Ltd. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except ~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License. ~ in compliance with the License.
~ You may obtain a copy of the License at ~ You may obtain a copy of the License at

@ -1,3 +1,21 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
module.exports = function (api) { module.exports = function (api) {
api.cache(true); api.cache(true);
const presets = [ "@babel/preset-env", const presets = [ "@babel/preset-env",

@ -1,17 +1,19 @@
/*! /*
~ Copyright (c) 2017 WSO2 Inc. (http://wso2.com) All Rights Reserved. * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ *
~ Licensed under the Apache License, Version 2.0 (the "License"); * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
~ you may not use this file except in compliance with the License. * Version 2.0 (the "License"); you may not use this file except
~ You may obtain a copy of the License at * in compliance with the License.
~ * You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0 *
~ * 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, * Unless required by applicable law or agreed to in writing,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * software distributed under the License is distributed on an
~ See the License for the specific language governing permissions and * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ limitations under the License. * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */

File diff suppressed because one or more lines are too long

@ -1,17 +1,19 @@
/*! /*
~ Copyright (c) 2017 WSO2 Inc. (http://wso2.com) All Rights Reserved. * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
~ *
~ Licensed under the Apache License, Version 2.0 (the "License"); * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
~ you may not use this file except in compliance with the License. * Version 2.0 (the "License"); you may not use this file except
~ You may obtain a copy of the License at * in compliance with the License.
~ * You may obtain a copy of the License at
~ http://www.apache.org/licenses/LICENSE-2.0 *
~ * 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, * Unless required by applicable law or agreed to in writing,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * software distributed under the License is distributed on an
~ See the License for the specific language governing permissions and * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ limitations under the License. * KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/ */
%icon-base { %icon-base {

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. * in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at

@ -39,63 +39,13 @@
padding: 5px; padding: 5px;
} }
/*.logo-image {*/
/*!*width: 120px;*!*/
/*height: 31px;*/
/*margin: 0 5px 16px 24px;*/
/*float: left;*/
/*}*/
.main-container { .main-container {
background: #f0f2f5; background: #f0f2f5;
min-height: 780px min-height: 780px
} }
.profile {
float: right;
margin-right: 2%;
}
@media only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
.main-container { .main-container {
padding: 24px; padding: 24px;
} }
} }
.layout .trigger {
font-size: 18px;
/*line-height: 64px;*/
padding: 0 24px;
cursor: pointer;
transition: color 0.3s;
float: left;
}
.layout .trigger:hover {
color: #1890ff;
}
.layout .logo-image {
position: relative;
height: 64px;
padding-left: 8px;
overflow: hidden;
line-height: 64px;
background: #001529;
transition: all .3s;
}
.layout .brand{
display: inline-block;
color: #fff;
font-weight: 600;
font-size: 20px;
font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;
vertical-align: middle;
}
.layout .logo-image img {
height: 32px;
margin: 16px;
}

@ -0,0 +1,68 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.profile {
float: right;
margin-right: 2%;
}
.layout .trigger {
font-size: 18px;
padding: 0 24px;
cursor: pointer;
transition: color 0.3s;
float: left;
width: 40px;
}
.layout .trigger:hover {
color: #1890ff;
}
.layout .logo-image {
position: relative;
height: 64px;
padding-left: 8px;
overflow: hidden;
line-height: 64px;
background: #001529;
transition: all .3s;
}
.layout .brand{
display: inline-block;
color: #fff;
font-weight: 600;
font-size: 20px;
font-family: Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;
vertical-align: middle;
}
.layout .logo-image img {
height: 32px;
margin: 16px;
}
@media only screen and (min-width: 760px) {
@media screen and (max-width: 1030px) {
Footer{
margin-bottom: 45%;
}
}
}

@ -17,27 +17,29 @@
*/ */
import React from "react"; import React from "react";
import {Layout, Menu, Icon, Typography} from 'antd'; import {Layout, Menu, Icon} from 'antd';
import {Switch, Link} from "react-router-dom"; import {Switch, Link} from "react-router-dom";
import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" import RouteWithSubRoutes from "../../components/RouteWithSubRoutes"
import {Redirect} from 'react-router' import {Redirect} from 'react-router'
import "../../App.css"; import "./Dashboard.css";
import {withConfigContext} from "../../context/ConfigContext"; import {withConfigContext} from "../../context/ConfigContext";
import Logout from "./Logout/Logout"; import Logout from "./Logout/Logout";
const {Header, Content, Footer, Sider} = Layout; const {Header, Content, Footer, Sider} = Layout;
const {SubMenu} = Menu; const {SubMenu} = Menu;
const {Title} = Typography;
class Dashboard extends React.Component { class Dashboard extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
const mobileWidth = (window.innerWidth<=768 ? '0' : '80');
this.state = { this.state = {
routes: props.routes, routes: props.routes,
selectedKeys: [], selectedKeys: [],
deviceTypes: [], deviceTypes: [],
isNavBarCollapsed: false, isNavBarCollapsed: false,
mobileWidth
}; };
this.logo = this.props.context.theme.logo; this.logo = this.props.context.theme.logo;
} }
@ -52,13 +54,17 @@ class Dashboard extends React.Component {
return ( return (
<div> <div>
<Layout className="layout" > <Layout className="layout" >
<Sider <Sider
trigger={null} trigger={null}
collapsible collapsible
collapsed={this.state.isNavBarCollapsed}> collapsed={this.state.isNavBarCollapsed}
collapsedWidth={this.state.mobileWidth}
>
<div className="logo-image"> <div className="logo-image">
<img alt="logo" src={this.logo}/> <Link to="/entgra/devices"><img alt="logo" src={this.logo}/>
<span className="brand">Entgra</span> <span className="brand">Entgra</span></Link>
</div> </div>
<Menu theme="dark" mode="inline" defaultSelectedKeys={['devices']}> <Menu theme="dark" mode="inline" defaultSelectedKeys={['devices']}>
<Menu.Item key="devices"> <Menu.Item key="devices">
@ -80,7 +86,9 @@ class Dashboard extends React.Component {
</Link> </Link>
</Menu.Item> </Menu.Item>
</Menu> </Menu>
</Sider> </Sider>
<Layout> <Layout>
<Header style={{background: '#fff', padding: 0}}> <Header style={{background: '#fff', padding: 0}}>
<div className="trigger"> <div className="trigger">
@ -89,19 +97,18 @@ class Dashboard extends React.Component {
onClick={this.toggle} onClick={this.toggle}
/> />
</div> </div>
<Menu <Menu
theme="light" theme="light"
mode="horizontal" mode="horizontal"
style={{lineHeight: '64px'}} style={{lineHeight: '64px'}}
> >
<Menu.Item key="trigger"> <Menu.Item key="trigger">
</Menu.Item> </Menu.Item>
<SubMenu className="profile" <SubMenu className="profile"
title={ title={
<span className="submenu-title-wrapper"> <span className="submenu-title-wrapper">
<Icon type="user"/> <Icon type="user"/>
Profile
</span> </span>
} }
> >
@ -110,6 +117,7 @@ class Dashboard extends React.Component {
</Menu> </Menu>
</Header> </Header>
<Content style={{marginTop: 2}}> <Content style={{marginTop: 2}}>
<Switch> <Switch>
<Redirect exact from="/entgra" to="/entgra/devices"/> <Redirect exact from="/entgra" to="/entgra/devices"/>
@ -118,9 +126,11 @@ class Dashboard extends React.Component {
))} ))}
</Switch> </Switch>
</Content> </Content>
<Footer style={{textAlign: 'center'}}> <Footer style={{textAlign: 'center'}}>
©2019 entgra.io ©2019 entgra.io
</Footer> </Footer>
</Layout> </Layout>
</Layout> </Layout>
</div> </div>

@ -1,33 +0,0 @@
/*
* Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
*
* Entgra (pvt) Ltd. 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.
*/
.logo {
width: 120px;
height: 31px;
margin: 16px 0 16px 20px;
float: left;
img{
height: 35px;
}
}
input{
min-height: 0;
}

@ -1,7 +1,7 @@
/* /*
* Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. * in compliance with the License.
* You may obtain a copy of the License at * You may obtain a copy of the License at

@ -166,6 +166,6 @@
"isOAuthEnabled": true, "isOAuthEnabled": true,
"backendRestEndpoints": { "backendRestEndpoints": {
"deviceMgt": "/api/device-mgt/v1.0", "deviceMgt": "/api/device-mgt/v1.0",
"appMgt": "/api/appm/store/v1.1" "appMgt": "/api/application-mgt-store/v1.0"
} }
} }

@ -67,7 +67,6 @@ policyModule = function () {
} else { } else {
policyObjectToView["deviceTypeIcon"] = policyObjectToView["platform"]; policyObjectToView["deviceTypeIcon"] = policyObjectToView["platform"];
} }
//policyObjectToView["icon"] = utility.getDeviceThumb(policyObjectToView["platform"]);
var ownershipType = "None"; var ownershipType = "None";
var deviceGroups = policyObjectFromRestEndpoint["deviceGroups"]; var deviceGroups = policyObjectFromRestEndpoint["deviceGroups"];
if (deviceGroups) { if (deviceGroups) {
@ -210,12 +209,15 @@ policyModule = function () {
} }
try { try {
var url = devicemgtProps["managerHTTPSURL"] + devicemgtProps["backendRestEndpoints"]["appMgt"] + var url = devicemgtProps["managerHTTPSURL"] + devicemgtProps["backendRestEndpoints"]["appMgt"] +
"/apps/mobileapp?field-filter=all"; "/applications";
return serviceInvokers.XMLHttp.get(url, var data = {
limit: -1
};
return serviceInvokers.XMLHttp.post(url, data,
function (backendResponse) { function (backendResponse) {
var response = {}; var response = {};
if (backendResponse.status === 200 && backendResponse.responseText) { if (backendResponse.status === 200 && backendResponse.responseText) {
var appListFromRestEndpoint = parse(backendResponse.responseText)["appList"]; var appListFromRestEndpoint = parse(backendResponse.responseText)["applications"];
var storeApps = []; var storeApps = [];
var i, appObjectFromRestEndpoint, appObjectToView; var i, appObjectFromRestEndpoint, appObjectToView;
for (i=0; i<appListFromRestEndpoint.length; i++) { for (i=0; i<appListFromRestEndpoint.length; i++) {
@ -223,16 +225,14 @@ policyModule = function () {
appObjectToView = {}; appObjectToView = {};
appObjectToView["appName"] = appObjectFromRestEndpoint["name"]; appObjectToView["appName"] = appObjectFromRestEndpoint["name"];
appObjectToView["appId"] = appObjectFromRestEndpoint["id"]; appObjectToView["appId"] = appObjectFromRestEndpoint["id"];
appObjectToView["webUrl"] = appObjectFromRestEndpoint["appmeta"]["weburl"]; if ("WEB_CLIP" === appObjectFromRestEndpoint["type"]) {
if ("webapp" === appObjectFromRestEndpoint["platform"]) {
appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["weburl"];
appObjectToView["type"] = "Web Clip" appObjectToView["type"] = "Web Clip"
} else { } else {
appObjectToView["packageName"] = appObjectFromRestEndpoint["appmeta"]["package"];
appObjectToView["type"] = "Mobile App" appObjectToView["type"] = "Mobile App"
} }
appObjectToView["version"] = appObjectFromRestEndpoint["version"]; appObjectToView["uuid"] = appObjectFromRestEndpoint["applicationReleases"][0]["uuid"];
appObjectToView["platform"] = appObjectFromRestEndpoint["platform"]; appObjectToView["version"] = appObjectFromRestEndpoint["applicationReleases"][0]["version"];
appObjectToView["platform"] = appObjectFromRestEndpoint["deviceType"];
storeApps.push(appObjectToView); storeApps.push(appObjectToView);
} }
response.status = "success"; response.status = "success";

@ -202,7 +202,7 @@ function getStoreApps(storeApps, deviceType) {
var selectedApps = []; var selectedApps = [];
var i; var i;
for (i=0; i<storeApps.length; i++) { for (i=0; i<storeApps.length; i++) {
if (deviceType === storeApps[i].platform || "webapp" === storeApps[i].platform) { if (deviceType === storeApps[i].platform || "ANY" === storeApps[i].platform) {
selectedApps.push(storeApps[i]); selectedApps.push(storeApps[i]);
} }
} }

@ -259,7 +259,7 @@ function getStoreApps(storeApps, deviceType) {
var selectedApps = []; var selectedApps = [];
var i; var i;
for (i=0; i<storeApps.length; i++) { for (i=0; i<storeApps.length; i++) {
if (storeApps[i].platform === deviceType || "webapp" === storeApps[i].platform) { if (deviceType === storeApps[i].platform || "ANY" === storeApps[i].platform) {
selectedApps.push(storeApps[i]); selectedApps.push(storeApps[i]);
} }
} }

Loading…
Cancel
Save