diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/public/themes/default/default-theme.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/public/themes/default/default-theme.css
index 0afbb7ba5f..2b7f80bffa 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/public/themes/default/default-theme.css
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/public/themes/default/default-theme.css
@@ -87,7 +87,7 @@ body {
.btn-header {
margin-top: 15px;
- margin-right: 20px;
+ margin-right: 100px;
color: white;
}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/App.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/App.jsx
index f1084e1993..e00894e3eb 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/App.jsx
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/App.jsx
@@ -63,6 +63,7 @@ class Base extends Component {
}
render() {
+ console.log('came here/////');
if (this.state.user !== null) {
return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/common/configuration.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/common/configuration.js
index 61adb30f01..77d90dc444 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/common/configuration.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/common/configuration.js
@@ -36,6 +36,7 @@ class Configuration {
let thisObject = this;
axios.get(thisObject.hostConstants.baseURL + '/' + thisObject.hostConstants.appContext + "/config.json").
then(function (response) {
+ console.log('succesfully loadedd....');
thisObject.serverConfig = response.data.config;
thisObject.themeConfig = response.data.theme;
Constants.load();
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/AppStoreBase/BaseLayout.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/AppStoreBase/BaseLayout.jsx
index de64011fe0..6e46e5fda8 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/AppStoreBase/BaseLayout.jsx
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/AppStoreBase/BaseLayout.jsx
@@ -36,10 +36,12 @@ class BaseLayout extends Component {
this.state = {
notifications: 0,
user: 'Admin',
- openModal: false
+ openModal: false,
+ userOptions : false
};
this.logout = this.logout.bind(this);
this.closeModal = this.closeModal.bind(this);
+ this.handleUserOptionsOnClick = this.handleUserOptionsOnClick.bind(this);
}
handleApplicationClick() {
@@ -62,6 +64,10 @@ class BaseLayout extends Component {
this.setState({openModal: false});
}
+ handleUserOptionsOnClick() {
+ this.setState({userOptions : true});
+ }
+
render() {
return (
@@ -72,8 +78,8 @@ class BaseLayout extends Component {
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/Application/ApplicationListing.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/Application/ApplicationListing.jsx
index 299e0a1513..39786db932 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/Application/ApplicationListing.jsx
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/Application/ApplicationListing.jsx
@@ -238,6 +238,7 @@ class ApplicationListing extends Component {
}
render() {
+ console.log('render app listing');
return (
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/UserOptions.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/UserOptions.jsx
index d9c2fa86a6..76f42c3d3a 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/UserOptions.jsx
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/UserOptions.jsx
@@ -17,37 +17,42 @@
*/
import React, {Component} from 'react';
-import Theme from '../../../theme';
+import './user-options.css';
+import AuthHandler from '../../../api/authHandler';
class UserOptions extends Component {
constructor() {
super();
- this.scriptId = "userOptions";
+ this.state = {};
}
componentWillMount() {
- /**
- *Loading the theme files based on the the user-preference.
- */
- Theme.insertThemingScripts(this.scriptId);
- }
-
- componentWillUnmount() {
- Theme.removeThemingScripts(this.scriptId);
+ let user = AuthHandler.getUser();
+ if (user) {
+ if (!AuthHandler.isTokenExpired()) {
+ this.setState({user: user});
+ } else {
+ this.setState({user: null});
+ }
+ }
}
render() {
- const {height, width} = this.props;
- return (
-
-
-
- )
+ var displayOptions = this.props.userOptions ? "block" : "none";
+ if (this.state.user) {
+ return (
+
+ );
+ } else {
+ return (
+
+ );
+ }
}
}
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/user-options.css b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/user-options.css
new file mode 100644
index 0000000000..8ac391a316
--- /dev/null
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/components/UIComponents/UserOptions/user-options.css
@@ -0,0 +1,45 @@
+
+.dropbtn {
+ background-color: #4CAF50;
+ color: white;
+ padding: 16px;
+ font-size: 16px;
+ border: none;
+ cursor: pointer;
+}
+
+/* The container - needed to position the dropdown content */
+.dropdown {
+ position: relative;
+ display: inline-block;
+}
+
+/* Dropdown Content (Hidden by Default) */
+.dropdown-content {
+ display: none;
+ position: absolute;
+ background-color: #f9f9f9;
+ box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
+ z-index: 1;
+}
+
+/* Links inside the dropdown */
+.dropdown-content a {
+ color: black;
+ padding: 12px 16px;
+ text-decoration: none;
+ display: block;
+}
+
+/* Change color of dropdown links on hover */
+.dropdown-content a:hover {background-color: #f1f1f1}
+
+/* Show the dropdown menu on hover */
+.dropdown:hover .dropdown-content {
+ display: block;
+}
+
+/* Change the background color of the dropdown button when the dropdown content is shown */
+.dropdown:hover .dropbtn {
+ background-color: #3e8e41;
+}
\ No newline at end of file
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/index.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/index.js
index b9bc86bba4..04e93185f8 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/index.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/src/index.js
@@ -46,7 +46,7 @@ function loadStore() {
}).catch(error => {
addLocaleData(require('react-intl/locale-data/en'));
let defaultLocale = Axios.create({
- baseURL: Configuration.hostConstants.baseURL + "/" + Configuration.hostConstants.appContext + "/locales"
+ baseURL: Configuration.hostConstants.baseURL + "/" + Configuration.hostConstants.appContext + "/locales/"
+ Constants.defaultLocale + ".json"
}).get();
defaultLocale.then(response => {
diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/webpack.config.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/webpack.config.js
index 8b9124b3f2..00f2d7dc43 100644
--- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/webpack.config.js
+++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.ui/src/main/resources/store/webpack.config.js
@@ -64,7 +64,6 @@ const config = {
]
},
resolve: {
- // you can now require('file') instead of require('file.coffee')
extensions: ['.jsx', '.js', '.ttf', '.woff', '.woff2', '.svg']
}