mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
feat: allow user to view their profile again (#11816)
This commit is contained in:
parent
07288789e2
commit
f2d9f00013
@ -46,6 +46,7 @@ interface NavBarProps {
|
|||||||
user_info_url: string;
|
user_info_url: string;
|
||||||
user_login_url: string;
|
user_login_url: string;
|
||||||
user_logout_url: string;
|
user_logout_url: string;
|
||||||
|
user_profile_url: string | null;
|
||||||
locale: string;
|
locale: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,8 +196,15 @@ export function Menu({
|
|||||||
{!navbarRight.user_is_anonymous && [
|
{!navbarRight.user_is_anonymous && [
|
||||||
<DropdownMenu.Divider key="user-divider" />,
|
<DropdownMenu.Divider key="user-divider" />,
|
||||||
<DropdownMenu.ItemGroup key="user-section" title={t('User')}>
|
<DropdownMenu.ItemGroup key="user-section" title={t('User')}>
|
||||||
<DropdownMenu.Item key="profile">
|
{navbarRight.user_profile_url && (
|
||||||
<a href={navbarRight.user_info_url}>{t('Profile')}</a>
|
<DropdownMenu.Item key="profile">
|
||||||
|
<a href={navbarRight.user_profile_url}>
|
||||||
|
{t('Profile')}
|
||||||
|
</a>
|
||||||
|
</DropdownMenu.Item>
|
||||||
|
)}
|
||||||
|
<DropdownMenu.Item key="info">
|
||||||
|
<a href={navbarRight.user_info_url}>{t('Info')}</a>
|
||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
<DropdownMenu.Item key="logout">
|
<DropdownMenu.Item key="logout">
|
||||||
<a href={navbarRight.user_logout_url}>{t('Logout')}</a>
|
<a href={navbarRight.user_logout_url}>{t('Logout')}</a>
|
||||||
|
@ -106,7 +106,8 @@
|
|||||||
<i class="fa fa-user"></i> <b class="caret"></b>
|
<i class="fa fa-user"></i> <b class="caret"></b>
|
||||||
</a>
|
</a>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="{{appbuilder.get_url_for_userinfo}}"><span class="fa fa-fw fa-user"></span>{{_("Profile")}}</a></li>
|
<li><a href="/superset/profile/{{g.user.username}}"><span class="fa fa-fw fa-user"></span>{{_("Profile")}}</a></li>
|
||||||
|
<li><a href="{{appbuilder.get_url_for_userinfo}}"><span class="fa fa-fw fa-user"></span>{{_("Info")}}</a></li>
|
||||||
<li><a href="{{appbuilder.get_url_for_logout}}"><span class="fa fa-fw fa-sign-out"></span>{{_("Logout")}}</a></li>
|
<li><a href="{{appbuilder.get_url_for_logout}}"><span class="fa fa-fw fa-sign-out"></span>{{_("Logout")}}</a></li>
|
||||||
{% if version_string or version_sha %}
|
{% if version_string or version_sha %}
|
||||||
<li class="fineprint">
|
<li class="fineprint">
|
||||||
|
@ -297,6 +297,9 @@ def menu_data() -> Dict[str, Any]:
|
|||||||
"user_info_url": appbuilder.get_url_for_userinfo,
|
"user_info_url": appbuilder.get_url_for_userinfo,
|
||||||
"user_logout_url": appbuilder.get_url_for_logout,
|
"user_logout_url": appbuilder.get_url_for_logout,
|
||||||
"user_login_url": appbuilder.get_url_for_login,
|
"user_login_url": appbuilder.get_url_for_login,
|
||||||
|
"user_profile_url": None
|
||||||
|
if g.user.is_anonymous
|
||||||
|
else f"/superset/profile/{g.user.username}",
|
||||||
"locale": session.get("locale", "en"),
|
"locale": session.get("locale", "en"),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user