- );
- }
-}
-
-export default App;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.test.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.test.js
deleted file mode 100644
index 0b509e08c1..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.test.js
+++ /dev/null
@@ -1,27 +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.
- */
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import App from './App';
-
-it('renders without crashing', () => {
- const div = document.createElement('div');
- ReactDOM.render(, div);
- ReactDOM.unmountComponentAtNode(div);
-});
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/Authorized/Authorized.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/Authorized/Authorized.js
deleted file mode 100644
index 7f06a0403c..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/Authorized/Authorized.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import react from 'react';
-import { withConfigContext } from '../ConfigContext';
-import { isAuthorized } from '../../services/utils/authorizationHandler';
-
-class Authorized extends react.Component {
- constructor(props) {
- super(props);
- }
-
- render() {
- return isAuthorized(this.props.context.user, this.props.permission)
- ? this.props.yes
- : this.props.no;
- }
-}
-
-Authorized.defaultProps = {
- yes: null,
- no: null,
-};
-export default withConfigContext(Authorized);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/ConfigContext/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/ConfigContext/index.js
deleted file mode 100644
index e79fea42fd..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/ConfigContext/index.js
+++ /dev/null
@@ -1,34 +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.
- */
-
-import React from 'react';
-
-const ConfigContext = React.createContext();
-
-export const withConfigContext = Component => {
- // eslint-disable-next-line react/display-name
- return props => (
-
- {context => {
- return ;
- }}
-
- );
-};
-
-export default ConfigContext;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/RouteWithSubRoutes/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/RouteWithSubRoutes/index.js
deleted file mode 100644
index 0b11230cc0..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/RouteWithSubRoutes/index.js
+++ /dev/null
@@ -1,40 +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.
- */
-
-import React from 'react';
-import { Route } from 'react-router-dom';
-class RouteWithSubRoutes extends React.Component {
- props;
- constructor(props) {
- super(props);
- this.props = props;
- }
- render() {
- return (
- (
-
- )}
- />
- );
- }
-}
-
-export default RouteWithSubRoutes;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.css
deleted file mode 100644
index 74dcd95a69..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.css
+++ /dev/null
@@ -1,45 +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.
- */
-
-.App {
- padding: 20px;
-}
-
-.ant-layout-header{
- padding: 0;
- height: auto;
- box-shadow: 0 2px 8px #f0f1f2;
-}
-
-.steps-content {
- margin-top: 16px;
- border: 1px dashed #e9e9e9;
- border-radius: 6px;
- background-color: #fafafa;
- min-height: 200px;
- text-align: center;
- padding-top: 80px;
-}
-
-.steps-action {
- margin-top: 24px;
-}
-
-.ant-input-affix-wrapper .ant-input{
- min-height: 0;
-}
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html
deleted file mode 100644
index 345bcc4521..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.html
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
-
-
-
-
- Entgra App Publisher
-
-
-
-
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.js
deleted file mode 100644
index fc94e3d68d..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/index.js
+++ /dev/null
@@ -1,107 +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.
- */
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import * as serviceWorker from './services/serviceWorkers/serviceWorker';
-import App from './App';
-import Login from './scenes/Login';
-import Dashboard from './scenes/Home';
-import Apps from './scenes/Home/scenes/Apps';
-import Release from './scenes/Home/scenes/Apps/scenes/Release';
-import AddNewEnterpriseApp from './scenes/Home/scenes/AddNewApp/scenes/Enterprise';
-import Mange from './scenes/Home/scenes/Manage';
-import './index.css';
-import AddNewPublicApp from './scenes/Home/scenes/AddNewApp/scenes/Public';
-import AddNewWebClip from './scenes/Home/scenes/AddNewApp/scenes/WebClip';
-import AddNewRelease from './scenes/Home/scenes/AddNewRelease';
-import AddNewCustomApp from './scenes/Home/scenes/AddNewApp/scenes/Custom';
-import ManageAndroidEnterprise from './scenes/Home/scenes/Manage/scenes/AndroidEnterprise';
-import Page from './scenes/Home/scenes/Manage/scenes/AndroidEnterprise/scenes/Page';
-
-const routes = [
- {
- path: '/publisher/login',
- exact: true,
- component: Login,
- },
- {
- path: '/publisher/',
- exact: false,
- component: Dashboard,
- routes: [
- {
- path: '/publisher/apps',
- component: Apps,
- exact: true,
- },
- {
- path: '/publisher/apps/releases/:uuid',
- exact: true,
- component: Release,
- },
- {
- path: '/publisher/apps/:deviceType/:appId/add-release',
- component: AddNewRelease,
- exact: true,
- },
- {
- path: '/publisher/add-new-app/enterprise',
- component: AddNewEnterpriseApp,
- exact: true,
- },
- {
- path: '/publisher/add-new-app/public',
- component: AddNewPublicApp,
- exact: true,
- },
- {
- path: '/publisher/add-new-app/web-clip',
- component: AddNewWebClip,
- exact: true,
- },
- {
- path: '/publisher/add-new-app/custom-app',
- component: AddNewCustomApp,
- exact: true,
- },
- {
- path: '/publisher/manage',
- component: Mange,
- exact: true,
- },
- {
- path: '/publisher/manage/android-enterprise',
- component: ManageAndroidEnterprise,
- exact: true,
- },
- {
- path: '/publisher/manage/android-enterprise/pages/:pageName/:pageId',
- component: Page,
- exact: true,
- },
- ],
- },
-];
-
-ReactDOM.render(, document.getElementById('root'));
-
-// If you want your app to work offline and load faster, you can change
-// unregister() to register() below. Note this comes with some pitfalls.
-// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister();
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/logo.svg b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/logo.svg
deleted file mode 100644
index 6b60c1042f..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/logo.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/components/Logout/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/components/Logout/index.js
deleted file mode 100644
index 0ecbb604fa..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/components/Logout/index.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { LogoutOutlined } from '@ant-design/icons';
-import { notification, Menu } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../components/ConfigContext';
-import { getUiConfig } from '../../../../services/utils/uiConfigHandler';
-
-/*
-This class for call the logout api by sending request
- */
-class Logout extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- inValid: false,
- loading: false,
- };
- }
- /*
- This function call the logout api when the request is success
- */
- handleSubmit = () => {
- const thisForm = this;
- const config = this.props.context;
-
- thisForm.setState({
- inValid: false,
- });
-
- let logoutUri;
- getUiConfig(config).then(uiConfig => {
- if (uiConfig !== undefined) {
- if (uiConfig.isSsoEnable) {
- logoutUri = window.location.origin + config.serverConfig.ssoLogoutUri;
- } else {
- logoutUri = window.location.origin + config.serverConfig.logoutUri;
- }
- axios
- .post(logoutUri)
- .then(res => {
- // if the api call status is correct then user
- // will logout and then it goes to login page
- if (res.status === 200) {
- window.location =
- window.location.origin + `/${config.appName}/login`;
- }
- })
- .catch(function(error) {
- notification.error({
- message: 'There was a problem',
- duration: 0,
- description: 'Error occurred while trying to logout.',
- });
- });
- } else {
- this.setState({
- loading: false,
- error: true,
- });
- }
- });
- };
-
- render() {
- return (
-
- );
- }
-}
-
-export default withConfigContext(Logout);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/index.js
deleted file mode 100644
index 080ac912b6..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/index.js
+++ /dev/null
@@ -1,278 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-
-import {
- AndroidFilled,
- AppstoreOutlined,
- ControlOutlined,
- PlusOutlined,
- SettingOutlined,
- UserOutlined,
- MenuFoldOutlined,
- MenuUnfoldOutlined,
-} from '@ant-design/icons';
-
-import { Layout, Menu, Drawer, Button } from 'antd';
-import { Switch, Link } from 'react-router-dom';
-import RouteWithSubRoutes from '../../components/RouteWithSubRoutes';
-import { Redirect } from 'react-router';
-import './styles.css';
-import { withConfigContext } from '../../components/ConfigContext';
-import Logout from './components/Logout';
-import { isAuthorized } from '../../services/utils/authorizationHandler';
-
-const { Header, Content, Footer } = Layout;
-const { SubMenu } = Menu;
-
-class Dashboard extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- routes: props.routes,
- visible: false,
- collapsed: false,
- };
- this.config = this.props.context;
- this.Logo = this.config.theme.logo;
- this.footerText = this.config.theme.footerText;
- }
-
- showMobileNavigationBar = () => {
- this.setState({
- visible: true,
- collapsed: !this.state.collapsed,
- });
- };
-
- onCloseMobileNavigationBar = () => {
- this.setState({
- visible: false,
- });
- };
-
- render() {
- return (
-
- {metaData.map((data, index) => {
- /*
- Exclude showing the values related to
- windows app type variables in meta Data UI
- */
- if (
- !config.windowsAppxMsiKeyValueForMetaData.metaKeyArray.includes(
- data.key,
- )
- ) {
- return (
-
-
-
- );
- }
-}
-
-const AddNewAppForm = withRouter(
- Form.create({ name: 'add-new-app' })(AddNewAppFormComponent),
-);
-export default withConfigContext(AddNewAppForm);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Custom/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Custom/index.js
deleted file mode 100644
index 3a6fa9c24d..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Custom/index.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb, Result } from 'antd';
-import AddNewAppForm from '../../components/AddNewAppForm';
-import { Link } from 'react-router-dom';
-import Authorized from '../../../../../../components/Authorized/Authorized';
-
-const { Paragraph } = Typography;
-
-const formConfig = {
- installationType: 'CUSTOM',
- endpoint: '/custom-app',
- jsonPayloadName: 'application',
- releaseWrapperName: 'customAppReleaseWrappers',
- specificElements: {
- binaryFile: {
- required: true,
- },
- packageName: {
- required: true,
- },
- version: {
- required: true,
- },
- },
-};
-
-class AddNewCustomApp extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- current: 0,
- categories: [],
- };
- }
-
- render() {
- return (
-
-
-
-
-
- Home
-
-
- Add New Custom App
-
-
-
Add New Custom App
-
- Submit and share your own application to the corporate app store.
-
-
-
-
- }
- no={
-
- }
- />
-
-
- );
- }
-}
-
-export default AddNewCustomApp;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Enterprise/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Enterprise/index.js
deleted file mode 100644
index 38fd3e1341..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Enterprise/index.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb, Result } from 'antd';
-import AddNewAppForm from '../../components/AddNewAppForm';
-import { Link } from 'react-router-dom';
-import Authorized from '../../../../../../components/Authorized/Authorized';
-
-const { Paragraph } = Typography;
-
-const formConfig = {
- installationType: 'ENTERPRISE',
- endpoint: '/ent-app',
- jsonPayloadName: 'application',
- releaseWrapperName: 'entAppReleaseWrappers',
- specificElements: {
- binaryFile: {
- required: true,
- },
- },
-};
-
-class AddNewEnterpriseApp extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- current: 0,
- categories: [],
- };
- }
-
- render() {
- return (
-
-
-
-
-
- Home
-
-
- Add New Enterprise App
-
-
-
Add New Enterprise App
-
- Submit and share your own application to the corporate app store.
-
-
-
-
- }
- no={
-
- }
- />
-
-
- );
- }
-}
-
-export default AddNewEnterpriseApp;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Public/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Public/index.js
deleted file mode 100644
index 8860227d0d..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/Public/index.js
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb, Result } from 'antd';
-import AddNewAppForm from '../../components/AddNewAppForm';
-import { Link } from 'react-router-dom';
-import Authorized from '../../../../../../components/Authorized/Authorized';
-
-const { Paragraph } = Typography;
-
-const formConfig = {
- installationType: 'PUBLIC',
- endpoint: '/public-app',
- jsonPayloadName: 'public-app',
- releaseWrapperName: 'publicAppReleaseWrappers',
- specificElements: {
- packageName: {
- required: true,
- },
- version: {
- required: true,
- },
- },
-};
-
-class AddNewPublicApp extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- current: 0,
- categories: [],
- };
- }
-
- componentDidMount() {
- // this.getCategories();
- }
-
- render() {
- return (
-
-
-
-
-
- Home
-
-
- Add New Public App
-
-
-
Add New Public App
-
- Share a public application in google play or apple store to your
- corporate app store.
-
-
-
-
- }
- no={
-
- }
- />
-
-
- );
- }
-}
-
-export default AddNewPublicApp;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/WebClip/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/WebClip/index.js
deleted file mode 100644
index 5423c471eb..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/scenes/WebClip/index.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb, Result } from 'antd';
-import AddNewAppForm from '../../components/AddNewAppForm';
-import { Link } from 'react-router-dom';
-import Authorized from '../../../../../../components/Authorized/Authorized';
-
-const { Paragraph } = Typography;
-
-const formConfig = {
- installationType: 'WEB_CLIP',
- endpoint: '/web-app',
- jsonPayloadName: 'webapp',
- releaseWrapperName: 'webAppReleaseWrappers',
- specificElements: {
- url: {
- required: true,
- },
- version: {
- required: true,
- },
- },
-};
-
-class AddNewEnterpriseApp extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- current: 0,
- categories: [],
- };
- }
-
- render() {
- return (
-
-
-
-
-
- Home
-
-
- Add New Web Clip
-
-
-
Add New Web Clip
- Share a Web Clip to your corporate app store.
-
-
-
- }
- no={
-
- }
- />
-
-
- );
- }
-}
-
-export default AddNewEnterpriseApp;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/styles.less b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/styles.less
deleted file mode 100644
index 823ca73809..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewApp/styles.less
+++ /dev/null
@@ -1,22 +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.
- */
-
-.stepForm {
- max-width: 500px;
- margin: 40px auto 0;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js
deleted file mode 100644
index 7c3c126c1a..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/components/AddNewReleaseForm/index.js
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { notification, Spin, Card, Row, Col } from 'antd';
-import axios from 'axios';
-import { withRouter } from 'react-router-dom';
-import { withConfigContext } from '../../../../../../components/ConfigContext';
-import { handleApiError } from '../../../../../../services/utils/errorHandler';
-import NewAppUploadForm from '../../../AddNewApp/components/AddNewAppForm/components/NewAppUploadForm';
-
-const formConfig = {
- isNewRelease: true,
- specificElements: {
- binaryFile: {
- required: true,
- },
- },
-};
-
-class AddNewReleaseFormComponent extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- loading: false,
- supportedOsVersions: [],
- application: null,
- release: null,
- deviceType: null,
- forbiddenErrors: {
- supportedOsVersions: false,
- },
- };
- }
-
- componentDidMount() {
- this.getSupportedOsVersions(this.props.deviceType);
- }
-
- getSupportedOsVersions = deviceType => {
- const config = this.props.context;
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- `/admin/device-types/${deviceType}/versions`,
- )
- .then(res => {
- if (res.status === 200) {
- let supportedOsVersions = JSON.parse(res.data.data);
- this.setState({
- supportedOsVersions,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load supported OS versions.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- const { forbiddenErrors } = this.state;
- forbiddenErrors.supportedOsVersions = true;
- this.setState({
- forbiddenErrors,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- onSuccessReleaseData = releaseData => {
- const config = this.props.context;
- const { appId, deviceType } = this.props;
- this.setState({
- loading: true,
- });
- const { data, release } = releaseData;
-
- const json = JSON.stringify(release);
- const blob = new Blob([json], {
- type: 'application/json',
- });
- data.append('applicationRelease', blob);
-
- const url =
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/applications/' +
- deviceType +
- '/ent-app/' +
- appId;
- axios
- .post(url, data)
- .then(res => {
- if (res.status === 201) {
- this.setState({
- loading: false,
- });
-
- notification.success({
- message: 'Done!',
- description: 'New release was added successfully',
- });
- const uuid = res.data.data.uuid;
- this.props.history.push({
- pathname: '/publisher/apps/releases/' + uuid,
- state: { fullAppDetails: this.props.location.state.fullAppDetails },
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Sorry, we were unable to complete your request.',
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- onClickBackButton = () => {
- this.props.history.push('/publisher/apps/');
- };
-
- render() {
- const { loading, supportedOsVersions, forbiddenErrors } = this.state;
- return (
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-const AddReleaseForm = withRouter(
- Form.create({ name: 'add-new-release' })(AddNewReleaseFormComponent),
-);
-export default withConfigContext(AddReleaseForm);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/index.js
deleted file mode 100644
index b15efedfd7..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/AddNewRelease/index.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb } from 'antd';
-import AddNewReleaseForm from './components/AddNewReleaseForm';
-import { Link } from 'react-router-dom';
-
-const Paragraph = Typography;
-
-class AddNewRelease extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- current: 0,
- categories: [],
- };
- }
-
- render() {
- const { appId, deviceType } = this.props.match.params;
- return (
-
-
-
-
-
- Home
-
-
- Add New Release
-
-
-
Add New Release
- Add new release for the application
-
-
-
-
-
-
- );
- }
-}
-
-export default AddNewRelease;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/DeleteApp/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/DeleteApp/index.js
deleted file mode 100644
index f7c4da1bb3..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/DeleteApp/index.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons';
-import { Button, Modal, notification, Tooltip } from 'antd';
-import axios from 'axios';
-import { handleApiError } from '../../../../../../../../../../../services/utils/errorHandler';
-import { withConfigContext } from '../../../../../../../../../../../components/ConfigContext';
-import { withRouter } from 'react-router-dom';
-import '../../styles.css';
-
-const { confirm } = Modal;
-
-class DeleteApp extends React.Component {
- showModal = () => {
- confirm({
- title: 'Are you sure you want to delete this app?',
- icon: ,
- content:
- 'You are trying to delete the entire application, by performing this operation all ' +
- 'app data, app release data, and all release artifacts will be deleted ' +
- 'permanently. Further, please note, this process cannot be undone.',
- okText: 'Yes',
- okType: 'danger',
- cancelText: 'No',
- onOk: this.deleteRelease,
- });
- };
-
- deleteRelease = () => {
- const config = this.props.context;
- const apiUrl =
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/admin/applications/' +
- this.props.id;
- axios
- .delete(apiUrl)
- .then(res => {
- if (res.status === 200) {
- notification.success({
- message: 'Successfully deleted the app',
- });
- this.props.history.push('/publisher');
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Something Went wrong when trying to delete the app, Please contact the administrator',
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- render() {
- return (
-
-
- If you are developing apps for the enterprise market, you may
- need to satisfy particular requirements set by a
- organization"s policies. Managed configurations,
- previously previously known as application restrictions, allow
- the organization"s IT admin to remotely specify settings
- for apps. This capability is particularly useful for
- organization-approved apps deployed to a work profile.
-
- }
- onVisibleChange={this.handleHintVisibleChange}
- overlayStyle={{ width: 300 }}
- >
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(ManagedConfigurationsIframe);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/RetireApp/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/RetireApp/index.js
deleted file mode 100644
index 0aab732f3c..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/components/RetireApp/index.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import {
- EyeInvisibleOutlined,
- ExclamationCircleOutlined,
-} from '@ant-design/icons';
-import { Button, Modal, notification, Tooltip } from 'antd';
-import axios from 'axios';
-import { handleApiError } from '../../../../../../../../../../../services/utils/errorHandler';
-import { withConfigContext } from '../../../../../../../../../../../components/ConfigContext';
-import { withRouter } from 'react-router-dom';
-import '../../styles.css';
-
-const { confirm } = Modal;
-
-class RetireApp extends React.Component {
- showModal = () => {
- confirm({
- title: 'Are you sure you want to retire this app?',
- icon: ,
- content:
- 'You are trying to retire the entire application, by performing this operation, ' +
- 'you will not see the app data or app release data on either publisher or store. ' +
- 'Further, please note, this process cannot be undone.',
- okText: 'Yes',
- okType: 'danger',
- cancelText: 'No',
- onOk: this.hideApp,
- });
- };
-
- hideApp = () => {
- const config = this.props.context;
- const apiUrl =
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/admin/applications/retire/' +
- this.props.id;
- axios
- .put(apiUrl)
- .then(res => {
- if (res.status === 200) {
- notification.success({
- message: 'Successfully hided the app',
- });
- this.props.history.push('/publisher');
- }
- })
- .catch(error => {
- console.log(error);
- handleApiError(
- error,
- 'Something Went wrong when trying to reitre the app, Please contact the administrator',
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- render() {
- return (
-
-
- }
- />
-
-
-
- );
- }
-}
-
-export default withConfigContext(AppDetailsDrawer);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/styles.css
deleted file mode 100644
index 3c50034c10..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/styles.css
+++ /dev/null
@@ -1,45 +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.
- */
-
-.release-card{
- margin-top: 16px;
-}
-
-.release-card:hover {
- background-color: rgba(15, 188, 249,0.1);
-}
-
-@media screen and (max-width: 700px) {
-
- .release-card{
- width: 210%;
- }
-
- .app-release-cards{
- display: grid;
- }
-
-}
-
-.app-details-drawer {
- text-align: right
-}
-
-.btn-view-more {
- color: rgba(0, 0, 0, 0.65) !important;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/index.js
deleted file mode 100644
index 48fa42e395..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/index.js
+++ /dev/null
@@ -1,335 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { CheckCircleOutlined } from '@ant-design/icons';
-import { Avatar, Table, Tag, Badge, Alert, Tooltip } from 'antd';
-import axios from 'axios';
-import pSBC from 'shade-blend-color';
-import './styles.css';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import AppDetailsDrawer from './AppDetailsDrawer';
-import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
-import { EntgraIcon } from 'entgra-icons-react';
-
-let config = null;
-
-const columns = [
- {
- title: '',
- dataIndex: 'name',
- // eslint-disable-next-line react/display-name
- render: (name, row) => {
- let avatar = null;
- if (row.applicationReleases.length === 0) {
- const avatarLetter = name.charAt(0).toUpperCase();
- avatar = (
-
- {avatarLetter}
-
- );
- } else {
- const { applicationReleases } = row;
- let hasPublishedRelease = false;
- for (let i = 0; i < applicationReleases.length; i++) {
- if (applicationReleases[i].currentStatus === 'PUBLISHED') {
- hasPublishedRelease = true;
- break;
- }
- }
- avatar = hasPublishedRelease ? (
-
-
-
- }
- >
-
-
- ) : (
-
- );
- }
-
- return (
-
record.id}
- dataSource={this.state.apps}
- columns={columns}
- pagination={this.state.pagination}
- onChange={this.handleTableChange}
- rowClassName="app-row"
- loading={loading}
- onRow={(record, rowIndex) => {
- return {
- onClick: event => {
- this.showDrawer(record, rowIndex);
- },
- };
- }}
- />
-
-
-
- );
- }
-}
-
-export default withConfigContext(AppsTable);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/styles.css
deleted file mode 100644
index 030832abea..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/styles.css
+++ /dev/null
@@ -1,27 +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.
- */
-
-.app-row{
- cursor: pointer;
-}
-
-.apps-table{
- display: block;
- overflow: auto;
- width: 100%;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/Filters/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/Filters/index.js
deleted file mode 100644
index 649f3f8dc6..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/Filters/index.js
+++ /dev/null
@@ -1,293 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import { Card, Col, Row, Typography, Divider, Select, Button } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
-import Authorized from '../../../../../../../../components/Authorized/Authorized';
-
-const { Option } = Select;
-const { Title } = Typography;
-
-class FiltersForm extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- categories: [],
- tags: [],
- deviceTypes: [],
- };
- }
-
- handleSubmit = e => {
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- for (const [key, value] of Object.entries(values)) {
- if (value === undefined) {
- delete values[key];
- }
- }
-
- if (values.hasOwnProperty('deviceType') && values.deviceType === 'ALL') {
- delete values.deviceType;
- }
-
- if (values.hasOwnProperty('appType') && values.appType === 'ALL') {
- delete values.appType;
- }
-
- this.props.setFilters(values);
- });
- };
-
- componentDidMount() {
- this.getCategories();
- this.getTags();
- this.getDeviceTypes();
- }
-
- getCategories = () => {
- const config = this.props.context;
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/applications/categories',
- )
- .then(res => {
- if (res.status === 200) {
- let categories = JSON.parse(res.data.data);
- this.setState({
- categories: categories,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load categories.',
- true,
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- getTags = () => {
- const config = this.props.context;
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/applications/tags',
- )
- .then(res => {
- if (res.status === 200) {
- let tags = JSON.parse(res.data.data);
- this.setState({
- tags: tags,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load tags.',
- true,
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- getDeviceTypes = () => {
- const config = this.props.context;
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/device-types',
- )
- .then(res => {
- if (res.status === 200) {
- const deviceTypes = JSON.parse(res.data.data);
- this.setState({
- deviceTypes,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load device types.',
- true,
- );
- this.setState({
- loading: false,
- });
- });
- };
-
- render() {
- const { categories, tags, deviceTypes } = this.state;
- const { getFieldDecorator } = this.props.form;
-
- return (
-
-
-
- );
- }
-}
-
-const Filters = withConfigContext(
- Form.create({ name: 'filter-apps' })(FiltersForm),
-);
-
-export default withConfigContext(Filters);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js
deleted file mode 100644
index 33ae02dbcb..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Card, Col, Row, Typography, Input, Divider } from 'antd';
-import AppsTable from './components/ApssTable';
-import Filters from './components/Filters';
-
-const { Title } = Typography;
-const Search = Input.Search;
-
-class Apps extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- filters: {},
- };
- this.appName = '';
- }
-
- setFilters = filters => {
- if (this.appName === '' && filters.hasOwnProperty('appName')) {
- delete filters.appName;
- } else {
- filters.appName = this.appName;
- }
- this.setState({
- filters,
- });
- };
-
- setSearchText = appName => {
- const filters = { ...this.state.filters };
- this.appName = appName;
- if (appName === '' && filters.hasOwnProperty('appName')) {
- delete filters.appName;
- } else {
- filters.appName = appName;
- }
- this.setState({
- filters,
- });
- };
-
- onChangeSearchText = e => {
- const filters = { ...this.state.filters };
- const appName = e.target.value;
- if (appName === '' && filters.hasOwnProperty('appName')) {
- delete filters.appName;
- this.setState({
- filters,
- });
- }
- };
-
- render() {
- const { filters } = this.state;
- return (
-
-
-
-
-
-
-
-
- Apps
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Apps;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/index.js
deleted file mode 100644
index 282c727665..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/index.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { TeamOutlined } from '@ant-design/icons';
-import { Row, Typography } from 'antd';
-import StarRatings from 'react-star-ratings';
-import './styles.css';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../components/ConfigContext';
-import { handleApiError } from '../../../../../../services/utils/errorHandler';
-
-const { Text } = Typography;
-
-class DetailedRating extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- detailedRating: null,
- };
- }
-
- componentDidMount() {
- const { type, uuid } = this.props;
- this.getData(type, uuid);
- }
-
- componentDidUpdate(prevProps, prevState) {
- if (prevProps.uuid !== this.props.uuid) {
- const { type, uuid } = this.props;
- this.getData(type, uuid);
- }
- }
-
- getData = (type, uuid) => {
- const config = this.props.context;
- return axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/admin/reviews/' +
- uuid +
- '/' +
- type +
- '-rating',
- )
- .then(res => {
- if (res.status === 200) {
- let detailedRating = res.data.data;
- this.setState({
- detailedRating,
- });
- }
- })
- .catch(function(error) {
- handleApiError(
- error,
- 'Error occurred while trying to load rating for the release.',
- true,
- );
- });
- };
-
- render() {
- const detailedRating = this.state.detailedRating;
-
- if (detailedRating == null) {
- return null;
- }
-
- const totalCount = detailedRating.noOfUsers;
- const ratingVariety = detailedRating.ratingVariety;
-
- const ratingArray = [];
-
- // eslint-disable-next-line no-unused-vars
- for (let [key, value] of Object.entries(ratingVariety)) {
- ratingArray.push(value);
- }
-
- const maximumRating = Math.max(...ratingArray);
-
- const ratingBarPercentages = [0, 0, 0, 0, 0];
-
- if (maximumRating > 0) {
- for (let i = 0; i < 5; i++) {
- ratingBarPercentages[i] =
- (ratingVariety[(i + 1).toString()] / maximumRating) * 100;
- }
- }
-
- return (
-
-
-
{detailedRating.ratingValue.toFixed(1)}
-
-
-
- {totalCount} total
-
-
-
-
- 5
-
- {' '}
-
-
-
- 4
-
- {' '}
-
-
-
- 3
-
- {' '}
-
-
-
- 2
-
- {' '}
-
-
-
- 1
-
- {' '}
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(DetailedRating);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/styles.css
deleted file mode 100644
index 34c484c34f..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/DetailedRating/styles.css
+++ /dev/null
@@ -1,102 +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.
- */
-
-.d-rating .numeric-data{
- box-sizing: border-box;
- display: inline-block;
- padding: 20px 0 20px 0;
- vertical-align: top;
- text-align: center;
- width: 30%;
-}
-
-.d-rating .bar-containers{
- box-sizing: border-box;
- display: inline-block;
- padding: 20px 20px 20px 30px;
- vertical-align: top;
- 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{
- color: #737373;
- font-weight: 400;
- height: 20px;
- margin-bottom: 4px;
- position: relative;
- width: 100%;
-}
-
-.d-rating .bar-containers .bar-container .number{
- font-size: 11px;
- left: -16px;
- letter-spacing: 1px;
- position: absolute;
-}
-
-.d-rating .bar-containers .bar-container .bar{
- transition: width .25s ease;
- display: inline-block;
- height: 100%;
- opacity: .8;
- border-radius: 5px;
-}
-
-.bar-container .rate-5{
- background: #57bb8a;
-}
-
-.bar-container .rate-4{
- background: #9ace6a;
-}
-
-.bar-container .rate-3{
- background: #ffcf02;
-}
-
-.bar-container .rate-2{
- background: #ff9f02;
-}
-
-.bar-container .rate-1{
- background: #ff6f31;
-}
-
-.d-rating .numeric-data .rate{
- color: #333;
- font-size: 64px;
- font-weight: 100;
- line-height: 64px;
- padding-bottom: 6px;
-}
-
-.d-rating .numeric-data .people-count{
- padding-top: 6px;
-}
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/index.js
deleted file mode 100644
index 716676be3d..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/index.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import AppList from './components/AppList';
-import Authorized from '../../../../components/Authorized/Authorized';
-import { Result } from 'antd';
-
-class Apps extends React.Component {
- routes;
- constructor(props) {
- super(props);
- this.routes = props.routes;
- }
-
- render() {
- return (
-
-
- }
- no={
-
- }
- />
-
-
- );
- }
-}
-
-export default Apps;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/LifeCycleHistory/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/LifeCycleHistory/index.js
deleted file mode 100644
index 158a0700de..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/LifeCycleHistory/index.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Tag, Timeline, Card } from 'antd';
-import { withConfigContext } from '../../../../../../../../../../components/ConfigContext';
-
-class LifeCycleHistory extends React.Component {
- constructor(props) {
- super(props);
- }
-
- render() {
- const { lifeCycleStates } = this.props;
- return (
-
- );
- }
-}
-
-export default withConfigContext(LifeCycleHistory);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/lifeCycleDetailsModal/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/lifeCycleDetailsModal/index.js
deleted file mode 100644
index 74797e8f23..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/components/lifeCycleDetailsModal/index.js
+++ /dev/null
@@ -1,113 +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.
- */
-
-import React from 'react';
-import { QuestionCircleOutlined } from '@ant-design/icons';
-import { Modal, Button, Tag, List, Typography } from 'antd';
-import pSBC from 'shade-blend-color';
-import { withConfigContext } from '../../../../../../../../../../components/ConfigContext';
-
-const { Text } = Typography;
-
-class LifeCycleDetailsModal extends React.Component {
- constructor(props) {
- super(props);
- this.state = { visible: false };
- }
-
- showModal = () => {
- this.setState({
- visible: true,
- });
- };
-
- handleCancel = e => {
- this.setState({
- visible: false,
- });
- };
-
- render() {
- const config = this.props.context;
- const lifeCycleConfig = config.lifecycle;
- const { lifecycle } = this.props;
- return (
-
- }
- onClick={this.showModal}
- >
- Learn more
-
-
- {
- let text = '';
- let footerText = '';
- let nextProceedingStates = [];
-
- if (lifeCycleConfig.hasOwnProperty(lifecycleState)) {
- text = lifeCycleConfig[lifecycleState].text;
- }
- if (
- lifecycle[lifecycleState].hasOwnProperty('proceedingStates')
- ) {
- nextProceedingStates =
- lifecycle[lifecycleState].proceedingStates;
- footerText =
- 'You can only proceed to one of the following states:';
- }
-
- return (
-
-
- {text}
-
- {footerText}
-
- );
- }
-}
-
-export default withConfigContext(LifeCycleDetailsModal);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/index.js
deleted file mode 100644
index 03c7801ac3..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/LifeCycle/index.js
+++ /dev/null
@@ -1,354 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import {
- Typography,
- Tag,
- Divider,
- Button,
- Modal,
- notification,
- Steps,
- Alert,
- Tabs,
- Tooltip,
-} from 'antd';
-import axios from 'axios';
-import ReactQuill from 'react-quill';
-import 'react-quill/dist/quill.snow.css';
-import './styles.css';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
-import LifeCycleHistory from './components/LifeCycleHistory';
-import { EntgraIcon } from 'entgra-icons-react';
-const { Text, Title, Paragraph } = Typography;
-const { TabPane } = Tabs;
-
-const modules = {
- toolbar: [
- [{ header: [1, 2, false] }],
- ['bold', 'italic', 'underline', 'strike', 'blockquote', 'code-block'],
- [{ list: 'ordered' }, { list: 'bullet' }],
- ['link', 'image'],
- ],
-};
-
-const formats = [
- 'header',
- 'bold',
- 'italic',
- 'underline',
- 'strike',
- 'blockquote',
- 'code-block',
- 'list',
- 'bullet',
- 'link',
- 'image',
-];
-
-const { Step } = Steps;
-
-class LifeCycle extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- currentStatus: props.currentStatus,
- selectedStatus: null,
- reasonText: '',
- isReasonModalVisible: false,
- isConfirmButtonLoading: false,
- current: 0,
- lifecycleSteps: [],
- lifeCycleStates: [],
- isPublished: false,
- };
- }
-
- componentDidMount() {
- const config = this.props.context;
- const lifeCycleConfig = config.lifecycle;
- const lifecycleSteps = Object.keys(lifeCycleConfig).map(config => {
- return lifeCycleConfig[config];
- });
- let isPublished = this.checkReleaseLifeCycleStatus();
- this.setState({
- current: lifeCycleConfig[this.props.currentStatus].step,
- lifecycleSteps,
- isPublished,
- });
- this.getLifeCycleHistory();
- }
-
- componentDidUpdate(prevProps, prevState, snapshot) {
- if (
- prevProps.currentStatus !== this.props.currentStatus ||
- prevProps.uuid !== this.props.uuid
- ) {
- this.setState({
- currentStatus: this.props.currentStatus,
- });
- }
- }
-
- handleChange = value => {
- this.setState({ reasonText: value });
- };
-
- showReasonModal = lifecycleState => {
- this.setState({
- selectedStatus: lifecycleState,
- isReasonModalVisible: true,
- });
- };
-
- closeReasonModal = () => {
- this.setState({
- isReasonModalVisible: false,
- });
- };
-
- addLifeCycle = () => {
- const config = this.props.context;
- const lifeCycleConfig = config.lifecycle;
- const { selectedStatus, reasonText } = this.state;
- const { uuid } = this.props;
- const data = {
- action: selectedStatus,
- reason: reasonText,
- };
-
- this.setState({
- isConfirmButtonLoading: true,
- });
-
- axios
- .post(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/applications/life-cycle/' +
- uuid,
- data,
- )
- .then(res => {
- if (res.status === 201) {
- this.setState({
- current: lifeCycleConfig[selectedStatus].step,
- isReasonModalVisible: false,
- isConfirmButtonLoading: false,
- currentStatus: selectedStatus,
- selectedStatus: null,
- reasonText: '',
- });
- this.props.changeCurrentLifecycleStatus(selectedStatus);
- notification.success({
- message: 'Done!',
- description: 'Lifecycle state updated successfully!',
- });
- this.getLifeCycleHistory();
- }
- })
- .catch(error => {
- handleApiError(error, 'Error occurred while trying to add lifecycle');
- this.setState({
- isConfirmButtonLoading: false,
- });
- });
- };
-
- getLifeCycleHistory = () => {
- const config = this.props.context;
- const { uuid } = this.props;
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.publisher +
- '/applications/life-cycle/state-changes/' +
- uuid,
- )
- .then(res => {
- if (res.status === 200) {
- this.setState({ lifeCycleStates: JSON.parse(res.data.data) });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to get lifecycle history',
- );
- });
- };
-
- onChange = current => {
- this.setState({ current });
- };
-
- /*
- Function to check if the same app releases are in published
- state or not and assigned a boolean value to disable
- the publish button if an app release is already published
-*/
- checkReleaseLifeCycleStatus = () => {
- if (typeof this.props.appReleases !== 'undefined') {
- let appReleases = this.props.appReleases.fullAppDetails;
- for (let i = 0; i < appReleases.length; i++) {
- if (
- this.props.uuid !== appReleases[i].uuid &&
- appReleases[i].currentStatus === 'PUBLISHED'
- ) {
- return true;
- }
- }
- return false;
- }
- return false;
- };
-
- render() {
- const {
- currentStatus,
- selectedStatus,
- current,
- lifecycleSteps,
- lifeCycleStates,
- } = this.state;
- const { lifecycle } = this.props;
- const text = Already an app is in publish state;
- let proceedingStates = [];
- if (
- lifecycle !== null &&
- lifecycle.hasOwnProperty(currentStatus) &&
- lifecycle[currentStatus].hasOwnProperty('proceedingStates')
- ) {
- proceedingStates = lifecycle[currentStatus].proceedingStates;
- }
- return (
-
- Manage Lifecycle
-
-
- Ensure that your security policies are not violated by the
- application. Have a thorough review and approval process before
- directly publishing it to your app store. You can easily transition
- from one state to another.
-
-
-
-
-
-
-
-
- >
- );
- }
-}
-
-const EditRelease = withConfigContext(
- Form.create({ name: 'add-new-release' })(EditReleaseModal),
-);
-
-export default EditRelease;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/components/Review/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/components/Review/index.js
deleted file mode 100644
index 7dbd0139b7..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/components/Review/index.js
+++ /dev/null
@@ -1,84 +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.
- */
-
-import React from 'react';
-import { Avatar } from 'antd';
-import { List, Typography } from 'antd';
-import StarRatings from 'react-star-ratings';
-
-const { Text, Paragraph } = Typography;
-const colorList = [
- '#f0932b',
- '#badc58',
- '#6ab04c',
- '#eb4d4b',
- '#0abde3',
- '#9b59b6',
- '#3498db',
- '#22a6b3',
-];
-
-class SingleReview extends React.Component {
- render() {
- const review = this.props.review;
- const randomColor = colorList[Math.floor(Math.random() * colorList.length)];
- const avatarLetter = review.username.charAt(0).toUpperCase();
- const content = (
-
- );
- }
-}
-
-export default withConfigContext(Reviews);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/styles.css
deleted file mode 100644
index 089e7c6cf2..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/components/Reviews/styles.css
+++ /dev/null
@@ -1,34 +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.
- */
-
-.demo-infinite-container {
- overflow: auto;
- padding: 8px 24px;
-}
-.demo-loading-container {
- position: absolute;
- bottom: 40px;
- width: 100%;
- text-align: center;
-}
-
-.demo-loading {
- position: absolute;
- bottom: -40px;
- left: 50%;
-}
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/index.js
deleted file mode 100644
index 2c5a0d1de1..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleaseView/index.js
+++ /dev/null
@@ -1,231 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { ShopOutlined } from '@ant-design/icons';
-import { Divider, Row, Col, Typography, Button, Tooltip, Alert } from 'antd';
-import StarRatings from 'react-star-ratings';
-import Reviews from './components/Reviews';
-import '../../../../../../../../App.css';
-import DetailedRating from '../../../../components/DetailedRating';
-import EditRelease from './components/EditRelease';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import Authorized from '../../../../../../../../components/Authorized/Authorized';
-import DeleteRelease from './components/DeleteRelease';
-import { EntgraIcon } from 'entgra-icons-react';
-
-const { Title, Text, Paragraph } = Typography;
-
-class ReleaseView extends React.Component {
- constructor(props) {
- super(props);
- this.state = {};
- }
-
- render() {
- const { app, release } = this.props;
- const config = this.props.context;
- const { lifecycle, currentLifecycleStatus } = this.props;
- let isKeyInclude = false;
- let metaArrayWithOutWindowsKey = [];
- if (release == null) {
- return null;
- }
- let isAppUpdatable,
- isAppInstallable,
- isDeletableState = false;
- if (lifecycle != null) {
- isAppUpdatable = lifecycle[currentLifecycleStatus].isAppUpdatable;
- isAppInstallable = lifecycle[currentLifecycleStatus].isAppInstallable;
- isDeletableState = lifecycle[currentLifecycleStatus].isDeletableState;
- }
-
- const platform = app.deviceType;
- const defaultPlatformIcons = config.defaultPlatformIcons;
- let icon = defaultPlatformIcons.default.icon;
- let color = defaultPlatformIcons.default.color;
-
- if (defaultPlatformIcons.hasOwnProperty(platform)) {
- icon = defaultPlatformIcons[platform].icon;
- color = defaultPlatformIcons[platform].color;
- }
- let metaData = [];
- try {
- metaData = JSON.parse(release.metaData);
- } catch (e) {
- console.log(e);
- }
-
- return (
-
- );
- }
-}
-
-export default withConfigContext(ManageTags);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/index.js
deleted file mode 100644
index 6a8b8122cf..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/index.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Typography, Breadcrumb, Row, Col } from 'antd';
-import ManageCategories from './components/Categories';
-import ManageTags from './components/Tags';
-import { Link } from 'react-router-dom';
-import Authorized from '../../../../components/Authorized/Authorized';
-
-const { Paragraph } = Typography;
-
-class Manage extends React.Component {
- routes;
-
- constructor(props) {
- super(props);
- this.routes = props.routes;
- }
-
- render() {
- return (
-
-
-
-
-
- Home
-
-
- Manage
- General
-
-
-
Manage General Settings
-
- Maintain and manage categories and tags here..
-
-
-
-
-
-
-
-
-
-
-
-
- >
- }
- />
-
-
-
- );
- }
-}
-
-export default Manage;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/GooglePlayIframe/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/GooglePlayIframe/index.js
deleted file mode 100644
index d4ab696d15..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/GooglePlayIframe/index.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Modal, Button } from 'antd';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-
-class GooglePlayIframe extends React.Component {
- constructor(props) {
- super(props);
- this.config = this.props.context;
-
- this.state = {
- visible: false,
- };
- }
-
- showModal = () => {
- this.setState({
- visible: true,
- });
- };
-
- handleOk = e => {
- this.setState({
- visible: false,
- });
- };
-
- handleCancel = e => {
- this.setState({
- visible: false,
- });
- };
-
- render() {
- return (
-
-
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(GooglePlayIframe);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/components/AddNewPage/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/components/AddNewPage/index.js
deleted file mode 100644
index c7ac23da3a..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/components/AddNewPage/index.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { Button, Divider, Input, Modal, notification, Spin } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../components/ConfigContext';
-import { withRouter } from 'react-router';
-import { handleApiError } from '../../../../../../../../../../services/utils/errorHandler';
-
-class AddNewPage extends React.Component {
- state = {
- visible: false,
- pageName: '',
- };
-
- showModal = () => {
- this.setState({
- visible: true,
- loading: false,
- });
- };
-
- handleCancel = e => {
- this.setState({
- visible: false,
- });
- };
-
- handlePageName = e => {
- this.setState({
- pageName: e.target.value,
- });
- };
-
- createNewPage = () => {
- const config = this.props.context;
- this.setState({ loading: true });
-
- axios
- .post(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/store-layout/page',
- {
- locale: 'en',
- pageName: this.state.pageName,
- },
- )
- .then(res => {
- if (res.status === 200) {
- const { pageId, pageName } = res.data.data;
-
- notification.success({
- message: 'Saved!',
- description: 'Page created successfully!',
- });
-
- this.setState({ loading: false });
-
- this.props.history.push(
- `/publisher/manage/android-enterprise/pages/${pageName}/${pageId}`,
- );
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to update the cluster.',
- );
- this.setState({ loading: false });
- });
- };
-
- render() {
- return (
-
-
-
-
-
Choose a name for the page
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(withRouter(AddNewPage));
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js
deleted file mode 100644
index 33d67ef4ed..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/index.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import axios from 'axios';
-import { DeleteOutlined, HomeOutlined } from '@ant-design/icons';
-import {
- Tag,
- notification,
- Table,
- Typography,
- Divider,
- Popconfirm,
- Button,
-} from 'antd';
-
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import './styles.css';
-import { Link } from 'react-router-dom';
-import AddNewPage from './components/AddNewPage';
-import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
-import { isAuthorized } from '../../../../../../../../services/utils/authorizationHandler';
-
-const { Text, Title } = Typography;
-
-class Pages extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- data: [],
- pagination: {},
- loading: false,
- selectedRows: [],
- homePageId: null,
- };
- this.hasPermissionToManage = isAuthorized(
- this.props.context.user,
- '/permission/admin/device-mgt/enterprise/user/modify',
- );
- }
-
- rowSelection = {
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows,
- });
- },
- };
-
- componentDidMount() {
- if (this.hasPermissionToView) {
- this.setHomePage();
- }
- this.fetch();
- }
-
- // fetch data from api
- fetch = (params = {}) => {
- const config = this.props.context;
- this.setState({ loading: true });
-
- // send request to the invoker
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/store-layout/page',
- )
- .then(res => {
- if (res.status === 200) {
- const pagination = { ...this.state.pagination };
- this.setState({
- loading: false,
- data: res.data.data.page,
- pagination,
- });
- }
- })
- .catch(error => {
- handleApiError(error, 'Error occurred while trying to load pages.');
- this.setState({ loading: false });
- });
- };
-
- setHomePage = () => {
- const config = this.props.context;
- // send request to the invoker
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/store-layout/home-page',
- )
- .then(res => {
- if (res.status === 200) {
- this.setState({
- homePageId: res.data.data.homepageId,
- });
- }
- })
- .catch(error => {
- handleApiError(error, 'Error occurred while trying to get home page.');
- this.setState({ loading: false });
- });
- };
-
- updateHomePage = pageId => {
- const config = this.props.context;
- this.setState({
- loading: true,
- });
- // send request to the invoker
- axios
- .put(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/store-layout/home-page/' +
- pageId,
- {},
- )
- .then(res => {
- if (res.status === 200) {
- notification.success({
- message: 'Done!',
- description: 'Home page was updated successfully!',
- });
-
- this.setState({
- homePageId: res.data.data.homepageId,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to update the home page.',
- );
- this.setState({ loading: false });
- });
- };
-
- deletePage = pageId => {
- const { data } = this.state;
- const config = this.props.context;
- this.setState({
- loading: true,
- });
- // send request to the invoker
- axios
- .delete(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/store-layout/page/' +
- pageId,
- )
- .then(res => {
- if (res.status === 200) {
- notification.success({
- message: 'Done!',
- description: 'Home page was updated successfully!',
- });
-
- for (let i = 0; i < data.length; i++) {
- if (data[i].id === pageId) {
- data.splice(i, 1);
- }
- }
-
- this.setState({
- loading: false,
- data: data,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to delete the page.',
- );
- this.setState({ loading: false });
- });
- };
-
- handleTableChange = (pagination, filters, sorter) => {
- const pager = { ...this.state.pagination };
- pager.current = pagination.current;
- this.setState({
- pagination: pager,
- });
- };
-
- columns = [
- {
- title: 'Page',
- dataIndex: 'name',
- key: 'name',
- width: 300,
- render: (name, page) => {
- const pageName = name[0].text;
- return (
-
record.id}
- dataSource={data}
- pagination={{
- ...pagination,
- size: 'small',
- // position: "top",
- showTotal: (total, range) =>
- `showing ${range[0]}-${range[1]} of ${total} pages`,
- showQuickJumper: true,
- }}
- loading={loading}
- onChange={this.handleTableChange}
- // rowSelection={this.rowSelection}
- scroll={{ x: 1000 }}
- />
-
-
- );
- }
-}
-
-export default withConfigContext(Pages);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/styles.css
deleted file mode 100644
index 1881f61361..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/Pages/styles.css
+++ /dev/null
@@ -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.
- */
-
-.layout-pages .action {
- cursor: pointer;
-}
-
-.layout-pages .edit {
- color: #008dff;
-}
-
-.layout-pages .btn-warning {
- color: #faad14;
-}
-
-.layout-pages .btn-warning:hover {
- color: #fa8905;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/SyncAndroidApps/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/SyncAndroidApps/index.js
deleted file mode 100644
index 3f681cb6fa..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/components/SyncAndroidApps/index.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { SyncOutlined } from '@ant-design/icons';
-import { Button, notification } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../components/ConfigContext';
-import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
-
-class SyncAndroidApps extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- loading: false,
- };
- }
-
- syncApps = () => {
- const config = this.props.context;
- this.setState({
- loading: true,
- });
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- '/device-mgt/android/v1.0/enterprise/products/sync',
- )
- .then(res => {
- notification.success({
- message: 'Done!',
- description: 'Apps synced successfully!',
- });
-
- this.setState({
- loading: false,
- });
- })
- .catch(error => {
- handleApiError(error, 'Error occurred while syncing the apps.');
- this.setState({
- loading: false,
- });
- });
- };
-
- render() {
- const { loading } = this.state;
- return (
-
- }
- >
- Sync{loading && 'ing...'}
-
-
- );
- }
-}
-
-export default withConfigContext(SyncAndroidApps);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/index.js
deleted file mode 100644
index ffdf934e90..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Manage/scenes/AndroidEnterprise/index.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { HomeOutlined } from '@ant-design/icons';
-import { PageHeader, Breadcrumb, Divider, Result } from 'antd';
-import { Link } from 'react-router-dom';
-import SyncAndroidApps from './components/SyncAndroidApps';
-import { withConfigContext } from '../../../../../../components/ConfigContext';
-import GooglePlayIframe from './components/GooglePlayIframe';
-import Pages from './components/Pages';
-import Authorized from '../../../../../../components/Authorized/Authorized';
-
-class ManageAndroidEnterprise extends React.Component {
- routes;
-
- constructor(props) {
- super(props);
- this.routes = props.routes;
- this.config = this.props.context;
- }
-
- render() {
- return (
-
-
- }
- no={
-
- }
- />
-
- );
- }
-}
-
-export default withConfigContext(withRouter(Page));
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/styles.css
deleted file mode 100644
index 96c85a341f..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/styles.css
+++ /dev/null
@@ -1,89 +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-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: 15px;
- }
-
- Header{
- position: fixed;
- z-index: 1;
- width: 100%;
- }
-
- .dashboard-body{
- margin-top: 50px;
- }
-
- .logo-image {
- margin-left: 20%;
- }
-
-}
-
-@media screen and (max-height: 350px) {
-
- .mobile-menu-button{
- margin-top: 15px;
- }
- .dashboard-body{
- margin-top: 9%;
- }
-
-}
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Login/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Login/index.js
deleted file mode 100644
index 95e8039c3b..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Login/index.js
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import React from 'react';
-import { LockOutlined, UserOutlined } from '@ant-design/icons';
-import { Form } from '@ant-design/compatible';
-import '@ant-design/compatible/assets/index.css';
-import {
- Typography,
- Row,
- Col,
- Input,
- Button,
- message,
- notification,
-} from 'antd';
-import './styles.css';
-import axios from 'axios';
-import './styles.css';
-import { withConfigContext } from '../../components/ConfigContext';
-
-const { Title } = Typography;
-const { Text } = Typography;
-
-class Login extends React.Component {
- render() {
- const config = this.props.context;
- return (
-
- );
- }
-}
-
-export default App;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.test.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.test.js
deleted file mode 100644
index 0b509e08c1..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.test.js
+++ /dev/null
@@ -1,27 +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.
- */
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import App from './App';
-
-it('renders without crashing', () => {
- const div = document.createElement('div');
- ReactDOM.render(, div);
- ReactDOM.unmountComponentAtNode(div);
-});
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/Authorized/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/Authorized/index.js
deleted file mode 100644
index bf7376ac84..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/Authorized/index.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright (c) 2020, 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.
- */
-
-import react from 'react';
-import { withConfigContext } from '../context/ConfigContext';
-
-class Authorized extends react.Component {
- constructor(props) {
- super(props);
- }
-
- isAuthorized = (user, permission) => {
- if (!user || !permission) {
- return false;
- }
- return user.permissions.includes(permission);
- };
-
- render() {
- return this.isAuthorized(this.props.context.user, this.props.permission)
- ? this.props.yes
- : this.props.no;
- }
-}
-
-Authorized.defaultProps = {
- yes: () => null,
- no: () => null,
-};
-export default withConfigContext(Authorized);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/RouteWithSubRoutes/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/RouteWithSubRoutes/index.js
deleted file mode 100644
index 0f255e852f..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/RouteWithSubRoutes/index.js
+++ /dev/null
@@ -1,44 +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.
- */
-
-import React from 'react';
-import { Route } from 'react-router-dom';
-class RouteWithSubRoutes extends React.Component {
- props;
- constructor(props) {
- super(props);
- this.props = props;
- }
- render() {
- return (
- (
-
- )}
- />
- );
- }
-}
-
-export default RouteWithSubRoutes;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/context/ConfigContext/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/context/ConfigContext/index.js
deleted file mode 100644
index e79fea42fd..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/components/context/ConfigContext/index.js
+++ /dev/null
@@ -1,34 +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.
- */
-
-import React from 'react';
-
-const ConfigContext = React.createContext();
-
-export const withConfigContext = Component => {
- // eslint-disable-next-line react/display-name
- return props => (
-
- {context => {
- return ;
- }}
-
- );
-};
-
-export default ConfigContext;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.css
deleted file mode 100644
index 31f05bcdaa..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.css
+++ /dev/null
@@ -1,45 +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.
- */
-
-.App {
- padding: 20px;
-}
-
-.ant-layout-header{
- padding: 0;
- height: auto;
- box-shadow: 0 2px 8px #f0f1f2;
-}
-
-.steps-content {
- margin-top: 16px;
- border: 1px dashed #e9e9e9;
- border-radius: 6px;
- background-color: #fafafa;
- min-height: 200px;
- text-align: center;
- padding-top: 80px;
-}
-
-.steps-action {
- margin-top: 24px;
-}
-
-.ant-input-affix-wrapper .ant-input{
- min-height: 0;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.html b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.html
deleted file mode 100644
index 8f254050f2..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.html
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
-
-
-
-
- Entgra App Store
-
-
-
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.js
deleted file mode 100644
index c4249a4206..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/index.js
+++ /dev/null
@@ -1,59 +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.
- */
-
-import React from 'react';
-import ReactDOM from 'react-dom';
-import * as serviceWorker from './services/serviceWorkers/serviceWorker';
-import App from './App';
-import Login from './scenes/Login';
-import Dashboard from './scenes/Home';
-import Apps from './scenes/Home/scenes/Apps';
-import Release from './scenes/Home/scenes/Apps/scenes/Release';
-import './index.css';
-
-const routes = [
- {
- path: '/store/login',
- exact: true,
- component: Login,
- },
- {
- path: '/store',
- exact: false,
- component: Dashboard,
- routes: [
- {
- path: '/store/:deviceType',
- component: Apps,
- exact: true,
- },
- {
- path: '/store/:deviceType/apps/:uuid',
- exact: true,
- component: Release,
- },
- ],
- },
-];
-
-ReactDOM.render(, document.getElementById('root'));
-
-// If you want your app e and load faster, you can change
-// unregister() to register() below. Note this comes with some pitfalls.
-// Learn more about service workers: https://bit.ly/CRA-PWA
-serviceWorker.unregister();
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/logo.svg b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/logo.svg
deleted file mode 100644
index 6b60c1042f..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/logo.svg
+++ /dev/null
@@ -1,7 +0,0 @@
-
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/components/Logout/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/components/Logout/index.js
deleted file mode 100644
index 84bc6c0c94..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/components/Logout/index.js
+++ /dev/null
@@ -1,91 +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.
- */
-
-import React from 'react';
-import { LogoutOutlined } from '@ant-design/icons';
-import { Menu } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../services/utils/errorHandler';
-import { getUiConfig } from '../../../../services/utils/uiConfigHandler';
-
-/*
-This class for call the logout api by sending request
- */
-class Logout extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- inValid: false,
- loading: false,
- };
- }
- /*
- This function call the logout api when the request is success
- */
- handleSubmit = () => {
- const thisForm = this;
- const config = this.props.context;
-
- thisForm.setState({
- inValid: false,
- });
-
- let logoutUri;
- getUiConfig(config).then(uiConfig => {
- if (uiConfig !== undefined) {
- if (uiConfig.isSsoEnable) {
- logoutUri = window.location.origin + config.serverConfig.ssoLogoutUri;
- } else {
- logoutUri = window.location.origin + config.serverConfig.logoutUri;
- }
- axios
- .post(logoutUri)
- .then(res => {
- // if the api call status is correct then user
- // will logout and then it goes to login page
- if (res.status === 200) {
- window.location =
- window.location.origin + `/${config.appName}/login`;
- }
- })
- .catch(function(error) {
- handleApiError(error, 'Error occurred while trying to logout.');
- });
- } else {
- this.setState({
- loading: false,
- error: true,
- });
- }
- });
- };
-
- render() {
- return (
-
- );
- }
-}
-
-export default withConfigContext(Logout);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/index.js
deleted file mode 100644
index c5a8bf47fc..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/index.js
+++ /dev/null
@@ -1,291 +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.
- */
-
-import React from 'react';
-import {
- UploadOutlined,
- UserOutlined,
- AndroidFilled,
- AppleFilled,
- WindowsFilled,
- HddFilled,
- MenuFoldOutlined,
- MenuUnfoldOutlined,
-} from '@ant-design/icons';
-import { Layout, Menu, Drawer, Button, Alert } from 'antd';
-
-const { Header, Content, Footer } = Layout;
-import { Link } from 'react-router-dom';
-import RouteWithSubRoutes from '../../components/RouteWithSubRoutes';
-import { Switch } from 'react-router';
-import axios from 'axios';
-import './styles.css';
-import { withConfigContext } from '../../components/context/ConfigContext';
-import Logout from './components/Logout';
-import { handleApiError } from '../../services/utils/errorHandler';
-
-const { SubMenu } = Menu;
-
-class Dashboard extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- routes: props.routes,
- selectedKeys: [],
- deviceTypes: [],
- visible: false,
- collapsed: false,
- forbiddenErrors: {
- deviceTypes: false,
- },
- };
- this.logo = this.props.context.theme.logo;
- this.footerText = this.props.context.theme.footerText;
- this.config = this.props.context;
- }
-
- componentDidMount() {
- this.getDeviceTypes();
- }
-
- getDeviceTypes = () => {
- const config = this.props.context;
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/device-types',
- )
- .then(res => {
- if (res.status === 200) {
- const deviceTypes = JSON.parse(res.data.data);
- this.setState({
- deviceTypes,
- loading: false,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load device types.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- const { forbiddenErrors } = this.state;
- forbiddenErrors.deviceTypes = true;
- this.setState({
- forbiddenErrors,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- changeSelectedMenuItem = key => {
- this.setState({
- selectedKeys: [key],
- });
- };
-
- showMobileNavigationBar = () => {
- this.setState({
- visible: true,
- collapsed: !this.state.collapsed,
- });
- };
-
- onCloseMobileNavigationBar = () => {
- this.setState({
- visible: false,
- });
- };
-
- render() {
- const { selectedKeys, deviceTypes, forbiddenErrors } = this.state;
- const DeviceTypesData = deviceTypes.map(deviceType => {
- let icon;
- switch (deviceType.name) {
- case 'android':
- icon = ;
- break;
- case 'ios':
- icon = ;
- break;
- case 'windows':
- icon = ;
- break;
- default:
- icon = ;
- }
- return (
-
-
- {icon}
- {deviceType.name}
-
-
- );
- });
-
- return (
-
- );
- }
-}
-
-export default withConfigContext(Dashboard);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/index.js
deleted file mode 100644
index c0526ba91e..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/index.js
+++ /dev/null
@@ -1,81 +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.
- */
-
-import { Card, Typography, Col, Row } from 'antd';
-import React from 'react';
-import { Link } from 'react-router-dom';
-import './styles.css';
-import StarRatings from 'react-star-ratings';
-
-const { Meta } = Card;
-const { Text } = Typography;
-
-class AppCard extends React.Component {
- constructor(props) {
- super(props);
- }
-
- render() {
- const app = this.props.app;
- const release = this.props.app.applicationReleases[0];
-
- const description = (
-
- );
-
- return (
-
-
-
- );
- }
-}
-
-export default AppCard;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/styles.css
deleted file mode 100644
index 30256eeebe..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/AppCard/styles.css
+++ /dev/null
@@ -1,56 +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.
- */
-.app-icon {
- min-width: 100%;
- height: auto;
-}
-
-.content {
- position: absolute;
- top: 0;
- left: 0;
- bottom: 0;
- right: 0;
-}
-
-.box {
- position: relative;
- width: 100%; /* desired width */
-}
-
-.box:before {
- content: "";
- display: block;
- padding-top: 100%; /* initial ratio of 1:1*/
-}
-
-.release .release-icon {
- margin-right: 15px;
-}
-
-.release .release-icon img {
- width: 100%;
- border-radius: 28%;
-}
-
-.release .app-name{
- white-space: nowrap;
- overflow: hidden;
- width: 100%;
- text-overflow: ellipsis;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js
deleted file mode 100644
index ab43ad7156..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/index.js
+++ /dev/null
@@ -1,166 +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.
- */
-
-import React from 'react';
-import AppCard from './components/AppCard';
-import { Col, Row, Result } from 'antd';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../services/utils/errorHandler';
-import InfiniteScroll from 'react-infinite-scroller';
-
-const limit = 30;
-
-class AppList extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- apps: [],
- loading: true,
- hasMore: true,
- loadMore: true,
- totalAppCount: 0,
- };
- }
-
- componentDidMount() {
- const { deviceType } = this.props;
- this.props.changeSelectedMenuItem(deviceType);
- this.fetchData(0, 30, res => {
- this.setState({
- apps: res,
- loading: false,
- });
- });
- }
-
- componentDidUpdate(prevProps, prevState) {
- if (prevProps.deviceType !== this.props.deviceType) {
- const { deviceType } = this.props;
- this.props.changeSelectedMenuItem(deviceType);
- this.fetchData(0, 30, res => {
- this.setState({
- apps: res,
- loading: false,
- hasMore: true,
- });
- });
- }
- }
-
- fetchData = (offset, limit, callbackFunction) => {
- const { deviceType } = this.props;
- const config = this.props.context;
- const payload = {
- offset,
- limit,
- };
- if (deviceType === 'web-clip') {
- payload.appType = 'WEB_CLIP';
- } else {
- payload.deviceType = deviceType;
- }
-
- this.setState({
- loading: true,
- });
- // send request to the invoker
- axios
- .post(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/applications/',
- payload,
- )
- .then(res => {
- if (res.status === 200) {
- // todo remove this property check after backend improvement
- let apps = res.data.data.hasOwnProperty('applications')
- ? res.data.data.applications
- : [];
- callbackFunction(apps);
- }
- })
- .catch(error => {
- handleApiError(error, 'Error occurred while trying to load apps.');
- this.setState({
- loading: false,
- });
- });
- };
-
- handleInfiniteOnLoad = count => {
- const offset = count * limit;
- let apps = this.state.apps;
- this.setState({
- loading: true,
- });
-
- this.fetchData(offset, limit, res => {
- if (res.length > 0) {
- apps = apps.concat(res);
- this.setState({
- apps,
- loading: false,
- });
- } else {
- this.setState({
- hasMore: false,
- loading: false,
- });
- }
- });
- };
-
- render() {
- const { apps, loading, hasMore } = this.state;
-
- return (
-
-
-
- {apps.length === 0 && (
-
-
-
- )}
- {apps.map(app => (
-
-
-
- ))}
-
-
-
- );
- }
-}
-
-export default withConfigContext(AppList);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/index.js
deleted file mode 100644
index 05475b0214..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/index.js
+++ /dev/null
@@ -1,60 +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.
- */
-
-import React from 'react';
-import AppList from './components/AppList';
-import Authorized from '../../../../components/Authorized';
-import { Result } from 'antd';
-
-class Apps extends React.Component {
- routes;
- constructor(props) {
- super(props);
- this.routes = props.routes;
- }
-
- render() {
- const { deviceType } = this.props.match.params;
- return (
-
- );
- }
-}
-
-export default Apps;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ImageViewer/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ImageViewer/index.js
deleted file mode 100644
index e4fa6dba15..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ImageViewer/index.js
+++ /dev/null
@@ -1,62 +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.
- */
-
-import React, { Component } from 'react';
-import RcViewer from 'rc-viewer';
-
-class ImageViewer extends Component {
- render() {
- const options = {
- title: false,
- toolbar: {
- zoomIn: 0,
- zoomOut: 0,
- oneToOne: 0,
- reset: 0,
- prev: 1,
- play: {
- show: 0,
- },
- next: 1,
- rotateLeft: 0,
- rotateRight: 0,
- flipHorizontal: 0,
- flipVertical: 0,
- },
- rotatable: false,
- transition: false,
- movable: false,
- };
- return (
-
- );
- }
-}
-
-export default ImageViewer;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/DeviceInstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/DeviceInstall/index.js
deleted file mode 100644
index f94bcf3820..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/DeviceInstall/index.js
+++ /dev/null
@@ -1,266 +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.
- */
-
-import React from 'react';
-import axios from 'axios';
-import { Table, Typography, Alert } from 'antd';
-import TimeAgo from 'javascript-time-ago';
-
-// Load locale-specific relative date/time formatting rules.
-import en from 'javascript-time-ago/locale/en';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const columns = [
- {
- title: 'Device',
- dataIndex: 'name',
- fixed: 'left',
- width: 100,
- },
- {
- title: 'Modal',
- dataIndex: 'deviceInfo',
- key: 'modal',
- render: deviceInfo => `${deviceInfo.vendor} ${deviceInfo.deviceModel}`,
- // todo add filtering options
- },
- {
- title: 'Owner',
- dataIndex: 'enrolmentInfo',
- key: 'owner',
- render: enrolmentInfo => enrolmentInfo.owner,
- // todo add filtering options
- },
- {
- title: 'Last Updated',
- dataIndex: 'deviceInfo',
- key: 'updatedTime',
- render: data => {
- return data.updatedTime;
- },
- // todo add filtering options
- },
- {
- title: 'Status',
- dataIndex: 'enrolmentInfo',
- key: 'status',
- render: enrolmentInfo => enrolmentInfo.status,
- // todo add filtering options
- },
- {
- title: 'Ownership',
- dataIndex: 'enrolmentInfo',
- key: 'ownership',
- render: enrolmentInfo => enrolmentInfo.ownership,
- // todo add filtering options
- },
- {
- title: 'OS Version',
- dataIndex: 'deviceInfo',
- key: 'osVersion',
- render: deviceInfo => deviceInfo.osVersion,
- // todo add filtering options
- },
- {
- title: 'IMEI',
- dataIndex: 'properties',
- key: 'imei',
- render: properties => {
- let imei = 'not-found';
- if (properties) {
- for (let i = 0; i < properties.length; i++) {
- if (properties[i].name === 'IMEI') {
- imei = properties[i].value;
- }
- }
- }
- return imei;
- },
- // todo add filtering options
- },
-];
-
-class DeviceInstall extends React.Component {
- constructor(props) {
- super(props);
- TimeAgo.addLocale(en);
- this.state = {
- data: [],
- pagination: {},
- loading: false,
- selectedRows: [],
- scheduledTime: null,
- isScheduledInstallVisible: false,
- isForbidden: false,
- };
- }
-
- rowSelection = {
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows,
- });
- },
- getCheckboxProps: record => ({
- disabled: record.name === 'Disabled User', // Column configuration not to be checked
- name: record.name,
- }),
- };
-
- componentDidMount() {
- this.fetch();
- }
-
- // fetch data from api
- fetch = (params = {}) => {
- const config = this.props.context;
- this.setState({ loading: true });
- const { deviceType } = this.props;
- // get current page
- const currentPage = params.hasOwnProperty('page') ? params.page : 1;
-
- const extraParams = {
- offset: 10 * (currentPage - 1), // calculate the offset
- limit: 10,
- requireDeviceInfo: true,
- };
-
- if (deviceType !== 'ANY') {
- extraParams.type = deviceType;
- }
-
- let encodedExtraParams = Object.keys(extraParams)
- .map(key => key + '=' + extraParams[key])
- .join('&');
-
- encodedExtraParams += '&status=ACTIVE&status=INACTIVE'; // fetch only active and inactive devices
- // send request to the invoker
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/devices?' +
- encodedExtraParams,
- )
- .then(res => {
- if (res.status === 200) {
- const pagination = { ...this.state.pagination };
- this.setState({
- loading: false,
- data: res.data.data,
- pagination,
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load devices.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleTableChange = (pagination, filters, sorter) => {
- const pager = { ...this.state.pagination };
- pager.current = pagination.current;
- this.setState({
- pagination: pager,
- });
- this.fetch({
- results: pagination.pageSize,
- page: pagination.current,
- sortField: sorter.field,
- sortOrder: sorter.order,
- ...filters,
- });
- };
-
- install = (timestamp = null) => {
- const { selectedRows } = this.state;
- const payload = [];
- selectedRows.map(device => {
- payload.push({
- id: device.deviceIdentifier,
- type: device.type,
- });
- });
- this.props.onInstall('devices', payload, 'install', timestamp);
- };
-
- render() {
- const { data, pagination, loading, selectedRows } = this.state;
- return (
-
-
- Start installing the application for one or more users by entering the
- corresponding user name. Select install to automatically start
- downloading the application for the respective user/users.
-
- {this.state.isForbidden && (
-
- )}
-
record.deviceIdentifier}
- dataSource={data.devices}
- pagination={{
- ...pagination,
- size: 'small',
- // position: "top",
- total: data.count,
- showTotal: (total, range) =>
- `showing ${range[0]}-${range[1]} of ${total} devices`,
- // showQuickJumper: true
- }}
- loading={loading}
- onChange={this.handleTableChange}
- rowSelection={this.rowSelection}
- scroll={{ x: 1000 }}
- />
-
-
- );
- }
-}
-
-export default withConfigContext(DeviceInstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/GroupInstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/GroupInstall/index.js
deleted file mode 100644
index f49680c5b2..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/GroupInstall/index.js
+++ /dev/null
@@ -1,154 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class GroupInstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- isForbidden: false,
- };
-
- fetchUser = value => {
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- const config = this.props.context;
- this.setState({ data: [], fetching: true });
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/groups?name=' +
- value,
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
-
- const data = res.data.data.deviceGroups.map(group => ({
- text: group.name,
- value: group.name,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load groups.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- });
- };
-
- install = () => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onInstall('group', data, 'install');
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start installing the application for one or more groups by entering
- the corresponding group name. Select install to automatically start
- downloading the application for the respective device group/ groups.
-
- {this.state.isForbidden && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{ width: '100%' }}
- >
- {data.map(d => (
-
- ))}
-
-
-
- );
- }
-}
-
-export default withConfigContext(GroupInstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/RoleInstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/RoleInstall/index.js
deleted file mode 100644
index e28026c3fd..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/RoleInstall/index.js
+++ /dev/null
@@ -1,154 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class RoleInstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- isForbidden: false,
- };
-
- fetchUser = value => {
- const config = this.props.context;
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- this.setState({ data: [], fetching: true });
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/roles?filter=' +
- value,
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
-
- const data = res.data.data.roles.map(role => ({
- text: role,
- value: role,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load roles.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- });
- };
-
- install = (timestamp = null) => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onInstall('role', data, 'install', timestamp);
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start installing the application for one or more roles by entering the
- corresponding role name. Select install to automatically start
- downloading the application for the respective user role/roles.
-
- {this.state.isForbidden && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{ width: '100%' }}
- >
- {data.map(d => (
-
- ))}
-
-
-
- );
- }
-}
-
-export default withConfigContext(RoleInstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/UserInstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/UserInstall/index.js
deleted file mode 100644
index 10ed1a3db5..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/components/UserInstall/index.js
+++ /dev/null
@@ -1,154 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class UserInstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- };
-
- fetchUser = value => {
- const config = this.props.context;
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- this.setState({ data: [], fetching: true });
-
- // send request to the invoker
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.deviceMgt +
- '/users/search?username=' +
- value,
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
-
- const data = res.data.data.users.map(user => ({
- text: user.username,
- value: user.username,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load users.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- isForbidden: false,
- });
- };
-
- install = (timestamp = null) => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onInstall('user', data, 'install', timestamp);
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start installing the application for one or more users by entering the
- corresponding user name. Select install to automatically start
- downloading the application for the respective user/users.{' '}
-
- {this.state.isForbidden && (
-
- )}
-
- );
- }
-}
-
-export default withConfigContext(UserInstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/index.js
deleted file mode 100644
index bb8bd66673..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Install/index.js
+++ /dev/null
@@ -1,68 +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.
- */
-
-import React from 'react';
-import { Modal, Spin, Tabs } from 'antd';
-import UserInstall from './components/UserInstall';
-import GroupInstall from './components/GroupInstall';
-import RoleInstall from './components/RoleInstall';
-import DeviceInstall from './components/DeviceInstall';
-
-const { TabPane } = Tabs;
-
-class Install extends React.Component {
- state = {
- data: [],
- };
-
- render() {
- const { deviceType } = this.props;
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Install;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/components/AddReview/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/components/AddReview/index.js
deleted file mode 100644
index af24e7dbf5..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/components/AddReview/index.js
+++ /dev/null
@@ -1,185 +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.
- */
-
-import React from 'react';
-import { StarOutlined } from '@ant-design/icons';
-import {
- Drawer,
- Button,
- Row,
- Col,
- Typography,
- Divider,
- Input,
- Spin,
- notification,
-} from 'antd';
-import StarRatings from 'react-star-ratings';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../../../services/utils/errorHandler';
-
-const { Title } = Typography;
-const { TextArea } = Input;
-
-class AddReview extends React.Component {
- state = {
- visible: false,
- content: '',
- rating: 0,
- loading: false,
- };
-
- showDrawer = () => {
- this.setState({
- visible: true,
- content: '',
- rating: 0,
- loading: false,
- });
- };
-
- onClose = () => {
- this.setState({
- visible: false,
- });
- };
- changeRating = (newRating, name) => {
- this.setState({
- rating: newRating,
- });
- };
-
- onChange = e => {
- this.setState({ content: e.target.value });
- };
-
- onSubmit = () => {
- const config = this.props.context;
- const { content, rating } = this.state;
- const { uuid } = this.props;
- this.setState({
- loading: true,
- });
-
- const payload = {
- content: content,
- rating: rating,
- };
-
- axios
- .post(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/reviews/' +
- uuid,
- payload,
- )
- .then(res => {
- if (res.status === 201) {
- this.setState({
- loading: false,
- visible: false,
- });
- notification.success({
- message: 'Done!',
- description: 'Your review has been posted successfully.',
- });
- this.props.onUpdateReview();
- } else {
- this.setState({
- loading: false,
- visible: false,
- });
- notification.error({
- message: 'There was a problem',
- duration: 0,
- description: 'We are unable to add your review right now.',
- });
- }
- })
- .catch(error => {
- handleApiError(error, 'We are unable to add your review right now.');
- this.setState({
- loading: false,
- visible: false,
- });
- });
- };
-
- render() {
- return (
-
-
-
-
-
-
-
-
- Add review
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(AddReview);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/index.js
deleted file mode 100644
index 391ff813d1..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/CurrentUsersReview/index.js
+++ /dev/null
@@ -1,98 +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.
- */
-
-import React from 'react';
-import { List, Typography, Empty, Alert } from 'antd';
-import SingleReview from '../Reviews/components/Review';
-import AddReview from './components/AddReview';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import Authorized from '../../../../../../../../../../../../../../components/Authorized';
-
-const { Text } = Typography;
-
-class CurrentUsersReview extends React.Component {
- render() {
- const { uuid, currentUserReviews } = this.props;
- return (
-
- MY REVIEW
-
- {currentUserReviews.length > 0 && (
-
- (
-
-
-
- )}
- />
-
- )}
-
- {currentUserReviews.length === 0 && (
-
- Share your experience with your community by adding a
- review.
-
- }
- >
-
-
- }
- no={
-
- }
- />
- )}
-
-
- );
- }
-}
-
-export default withConfigContext(CurrentUsersReview);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/index.js
deleted file mode 100644
index 3c6b5ddc9a..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/index.js
+++ /dev/null
@@ -1,126 +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.
- */
-
-import React from 'react';
-import { TeamOutlined } from '@ant-design/icons';
-import { Row, Typography } from 'antd';
-import StarRatings from 'react-star-ratings';
-import './styles.css';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-
-const { Text } = Typography;
-
-class Rating extends React.Component {
- render() {
- const { detailedRating } = this.props;
-
- if (detailedRating == null) {
- return null;
- }
-
- const totalCount = detailedRating.noOfUsers;
- const ratingVariety = detailedRating.ratingVariety;
-
- const ratingArray = [];
-
- // eslint-disable-next-line no-unused-vars
- for (let [key, value] of Object.entries(ratingVariety)) {
- ratingArray.push(value);
- }
-
- const maximumRating = Math.max(...ratingArray);
-
- const ratingBarPercentages = [0, 0, 0, 0, 0];
-
- if (maximumRating > 0) {
- for (let i = 0; i < 5; i++) {
- ratingBarPercentages[i] =
- (ratingVariety[(i + 1).toString()] / maximumRating) * 100;
- }
- }
-
- return (
-
-
-
{detailedRating.ratingValue.toFixed(1)}
-
-
-
- {totalCount} total
-
-
-
-
- 5
-
- {' '}
-
-
-
- 4
-
- {' '}
-
-
-
- 3
-
- {' '}
-
-
-
- 2
-
- {' '}
-
-
-
- 1
-
- {' '}
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(Rating);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/styles.css
deleted file mode 100644
index cfd70c4bdb..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Rating/styles.css
+++ /dev/null
@@ -1,90 +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.
- */
-
-.d-rating .numeric-data{
- box-sizing: border-box;
- display: inline-block;
- padding: 20px 0 20px 0;
- vertical-align: top;
- text-align: center;
- width: 30%;
-}
-
-.d-rating .bar-containers{
- box-sizing: border-box;
- display: inline-block;
- padding: 20px 20px 20px 30px;
- vertical-align: top;
- width: 70%;
-}
-
-.d-rating .bar-containers .bar-container{
- color: #737373;
- font-weight: 400;
- height: 20px;
- margin-bottom: 4px;
- position: relative;
- width: 100%;
-}
-
-.d-rating .bar-containers .bar-container .number{
- font-size: 11px;
- left: -16px;
- letter-spacing: 1px;
- position: absolute;
-}
-
-.d-rating .bar-containers .bar-container .bar{
- transition: width .25s ease;
- display: inline-block;
- height: 100%;
- opacity: .8;
- border-radius: 5px;
-}
-
-.bar-container .rate-5{
- background: #57bb8a;
-}
-
-.bar-container .rate-4{
- background: #9ace6a;
-}
-
-.bar-container .rate-3{
- background: #ffcf02;
-}
-
-.bar-container .rate-2{
- background: #ff9f02;
-}
-
-.bar-container .rate-1{
- background: #ff6f31;
-}
-
-.d-rating .numeric-data .rate{
- color: #333;
- font-size: 64px;
- font-weight: 100;
- line-height: 64px;
- padding-bottom: 6px;
-}
-
-.d-rating .numeric-data .people-count{
- padding-top: 6px;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/index.js
deleted file mode 100644
index 4dce40b902..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/index.js
+++ /dev/null
@@ -1,198 +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.
- */
-
-import React from 'react';
-import {
- Drawer,
- Button,
- Row,
- Col,
- Typography,
- Divider,
- Input,
- Spin,
- notification,
-} from 'antd';
-import StarRatings from 'react-star-ratings';
-import axios from 'axios';
-import './styles.css';
-import { withConfigContext } from '../../../../../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../../../../../services/utils/errorHandler';
-
-const { Title } = Typography;
-const { TextArea } = Input;
-
-class Edit extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- visible: false,
- content: '',
- rating: 0,
- loading: false,
- };
- }
-
- componentDidMount() {
- const { content, rating } = this.props.review;
- this.setState({
- content,
- rating,
- });
- }
-
- showDrawer = () => {
- this.setState({
- visible: true,
- loading: false,
- });
- };
-
- onClose = () => {
- this.setState({
- visible: false,
- });
- };
-
- changeRating = (newRating, name) => {
- this.setState({
- rating: newRating,
- });
- };
-
- onChange = e => {
- this.setState({ content: e.target.value });
- };
-
- onSubmit = () => {
- const config = this.props.context;
- const { content, rating } = this.state;
- const { id } = this.props.review;
- const { uuid } = this.props;
- this.setState({
- loading: true,
- });
-
- const payload = {
- content: content,
- rating: rating,
- };
-
- axios
- .put(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/reviews/' +
- uuid +
- '/' +
- id,
- payload,
- )
- .then(res => {
- if (res.status === 200) {
- this.setState({
- loading: false,
- visible: false,
- });
- notification.success({
- message: 'Done!',
- description: 'Your review has been update successfully.',
- });
-
- this.props.updateCallback(res.data.data);
- } else {
- this.setState({
- loading: false,
- visible: false,
- });
- notification.error({
- message: 'There was a problem',
- duration: 0,
- description: 'We are unable to update your review right now.',
- });
- }
- })
- .catch(error => {
- handleApiError(error, 'We are unable to add your review right now.');
- this.setState({
- loading: false,
- visible: false,
- });
- });
- };
-
- render() {
- return (
-
-
- edit
-
-
-
-
-
-
- Edit review
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default withConfigContext(Edit);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/styles.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/styles.css
deleted file mode 100644
index 5154172fc2..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/components/Edit/styles.css
+++ /dev/null
@@ -1,27 +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.
- */
-
-.edit-button {
- color: #1890ff;
- text-decoration: none;
- outline: none;
- cursor: pointer;
- font-weight: normal;
- font-size: 0.8em;
- padding-left: 5px;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/index.js
deleted file mode 100644
index 2d3ec681d9..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/ReviewContainer/componets/Reviews/components/Review/index.js
+++ /dev/null
@@ -1,191 +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.
- */
-
-import React from 'react';
-import { Avatar, notification } from 'antd';
-import { List, Typography, Popconfirm } from 'antd';
-import StarRatings from 'react-star-ratings';
-import Twemoji from 'react-twemoji';
-import './styles.css';
-import EditReview from './components/Edit';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../../../services/utils/errorHandler';
-import Authorized from '../../../../../../../../../../../../../../../../components/Authorized';
-
-const { Text, Paragraph } = Typography;
-const colorList = [
- '#f0932b',
- '#badc58',
- '#6ab04c',
- '#eb4d4b',
- '#0abde3',
- '#9b59b6',
- '#3498db',
- '#22a6b3',
- '#e84393',
- '#f9ca24',
-];
-
-class Review extends React.Component {
- static defaultProps = {
- isPersonalReview: false,
- };
-
- constructor(props) {
- super(props);
- const { username } = this.props.review;
- const color = colorList[username.length % 10];
- this.state = {
- content: '',
- rating: 0,
- color: color,
- review: props.review,
- };
- }
-
- updateCallback = review => {
- this.setState({
- review,
- });
- this.props.onUpdateReview();
- };
-
- deleteReview = () => {
- const { uuid } = this.props;
- const { id } = this.state.review;
- const config = this.props.context;
-
- let url =
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store;
-
- // call as an admin api if the review is not a personal review
- if (!this.props.isPersonalReview) {
- url += '/admin';
- }
-
- url += '/reviews/' + uuid + '/' + id;
-
- axios
- .delete(url)
- .then(res => {
- if (res.status === 200) {
- notification.success({
- message: 'Done!',
- description: 'The review has been deleted successfully.',
- });
-
- this.props.deleteCallback(id);
- }
- })
- .catch(error => {
- handleApiError(error, 'We were unable to delete the review..');
- });
- };
-
- render() {
- const { isEditable, isDeletable, uuid, isPersonalReview } = this.props;
- const { color, review } = this.state;
- const { content, rating, username } = review;
- const avatarLetter = username.charAt(0).toUpperCase();
- const body = (
-
-
- Start uninstalling the application for devices by selecting the
- corresponding devices. Select uninstall to automatically start
- uninstalling the application for the respective devices.
-
- {this.state.isForbidden && (
-
- )}
-
record.deviceIdentifier}
- dataSource={data.devices}
- pagination={{
- ...pagination,
- size: 'small',
- total: data.count,
- showTotal: (total, range) =>
- `showing ${range[0]}-${range[1]} of ${total} devices`,
- }}
- loading={loading}
- onChange={this.handleTableChange}
- rowSelection={this.rowSelection}
- scroll={{ x: 1000 }}
- />
-
-
- );
- }
-}
-
-export default withConfigContext(DeviceUninstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/GroupUninstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/GroupUninstall/index.js
deleted file mode 100644
index aa715abe83..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/GroupUninstall/index.js
+++ /dev/null
@@ -1,158 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class GroupUninstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- isForbidden: false,
- };
-
- fetchUser = value => {
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- const config = this.props.context;
- this.setState({ data: [], fetching: true });
-
- const uuid = this.props.uuid;
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/subscription/' +
- uuid +
- '/' +
- '/GROUP?',
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
-
- const data = res.data.data.deviceGroups.map(group => ({
- text: group,
- value: group,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load groups.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- });
- };
-
- uninstall = (timestamp = null) => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onUninstall('group', data, 'uninstall', timestamp);
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start uninstalling the application for one or more groups by entering
- the corresponding group name. Select uninstall to automatically start
- uninstalling the application for the respective device group/ groups.
-
- {this.state.isForbidden && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{ width: '100%' }}
- >
- {data.map(d => (
-
- ))}
-
-
-
- );
- }
-}
-
-export default withConfigContext(GroupUninstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/RoleUninstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/RoleUninstall/index.js
deleted file mode 100644
index 3d29772c25..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/RoleUninstall/index.js
+++ /dev/null
@@ -1,158 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class RoleUninstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- isForbidden: false,
- };
-
- fetchUser = value => {
- const config = this.props.context;
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- this.setState({ data: [], fetching: true });
-
- const uuid = this.props.uuid;
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/subscription/' +
- uuid +
- '/' +
- '/ROLE?',
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
-
- const data = res.data.data.roles.map(role => ({
- text: role,
- value: role,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load roles.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- });
- };
-
- uninstall = (timestamp = null) => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onUninstall('role', data, 'uninstall', timestamp);
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start uninstalling the application for one or more roles by entering
- the corresponding role name. Select uninstall to automatically start
- uninstalling the application for the respective user role/roles.
-
- {this.state.isForbidden && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{ width: '100%' }}
- >
- {data.map(d => (
-
- ))}
-
-
-
- );
- }
-}
-
-export default withConfigContext(RoleUninstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/UserUninstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/UserUninstall/index.js
deleted file mode 100644
index 5880d09f0e..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/components/UserUninstall/index.js
+++ /dev/null
@@ -1,156 +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.
- */
-
-import React from 'react';
-import { Typography, Select, Spin, Alert } from 'antd';
-import debounce from 'lodash.debounce';
-import axios from 'axios';
-import { withConfigContext } from '../../../../../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../../../../../services/utils/errorHandler';
-import InstallModalFooter from '../../../installModalFooter';
-
-const { Text } = Typography;
-const { Option } = Select;
-
-class UserUninstall extends React.Component {
- constructor(props) {
- super(props);
- this.lastFetchId = 0;
- this.fetchUser = debounce(this.fetchUser, 800);
- }
-
- state = {
- data: [],
- value: [],
- fetching: false,
- isForbidden: false,
- };
-
- fetchUser = value => {
- const config = this.props.context;
- this.lastFetchId += 1;
- const fetchId = this.lastFetchId;
- this.setState({ data: [], fetching: true });
-
- const uuid = this.props.uuid;
-
- axios
- .get(
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/subscription/' +
- uuid +
- '/' +
- '/USER?',
- )
- .then(res => {
- if (res.status === 200) {
- if (fetchId !== this.lastFetchId) {
- // for fetch callback order
- return;
- }
- const data = res.data.data.users.map(user => ({
- text: user,
- value: user,
- }));
-
- this.setState({ data, fetching: false });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while trying to load users.',
- true,
- );
- if (error.hasOwnProperty('response') && error.response.status === 403) {
- this.setState({
- isForbidden: true,
- loading: false,
- });
- } else {
- this.setState({
- loading: false,
- });
- }
- });
- };
-
- handleChange = value => {
- this.setState({
- value,
- data: [],
- fetching: false,
- });
- };
-
- uninstall = (timestamp = null) => {
- const { value } = this.state;
- const data = [];
- value.map(val => {
- data.push(val.key);
- });
- this.props.onUninstall('user', data, 'uninstall', timestamp);
- };
-
- render() {
- const { fetching, data, value } = this.state;
-
- return (
-
-
- Start uninstalling the application for one or more users by entering
- the corresponding user name. Select uninstall to automatically start
- uninstalling the application for the respective user/users.{' '}
-
- {this.state.isForbidden && (
-
- )}
-
- );
- }
-}
-
-export default withConfigContext(UserUninstall);
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/index.js
deleted file mode 100644
index f320eeed53..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/Uninstall/index.js
+++ /dev/null
@@ -1,77 +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.
- */
-import React from 'react';
-import { Modal, Spin, Tabs } from 'antd';
-import DeviceUninstall from './components/DeviceUninstall';
-import UserUninstall from './components/UserUninstall';
-import RoleUninstall from './components/RoleUninstall';
-import GroupUninstall from './components/GroupUninstall';
-
-const { TabPane } = Tabs;
-
-class Uninstall extends React.Component {
- state = {
- data: [],
- };
-
- render() {
- const { deviceType } = this.props;
- return (
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default Uninstall;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/installModalFooter/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/installModalFooter/index.js
deleted file mode 100644
index 409c27557a..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/components/installModalFooter/index.js
+++ /dev/null
@@ -1,99 +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.
- */
-
-import React from 'react';
-import { Button, DatePicker, Checkbox } from 'antd';
-
-class InstallModalFooter extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- scheduledTime: null,
- isScheduledInstallVisible: false,
- };
- }
-
- onDateTimeChange = (value, dateString) => {
- this.setState({
- scheduledTime: dateString,
- });
- };
-
- toggleScheduledInstall = () => {
- this.setState({
- isScheduledInstallVisible: !this.state.isScheduledInstallVisible,
- });
- };
-
- triggerInstallOperation = () => {
- const { scheduledTime, isScheduledInstallVisible } = this.state;
- if (isScheduledInstallVisible && scheduledTime != null) {
- this.props.operation(scheduledTime);
- } else {
- this.props.operation();
- }
- };
-
- render() {
- const { scheduledTime, isScheduledInstallVisible } = this.state;
- const { disabled, type } = this.props;
- return (
-
-
-
-
- Schedule {type}
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default InstallModalFooter;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/index.js
deleted file mode 100644
index 083e1a9542..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/scenes/Home/scenes/Apps/scenes/Release/components/ReleasePage/components/ReleaseView/index.js
+++ /dev/null
@@ -1,318 +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.
- */
-
-import React from 'react';
-import { DownOutlined } from '@ant-design/icons';
-import {
- Divider,
- Row,
- Col,
- Typography,
- Button,
- Dropdown,
- notification,
- Menu,
- Tabs,
- Tag,
-} from 'antd';
-import '../../../../../../../../../../App.css';
-import ImageViewer from './components/ImageViewer';
-import StarRatings from 'react-star-ratings';
-import axios from 'axios';
-import pSBC from 'shade-blend-color';
-import AppInstallModal from './components/Install';
-import Uninstall from './components/Uninstall';
-import { withConfigContext } from '../../../../../../../../../../components/context/ConfigContext';
-import { handleApiError } from '../../../../../../../../../../services/utils/errorHandler';
-import ReviewContainer from './components/ReviewContainer';
-import SubscriptionDetails from './components/SubscriptionDetails';
-import Authorized from '../../../../../../../../../../components/Authorized';
-
-const { Title, Text, Paragraph } = Typography;
-const { TabPane } = Tabs;
-
-class ReleaseView extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- loading: false,
- appInstallModalVisible: false,
- appUninstallModalVisible: false,
- };
- }
-
- appOperation = (type, payload, operation, timestamp = null) => {
- const config = this.props.context;
- const release = this.props.app.applicationReleases[0];
- const { uuid } = release;
- const { isAndroidEnterpriseApp } = this.props.app;
-
- this.setState({
- loading: true,
- });
- const parameters = {};
-
- let url =
- window.location.origin +
- config.serverConfig.invoker.uri +
- config.serverConfig.invoker.store +
- '/subscription/' +
- uuid +
- '/' +
- type +
- '/';
- if (isAndroidEnterpriseApp) {
- url += 'ent-app-install/'; // add ent-app-install path param for android enterprise app
- parameters.requiresUpdatingExternal = true;
- }
- url += operation; // add operation to url
- if (timestamp != null) {
- parameters.timestamp = timestamp; // add timestamp for scheduled operations
- }
-
- const queryParams = Object.keys(parameters)
- .map(key => key + '=' + parameters[key])
- .join('&');
- url += '?' + queryParams;
-
- axios
- .post(url, payload, {
- headers: { 'X-Platform': config.serverConfig.platform },
- })
- .then(res => {
- if (res.status === 200 || res.status === 201) {
- this.setState({
- loading: false,
- appInstallModalVisible: false,
- appUninstallModalVisible: false,
- });
- notification.success({
- message: 'Done!',
- description: 'Operation triggered.',
- });
- } else {
- this.setState({
- loading: false,
- });
- notification.error({
- message: 'There was a problem',
- duration: 0,
- description: 'Error occurred while ' + operation + 'ing app',
- });
- }
- })
- .catch(error => {
- handleApiError(
- error,
- 'Error occurred while ' + operation + 'ing the app.',
- );
- });
- };
-
- closeAppOperationModal = () => {
- this.setState({
- appInstallModalVisible: false,
- appUninstallModalVisible: false,
- });
- };
-
- handleSubscribeClick = e => {
- if (e.key === 'install') {
- this.setState({
- appInstallModalVisible: true, // display app install modal
- });
- } else if (e.key === 'uninstall') {
- this.setState({
- appUninstallModalVisible: true, // display app uninstall modal
- });
- }
- };
-
- render() {
- const { app, deviceType } = this.props;
- const config = this.props.context;
- const release = app.applicationReleases[0];
-
- let isKeyInclude = false;
- let metaArrayWithOutWindowsKey = [];
- let metaData = [];
- try {
- metaData = JSON.parse(release.metaData);
- // eslint-disable-next-line no-empty
- } catch (e) {}
- if (app.type !== 'WEB_CLIP' && app.hasOwnProperty('packageName')) {
- metaData.push({
- key: 'Package Name',
- value: app.packageName,
- });
- }
- const menu = (
-
- );
-
- return (
-