Merge branch 'application-mgt-new' into 'application-mgt-new'

Improve the profile feature to Show the logged user name

See merge request entgra/carbon-device-mgt!312
4.x.x
Dharmakeerthi Lasantha 5 years ago
commit ace268e12a

@ -102,6 +102,7 @@ class App extends React.Component {
window.location.origin + "/publisher-ui-request-handler/user", window.location.origin + "/publisher-ui-request-handler/user",
"platform=publisher" "platform=publisher"
).then(res => { ).then(res => {
config.user = res.data.data;
const pageURL = window.location.pathname; const pageURL = window.location.pathname;
const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1); const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
if (lastURLSegment === "login") { if (lastURLSegment === "login") {

@ -221,7 +221,7 @@ class NewAppUploadForm extends React.Component {
}; };
handleLowerOsVersionChange = (lowerOsVersion) => { handleLowerOsVersionChange = (lowerOsVersion) => {
this.lowerOsVersion = lowerOsVersion; this.lowerOsVersion = parseFloat(lowerOsVersion);
this.setState({ this.setState({
osVersionsValidateStatus: 'validating', osVersionsValidateStatus: 'validating',
osVersionsHelperText: '' osVersionsHelperText: ''
@ -229,7 +229,7 @@ class NewAppUploadForm extends React.Component {
}; };
handleUpperOsVersionChange = (upperOsVersion) => { handleUpperOsVersionChange = (upperOsVersion) => {
this.upperOsVersion = upperOsVersion; this.upperOsVersion = parseFloat(upperOsVersion);
this.setState({ this.setState({
osVersionsValidateStatus: 'validating', osVersionsValidateStatus: 'validating',
osVersionsHelperText: '' osVersionsHelperText: ''
@ -479,6 +479,7 @@ class NewAppUploadForm extends React.Component {
required: true, required: true,
message: 'Please select' message: 'Please select'
}], }],
initialValue: false
})( })(
<Switch checkedChildren={<Icon type="check"/>} <Switch checkedChildren={<Icon type="check"/>}
unCheckedChildren={<Icon type="close"/>} unCheckedChildren={<Icon type="close"/>}

@ -122,7 +122,7 @@ class Dashboard extends React.Component {
<SubMenu className="profile" <SubMenu className="profile"
title={ title={
<span className="submenu-title-wrapper"> <span className="submenu-title-wrapper">
<Icon type="user"/>Profile <Icon type="user"/>{this.config.user}
</span>}> </span>}>
<Logout/> <Logout/>
</SubMenu> </SubMenu>

@ -82,6 +82,7 @@ class App extends React.Component {
window.location.origin + "/store-ui-request-handler/user", window.location.origin + "/store-ui-request-handler/user",
"platform=publisher" "platform=publisher"
).then(res => { ).then(res => {
config.user = res.data.data;
const pageURL = window.location.pathname; const pageURL = window.location.pathname;
const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1); const lastURLSegment = pageURL.substr(pageURL.lastIndexOf('/') + 1);
if (lastURLSegment === "login") { if (lastURLSegment === "login") {

@ -41,6 +41,7 @@ class Dashboard extends React.Component {
collapsed: false collapsed: false
}; };
this.logo = this.props.context.theme.logo; this.logo = this.props.context.theme.logo;
this.config = this.props.context;
} }
componentDidMount() { componentDidMount() {
@ -138,7 +139,7 @@ class Dashboard extends React.Component {
title={ title={
<span className="submenu-title-wrapper"> <span className="submenu-title-wrapper">
<Icon type="user"/> <Icon type="user"/>
Profile {this.config.user}
</span> }> </span> }>
<Logout/> <Logout/>
</SubMenu> </SubMenu>

Loading…
Cancel
Save