From 13bdeee8834fe066a2d56792700dca81e3ab5a5d Mon Sep 17 00:00:00 2001 From: Jayasanka Date: Sat, 19 Oct 2019 16:00:48 +0530 Subject: [PATCH] Set favicon when loading APPM UI --- .../react-app/src/App.js | 9 +++++++++ .../src/components/new-app/subForms/NewAppUploadForm.js | 2 +- .../react-app/src/App.js | 9 +++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) 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 01250e3791..69ecede98c 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 @@ -64,6 +64,7 @@ class App extends React.Component { } componentDidMount() { + this.updateFavicon(); axios.get( window.location.origin + "/publisher/public/conf/config.json", ).then(res => { @@ -130,6 +131,14 @@ class App extends React.Component { }); }; + 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; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js index 3cf81bf2b3..57ca8f1f57 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.ui/react-app/src/components/new-app/subForms/NewAppUploadForm.js @@ -34,7 +34,7 @@ import { Select } from 'antd'; import axios from "axios"; -import {withConfigContext} from "../../../../context/ConfigContext"; +import {withConfigContext} from "../../../context/ConfigContext"; const {TextArea} = Input; const InputGroup = Input.Group; 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 7031c03cc8..fd047221ee 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 @@ -64,6 +64,7 @@ class App extends React.Component { } componentDidMount() { + this.updateFavicon(); axios.get( window.location.origin + "/store/public/conf/config.json", ).then(res => { @@ -77,6 +78,14 @@ class App extends React.Component { }); } + 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",