From 60ac2b649550a1e700730bdc7229282cc34060fc Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Wed, 10 Jul 2019 22:37:08 +0530 Subject: [PATCH 1/4] Add configuration to change theme color in APPM publisher UI --- .../react-app/public/conf/config.json | 16 ++++++-- .../react-app/src/App.css | 4 +- .../react-app/src/App.js | 2 +- .../src/components/apps/list-apps/Filters.js | 33 +++++++++++---- .../apps/list-apps/appsTable/AppsTable.js | 4 +- .../src/components/new-app/AddNewAppForm.js | 2 +- .../src/pages/dashboard/Dashboard.js | 15 ++++--- .../add-new-app/AddNewEnterpriseApp.js | 1 - .../dashboard/add-new-app/AddNewPublicApp.js | 2 +- .../dashboard/add-new-app/AddNewWebClip.js | 2 +- .../add-new-release/AddNewRelease.js | 2 +- .../src/pages/dashboard/apps/Apps.js | 2 +- .../src/pages/dashboard/manage/Manage.js | 2 +- .../react-app/webpack.config.js | 41 +++++++++++-------- 14 files changed, 82 insertions(+), 46 deletions(-) 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 1411e8bef68..1a98c1a6dc7 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,16 +18,24 @@ }, "defaultPlatformIcons": { "default": { - "icon": "mobile", - "color": "#535c68" + "icon": "global", + "color": "#535c68", + "theme": "outlined" }, "android": { "icon": "android", - "color": "#7db343" + "color": "#7db343", + "theme": "filled" }, "ios": { "icon": "apple", - "color": "#535c68" + "color": "#535c68", + "theme": "filled" + }, + "windows": { + "icon": "windows", + "color": "#008cc4", + "theme": "filled" } } } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css index 048a7eb7ab4..94ce220af49 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css @@ -21,14 +21,14 @@ padding: 5px; } -.logo { +.logo-image { width: 120px; height: 31px; margin: 0 0 16px 20px; float: left; } -.logo img{ +.logo-image img{ height: 35px; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js index 2f6d2d164ff..76e9922736d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +import "antd/dist/antd.less"; import RouteWithSubRoutes from "./components/RouteWithSubRoutes"; import { BrowserRouter as Router, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js index 43b1d36274c..01609175641 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js @@ -1,5 +1,5 @@ import React from "react"; -import {Avatar, Card, Col, Row, Table, Typography, Input, Divider, Checkbox, Select, Button, Form, message} from "antd"; +import {Avatar, Card, Col, Row, Table, Typography, Input, Divider, Icon, Select, Button, Form, message, Radio} from "antd"; import axios from "axios"; import config from "../../../../public/conf/config.json"; @@ -26,10 +26,17 @@ class FiltersForm extends React.Component { } } - if(values.hasOwnProperty("deviceType") && values.deviceType==="all"){ + if(values.hasOwnProperty("deviceType") && values.deviceType==="ALL"){ delete values["deviceType"]; } + if(values.hasOwnProperty("subscriptionType") && values.subscriptionType==="ALL"){ + delete values["subscriptionType"]; + } + if(values.hasOwnProperty("appType") && values.appType==="ALL"){ + delete values["appType"]; + } + this.props.setFilters(values); }); }; @@ -152,6 +159,15 @@ class FiltersForm extends React.Component { + + {getFieldDecorator('serach', {})( + } + placeholder="Username" + />, + )} + + {getFieldDecorator('categories', { rules: [{ @@ -202,8 +218,7 @@ class FiltersForm extends React.Component { }) } )} @@ -244,6 +259,7 @@ class FiltersForm extends React.Component { + )} @@ -251,10 +267,11 @@ class FiltersForm extends React.Component { {getFieldDecorator('subscriptionType', {})( - - Free
- Paid
-
, + + Free + Paid + All + , )}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js index df1182da04a..29e1207ad00 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js @@ -45,12 +45,14 @@ 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 () + theme={theme}/>) } }, { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js index c8f67e8b456..10f8482934e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import { Card, Button, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js index 85a7fa6c08e..108bc123fef 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js @@ -21,9 +21,9 @@ class Dashboard extends React.Component { return (
-
-
- +
+
+ logo
} > - Public APP - Enterprise APP - Web Clip + Public + APP + Enterprise + APP + Web + Clip Manage diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js index d6245bd10fb..cfa062f84d3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js @@ -1,5 +1,4 @@ import React from "react"; -import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js index f1750074999..4d4f70558d1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js index 9f1a459f0e4..09e723afb76 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js index 03d52ef4666..af92c42f423 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js index bac349fe2f8..edf28b49bb7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import {PageHeader, Typography,Input, Button, Row, Col} from "antd"; import ListApps from "../../../components/apps/list-apps/ListApps"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js index b69e3237772..40c628b3b25 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +//import "antd/dist/antd.css"; import {PageHeader, Typography, Input, Button, Row, Col} from "antd"; import ManageCategories from "../../../components/manage/categories/ManageCategories"; import ManageTags from "../../../components/manage/categories/ManageTags"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js index c1724e9a8c0..127a2df2611 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js @@ -48,7 +48,7 @@ const config = { use: [ { loader: "html-loader", - options: { minimize: true } + options: {minimize: true} } ] }, @@ -59,7 +59,7 @@ const config = { { test: /\.scss$/, use: [ - MiniCssExtractPlugin.loader, + MiniCssExtractPlugin.loader, "css-loader", "postcss-loader", "sass-loader" @@ -67,7 +67,7 @@ const config = { }, { test: /\.scss$/, - use: [ 'style-loader', 'scss-loader' ] + use: ['style-loader', 'scss-loader'] }, { test: /\.less$/, @@ -77,14 +77,21 @@ const config = { }, { loader: "css-loader", - options: { - sourceMap: true, - modules: true, - localIdentName: "[local]___[hash:base64:5]" - } + // options: { + // sourceMap: true, + // modules: true, + // localIdentName: "[local]___[hash:base64:5]" + // } }, { - loader: "less-loader" + loader: "less-loader", + options: { + modifyVars: { + 'primary-color': '#1890ff', + 'link-color': '#1890ff', + }, + javascriptEnabled: true, + }, } ] }, @@ -95,16 +102,16 @@ const config = { { test: /\.(png|jpe?g)/i, use: [ - { - loader: "url-loader", + { + loader: "url-loader", options: { - name: "./img/[name].[ext]", - limit: 10000 + name: "./img/[name].[ext]", + limit: 10000 } - }, - { - loader: "img-loader" - } + }, + { + loader: "img-loader" + } ] } ] From c65c0fb094b22012b13b2c1c6fb47759543fa6b7 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 11 Jul 2019 15:39:13 +0530 Subject: [PATCH 2/4] Fix Theme change issues in publisher UI --- .../react-app/package.json | 1 + .../react-app/public/conf/config.json | 4 ++- .../react-app/src/App.css | 4 +-- .../AppDetailsDrawer/AppDetailsDrawer.js | 9 +++--- .../apps/list-apps/appsTable/AppsTable.js | 3 +- .../manage/categories/ManageCategories.js | 9 +++--- .../manage/categories/ManageTags.js | 8 ++--- .../react-app/src/pages/Login.js | 29 ++++++++++++++----- .../react-app/src/pages/Login.less | 3 +- .../src/pages/dashboard/Dashboard.js | 11 ++++--- .../add-new-app/AddNewEnterpriseApp.js | 10 +++---- .../dashboard/add-new-app/AddNewPublicApp.js | 8 ++--- .../dashboard/add-new-app/AddNewWebClip.js | 8 ++--- .../src/pages/dashboard/manage/Manage.js | 22 +++++++------- .../react-app/webpack.config.js | 5 ++-- 15 files changed, 77 insertions(+), 57 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 62810cf4b12..df3708acca1 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 @@ -29,6 +29,7 @@ "react-scripts": "2.1.8", "react-star-ratings": "^2.3.0", "redux-thunk": "^2.3.0", + "shade-blend-color": "^1.0.0", "storm-react-diagrams": "^5.2.1" }, "devDependencies": { 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 1a98c1a6dc7..fcea32d7295 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 @@ -1,7 +1,9 @@ { "theme": { "type": "default", - "value": "lightBaseTheme" + "value": "lightBaseTheme", + "logo" : "https://www.brandchannel.com/wp-content/uploads/2016/05/instagram-new-logo-may-2016.jpg", + "primaryColor": "#F62459" }, "serverConfig": { "protocol": "https", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css index 94ce220af49..f4f68f0f707 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/App.css @@ -22,9 +22,9 @@ } .logo-image { - width: 120px; + /*width: 120px;*/ height: 31px; - margin: 0 0 16px 20px; + margin: 0 5px 16px 24px; float: left; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js index 64bbaca6b13..d9eed2d6991 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js @@ -24,6 +24,7 @@ import config from "../../../../../public/conf/config.json"; import ReactQuill from "react-quill"; import ReactHtmlParser, {processNodes, convertNodeToElement, htmlparser2} from 'react-html-parser'; import "./AppDetailsDrawer.css"; +import pSBC from "shade-blend-color"; const {Text, Title} = Typography; const {Option} = Select; @@ -456,7 +457,7 @@ class AppDetailsDrawer extends React.Component { {!isDescriptionEditEnabled && ( @@ -492,7 +493,7 @@ class AppDetailsDrawer extends React.Component { Categories {!isCategoriesEditEnabled && ( @@ -525,7 +526,7 @@ class AppDetailsDrawer extends React.Component { { categories.map(category => { return ( - + {category} ); @@ -537,7 +538,7 @@ class AppDetailsDrawer extends React.Component { Tags {!isTagsEditEnabled && ( diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js index 29e1207ad00..033c05cd85c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js @@ -1,6 +1,7 @@ import React from "react"; import {Avatar, Card, Col, Row, Table, Typography, Tag, Icon, message} from "antd"; import axios from "axios"; +import pSBC from 'shade-blend-color'; import config from "../../../../../public/conf/config.json"; import "./AppsTable.css"; @@ -30,7 +31,7 @@ const columns = [ {categories.map(category => { return ( - + {category} ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js index 7b6fe35f754..6edc414cbcb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js @@ -3,6 +3,7 @@ import {Card, Tag, message, Icon, Input, notification, Divider, Button, Spin, To import axios from "axios"; import config from "../../../../public/conf/config.json"; import {TweenOneGroup} from 'rc-tween-one'; +import pSBC from "shade-blend-color"; class ManageCategories extends React.Component { @@ -95,14 +96,14 @@ class ManageCategories extends React.Component { const categoryName = category.categoryName; const tagElem = ( {categoryName} { this.openEditModal(categoryName) - }} style={{color: 'rgba(0,0,0,0.45)'}} type="edit"/> + }} type="edit"/> @@ -122,7 +123,7 @@ class ManageCategories extends React.Component { okText="Yes" cancelText="No" > - + @@ -306,7 +307,7 @@ class ManageCategories extends React.Component { const categoriesElements = categories.map(this.renderElement); const temporaryElements = tempElements.map(this.renderTempElement); return ( -
+
{!isAddNewVisible && diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js index a815bdb78d3..e2a7e14993e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js @@ -98,14 +98,14 @@ class ManageTags extends React.Component { const tagName = tag.tagName; const tagElem = ( {tagName} { this.openEditModal(tagName) - }} style={{color: 'rgba(0,0,0,0.45)'}} type="edit"/> + }} type="edit"/> @@ -125,7 +125,7 @@ class ManageTags extends React.Component { okText="Yes" cancelText="No" > - + @@ -307,7 +307,7 @@ class ManageTags extends React.Component { const tagsElements = tags.map(this.renderElement); const temporaryElements = tempElements.map(this.renderTempElement); return ( -
+
{!isAddNewVisible && diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js index 48701cf09df..32104673fbe 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js @@ -11,15 +11,30 @@ class Login extends React.Component { render() { return (
-
+
- + + + + - - + + - Login + Login @@ -42,7 +57,7 @@ class NormalLoginForm extends React.Component { super(props); this.state = { inValid: false, - loading : false + loading: false }; } @@ -65,7 +80,7 @@ class NormalLoginForm extends React.Component { const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname+':'+config.serverConfig.httpsPort+config.serverConfig.loginUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.loginUri, request ).then(res => { if (res.status === 200) { window.location = res.data.url; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less index f04eeb84c86..4d0606375a8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less @@ -17,14 +17,13 @@ } - .content{ padding-top: 128px; } .logo{ + margin-top: 36px; height: 44px; - margin: auto; width: 100%; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js index 108bc123fef..4f82e49fbe6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js @@ -1,10 +1,11 @@ import React from "react"; import {Layout, Menu, Icon} from 'antd'; -import Logo from "../../../public/images/logo.svg"; +// import Logo from "../../../public/images/logo.svg"; import {Switch, Link} from "react-router-dom"; import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" import {Redirect} from 'react-router' import "../../App.css"; +import config from "../../../public/conf/config.json"; const {Header, Content, Footer} = Layout; const {SubMenu} = Menu; @@ -15,6 +16,8 @@ class Dashboard extends React.Component { this.state = { routes: props.routes }; + + this.Logo = config.theme.logo; } render() { @@ -22,8 +25,8 @@ class Dashboard extends React.Component {
-
- logo +
+ logo
- + {this.state.routes.map((route) => ( diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js index cfa062f84d3..085f6592a36 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewEnterpriseApp.js @@ -10,7 +10,7 @@ const Paragraph = Typography; const formConfig = { installationType: "ENTERPRISE", endpoint: "/ent-app", - jsonPayloadName:"application", + jsonPayloadName: "application", releaseWrapperName: "entAppReleaseWrappers", specificElements: { binaryFile: { @@ -41,11 +41,9 @@ class AddNewEnterpriseApp extends React.Component { title="Add New Enterprise App" >
-
- - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. - -
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js index 4d4f70558d1..e6aa2845741 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js @@ -45,11 +45,9 @@ class AddNewEnterpriseApp extends React.Component { title="Add New Public App" >
-
- - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. - -
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js index 09e723afb76..a2803091595 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js @@ -45,11 +45,9 @@ class AddNewEnterpriseApp extends React.Component { title="Add New Web Clip" >
-
- - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. - -
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js index 40c628b3b25..d550bf206f0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js @@ -36,21 +36,23 @@ class Manage extends React.Component {
-
- - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. - -
+ + Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempo. +
- -
- - + + + + + + + +
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js index 127a2df2611..f32cbd8a01b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js @@ -18,6 +18,7 @@ var path = require('path'); const HtmlWebPackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const configurations = require("./public/conf/config.json"); const config = { devtool: "source-map", @@ -87,8 +88,8 @@ const config = { loader: "less-loader", options: { modifyVars: { - 'primary-color': '#1890ff', - 'link-color': '#1890ff', + 'primary-color': configurations.theme.primaryColor, + 'link-color': configurations.theme.primaryColor, }, javascriptEnabled: true, }, From e5e7dc5bcc508f6a3a4729dad736319545b29a16 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Thu, 11 Jul 2019 17:49:28 +0530 Subject: [PATCH 3/4] Add theming feature to store --- .../react-app/public/conf/config.json | 4 +- .../src/components/new-app/AddNewAppForm.js | 1 - .../react-app/src/pages/Login.css | 44 ++++++++++++++++ .../react-app/src/pages/Login.js | 21 ++++---- .../react-app/src/pages/Login.less | 33 ------------ .../src/pages/dashboard/Dashboard.js | 1 - .../dashboard/add-new-app/AddNewPublicApp.js | 1 - .../dashboard/add-new-app/AddNewWebClip.js | 1 - .../add-new-release/AddNewRelease.js | 1 - .../src/pages/dashboard/apps/Apps.js | 1 - .../src/pages/dashboard/manage/Manage.js | 1 - .../react-app/webpack.config.js | 7 +-- .../react-app/package.json | 50 +++++++++---------- .../react-app/public/conf/config.json | 4 +- .../react-app/src/App.css | 19 ++++--- .../react-app/src/App.js | 3 +- .../react-app/src/pages/Login.css | 44 ++++++++++++++++ .../react-app/src/pages/Login.js | 36 ++++++++----- .../react-app/src/pages/Login.less | 34 ------------- .../src/pages/dashboard/Dashboard.js | 19 ++++--- .../pages/dashboard/add-new-app/AddNewApp.js | 1 - .../src/pages/dashboard/apps/Apps.js | 1 - .../react-app/webpack.config.js | 17 ++++--- 23 files changed, 181 insertions(+), 163 deletions(-) create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.css delete mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less create mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.css delete mode 100644 components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.less 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 fcea32d7295..4a5890600e6 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 @@ -2,8 +2,8 @@ "theme": { "type": "default", "value": "lightBaseTheme", - "logo" : "https://www.brandchannel.com/wp-content/uploads/2016/05/instagram-new-logo-may-2016.jpg", - "primaryColor": "#F62459" + "logo" : "https://entgra.io/assets/images/svg/logo.svg", + "primaryColor": "rgb(24, 144, 255)" }, "serverConfig": { "protocol": "https", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js index 10f8482934e..74856e99b81 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import { Card, Button, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.css new file mode 100644 index 00000000000..66accd6913f --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.css @@ -0,0 +1,44 @@ +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) scale(1.0); + } + 100% { + -moz-transform: rotate(360deg) scale(0.1); + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) scale(1.0); + } + 100% { + -webkit-transform: rotate(360deg) scale(0.1); + } +} + +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg) scale(1.0); + } + 100% { + -webkit-transform: rotate(360deg) scale(0.1); + transform: rotate(360deg) scale(0.1); + } +} + +.background { + position: absolute; + height: 100%; + width: 100%; + z-index: 0; + background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); + background-repeat: no-repeat; + background-position: center 110px; + background-size: 100%; + animation: spin 200s infinite linear; +} + +.content { + position: relative; + z-index: 1; +} \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js index 32104673fbe..c13c1d98271 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js @@ -1,8 +1,9 @@ import React from "react"; import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd'; -import styles from './Login.less'; +import './Login.css'; import axios from 'axios'; import config from "../../public/conf/config.json"; +import "./Login.css"; const {Title} = Typography; const {Text} = Typography; @@ -10,14 +11,12 @@ const {Text} = Typography; class Login extends React.Component { render() { return ( -
-
+
+
+
+
@@ -31,7 +30,7 @@ class Login extends React.Component { height: 60 } } - className={styles.logo} src={config.theme.logo}/> + src={config.theme.logo}/> Login @@ -122,7 +121,7 @@ class NormalLoginForm extends React.Component { {getFieldDecorator('password', { rules: [{required: true, message: 'Please input your Password!'}], })( - } type="password" placeholder="Password"/> )} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less deleted file mode 100644 index 4d0606375a8..00000000000 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.less +++ /dev/null @@ -1,33 +0,0 @@ -@nice-blue: #5B83AD; -@light-blue: @nice-blue + #111; - -.header { - color: @nice-blue; -} - -.main{ - background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); - background-repeat: no-repeat; - background-position: center 110px; - background-size: 100%; - - .header { - color: @nice-blue; - } - - -} -.content{ - padding-top: 128px; -} - -.logo{ - margin-top: 36px; - height: 44px; - width: 100%; - -} - -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/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js index 4f82e49fbe6..ec1ae9affd4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/Dashboard.js @@ -1,6 +1,5 @@ import React from "react"; import {Layout, Menu, Icon} from 'antd'; -// import Logo from "../../../public/images/logo.svg"; import {Switch, Link} from "react-router-dom"; import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" import {Redirect} from 'react-router' diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js index e6aa2845741..37083f4921b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewPublicApp.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js index a2803091595..f1aaf13f557 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-app/AddNewWebClip.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js index af92c42f423..3578dca6331 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/add-new-release/AddNewRelease.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import { PageHeader, Typography diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js index edf28b49bb7..9c6848d5f8c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/Apps.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import {PageHeader, Typography,Input, Button, Row, Col} from "antd"; import ListApps from "../../../components/apps/list-apps/ListApps"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js index d550bf206f0..236d06c2f29 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/manage/Manage.js @@ -1,5 +1,4 @@ import React from "react"; -//import "antd/dist/antd.css"; import {PageHeader, Typography, Input, Button, Row, Col} from "antd"; import ManageCategories from "../../../components/manage/categories/ManageCategories"; import ManageTags from "../../../components/manage/categories/ManageTags"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js index f32cbd8a01b..9e08e099242 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/webpack.config.js @@ -23,7 +23,7 @@ const configurations = require("./public/conf/config.json"); const config = { devtool: "source-map", output: { - publicPath: '/publisher/' // <---- this + publicPath: '/publisher/' }, watch: false, resolve: { @@ -78,11 +78,6 @@ const config = { }, { loader: "css-loader", - // options: { - // sourceMap: true, - // modules: true, - // localIdentName: "[local]___[hash:base64:5]" - // } }, { loader: "less-loader", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json index 24acd03ce48..77dc59124d4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/package.json @@ -10,24 +10,22 @@ }, "license": "Apache License 2.0", "dependencies": { - "acorn": "^6.1.1", - "antd": "^3.15.0", - "axios": "^0.18.0", - "d3": "^5.9.2", + "acorn": "^6.2.0", + "antd": "^3.20.1", + "axios": "^0.18.1", + "d3": "^5.9.7", "dagre": "^0.8.4", "javascript-time-ago": "^2.0.1", "keymirror": "^0.1.1", "lodash.debounce": "^4.0.8", "rc-viewer": "0.0.9", - "react": "^16.8.4", - "react-d3-graph": "^2.0.2", - "react-dom": "^16.8.4", + "react-d3-graph": "^2.1.0", "react-highlight-words": "^0.16.0", "react-image-viewer-zoom": "^1.0.36", "react-infinite-scroller": "^1.2.4", - "react-router": "latest", - "react-router-config": "^5.0.0", - "react-router-dom": "latest", + "react-router": "^5.0.1", + "react-router-config": "^5.0.1", + "react-router-dom": "^5.0.1", "react-scripts": "2.1.8", "react-star-ratings": "^2.3.0", "react-twemoji": "^0.2.3", @@ -36,16 +34,16 @@ "storm-react-diagrams": "^5.2.1" }, "devDependencies": { - "@babel/core": "^7.0.0", - "@babel/plugin-proposal-class-properties": "^7.0.0", - "@babel/preset-env": "^7.0.0", + "@babel/core": "^7.5.4", + "@babel/plugin-proposal-class-properties": "^7.5.0", + "@babel/preset-env": "^7.5.4", "@babel/preset-react": "^7.0.0", - "@babel/register": "^7.0.0", - "babel-loader": "^8.0.0", - "body-parser": "^1.18.3", + "@babel/register": "^7.4.4", + "babel-loader": "^8.0.6", + "body-parser": "^1.19.0", "chai": "^4.1.2", "css-loader": "^0.28.11", - "express": "^4.16.4", + "express": "^4.17.1", "express-pino-logger": "^4.0.0", "file-loader": "^2.0.0", "html-loader": "^0.5.5", @@ -58,20 +56,20 @@ "mocha": "^5.2.0", "mock-local-storage": "^1.0.5", "node-env-run": "^3.0.2", - "node-sass": "^4.11.0", - "nodemon": "^1.18.9", + "node-sass": "^4.12.0", + "nodemon": "^1.19.1", "npm-run-all": "^4.1.5", - "pino-colada": "^1.4.4", + "pino-colada": "^1.4.5", "postcss-loader": "^3.0.0", - "react": "^15.6.2", - "react-dom": "^15.6.2", - "react-intl": "^2.4.0", + "react": "^16.8.6", + "react-dom": "^16.8.6", + "react-intl": "^2.9.0", "sass-loader": "^6.0.7", "style-loader": "^0.18.2", "url-loader": "^1.1.2", - "webpack": "^4.27.1", - "webpack-cli": "^3.1.2", - "webpack-dev-server": "^3.1.10" + "webpack": "^4.35.3", + "webpack-cli": "^3.3.5", + "webpack-dev-server": "^3.7.2" }, "scripts": { "start": "webpack-dev-server --mode development --open", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json index b9c5fe6266b..ac90b4874d1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/public/conf/config.json @@ -1,7 +1,9 @@ { "theme": { "type": "default", - "value": "lightBaseTheme" + "value": "lightBaseTheme", + "logo" : "https://entgra.io/assets/images/svg/logo.svg", + "primaryColor": "rgb(24, 144, 255)" }, "serverConfig": { "protocol": "https", diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.css index 1e8064d0d9b..f4f68f0f707 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.css +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.css @@ -2,16 +2,15 @@ height: 170px; } -.release-icon img{ - width: 100%; - border-radius: 28%; -} .release .release-icon{ margin-right: 15px; } -.appCard .release-icon{ - margin-bottom: 10px; + +.release .release-icon img{ + width: 100%; + border-radius: 28%; } + .release .release-title{ margin-left: 15px; } @@ -22,14 +21,14 @@ padding: 5px; } -.logo { - width: 120px; +.logo-image { + /*width: 120px;*/ height: 31px; - margin: 0 0 16px 20px; + margin: 0 5px 16px 24px; float: left; } -.logo img{ +.logo-image img{ height: 35px; } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js index 898b67496f7..2b6921e0953 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/App.js @@ -1,5 +1,5 @@ import React from "react"; -import "antd/dist/antd.css"; +import "antd/dist/antd.less"; import RouteWithSubRoutes from "./components/RouteWithSubRoutes"; import { BrowserRouter as Router, @@ -15,7 +15,6 @@ class App extends React.Component { } render() { - // console.log(this.routes); return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.css new file mode 100644 index 00000000000..c5520cd7929 --- /dev/null +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.css @@ -0,0 +1,44 @@ +@-moz-keyframes spin { + 0% { + -moz-transform: rotate(0deg) scale(1.0); + } + 100% { + -moz-transform: rotate(360deg) scale(0.1); + } +} + +@-webkit-keyframes spin { + 0% { + -webkit-transform: rotate(0deg) scale(1.0); + } + 100% { + -webkit-transform: rotate(360deg) scale(0.1); + } +} + +@keyframes spin { + 0% { + -webkit-transform: rotate(0deg) scale(1.0); + } + 100% { + -webkit-transform: rotate(360deg) scale(0.1); + transform: rotate(360deg) scale(0.1); + } +} + +.background { + position: absolute; + height: 100%; + width: 100%; + z-index: 0; + background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); + background-repeat: no-repeat; + background-position: center 110px; + background-size: 100%; + animation: spin 200s infinite linear; +} + +.content { + position: relative; + z-index: 1; +} \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.js index fbdb202364d..b480b5e584d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.js @@ -1,6 +1,6 @@ import React from "react"; import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd'; -import styles from './Login.less'; +import './Login.css'; import axios from 'axios'; import config from "../../public/conf/config.json"; @@ -10,16 +10,27 @@ const {Text} = Typography; class Login extends React.Component { render() { return ( -
-
+
+
+
+
- + + + + - - + + - Login + Login @@ -42,7 +53,7 @@ class NormalLoginForm extends React.Component { super(props); this.state = { inValid: false, - loading : false + loading: false }; } @@ -65,10 +76,10 @@ class NormalLoginForm extends React.Component { const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); - axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname+':'+config.serverConfig.httpsPort+config.serverConfig.loginUri, request + axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.loginUri, request ).then(res => { if (res.status === 200) { - window.location = config.serverConfig.protocol + "://"+config.serverConfig.hostname+':'+config.serverConfig.httpsPort+"/store"; + window.location = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + "/store"; } }).catch(function (error) { if (error.response.status === 400) { @@ -99,7 +110,8 @@ class NormalLoginForm extends React.Component { {getFieldDecorator('username', { rules: [{required: true, message: 'Please input your username!'}], })( - } + } placeholder="Username"/> )} @@ -107,7 +119,7 @@ class NormalLoginForm extends React.Component { {getFieldDecorator('password', { rules: [{required: true, message: 'Please input your Password!'}], })( - } type="password" placeholder="Password"/> )} diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.less b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.less deleted file mode 100644 index f04eeb84c86..00000000000 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/Login.less +++ /dev/null @@ -1,34 +0,0 @@ -@nice-blue: #5B83AD; -@light-blue: @nice-blue + #111; - -.header { - color: @nice-blue; -} - -.main{ - background-image: url('https://gw.alipayobjects.com/zos/rmsportal/TVYTbAXWheQpRcWDaDMu.svg'); - background-repeat: no-repeat; - background-position: center 110px; - background-size: 100%; - - .header { - color: @nice-blue; - } - - -} - -.content{ - padding-top: 128px; -} - -.logo{ - height: 44px; - margin: auto; - width: 100%; - -} - -input{ - min-height: 0; -} \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js index 55c99248581..9c2682904b9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/Dashboard.js @@ -1,13 +1,11 @@ import React from "react"; import {Layout, Menu, Icon} from 'antd'; - const {Header, Content, Footer} = Layout; - -import Logo from "../../../public/images/logo.svg"; -import {Link, NavLink} from "react-router-dom"; +import {Link} from "react-router-dom"; import RouteWithSubRoutes from "../../components/RouteWithSubRoutes" -import {Switch, Redirect} from 'react-router' +import {Switch} from 'react-router' import "../../App.css"; +import config from "../../../public/conf/config.json"; class Dashboard extends React.Component { constructor(props) { @@ -15,7 +13,8 @@ class Dashboard extends React.Component { this.state = { routes: props.routes, selectedKeys : [] - } + }; + this.Logo = config.theme.logo; } changeSelectedMenuItem = (key) =>{ @@ -29,14 +28,14 @@ class Dashboard extends React.Component { return (
-
-
- +
+
+ logo
Android diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js index f65353d118e..46c4efcd829 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/AddNewApp.js @@ -1,5 +1,4 @@ import React from "react"; -import "antd/dist/antd.css"; import { PageHeader, Typography, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/Apps.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/Apps.js index cb9ab7720a1..11cf5d4315c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/Apps.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/apps/Apps.js @@ -1,5 +1,4 @@ import React from "react"; -import "antd/dist/antd.css"; import AppList from "../../../components/apps/AppList"; class Apps extends React.Component { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/webpack.config.js index 19c52f4fbed..2f3874ea211 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/webpack.config.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/webpack.config.js @@ -18,11 +18,12 @@ var path = require('path'); const HtmlWebPackPlugin = require("html-webpack-plugin"); const MiniCssExtractPlugin = require("mini-css-extract-plugin"); +const configurations = require("./public/conf/config.json"); const config = { devtool: "source-map", output: { - publicPath: '/store/' // <---- this + publicPath: '/store/' }, watch: false, resolve: { @@ -77,14 +78,16 @@ const config = { }, { loader: "css-loader", - options: { - sourceMap: true, - modules: true, - localIdentName: "[local]___[hash:base64:5]" - } }, { - loader: "less-loader" + loader: "less-loader", + options: { + modifyVars: { + 'primary-color': configurations.theme.primaryColor, + 'link-color': configurations.theme.primaryColor, + }, + javascriptEnabled: true, + }, } ] }, From a5f75df99a5847a2862de01069f099e666a71703 Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Fri, 12 Jul 2019 14:47:20 +0530 Subject: [PATCH 4/4] Change error messages in publisher --- .../apps/detailed-rating/DetailedRating.js | 6 +- .../AppDetailsDrawer/AppDetailsDrawer.js | 64 ++++++++----------- .../src/components/apps/list-apps/Filters.js | 34 ++++------ .../apps/list-apps/appsTable/AppsTable.js | 4 +- .../apps/release/lifeCycle/LifeCycle.js | 20 +++--- .../components/apps/release/review/Reviews.js | 10 ++- .../manage/categories/ManageCategories.js | 14 ++-- .../manage/categories/ManageTags.js | 22 +++---- .../src/components/new-app/AddNewAppForm.js | 22 +++---- .../react-app/src/js/actions/index.js | 28 +++++--- .../react-app/src/pages/Login.js | 24 +++---- .../pages/dashboard/apps/release/Release.js | 5 +- 12 files changed, 119 insertions(+), 134 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js index d7a4056c301..4854bb7dc2f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/detailed-rating/DetailedRating.js @@ -1,5 +1,5 @@ import React from "react"; -import {Row, Typography, Icon} from "antd"; +import {Row, Typography, Icon, message} from "antd"; import StarRatings from "react-star-ratings"; import "./DetailedRating.css"; import config from "../../../../public/conf/config.json"; @@ -41,8 +41,10 @@ class DetailedRating extends React.Component{ } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; + } else { + message.error('Something went wrong while trying to load rating for the release... :('); } }); }; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js index d9eed2d6991..15ccc407180 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/AppDetailsDrawer/AppDetailsDrawer.js @@ -92,10 +92,8 @@ class AppDetailsDrawer extends React.Component { getCategories = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/categories", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/categories" + ).then(res => { if (res.status === 200) { const categories = JSON.parse(res.data.data); @@ -115,10 +113,10 @@ class AppDetailsDrawer extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong while trying to load app details... :('); } this.setState({ @@ -129,10 +127,8 @@ class AppDetailsDrawer extends React.Component { getTags = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/tags", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/tags" + ).then(res => { if (res.status === 200) { const tags = JSON.parse(res.data.data); @@ -152,10 +148,10 @@ class AppDetailsDrawer extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load tags.'); } this.setState({ @@ -172,14 +168,12 @@ class AppDetailsDrawer extends React.Component { const data = {name: name}; axios.put( config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, - data, - { - headers: {'X-Platform': config.serverConfig.platform} - } + data ).then(res => { if (res.status === 200) { notification["success"]({ - message: 'Saved!' + message: 'Saved!', + description: 'App name updated successfully!' }); this.setState({ loading: false, @@ -192,7 +186,7 @@ class AppDetailsDrawer extends React.Component { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.error('Something went wrong... :('); + message.error('Something went wrong when trying to save the app name... :('); } this.setState({loading: false}); @@ -231,7 +225,6 @@ class AppDetailsDrawer extends React.Component { }); }; - // handle description change handleCategoryChange = (temporaryCategories) => { this.setState({temporaryCategories}) @@ -250,14 +243,12 @@ class AppDetailsDrawer extends React.Component { const data = {categories: temporaryCategories}; axios.put( config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, - data, - { - headers: {'X-Platform': config.serverConfig.platform} - } + data ).then(res => { if (res.status === 200) { notification["success"]({ - message: 'Saved!' + message: 'Saved!', + description: 'App categories updated successfully!' }); this.setState({ loading: false, @@ -271,7 +262,7 @@ class AppDetailsDrawer extends React.Component { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.error('Something went wrong... :('); + message.error('Something went wrong when trying to updating categories'); } this.setState({loading: false}); @@ -297,7 +288,7 @@ class AppDetailsDrawer extends React.Component { this.setState({temporaryTags}) }; - // change app categories + // change app tags handleTagsSave = () => { const {id} = this.props.app; const {temporaryTags, tags} = this.state; @@ -311,14 +302,12 @@ class AppDetailsDrawer extends React.Component { const data = {tags: temporaryTags}; axios.put( config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, - data, - { - headers: {'X-Platform': config.serverConfig.platform} - } + data ).then(res => { if (res.status === 200) { notification["success"]({ - message: 'Saved!' + message: 'Saved!', + description: 'App tags updated successfully!' }); this.setState({ loading: false, @@ -331,7 +320,7 @@ class AppDetailsDrawer extends React.Component { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.error('Something went wrong... :('); + message.error('Something went wrong when trying to update tags'); } this.setState({loading: false}); @@ -349,14 +338,12 @@ class AppDetailsDrawer extends React.Component { const data = {description: temporaryDescription}; axios.put( config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/" + id, - data, - { - headers: {'X-Platform': config.serverConfig.platform} - } + data ).then(res => { if (res.status === 200) { notification["success"]({ - message: 'Saved!' + message: 'Saved!', + description: 'App description updated successfully!' }); this.setState({ loading: false, @@ -526,7 +513,8 @@ class AppDetailsDrawer extends React.Component { { categories.map(category => { return ( - + {category} ); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js index 01609175641..818072ee20f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/Filters.js @@ -1,10 +1,10 @@ import React from "react"; -import {Avatar, Card, Col, Row, Table, Typography, Input, Divider, Icon, Select, Button, Form, message, Radio} from "antd"; +import {Card, Col, Row,Typography, Input, Divider, Icon, Select, Button, Form, message, Radio} from "antd"; import axios from "axios"; import config from "../../../../public/conf/config.json"; const {Option} = Select; -const {Title, Text} = Typography; +const {Title} = Typography; class FiltersForm extends React.Component { @@ -49,10 +49,8 @@ class FiltersForm extends React.Component { getCategories = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/categories", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + 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({ @@ -62,10 +60,10 @@ class FiltersForm extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong while trying to load categories... :('); } this.setState({ @@ -76,10 +74,8 @@ class FiltersForm extends React.Component { getTags = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/tags", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + 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({ @@ -89,10 +85,10 @@ class FiltersForm extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load tags'); } this.setState({ @@ -104,10 +100,8 @@ class FiltersForm extends React.Component { getDeviceTypes = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.deviceMgt + "/device-types", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + 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({ @@ -117,10 +111,10 @@ class FiltersForm extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load device types'); } this.setState({ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js index 033c05cd85c..d62cc350e9e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/list-apps/appsTable/AppsTable.js @@ -1,5 +1,5 @@ import React from "react"; -import {Avatar, Card, Col, Row, Table, Typography, Tag, Icon, message} from "antd"; +import {Avatar, Table, Tag, Icon, message} from "antd"; import axios from "axios"; import pSBC from 'shade-blend-color'; import config from "../../../../../public/conf/config.json"; @@ -155,7 +155,7 @@ class AppsTable extends React.Component { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.error('Something went wrong... :('); + message.error('Something went wrong while trying to load apps... :('); } this.setState({loading: false}); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/lifeCycle/LifeCycle.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/lifeCycle/LifeCycle.js index 1d5fbcb4271..c419d29271a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/lifeCycle/LifeCycle.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/lifeCycle/LifeCycle.js @@ -55,10 +55,9 @@ class LifeCycle extends React.Component { fetchData = () => { - axios.get(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/lifecycle-config", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + axios.get( + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/lifecycle-config" + ).then(res => { if (res.status === 200) { const lifecycle = res.data.data; this.setState({ @@ -69,6 +68,8 @@ class LifeCycle extends React.Component { }).catch(function (error) { if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; + } else { + message.error('Something went wrong when trying to load lifecycle configuration'); } }); }; @@ -105,11 +106,10 @@ class LifeCycle extends React.Component { isConfirmButtonLoading: true, }); - axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/life-cycle/" + uuid, - data, - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + axios.post( + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/life-cycle/" + uuid, + data + ).then(res => { if (res.status === 201) { this.setState({ isReasonModalVisible: false, @@ -133,7 +133,7 @@ class LifeCycle extends React.Component { notification["error"]({ message: "Error", description: - "Something went wrong", + "Something went wrong when trying to add lifecycle", }); } this.setState({ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js index 743be28680a..19b508cc21b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/apps/release/review/Reviews.js @@ -31,20 +31,18 @@ class Reviews extends React.Component { const {uuid, type} = this.props; axios.get( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/reviews/"+type+"/"+uuid, - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/admin/reviews/" + type + "/" + uuid + ).then(res => { if (res.status === 200) { let reviews = res.data.data.data; callback(reviews); } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load reviews'); } }); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js index 6edc414cbcb..3711368638b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageCategories.js @@ -33,7 +33,7 @@ class ManageCategories extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { message.warning('Something went wrong'); @@ -80,11 +80,11 @@ class ManageCategories extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load categories'); } this.setState({ loading: false @@ -219,11 +219,11 @@ class ManageCategories extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to add categories'); } this.setState({ loading: false @@ -281,11 +281,11 @@ class ManageCategories extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to delete the category'); } this.setState({ loading: false, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js index e2a7e14993e..e3c15950820 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/manage/categories/ManageTags.js @@ -32,10 +32,10 @@ class ManageTags extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load tags'); } this.setState({ @@ -58,10 +58,8 @@ class ManageTags extends React.Component { }); axios.delete( - config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/tags/"+id, - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher+"/admin/applications/tags/"+id + ).then(res => { if (res.status === 200) { notification["success"]({ message: "Done!", @@ -82,11 +80,11 @@ class ManageTags extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to delete the tag'); } this.setState({ loading: false @@ -219,11 +217,11 @@ class ManageTags extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to delete tag'); } this.setState({ loading: false @@ -281,11 +279,11 @@ class ManageTags extends React.Component { } }).catch((error) => { - if (error.response.hasOwnProperty("status") && error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to edit tag'); } this.setState({ loading: false, diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js index 74856e99b81..95887548e0a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/AddNewAppForm.js @@ -54,10 +54,8 @@ class AddNewAppFormComponent extends React.Component { getCategories = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/categories", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + 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({ @@ -67,10 +65,10 @@ class AddNewAppFormComponent extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load categories'); } this.setState({ @@ -81,10 +79,8 @@ class AddNewAppFormComponent extends React.Component { getTags = () => { axios.get( - config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/tags", - { - headers: {'X-Platform': config.serverConfig.platform} - }).then(res => { + config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + 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({ @@ -94,10 +90,10 @@ class AddNewAppFormComponent extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.warning('Something went wrong'); + message.warning('Something went wrong when trying to load tags'); } this.setState({ @@ -209,7 +205,7 @@ class AddNewAppFormComponent extends React.Component { } }).catch((error) => { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { notification["error"]({ diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js index 79690cc148e..f810921f458 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/js/actions/index.js @@ -1,12 +1,15 @@ import axios from "axios"; import ActionTypes from "../constants/ActionTypes"; import config from "../../../public/conf/config.json"; +import {message} from "antd"; export const getApps = () => dispatch => { const request = "method=post&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications"; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request + return axios.post( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, + request ).then(res => { if (res.status === 200) { let apps = []; @@ -18,8 +21,10 @@ export const getApps = () => dispatch => { } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; + } else { + message.error('Something went wrong when trying to load applications... :('); } }); @@ -29,7 +34,8 @@ export const getRelease = (uuid) => dispatch => { const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications/release/" + uuid; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request + return axios.post( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 200) { let release = res.data.data; @@ -37,8 +43,10 @@ export const getRelease = (uuid) => dispatch => { } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; + } else { + message.error('Something went wrong... :('); } }); @@ -73,7 +81,8 @@ export const closeLifecycleModal = () => dispatch => { export const getLifecycle = () => dispatch => { const request = "method=get&content-type=application/json&payload={}&api-endpoint=/application-mgt-publisher/v1.0/applications/lifecycle-config"; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request + return axios.post( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 200) { let lifecycle = res.data.data; @@ -81,8 +90,10 @@ export const getLifecycle = () => dispatch => { } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; + } else { + message.error('Something went wrong... :('); } }); }; @@ -97,7 +108,8 @@ export const updateLifecycleState = (uuid, nextState, reason) => dispatch => { const request = "method=post&content-type=application/json&payload=" + JSON.stringify(payload) + "&api-endpoint=/application-mgt-publisher/v1.0/applications/life-cycle/" + uuid; - return axios.post(config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request + return axios.post( + config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri +config.serverConfig.invoker.publisher, request ).then(res => { if (res.status === 201) { let release = res.data.data; @@ -110,7 +122,7 @@ export const updateLifecycleState = (uuid, nextState, reason) => dispatch => { } }).catch(function (error) { - if (error.response.status === 401) { + if (error.hasOwnProperty("response") && error.response.status === 401) { window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort+'/publisher/login'; } else if (error.response.status === 500) { alert("error"); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js index c13c1d98271..cc7782747f6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/Login.js @@ -1,5 +1,5 @@ import React from "react"; -import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox} from 'antd'; +import {Typography, Row, Col, Form, Icon, Input, Button, Checkbox, message} from 'antd'; import './Login.css'; import axios from 'axios'; import config from "../../public/conf/config.json"; @@ -12,14 +12,11 @@ class Login extends React.Component { render() { return (
-
+
- @@ -35,7 +32,6 @@ class Login extends React.Component { Login - @@ -80,17 +76,21 @@ class NormalLoginForm extends React.Component { const request = Object.keys(parameters).map(key => key + '=' + parameters[key]).join('&'); axios.post(config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.loginUri, request - ).then(res => { + ).then(res=>{ if (res.status === 200) { window.location = res.data.url; } }).catch(function (error) { - if (error.response.status === 400) { + if (error.hasOwnProperty("response") && error.response.status === 400) { thisForm.setState({ - inValid: true, - loading: false + inValid: true }); + } else { + message.error('Something went wrong when trying to login... :('); } + thisForm.setState({ + loading: false + }); }); } @@ -111,7 +111,7 @@ class NormalLoginForm extends React.Component {
{getFieldDecorator('username', { - rules: [{required: true, message: 'Please input your username!'}], + rules: [{required: true, message: 'Please enter your username'}], })( } placeholder="Username"/> @@ -119,7 +119,7 @@ class NormalLoginForm extends React.Component { {getFieldDecorator('password', { - rules: [{required: true, message: 'Please input your Password!'}], + rules: [{required: true, message: 'Please enter your password'}], })( } type="password" diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js index 5f881704832..1fa7e5656e1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/pages/dashboard/apps/release/Release.js @@ -47,9 +47,6 @@ class Release extends React.Component { //send request to the invoker axios.get( config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invoker.uri + config.serverConfig.invoker.publisher + "/applications/release/"+ uuid, - { - headers: {'X-Platform': config.serverConfig.platform} - } ).then(res => { if (res.status === 200) { const app = res.data.data; @@ -70,7 +67,7 @@ class Release extends React.Component { message.error('You are not logged in'); window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/publisher/login'; } else { - message.error('Something went wrong... :('); + message.error('Something went wrong when trying to load the release... :('); } this.setState({loading: false});