diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml
index 4bd40a908a..c7755c873f 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/pom.xml
@@ -82,6 +82,16 @@
install
+
+ lint
+
+ npm
+
+
+ run-script lint
+
+ generate-resources
+ prod
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.eslintrc b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.eslintrc
new file mode 100644
index 0000000000..9ea2b2a401
--- /dev/null
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.eslintrc
@@ -0,0 +1,325 @@
+{
+ "parser": "babel-eslint",
+ "plugins": [
+ "react",
+ "babel",
+ "jsx",
+ "prettier"
+ ],
+ "extends": [
+ "eslint:recommended",
+ "plugin:react/recommended"
+ ],
+ "parserOptions": {
+ "ecmaVersion": 2016,
+ "sourceType": "module",
+ "ecmaFeatures": {
+ "jsx": true
+ }
+ },
+ "settings": {
+ "react": {
+ "createClass": "createReactClass",
+ "pragma": "React",
+ "version": "16.8.6"
+ }
+ },
+ "env": {
+ "node": true,
+ "commonjs": true,
+ "browser": true,
+ "jasmine": true,
+ "es6": true
+ },
+ "globals": {
+ "document": true,
+ "console": true,
+ // Only for development purposes
+ "setTimeout": true,
+ "window" : true
+ },
+ "rules": {
+ "prettier/prettier": "error",
+ // Enforce the spacing around the * in generator functions.
+ "generator-star-spacing": [2, "after"],
+ // Disallow using variables outside the blocks they are defined (especially
+ // since only let and const are used, see "no-var").
+ "block-scoped-var": 2,
+ // Require camel case names
+ "camelcase": 2,
+ // Allow trailing commas for easy list extension. Having them does not
+ // impair readability, but also not required either.
+ "comma-dangle": 0,
+ // Warn about cyclomatic complexity in functions.
+ "complexity": 1,
+ // Don't warn for inconsistent naming when capturing this (not so important
+ // with auto-binding fat arrow functions).
+ "consistent-this": 0,
+ // Enforce curly brace conventions for all control statements.
+ "curly": 2,
+ // Don't require a default case in switch statements. Avoid being forced to
+ // add a bogus default when you know all possible cases are handled.
+ "default-case": 0,
+ // Encourage the use of dot notation whenever possible.
+ "dot-notation": 2,
+ // Allow mixed 'LF' and 'CRLF' as linebreaks.
+ "linebreak-style": 0,
+ // Don't enforce the maximum depth that blocks can be nested.
+ "max-depth": 0,
+ // Maximum length of a line.
+ "max-len": [2, 100, 2, { "ignoreStrings": true, "ignoreUrls": true}],
+ // Maximum depth callbacks can be nested.
+ "max-nested-callbacks": [2, 3],
+ // Don't limit the number of parameters that can be used in a function.
+ "max-params": 0,
+ // Don't limit the maximum number of statement allowed in a function.
+ "max-statements": 0,
+ // Require a capital letter for constructors, only check if all new
+ // operators are followed by a capital letter. Don't warn when capitalized
+ // functions are used without the new operator.
+ "new-cap": [2, {"capIsNew": false}],
+ // Disallow use of the Array constructor.
+ "no-array-constructor": 2,
+ // Allow use of bitwise operators.
+ "no-bitwise": 0,
+ // Disallow use of arguments.caller or arguments.callee.
+ "no-caller": 2,
+ // Disallow the catch clause parameter name being the same as a variable in
+ // the outer scope, to avoid confusion.
+ "no-catch-shadow": 2,
+ // Disallow assignment in conditional expressions.
+ "no-cond-assign": 2,
+ // Allow using the console API.
+ "no-console": 0,
+ // Allow using constant expressions in conditions like while (true)
+ "no-constant-condition": 0,
+ // Allow use of the continue statement.
+ "no-continue": 0,
+ // Disallow control characters in regular expressions.
+ "no-control-regex": 2,
+ // Disallow deletion of variables (deleting properties is fine).
+ "no-delete-var": 2,
+ // Disallow duplicate arguments in functions.
+ "no-dupe-args": 2,
+ // Disallow duplicate keys when creating object literals.
+ "no-dupe-keys": 2,
+ // Disallow multiple empty lines
+ "no-multiple-empty-lines": "error",
+ // Disallow a duplicate case label.
+ "no-duplicate-case": 2,
+ // Disallow else after a return in an if. The else around the second return
+ // here is useless:
+ // if (something) { return false; } else { return true; }
+ "no-else-return": 2,
+ // Disallow empty statements. This will report an error for:
+ // try { something(); } catch (e) {}
+ // but will not report it for:
+ // try { something(); } catch (e) { /* Silencing the error because ...*/ }
+ // which is a valid use case.
+ "no-empty": 2,
+ // Disallow the use of empty character classes in regular expressions.
+ "no-empty-character-class": 2,
+ // Disallow use of labels for anything other then loops and switches.
+ "no-labels": 2,
+ // Disallow use of eval(). We have other APIs to evaluate code in content.
+ "no-eval": 2,
+ // Disallow assigning to the exception in a catch block.
+ "no-ex-assign": 2,
+ // Disallow adding to native types
+ "no-extend-native": 2,
+ // Disallow unnecessary function binding.
+ "no-extra-bind": 2,
+ // Disallow double-negation boolean casts in a boolean context.
+ "no-extra-boolean-cast": 2,
+ // Allow unnecessary parentheses, as they may make the code more readable.
+ "no-extra-parens": 0,
+ // Disallow fallthrough of case statements, except if there is a comment.
+ "no-fallthrough": 2,
+ // Allow the use of leading or trailing decimal points in numeric literals.
+ "no-floating-decimal": 0,
+ // Disallow if as the only statement in an else block.
+ "no-lonely-if": 2,
+ // Disallow use of multiline strings (use template strings instead).
+ "no-multi-str": 2,
+ // Disallow reassignments of native objects.
+ "no-native-reassign": 2,
+ // Disallow nested ternary expressions, they make the code hard to read.
+ "no-nested-ternary": 2,
+ // Allow use of new operator with the require function.
+ "no-new-require": 0,
+ // Disallow use of octal literals.
+ "no-octal": 2,
+ // Allow reassignment of function parameters.
+ "no-param-reassign": 0,
+ // Allow string concatenation with __dirname and __filename (not a node env).
+ "no-path-concat": 0,
+ // Allow use of unary operators, ++ and --.
+ "no-plusplus": 0,
+ // Allow using process.env (not a node environment).
+ "no-process-env": 0,
+ // Allow using process.exit (not a node environment).
+ "no-process-exit": 0,
+ // Disallow usage of __proto__ property.
+ "no-proto": 2,
+ // Disallow declaring the same variable more than once (we use let anyway).
+ "no-redeclare": 2,
+ // Disallow multiple spaces in a regular expression literal.
+ "no-regex-spaces": 2,
+ // Allow reserved words being used as object literal keys.
+ "no-reserved-keys": 0,
+ // Don't restrict usage of specified node modules (not a node environment).
+ "no-restricted-modules": 0,
+ // Disallow use of assignment in return statement. It is preferable for a
+ // single line of code to have only one easily predictable effect.
+ "no-return-assign": 2,
+ // Allow use of javascript: urls.
+ "no-script-url": 0,
+ // Disallow comparisons where both sides are exactly the same.
+ "no-self-compare": 2,
+ // Disallow use of comma operator.
+ "no-sequences": 2,
+ // Warn about declaration of variables already declared in the outer scope.
+ // This isn't an error because it sometimes is useful to use the same name
+ // in a small helper function rather than having to come up with another
+ // random name.
+ // Still, making this a warning can help people avoid being confused.
+ "no-shadow": 0,
+ // Require empty line at end of file
+ "eol-last": "error",
+ // Disallow shadowing of names such as arguments.
+ "no-shadow-restricted-names": 2,
+ "no-space-before-semi": 0,
+ // Disallow sparse arrays, eg. let arr = [,,2].
+ // Array destructuring is fine though:
+ // for (let [, breakpointPromise] of aPromises)
+ "no-sparse-arrays": 2,
+ // Allow use of synchronous methods (not a node environment).
+ "no-sync": 0,
+ // Allow the use of ternary operators.
+ "no-ternary": 0,
+ // Don't allow spaces after end of line
+ "no-trailing-spaces": "error",
+ // Disallow throwing literals (eg. throw "error" instead of
+ // throw new Error("error")).
+ "no-throw-literal": 2,
+ // Disallow use of undeclared variables unless mentioned in a /*global */
+ // block. Note that globals from head.js are automatically imported in tests
+ // by the import-headjs-globals rule form the mozilla eslint plugin.
+ "no-undef": 2,
+ // Allow use of undefined variable.
+ "no-undefined": 0,
+ // Disallow the use of Boolean literals in conditional expressions.
+ "no-unneeded-ternary": 2,
+ // Disallow unreachable statements after a return, throw, continue, or break
+ // statement.
+ "no-unreachable": 2,
+ // Allow using variables before they are defined.
+ "no-unused-vars": [2, {"vars": "all", "args": "none"}],
+ // Disallow global and local variables that arent used, but allow unused function arguments.
+ "no-use-before-define": 0,
+ // We use var-only-at-top-level instead of no-var as we allow top level
+ // vars.
+ "no-var": 0,
+ // Allow using TODO/FIXME comments.
+ "no-warning-comments": 0,
+ // Disallow use of the with statement.
+ "no-with": 2,
+ // Dont require method and property shorthand syntax for object literals.
+ // We use this in the code a lot, but not consistently, and this seems more
+ // like something to check at code review time.
+ "object-shorthand": 0,
+ // Allow more than one variable declaration per function.
+ "one-var": 0,
+ // Single quotes should be used.
+ "quotes": [2, "single", "avoid-escape"],
+ // Require use of the second argument for parseInt().
+ "radix": 2,
+ // Dont require to sort variables within the same declaration block.
+ // Anyway, one-var is disabled.
+ "sort-vars": 0,
+ "space-after-function-name": 0,
+ "space-before-function-parentheses": 0,
+ // Disallow space before function opening parenthesis.
+ //"space-before-function-paren": [2, "never"],
+ // Disable the rule that checks if spaces inside {} and [] are there or not.
+ // Our code is split on conventions, and itd be nice to have 2 rules
+ // instead, one for [] and one for {}. So, disabling until we write them.
+ "space-in-brackets": 0,
+ // Deprecated, will be removed in 1.0.
+ "space-unary-word-ops": 0,
+ // Require a space immediately following the // in a line comment.
+ "spaced-comment": [2, "always"],
+ // Require "use strict" to be defined globally in the script.
+ "strict": [2, "global"],
+ // Disallow comparisons with the value NaN.
+ "use-isnan": 2,
+ // Warn about invalid JSDoc comments.
+ // Disabled for now because of https://github.com/eslint/eslint/issues/2270
+ // The rule fails on some jsdoc comments like in:
+ // devtools/client/webconsole/console-output.js
+ "valid-jsdoc": 0,
+ // Ensure that the results of typeof are compared against a valid string.
+ "valid-typeof": 2,
+ // Allow vars to be declared anywhere in the scope.
+ "vars-on-top": 0,
+ // Dont require immediate function invocation to be wrapped in parentheses.
+ "wrap-iife": 0,
+ // Don't require regex literals to be wrapped in parentheses (which
+ // supposedly prevent them from being mistaken for division operators).
+ "wrap-regex": 0,
+ // Require for-in loops to have an if statement.
+ "guard-for-in": 0,
+ // allow/disallow an empty newline after var statement
+ "newline-after-var": 0,
+ // disallow the use of alert, confirm, and prompt
+ "no-alert": 0,
+ // disallow the use of deprecated react changes and lifecycle methods
+ "react/no-deprecated": 0,
+ // disallow comparisons to null without a type-checking operator
+ "no-eq-null": 0,
+ // disallow overwriting functions written as function declarations
+ "no-func-assign": 0,
+ // disallow use of eval()-like methods
+ "no-implied-eval": 0,
+ // disallow function or variable declarations in nested blocks
+ "no-inner-declarations": 0,
+ // disallow invalid regular expression strings in the RegExp constructor
+ "no-invalid-regexp": 0,
+ // disallow irregular whitespace outside of strings and comments
+ "no-irregular-whitespace": 0,
+ // disallow unnecessary nested blocks
+ "no-lone-blocks": 0,
+ // disallow creation of functions within loops
+ "no-loop-func": 0,
+ // disallow use of new operator when not part of the assignment or
+ // comparison
+ "no-new": 0,
+ // disallow use of new operator for Function object
+ "no-new-func": 0,
+ // disallow use of the Object constructor
+ "no-new-object": 0,
+ // disallows creating new instances of String,Number, and Boolean
+ "no-new-wrappers": 0,
+ // disallow the use of object properties of the global object (Math and
+ // JSON) as functions
+ "no-obj-calls": 0,
+ // disallow use of octal escape sequences in string literals, such as
+ // var foo = "Copyright \251";
+ "no-octal-escape": 0,
+ // disallow use of undefined when initializing variables
+ "no-undef-init": 0,
+ // disallow usage of expressions in statement position
+ "no-unused-expressions": 0,
+ // disallow use of void operator
+ "no-void": 0,
+ // disallow wrapping of non-IIFE statements in parens
+ "no-wrap-func": 0,
+ // require assignment operator shorthand where possible or prohibit it
+ // entirely
+ "operator-assignment": 0,
+ // enforce operators to be placed before or after line breaks
+ "operator-linebreak": 0,
+ // disable chacking prop types
+ "react/prop-types": 0
+ }
+}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.prettierrc b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.prettierrc
new file mode 100644
index 0000000000..d281e2bd55
--- /dev/null
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/.prettierrc
@@ -0,0 +1,5 @@
+{
+ "singleQuote": true,
+ "trailingComma": "all",
+ "parser": "flow"
+}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/babel.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/babel.config.js
index 7ec6d0936b..9cfcaf0bd9 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/babel.config.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/babel.config.js
@@ -16,14 +16,13 @@
* under the License.
*/
-module.exports = function (api) {
+module.exports = function(api) {
api.cache(true);
- const presets = [ "@babel/preset-env",
- "@babel/preset-react" ];
- const plugins = ["@babel/plugin-proposal-class-properties"];
+ const presets = ['@babel/preset-env', '@babel/preset-react'];
+ const plugins = ['@babel/plugin-proposal-class-properties'];
return {
presets,
- plugins
+ plugins,
};
-};
\ No newline at end of file
+};
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 b140135682..db8ec651f8 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
@@ -13,8 +13,10 @@
"acorn": "^6.2.0",
"antd": "^3.23.6",
"axios": "^0.18.1",
+ "babel-eslint": "^9.0.0",
"d3": "^5.9.7",
"dagre": "^0.8.4",
+ "imagemin": "^5.3.1",
"javascript-time-ago": "^2.0.1",
"keymirror": "^0.1.1",
"lodash.debounce": "^4.0.8",
@@ -43,6 +45,12 @@
"body-parser": "^1.19.0",
"chai": "^4.1.2",
"css-loader": "^0.28.11",
+ "eslint": "^5.16.0",
+ "eslint-config-prettier": "4.3.0",
+ "eslint-plugin-babel": "5.3.0",
+ "eslint-plugin-jsx": "0.0.2",
+ "eslint-plugin-prettier": "3.1.0",
+ "eslint-plugin-react": "7.14.2",
"express": "^4.17.1",
"express-pino-logger": "^4.0.0",
"file-loader": "^2.0.0",
@@ -61,6 +69,7 @@
"npm-run-all": "^4.1.5",
"pino-colada": "^1.4.5",
"postcss-loader": "^3.0.0",
+ "prettier": "1.18.1",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-intl": "^2.9.0",
@@ -81,6 +90,7 @@
"build_prod": "NODE_ENV=production NODE_OPTIONS=--max_old_space_size=4096 webpack -p --display errors-only --hide-modules",
"build_dev": "NODE_ENV=development webpack -d --watch ",
"server": "node-env-run server --exec nodemon | pino-colada",
- "dev2": "run-p server start"
+ "dev2": "run-p server start",
+ "lint": "eslint \"src/**/*.js\""
}
}
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 fd047221ee..264db3aed8 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
@@ -16,140 +16,147 @@
* under the License.
*/
-import React from "react";
-import "antd/dist/antd.less";
-import RouteWithSubRoutes from "./components/RouteWithSubRoutes";
-import {
- BrowserRouter as Router,
- Redirect, Switch,
-} from 'react-router-dom';
-import axios from "axios";
-import {Layout, Spin, Result} from "antd";
-import ConfigContext from "./context/ConfigContext";
+import React from 'react';
+import 'antd/dist/antd.less';
+import RouteWithSubRoutes from './components/RouteWithSubRoutes';
+import { BrowserRouter as Router, Redirect, Switch } from 'react-router-dom';
+import axios from 'axios';
+import { Layout, Spin, Result } from 'antd';
+import ConfigContext from './context/ConfigContext';
-const {Content} = Layout;
+const { Content } = Layout;
const loadingView = (
-
-
-
-
-
+
+
+
+
+
);
const errorView = (
-
+
);
class App extends React.Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ loading: true,
+ error: false,
+ config: {},
+ };
+ }
- constructor(props) {
- super(props);
- this.state = {
- loading: true,
- error: false,
- config: {}
+ componentDidMount() {
+ this.updateFavicon();
+ axios
+ .get(window.location.origin + '/store/public/conf/config.json')
+ .then(res => {
+ const config = res.data;
+ this.checkUserLoggedIn(config);
+ })
+ .catch(error => {
+ this.setState({
+ loading: false,
+ error: true,
+ });
+ });
+ }
+
+ updateFavicon = () => {
+ const link =
+ document.querySelector("link[rel*='icon']") ||
+ document.createElement('link');
+ link.type = 'image/x-icon';
+ link.rel = 'shortcut icon';
+ link.href =
+ window.location.origin +
+ '/devicemgt/public/uuf.unit.favicon/img/favicon.png';
+ document.getElementsByTagName('head')[0].appendChild(link);
+ };
+
+ checkUserLoggedIn = config => {
+ axios
+ .post(
+ window.location.origin + '/store-ui-request-handler/user',
+ 'platform=publisher',
+ )
+ .then(res => {
+ config.user = res.data.data;
+ const pageURL = window.location.pathname;
+ const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
+ if (lastURLSegment === 'login') {
+ window.location.href = window.location.origin + '/store/';
+ } else {
+ this.setState({
+ loading: false,
+ config: config,
+ });
}
- }
-
- componentDidMount() {
- this.updateFavicon();
- axios.get(
- window.location.origin + "/store/public/conf/config.json",
- ).then(res => {
- const config = res.data;
- this.checkUserLoggedIn(config);
- }).catch((error) => {
+ })
+ .catch(error => {
+ if (error.hasOwnProperty('response') && error.response.status === 401) {
+ const redirectUrl = encodeURI(window.location.href);
+ const pageURL = window.location.pathname;
+ const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
+ if (lastURLSegment !== 'login') {
+ window.location.href =
+ window.location.origin + `/store/login?redirect=${redirectUrl}`;
+ } else {
this.setState({
- loading: false,
- error: true
- })
- });
- }
+ loading: false,
+ config: config,
+ });
+ }
+ } else {
+ this.setState({
+ loading: false,
+ error: true,
+ });
+ }
+ });
+ };
- updateFavicon = () =>{
- const link = document.querySelector("link[rel*='icon']") || document.createElement('link');
- link.type = 'image/x-icon';
- link.rel = 'shortcut icon';
- link.href = window.location.origin+'/devicemgt/public/uuf.unit.favicon/img/favicon.png';
- document.getElementsByTagName('head')[0].appendChild(link);
- };
+ render() {
+ const { loading, error } = this.state;
- checkUserLoggedIn = (config) => {
- axios.post(
- window.location.origin + "/store-ui-request-handler/user",
- "platform=publisher"
- ).then(res => {
- config.user = res.data.data;
- const pageURL = window.location.pathname;
- const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
- if (lastURLSegment === "login") {
- window.location.href = window.location.origin + `/store/`;
- } else {
- this.setState({
- loading: false,
- config: config
- });
- }
- }).catch((error) => {
- if (error.hasOwnProperty("response") && error.response.status === 401) {
- const redirectUrl = encodeURI(window.location.href);
- const pageURL = window.location.pathname;
- const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
- if (lastURLSegment !== "login") {
- window.location.href = window.location.origin + `/store/login?redirect=${redirectUrl}`;
- } else {
- this.setState({
- loading: false,
- config: config
- })
- }
- } else {
- this.setState({
- loading: false,
- error: true
- })
- }
- });
- };
+ const applicationView = (
+
+
+
-
- Start installing the application for one or more users by entering the corresponding user name.
- Select install to automatically start downloading the application for the respective user/users.
-
- {(this.state.isForbidden) && (
-
- )}
-
+
+ Start installing the application for one or more users by entering the
+ corresponding user name. Select install to automatically start
+ downloading the application for the respective user/users.
+
+ {this.state.isForbidden && (
+
+ )}
+
-
- Start uninstalling the application for devices by selecting the corresponding devices.
- Select uninstall to automatically start uninstalling the application for the respective devices.
-
- {(this.state.isForbidden) && (
-
- )}
-
+
+ Start uninstalling the application for devices by selecting the
+ corresponding devices. Select uninstall to automatically start
+ uninstalling the application for the respective devices.
+
+ {this.state.isForbidden && (
+
+ )}
+
- Start installing the application for one or more groups by entering the corresponding group name. Select install to automatically start downloading the application for the respective device group/ groups.
- {(this.state.isForbidden) && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{width: '100%'}}
- >
- {data.map(d => (
-
- ))}
-
-
-
- Start uninstalling the application for one or more groups by entering the corresponding group
- name. Select uninstall to automatically start uninstalling the application for the respective device
- group/ groups.
- {(this.state.isForbidden) && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{width: '100%'}}>
- {data.map(d => (
-
- ))}
-
-
-
- Start installing the application for one or more roles by entering the corresponding role name. Select install to automatically start downloading the application for the respective user role/roles.
- {(this.state.isForbidden) && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{width: '100%'}}>
- {data.map(d => (
-
- ))}
-
-
-
- Start uninstalling the application for one or more roles by entering the corresponding role name.
- Select uninstall to automatically start uninstalling the application for the respective user
- role/roles.
- {(this.state.isForbidden) && (
-
- )}
-
-
- : null}
- filterOption={false}
- onSearch={this.fetchUser}
- onChange={this.handleChange}
- style={{width: '100%'}}
- >
- {data.map(d => (
-
- ))}
-
-
-
- Start installing the application for one or more users by entering the corresponding user name. Select install to automatically start downloading the application for the respective user/users.
- {(this.state.isForbidden) && (
-
- )}
-
+
+ Start installing the application for one or more users by entering the
+ corresponding user name. Select install to automatically start
+ downloading the application for the respective user/users.{' '}
+
+ {this.state.isForbidden && (
+
+ )}
+
- Start uninstalling the application for one or more users by entering the corresponding user name.
- Select uninstall to automatically start uninstalling the application for the respective
- user/users.
- {(this.state.isForbidden) && (
-
- )}
-
+
+ Start uninstalling the application for one or more users by entering
+ the corresponding user name. Select uninstall to automatically start
+ uninstalling the application for the respective user/users.{' '}
+
+ {this.state.isForbidden && (
+
+ )}
+
Support for a single or bulk upload.
- Strictly prohibit from uploading company data or other band
- files
-
-
-
-
-
Icon
-
-
-
-
Banner
-
-
-
-
-
-
-
-
Screenshots
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
- }
-}
-
-export default AddNewApp;
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/IconImg.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/IconImg.js
deleted file mode 100644
index 00937843d2..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/IconImg.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react";
-import { Upload, Icon, message } from 'antd';
-
-function getBase64(img, callback) {
- const reader = new FileReader();
- reader.addEventListener('load', () => callback(reader.result));
- reader.readAsDataURL(img);
-}
-
-function beforeUpload(file) {
- const isJPG = file.type === 'image/jpeg';
- if (!isJPG) {
- message.error('You can only upload JPG file!');
- }
- const isLt2M = file.size / 1024 / 1024 < 2;
- if (!isLt2M) {
- message.error('Image must smaller than 2MB!');
- }
- return isJPG && isLt2M;
-}
-
-
-class IconImage extends React.Component {
- state = {
- loading: false,
- };
-
- handleChange = (info) => {
- if (info.file.status === 'uploading') {
- this.setState({ loading: true });
- return;
- }
- if (info.file.status === 'done') {
- // Get this url from response in real world.
- getBase64(info.file.originFileObj, imageUrl => this.setState({
- imageUrl,
- loading: false,
- }));
- }
- }
-
- render() {
- const uploadButton = (
-
-
-
Upload
-
- );
- const imageUrl = this.state.imageUrl;
- return (
-
- {imageUrl ? : uploadButton}
-
- );
- }
-}
-
-export default IconImage;
\ 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/add-new-app/Step1.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step1.js
deleted file mode 100644
index ebe00b9122..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step1.js
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react";
-import {Form, Input, Button, Select, Divider, Tag, Tooltip, Icon, Checkbox, Row, Col} from "antd";
-import styles from './Style.less';
-
-const { Option } = Select;
-const { TextArea } = Input;
-const InputGroup = Input.Group;
-
-const formItemLayout = {
- labelCol: {
- span: 8,
- },
- wrapperCol: {
- span: 16,
- },
-};
-
-class EditableTagGroup extends React.Component {
- state = {
- tags: [],
- inputVisible: false,
- inputValue: '',
- };
-
- handleClose = (removedTag) => {
- const tags = this.state.tags.filter(tag => tag !== removedTag);
- // console.log(tags);
- this.setState({ tags });
- }
-
- showInput = () => {
- this.setState({ inputVisible: true }, () => this.input.focus());
- }
-
- handleInputChange = (e) => {
- this.setState({ inputValue: e.target.value });
- }
-
- handleInputConfirm = () => {
- const { inputValue } = this.state;
- let { tags } = this.state;
- if (inputValue && tags.indexOf(inputValue) === -1) {
- tags = [...tags, inputValue];
- }
- // console.log(tags);
- this.setState({
- tags,
- inputVisible: false,
- inputValue: '',
- });
- }
-
- saveInputRef = input => this.input = input
-
- render() {
- const { tags, inputVisible, inputValue } = this.state;
- return (
-
- );
- }
-}
-
-export default Step1;
\ 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/add-new-app/Step2.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step2.js
deleted file mode 100644
index 180da49c66..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step2.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react"
-
-class Step2 extends React.Component {
- render() {
- return (
-
tttoooeeee
- );
- }
-}
-
-export default Step2;
\ 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/add-new-app/Step3.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step3.js
deleted file mode 100644
index 0fe9610f9c..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Step3.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react"
-
-class Step3 extends React.Component {
- render() {
- return (
-
tttoooeeee
- );
- }
-}
-
-export default Step3;
\ 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/add-new-app/Style.less b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Style.less
deleted file mode 100644
index 823ca73809..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/Style.less
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-.stepForm {
- max-width: 500px;
- margin: 40px auto 0;
-}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/UploadScreenshots.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/UploadScreenshots.js
deleted file mode 100644
index b5405e8748..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/UploadScreenshots.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react";
-import { Upload, Icon, Modal} from 'antd';
-
-
-class UploadScreenshots extends React.Component {
- state = {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- };
-
- handleCancel = () => this.setState({ previewVisible: false });
-
- handlePreview = (file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- };
-
- handleChange = ({ fileList }) => this.setState({ fileList });
-
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
-
- );
- }
-}
-export default UploadScreenshots;
\ 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/add-new-app/components/AddTagModal.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/components/AddTagModal.js
deleted file mode 100644
index 1088ce4d8c..0000000000
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/react-app/src/pages/dashboard/add-new-app/components/AddTagModal.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2019, Entgra (pvt) Ltd. (http://entgra.io) All Rights Reserved.
- *
- * Entgra (pvt) Ltd. licenses this file to you under the Apache License,
- * Version 2.0 (the "License"); you may not use this file except
- * in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import React from "react";
-import { Upload, Icon, Modal} from 'antd';
-
-
-class AddTagModal extends React.Component {
- state = {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- };
-
- handleCancel = () => this.setState({ previewVisible: false });
-
- handlePreview = (file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- };
-
- handleChange = ({ fileList }) => this.setState({ fileList });
-
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
-