From 4f8d29456baf3742b751ece8b874014ba0fd8387 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Sun, 28 Jun 2020 14:19:23 +0530 Subject: [PATCH 1/2] Migrate APPM Publisher UI from antd v3 to v4 --- .../react-app/package.json | 3 +- .../scenes/Home/components/Logout/index.js | 5 +-- .../react-app/src/scenes/Home/index.js | 36 ++++++++++++------- .../components/NewAppDetailsForm/index.js | 4 ++- .../components/NewAppUploadForm/index.js | 13 +++---- .../components/AddNewAppForm/index.js | 4 ++- .../scenes/AddNewApp/scenes/Custom/index.js | 5 +-- .../AddNewApp/scenes/Enterprise/index.js | 5 +-- .../scenes/AddNewApp/scenes/Public/index.js | 5 +-- .../scenes/AddNewApp/scenes/WebClip/index.js | 5 +-- .../components/AddNewReleaseForm/index.js | 4 ++- .../scenes/Home/scenes/AddNewRelease/index.js | 5 +-- .../ApssTable/AppDetailsDrawer/index.js | 19 +++++----- .../AppList/components/ApssTable/index.js | 9 ++--- .../AppList/components/Filters/index.js | 25 ++++++------- .../Apps/components/DetailedRating/index.js | 5 +-- .../components/lifeCycleDetailsModal/index.js | 7 +++- .../Release/components/LifeCycle/index.js | 4 +-- .../components/DeleteRelease/index.js | 5 +-- .../components/EditRelease/index.js | 20 +++++++---- .../Release/components/ReleaseView/index.js | 17 +++------ .../Manage/components/Categories/index.js | 11 +++--- .../scenes/Manage/components/Tags/index.js | 11 +++--- .../src/scenes/Home/scenes/Manage/index.js | 5 +-- .../components/Pages/index.js | 6 ++-- .../components/SyncAndroidApps/index.js | 3 +- .../Manage/scenes/AndroidEnterprise/index.js | 5 +-- .../components/AddAppsToClusterModal/index.js | 5 +-- .../scenes/Page/components/Cluster/index.js | 21 +++++++---- .../AndroidEnterprise/scenes/Page/index.js | 6 ++-- .../react-app/src/scenes/Login/index.js | 9 ++--- 31 files changed, 164 insertions(+), 123 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json index df1743f096..593c3c385d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/package.json @@ -10,11 +10,12 @@ }, "license": "Apache License 2.0", "dependencies": { + "@ant-design/compatible": "^1.0.0", "@ant-design/dark-theme": "^0.2.2", "@ant-design/icons": "^4.0.6", "@babel/polyfill": "^7.6.0", "acorn": "^6.2.0", - "antd": "^3.23.6", + "antd": "^4.0.0", "axios": "^0.19.0", "babel-eslint": "^9.0.0", "d3": "^5.9.7", 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 index 1d94718fd1..f41e654bcc 100644 --- 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 @@ -17,7 +17,8 @@ */ import React from 'react'; -import { notification, Menu, Icon } from 'antd'; +import { LogoutOutlined } from '@ant-design/icons'; +import { notification, Menu } from 'antd'; import axios from 'axios'; import { withConfigContext } from '../../../../components/ConfigContext'; @@ -70,7 +71,7 @@ class Logout extends React.Component { return ( - + 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 index 983e74c07b..e585f75b5f 100644 --- 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 @@ -17,7 +17,18 @@ */ import React from 'react'; -import { Layout, Menu, Icon, Drawer, Button } from 'antd'; + +import { + AndroidFilled, + AppstoreOutlined, + ControlOutlined, + PlusOutlined, + SettingOutlined, + UserOutlined, +} from '@ant-design/icons'; + +import { Icon as LegacyIcon } from '@ant-design/compatible'; +import { Layout, Menu, Drawer, Button } from 'antd'; import { Switch, Link } from 'react-router-dom'; import RouteWithSubRoutes from '../../components/RouteWithSubRoutes'; import { Redirect } from 'react-router'; @@ -81,7 +92,7 @@ class Dashboard extends React.Component { > - + Apps @@ -92,7 +103,7 @@ class Dashboard extends React.Component { - + Add New App } @@ -118,21 +129,20 @@ class Dashboard extends React.Component { - + Manage } > - General + General {this.config.androidEnterpriseToken != null && ( - Android - Enterprise + Android Enterprise )} @@ -142,7 +152,7 @@ class Dashboard extends React.Component { className="profile" title={ - + {this.config.username} } @@ -157,7 +167,7 @@ class Dashboard extends React.Component {
)} , @@ -577,7 +578,7 @@ class NewAppUploadForm extends React.Component {
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/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/index.js index 29d6756157..32b5031d6a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/scenes/Home/scenes/Apps/components/AppList/components/ApssTable/AppDetailsDrawer/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/index.js @@ -17,7 +17,6 @@ */ import React from 'react'; -import { Icon as LegacyIcon } from '@ant-design/compatible'; import { Drawer, Select, @@ -52,6 +51,9 @@ import { CheckCircleOutlined, EditOutlined, MoreOutlined, + StarOutlined, + UploadOutlined, + CheckOutlined, } from '@ant-design/icons'; import DeleteApp from './components/DeleteApp'; import RetireApp from './components/RetireApp'; @@ -60,13 +62,6 @@ const { Meta } = Card; const { Text, Title } = Typography; const { Option } = Select; -const IconText = ({ type, text }) => ( - - - {text} - -); - const modules = { toolbar: [ ['bold', 'italic', 'underline', 'strike', 'blockquote'], @@ -636,24 +631,15 @@ class AppDetailsDrawer extends React.Component { description={
- + {release.currentStatus} - + {release.releaseType} - + {release.rating.toFixed(1)}
} /> 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 index f5d4adbd64..48fa42e395 100644 --- 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 @@ -18,7 +18,6 @@ import React from 'react'; import { CheckCircleOutlined } from '@ant-design/icons'; -import { Icon as LegacyIcon } from '@ant-design/compatible'; import { Avatar, Table, Tag, Badge, Alert, Tooltip } from 'antd'; import axios from 'axios'; import pSBC from 'shade-blend-color'; @@ -26,6 +25,7 @@ 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; @@ -140,15 +140,13 @@ const columns = [ const defaultPlatformIcons = config.defaultPlatformIcons; let icon = defaultPlatformIcons.default.icon; let color = defaultPlatformIcons.default.color; - let theme = defaultPlatformIcons.default.theme; if (defaultPlatformIcons.hasOwnProperty(platform)) { icon = defaultPlatformIcons[platform].icon; color = defaultPlatformIcons[platform].color; - theme = defaultPlatformIcons[platform].theme; } return ( - + ); }, 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 index 5e49f8eec2..4e715f0d87 100644 --- 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 @@ -17,7 +17,6 @@ */ import React from 'react'; -import { Icon as LegacyIcon } from '@ant-design/compatible'; import { Typography, Tag, @@ -36,7 +35,7 @@ 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; @@ -216,7 +215,6 @@ class LifeCycle extends React.Component { ) { proceedingStates = lifecycle[currentStatus].proceedingStates; } - return (
Manage Lifecycle @@ -236,36 +234,38 @@ class LifeCycle extends React.Component { onChange={this.onChange} size="small" > - {lifecycleSteps.map((step, index) => ( - } - title={step.title} - disabled={current !== step.step} - description={ - current === step.step && ( -
-

{step.text}

- {proceedingStates.map(lifecycleState => { - return ( - - ); - })} -
- ) - } - /> - ))} + {lifecycleSteps.map((step, index) => { + return ( + } + title={step.title} + disabled={current !== step.step} + description={ + current === step.step && ( +
+

{step.text}

+ {proceedingStates.map(lifecycleState => { + return ( + + ); + })} +
+ ) + } + /> + ); + })}
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 index 5573bfdd73..7dbd0139b7 100644 --- 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 @@ -63,7 +63,7 @@ class SingleReview extends React.Component { ); return ( -
+
Platform : - + Version : {release.version} @@ -154,7 +152,7 @@ class ReleaseView extends React.Component { - + {release.screenshots.map((screenshotUrl, index) => { return (