From 111e32e97d147ab3bbf6b647b3049bcbd62bfa04 Mon Sep 17 00:00:00 2001 From: anjula-sack Date: Fri, 3 Jul 2020 18:28:41 +0530 Subject: [PATCH] Change Legacy Icons to antd's v3 icons in APPM publisher --- .../react-app/.npmrc | 1 + .../react-app/package.json | 2 + .../react-app/public/conf/config.json | 36 +++++----- .../react-app/src/scenes/Home/index.js | 12 ++-- .../ApssTable/AppDetailsDrawer/index.js | 28 ++------ .../AppList/components/ApssTable/index.js | 6 +- .../Release/components/LifeCycle/index.js | 66 +++++++++---------- .../Reviews/components/Review/index.js | 2 +- .../Release/components/ReleaseView/index.js | 8 +-- 9 files changed, 72 insertions(+), 89 deletions(-) create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/.npmrc diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/.npmrc b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/.npmrc new file mode 100644 index 0000000000..f7425e8e44 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/.npmrc @@ -0,0 +1 @@ +registry=http://nexus.entgra.io/repository/npm-group/ 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 593c3c385d..49eae0fc0d 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 @@ -20,6 +20,7 @@ "babel-eslint": "^9.0.0", "d3": "^5.9.7", "dagre": "^0.8.4", + "entgra-icons-react": "^1.0.0", "eslint": "^5.16.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-jsx-a11y": "^6.2.3", @@ -59,6 +60,7 @@ "chai": "^4.1.2", "cross-env": "^7.0.0", "css-loader": "^0.28.11", + "entgra-icons": "^1.4.0", "eslint": "^5.16.0", "eslint-config-prettier": "4.3.0", "eslint-plugin-babel": "5.3.0", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json index 93174ff827..de1726ce39 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/public/conf/config.json @@ -18,73 +18,69 @@ }, "defaultPlatformIcons": { "default": { - "icon": "global", - "color": "#535c68", - "theme": "outlined" + "icon": "fw-globe", + "color": "#535c68" }, "android": { - "icon": "android", - "color": "#7db343", - "theme": "filled" + "icon": "fw-android", + "color": "#7db343" }, "ios": { - "icon": "apple", - "color": "#535c68", - "theme": "filled" + "icon": "fw-apple", + "color": "#535c68" }, "windows": { - "icon": "windows", - "color": "#008cc4", - "theme": "filled" + "icon": "fw-windows", + "color": "#008cc4" } }, "lifecycle": { "CREATED": { "title": "Created", "text": "The initial most state of an application.\n You can only proceed to one of the following states:", - "icon": "file-text", + "icon": "fw-document", "step": 0 }, "IN-REVIEW": { "title": "In-Review", "text": "In this state the application is being reviewed by approvers. You can move from this state to APPROVED state if it is approved by reviewers. Otherwise, you can move the application into either REJECTED state or CREATED state based on the feedback getting by reviewers.", - "icon": "audit", + "icon": "fw-throttling-policy", "step": 1 }, "APPROVED": { "title": "Approved", "text": "The approved state is a compulsory state prior to publishing the application.\n You can only proceed to one of the following states:", - "icon": "file-done", + "icon": "fw-check", "step": 2 }, "PUBLISHED": { "title": "Published", "text": "The state which is applied for applications which are qualified for your Corporate App Store. Only the applications of Published state can be installed to your corporate devices.\n You can only proceed to one of the following states:", - "icon": "global", + "icon": "fw-globe", "step": 3 }, "BLOCKED": { "title": "Blocked", "text": "This state allows you to block your application either to publish or deprecate at a future date.\n You can only proceed to one of the following states:", - "icon": "exception", + "icon": "fw-lock", "step": 4 }, "DEPRECATED": { "title": "Deprecated", "text": "The applications which are outdated and no longer suit your app store.\n You can only proceed to one of the following states:", - "icon": "file-excel", + "icon": "fw-warning", "step": 5 }, "REJECTED": { "title": "Rejected", "text": "The Approvers can reject an application due to a faulty of the app or not being in compliance with company policies.\n You can only proceed to one of the following states:", - "icon": "frown", + "icon": "fw-error", "step": 6 }, "RETIRED": { "title": "Retired", "text": "The final state of an application, where no transition of states will be allowed after this.", - "icon": "rest", + "icon": "fw-delete", "step": 7 } }, 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 e585f75b5f..080ac912b6 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 @@ -25,9 +25,10 @@ import { PlusOutlined, SettingOutlined, UserOutlined, + MenuFoldOutlined, + MenuUnfoldOutlined, } 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'; @@ -167,10 +168,11 @@ class Dashboard 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 (