Change Legacy Icons to antd's v3 icons in APPM publisher

This commit is contained in:
anjula-sack 2020-07-03 18:28:41 +05:30
parent 4f8d29456b
commit 111e32e97d
9 changed files with 72 additions and 89 deletions

View File

@ -0,0 +1 @@
registry=http://nexus.entgra.io/repository/npm-group/

View File

@ -20,6 +20,7 @@
"babel-eslint": "^9.0.0", "babel-eslint": "^9.0.0",
"d3": "^5.9.7", "d3": "^5.9.7",
"dagre": "^0.8.4", "dagre": "^0.8.4",
"entgra-icons-react": "^1.0.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-import": "^2.18.2", "eslint-plugin-import": "^2.18.2",
"eslint-plugin-jsx-a11y": "^6.2.3", "eslint-plugin-jsx-a11y": "^6.2.3",
@ -59,6 +60,7 @@
"chai": "^4.1.2", "chai": "^4.1.2",
"cross-env": "^7.0.0", "cross-env": "^7.0.0",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"entgra-icons": "^1.4.0",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-config-prettier": "4.3.0", "eslint-config-prettier": "4.3.0",
"eslint-plugin-babel": "5.3.0", "eslint-plugin-babel": "5.3.0",

View File

@ -18,73 +18,69 @@
}, },
"defaultPlatformIcons": { "defaultPlatformIcons": {
"default": { "default": {
"icon": "global", "icon": "fw-globe",
"color": "#535c68", "color": "#535c68"
"theme": "outlined"
}, },
"android": { "android": {
"icon": "android", "icon": "fw-android",
"color": "#7db343", "color": "#7db343"
"theme": "filled"
}, },
"ios": { "ios": {
"icon": "apple", "icon": "fw-apple",
"color": "#535c68", "color": "#535c68"
"theme": "filled"
}, },
"windows": { "windows": {
"icon": "windows", "icon": "fw-windows",
"color": "#008cc4", "color": "#008cc4"
"theme": "filled"
} }
}, },
"lifecycle": { "lifecycle": {
"CREATED": { "CREATED": {
"title": "Created", "title": "Created",
"text": "The initial most state of an application.\n You can only proceed to one of the following states:", "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 "step": 0
}, },
"IN-REVIEW": { "IN-REVIEW": {
"title": "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.", "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 "step": 1
}, },
"APPROVED": { "APPROVED": {
"title": "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:", "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 "step": 2
}, },
"PUBLISHED": { "PUBLISHED": {
"title": "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:", "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 "step": 3
}, },
"BLOCKED": { "BLOCKED": {
"title": "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:", "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 "step": 4
}, },
"DEPRECATED": { "DEPRECATED": {
"title": "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:", "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 "step": 5
}, },
"REJECTED": { "REJECTED": {
"title": "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:", "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 "step": 6
}, },
"RETIRED": { "RETIRED": {
"title": "Retired", "title": "Retired",
"text": "The final state of an application, where no transition of states will be allowed after this.", "text": "The final state of an application, where no transition of states will be allowed after this.",
"icon": "rest", "icon": "fw-delete",
"step": 7 "step": 7
} }
}, },

View File

@ -25,9 +25,10 @@ import {
PlusOutlined, PlusOutlined,
SettingOutlined, SettingOutlined,
UserOutlined, UserOutlined,
MenuFoldOutlined,
MenuUnfoldOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Layout, Menu, Drawer, Button } from 'antd'; import { Layout, Menu, Drawer, Button } from 'antd';
import { Switch, Link } from 'react-router-dom'; import { Switch, Link } from 'react-router-dom';
import RouteWithSubRoutes from '../../components/RouteWithSubRoutes'; import RouteWithSubRoutes from '../../components/RouteWithSubRoutes';
@ -167,10 +168,11 @@ class Dashboard extends React.Component {
<Layout className="mobile-layout"> <Layout className="mobile-layout">
<div className="mobile-menu-button"> <div className="mobile-menu-button">
<Button type="link" onClick={this.showMobileNavigationBar}> <Button type="link" onClick={this.showMobileNavigationBar}>
<LegacyIcon {this.state.collapsed ? (
type={this.state.collapsed ? 'menu-fold' : 'menu-unfold'} <MenuFoldOutlined />
className="bar-icon" ) : (
/> <MenuUnfoldOutlined />
)}
</Button> </Button>
</div> </div>
</Layout> </Layout>

View File

@ -17,7 +17,6 @@
*/ */
import React from 'react'; import React from 'react';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { import {
Drawer, Drawer,
Select, Select,
@ -52,6 +51,9 @@ import {
CheckCircleOutlined, CheckCircleOutlined,
EditOutlined, EditOutlined,
MoreOutlined, MoreOutlined,
StarOutlined,
UploadOutlined,
CheckOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import DeleteApp from './components/DeleteApp'; import DeleteApp from './components/DeleteApp';
import RetireApp from './components/RetireApp'; import RetireApp from './components/RetireApp';
@ -60,13 +62,6 @@ const { Meta } = Card;
const { Text, Title } = Typography; const { Text, Title } = Typography;
const { Option } = Select; const { Option } = Select;
const IconText = ({ type, text }) => (
<span>
<LegacyIcon type={type} style={{ marginRight: 8 }} />
{text}
</span>
);
const modules = { const modules = {
toolbar: [ toolbar: [
['bold', 'italic', 'underline', 'strike', 'blockquote'], ['bold', 'italic', 'underline', 'strike', 'blockquote'],
@ -636,24 +631,15 @@ class AppDetailsDrawer extends React.Component {
description={ description={
<div <div
style={{ style={{
fontSize: '0.7em', fontSize: '0.8em',
}} }}
className="description-view" className="description-view"
> >
<IconText <CheckOutlined /> {release.currentStatus}
type="check"
text={release.currentStatus}
/>
<Divider type="vertical" /> <Divider type="vertical" />
<IconText <UploadOutlined /> {release.releaseType}
type="upload"
text={release.releaseType}
/>
<Divider type="vertical" /> <Divider type="vertical" />
<IconText <StarOutlined /> {release.rating.toFixed(1)}
type="star-o"
text={release.rating.toFixed(1)}
/>
</div> </div>
} }
/> />

View File

@ -18,7 +18,6 @@
import React from 'react'; import React from 'react';
import { CheckCircleOutlined } from '@ant-design/icons'; import { CheckCircleOutlined } from '@ant-design/icons';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { Avatar, Table, Tag, Badge, Alert, Tooltip } from 'antd'; import { Avatar, Table, Tag, Badge, Alert, Tooltip } from 'antd';
import axios from 'axios'; import axios from 'axios';
import pSBC from 'shade-blend-color'; import pSBC from 'shade-blend-color';
@ -26,6 +25,7 @@ import './styles.css';
import { withConfigContext } from '../../../../../../../../components/ConfigContext'; import { withConfigContext } from '../../../../../../../../components/ConfigContext';
import AppDetailsDrawer from './AppDetailsDrawer'; import AppDetailsDrawer from './AppDetailsDrawer';
import { handleApiError } from '../../../../../../../../services/utils/errorHandler'; import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
import { EntgraIcon } from 'entgra-icons-react';
let config = null; let config = null;
@ -140,15 +140,13 @@ const columns = [
const defaultPlatformIcons = config.defaultPlatformIcons; const defaultPlatformIcons = config.defaultPlatformIcons;
let icon = defaultPlatformIcons.default.icon; let icon = defaultPlatformIcons.default.icon;
let color = defaultPlatformIcons.default.color; let color = defaultPlatformIcons.default.color;
let theme = defaultPlatformIcons.default.theme;
if (defaultPlatformIcons.hasOwnProperty(platform)) { if (defaultPlatformIcons.hasOwnProperty(platform)) {
icon = defaultPlatformIcons[platform].icon; icon = defaultPlatformIcons[platform].icon;
color = defaultPlatformIcons[platform].color; color = defaultPlatformIcons[platform].color;
theme = defaultPlatformIcons[platform].theme;
} }
return ( return (
<span style={{ fontSize: 20, color: color, textAlign: 'center' }}> <span style={{ fontSize: 20, color: color, textAlign: 'center' }}>
<LegacyIcon type={icon} theme={theme} /> <EntgraIcon type={icon} />
</span> </span>
); );
}, },

View File

@ -17,7 +17,6 @@
*/ */
import React from 'react'; import React from 'react';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { import {
Typography, Typography,
Tag, Tag,
@ -36,7 +35,7 @@ import './styles.css';
import { withConfigContext } from '../../../../../../../../components/ConfigContext'; import { withConfigContext } from '../../../../../../../../components/ConfigContext';
import { handleApiError } from '../../../../../../../../services/utils/errorHandler'; import { handleApiError } from '../../../../../../../../services/utils/errorHandler';
import LifeCycleHistory from './components/LifeCycleHistory'; import LifeCycleHistory from './components/LifeCycleHistory';
import { EntgraIcon } from 'entgra-icons-react';
const { Text, Title, Paragraph } = Typography; const { Text, Title, Paragraph } = Typography;
const { TabPane } = Tabs; const { TabPane } = Tabs;
@ -216,7 +215,6 @@ class LifeCycle extends React.Component {
) { ) {
proceedingStates = lifecycle[currentStatus].proceedingStates; proceedingStates = lifecycle[currentStatus].proceedingStates;
} }
return ( return (
<div> <div>
<Title level={4}>Manage Lifecycle</Title> <Title level={4}>Manage Lifecycle</Title>
@ -236,10 +234,11 @@ class LifeCycle extends React.Component {
onChange={this.onChange} onChange={this.onChange}
size="small" size="small"
> >
{lifecycleSteps.map((step, index) => ( {lifecycleSteps.map((step, index) => {
return (
<Step <Step
key={index} key={index}
icon={<LegacyIcon type={step.icon} />} icon={<EntgraIcon type={step.icon} />}
title={step.title} title={step.title}
disabled={current !== step.step} disabled={current !== step.step}
description={ description={
@ -265,7 +264,8 @@ class LifeCycle extends React.Component {
) )
} }
/> />
))} );
})}
</Steps> </Steps>
</div> </div>
</TabPane> </TabPane>

View File

@ -63,7 +63,7 @@ class SingleReview extends React.Component {
); );
return ( return (
<div> <div style={{ width: '100%' }}>
<List.Item.Meta <List.Item.Meta
avatar={ avatar={
<Avatar <Avatar

View File

@ -17,7 +17,6 @@
*/ */
import React from 'react'; import React from 'react';
import { Icon as LegacyIcon } from '@ant-design/compatible';
import { ShopOutlined } from '@ant-design/icons'; import { ShopOutlined } from '@ant-design/icons';
import { Divider, Row, Col, Typography, Button, Tooltip, Alert } from 'antd'; import { Divider, Row, Col, Typography, Button, Tooltip, Alert } from 'antd';
import StarRatings from 'react-star-ratings'; import StarRatings from 'react-star-ratings';
@ -28,6 +27,7 @@ import EditRelease from './components/EditRelease';
import { withConfigContext } from '../../../../../../../../components/ConfigContext'; import { withConfigContext } from '../../../../../../../../components/ConfigContext';
import Authorized from '../../../../../../../../components/Authorized/Authorized'; import Authorized from '../../../../../../../../components/Authorized/Authorized';
import DeleteRelease from './components/DeleteRelease'; import DeleteRelease from './components/DeleteRelease';
import { EntgraIcon } from 'entgra-icons-react';
const { Title, Text, Paragraph } = Typography; const { Title, Text, Paragraph } = Typography;
@ -57,12 +57,10 @@ class ReleaseView extends React.Component {
const defaultPlatformIcons = config.defaultPlatformIcons; const defaultPlatformIcons = config.defaultPlatformIcons;
let icon = defaultPlatformIcons.default.icon; let icon = defaultPlatformIcons.default.icon;
let color = defaultPlatformIcons.default.color; let color = defaultPlatformIcons.default.color;
let theme = defaultPlatformIcons.default.theme;
if (defaultPlatformIcons.hasOwnProperty(platform)) { if (defaultPlatformIcons.hasOwnProperty(platform)) {
icon = defaultPlatformIcons[platform].icon; icon = defaultPlatformIcons[platform].icon;
color = defaultPlatformIcons[platform].color; color = defaultPlatformIcons[platform].color;
theme = defaultPlatformIcons[platform].theme;
} }
let metaData = []; let metaData = [];
try { try {
@ -91,7 +89,7 @@ class ReleaseView extends React.Component {
<br /> <br />
<Text>Platform : </Text> <Text>Platform : </Text>
<span style={{ fontSize: 20, color: color, textAlign: 'center' }}> <span style={{ fontSize: 20, color: color, textAlign: 'center' }}>
<LegacyIcon type={icon} theme={theme} /> <EntgraIcon type={icon} />
</span> </span>
<Divider type="vertical" /> <Divider type="vertical" />
<Text>Version : {release.version}</Text> <Text>Version : {release.version}</Text>
@ -154,7 +152,7 @@ class ReleaseView extends React.Component {
</Col> </Col>
</Row> </Row>
<Divider /> <Divider />
<Row className="release-images"> <Row className="release-images" style={{ flexFlow: 'nowrap' }}>
{release.screenshots.map((screenshotUrl, index) => { {release.screenshots.map((screenshotUrl, index) => {
return ( return (
<div key={index} className="release-screenshot"> <div key={index} className="release-screenshot">