diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx index eb64ab434a2..cdf1b82a938 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/src/main/resources/publisher/src/components/AppPublisherBase/BaseLayout.jsx @@ -39,11 +39,12 @@ class BaseLayout extends Component { this.logout = this.logout.bind(this); this.closeModal = this.closeModal.bind(this); this.onClickPlatforms = this.onClickPlatforms.bind(this); + this.onClickApplications = this.onClickApplications.bind(this); this.state = { notifications: 0, user: 'Admin', openModal: false, - currentPage: "Applications", + currentPage: "", logo: {} }; } @@ -80,10 +81,25 @@ class BaseLayout extends Component { onClickPlatforms() { window.location.href = "/publisher/assets/platforms"; - this.setState({currentPage: "Platforms"}); + this.setState({currentPage: "Platforms"}) + } + + onClickApplications() { + window.location.href = "/publisher/assets/apps"; + } + + getCurrentPageTitle() { + let href = window.location.href; + + if (href.indexOf("apps") !== -1) { + return "Applications"; + } else if (href.indexOf("platforms") !== -1) { + return "Platforms" + } } + render() { const userName = this.state.user._userName[0]; return ( @@ -138,13 +154,21 @@ class BaseLayout extends Component {
{/*TODO: Add the current page title*/} - {/*{window.location.pathname}*/} + {this.getCurrentPageTitle()}
- + {this.getCurrentPageTitle() === "Applications" ? + : + + }