Skip to content

Commit c1aa21d

Browse files
author
sfiguere
committed
[TA24802769] pull and use country code, globe icon, and styling for text for location
1 parent 9dd179c commit c1aa21d

File tree

3 files changed

+47
-1
lines changed

3 files changed

+47
-1
lines changed

datahub-web-react/src/app/entity/shared/SidebarStyledComponents.tsx

+27
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,14 @@ export const Name = styled.div`
6464
margin: 13px 0 7px 0;
6565
`;
6666

67+
export const UserDetails = styled.div`
68+
font-size: 14px;
69+
line-height: 35px;
70+
font-weight: 400;
71+
line-height: 28px;
72+
text-align: center;
73+
`
74+
6775
export const TitleRole = styled.div`
6876
font-size: 14px;
6977
line-height: 22px;
@@ -74,6 +82,8 @@ export const TitleRole = styled.div`
7482
export const Team = styled.div`
7583
font-size: 12px;
7684
line-height: 20px;
85+
font-weight: 400;
86+
padding-bottom: 10px;
7787
color: #8c8c8c;
7888
`;
7989

@@ -111,6 +121,23 @@ export const AboutSection = styled.div`
111121
color: #262626;
112122
`;
113123

124+
export const LocationSection = styled.div`
125+
text-align: left;
126+
font-weight: bold;
127+
font-size: 14px;
128+
line-height: 26px;
129+
color: #262626;
130+
`;
131+
132+
export const LocationSectionText = styled.div`
133+
text-align: left;
134+
font-weight: normal;
135+
font-size: 14px;
136+
line-height: 26px;
137+
margin-bottom: -10px;
138+
color: #262626;
139+
`;
140+
114141
export const AboutSectionText = styled.div`
115142
font-size: 12px;
116143
font-weight: 100;

datahub-web-react/src/app/entity/user/UserInfoSideBar.tsx

+19-1
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@ import {
1717
Name,
1818
TitleRole,
1919
Team,
20+
LocationSection,
21+
LocationSectionText,
22+
UserDetails
2023
} from '../shared/SidebarStyledComponents';
2124
import EntityGroups from '../shared/EntityGroups';
2225
import { mapRoleIcon } from '../../identity/user/UserUtils';
2326
import { useUserContext } from '../../context/useUserContext';
2427
import { useBrowserTitle } from '../../shared/BrowserTabTitleContext';
28+
import GlobeIcon from '../../../images/Globe.svg';
29+
import { countries } from 'country-data-list';
2530

2631
const { Paragraph } = Typography;
2732

@@ -38,6 +43,7 @@ type SideBarData = {
3843
groupsDetails: Array<EntityRelationship>;
3944
urn: string | undefined;
4045
dataHubRoles: Array<EntityRelationship>;
46+
countryCode: string | undefined;
4147
};
4248

4349
type Props = {
@@ -51,7 +57,7 @@ const AVATAR_STYLE = { marginTop: '14px' };
5157
* UserInfoSideBar- Sidebar section for users profiles.
5258
*/
5359
export default function UserInfoSideBar({ sideBarData, refetch }: Props) {
54-
const { name, aboutText, avatarName, email, groupsDetails, phone, photoUrl, role, slack, team, dataHubRoles, urn } =
60+
const { name, aboutText, avatarName, email, groupsDetails, phone, photoUrl, role, slack, team, dataHubRoles, urn, countryCode } =
5561
sideBarData;
5662

5763
const [updateCorpUserPropertiesMutation] = useUpdateCorpUserPropertiesMutation();
@@ -120,6 +126,7 @@ export default function UserInfoSideBar({ sideBarData, refetch }: Props) {
120126
<SideBarSubSection className={isProfileOwner ? '' : 'fullView'}>
121127
<CustomAvatar size={160} photoUrl={photoUrl} name={avatarName} style={AVATAR_STYLE} />
122128
<Name>{name || <EmptyValue />}</Name>
129+
<UserDetails>{urn?.replace('urn:li:corpuser:', '') || <EmptyValue />}</UserDetails>
123130
{role && <TitleRole>{role}</TitleRole>}
124131
{team && <Team>{team}</Team>}
125132
{dataHubRoleName && <Tag icon={mapRoleIcon(dataHubRoleName)}>{dataHubRoleName}</Tag>}
@@ -143,6 +150,17 @@ export default function UserInfoSideBar({ sideBarData, refetch }: Props) {
143150
</Space>
144151
</SocialDetails>
145152
<Divider className="divider-aboutSection" />
153+
{ countryCode && (
154+
<LocationSection>
155+
Location
156+
<br />
157+
<LocationSectionText>
158+
<img src={GlobeIcon} alt="Manage Users" style={{ display: 'inline' }} /> &nbsp;
159+
{countries[countryCode].name}
160+
</LocationSectionText>
161+
<Divider className="divider-aboutSection" />
162+
</LocationSection>
163+
)}
146164
<AboutSection>
147165
About
148166
<AboutSectionText>

datahub-web-react/src/app/entity/user/UserProfile.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ export default function UserProfile() {
107107
undefined,
108108
role: data?.corpUser?.editableProperties?.title || data?.corpUser?.info?.title || undefined,
109109
team: data?.corpUser?.editableProperties?.teams?.join(',') || data?.corpUser?.info?.departmentName || undefined,
110+
countryCode: data?.corpUser?.info?.countryCode|| undefined,
110111
email: data?.corpUser?.editableProperties?.email || data?.corpUser?.info?.email || undefined,
111112
slack: data?.corpUser?.editableProperties?.slack || undefined,
112113
phone: data?.corpUser?.editableProperties?.phone || undefined,

0 commit comments

Comments
 (0)