Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(UI): add user location to user profile page #12016

Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
59f5510
[TA24802769] globe svg and package changes
Nov 20, 2024
9dd179c
[TA24802769] addition of country code fo user grapgql pulled info
Nov 20, 2024
c1aa21d
[TA24802769] pull and use country code, globe icon, and styling for t…
Nov 20, 2024
c7f3a72
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Dec 9, 2024
74aa42c
[TA25277786] move imports to top of file
Dec 11, 2024
8bf12c2
[TA25277786] move imports to top, pull in username from corpuser, imp…
Dec 11, 2024
0e95849
[TA25277786] add semicolon
Dec 11, 2024
4587495
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Dec 11, 2024
eaae314
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Dec 12, 2024
f943f9b
[TA25277786] follow import order, change countryCode var name in find…
Dec 12, 2024
4ec8e32
[TA25277786] prettier fixes
Dec 13, 2024
c22839f
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Dec 13, 2024
fe03f29
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Dec 13, 2024
26074c1
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 7, 2025
69df8ee
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 9, 2025
e00a161
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 10, 2025
80db21d
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 17, 2025
10cfa20
[TA25771590] refactoring changes
Jan 28, 2025
1853a36
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 28, 2025
08a1ab2
[TA25771590] linting changes
Jan 28, 2025
d1703a9
[TA25771590] linting changes
Jan 28, 2025
2669e55
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 29, 2025
b573b12
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 29, 2025
5c209af
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 29, 2025
0f077d3
Merge branch 'master' into sfiguere_uhg-add-user-location-to-profile
samanthafigueredo5 Jan 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion datahub-web-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@
"uuid": "^8.3.2",
"virtualizedtableforantd4": "^1.2.1",
"web-vitals": "^0.2.4",
"yamljs": "^0.3.0"
"yamljs": "^0.3.0",
"country-data-list": "^1.3.4"
},
"scripts": {
"analyze": "source-map-explorer 'dist/assets/*.js'",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ export const Name = styled.div`
margin: 13px 0 7px 0;
`;

export const UserDetails = styled.div`
font-size: 14px;
line-height: 35px;
font-weight: 400;
line-height: 28px;
text-align: center;
`

export const TitleRole = styled.div`
font-size: 14px;
line-height: 22px;
Expand All @@ -74,6 +82,8 @@ export const TitleRole = styled.div`
export const Team = styled.div`
font-size: 12px;
line-height: 20px;
font-weight: 400;
padding-bottom: 10px;
color: #8c8c8c;
`;

Expand Down Expand Up @@ -111,6 +121,23 @@ export const AboutSection = styled.div`
color: #262626;
`;

export const LocationSection = styled.div`
text-align: left;
font-weight: bold;
font-size: 14px;
line-height: 26px;
color: #262626;
`;

export const LocationSectionText = styled.div`
text-align: left;
font-weight: normal;
font-size: 14px;
line-height: 26px;
margin-bottom: -10px;
color: #262626;
`;

export const AboutSectionText = styled.div`
font-size: 12px;
font-weight: 100;
Expand Down
20 changes: 19 additions & 1 deletion datahub-web-react/src/app/entity/user/UserInfoSideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ import {
Name,
TitleRole,
Team,
LocationSection,
LocationSectionText,
UserDetails
} from '../shared/SidebarStyledComponents';
import EntityGroups from '../shared/EntityGroups';
import { mapRoleIcon } from '../../identity/user/UserUtils';
import { useUserContext } from '../../context/useUserContext';
import { useBrowserTitle } from '../../shared/BrowserTabTitleContext';
import GlobeIcon from '../../../images/Globe.svg';
import { countries } from 'country-data-list';
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved

const { Paragraph } = Typography;

Expand All @@ -38,6 +43,7 @@ type SideBarData = {
groupsDetails: Array<EntityRelationship>;
urn: string | undefined;
dataHubRoles: Array<EntityRelationship>;
countryCode: string | undefined;
};

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

const [updateCorpUserPropertiesMutation] = useUpdateCorpUserPropertiesMutation();
Expand Down Expand Up @@ -120,6 +126,7 @@ export default function UserInfoSideBar({ sideBarData, refetch }: Props) {
<SideBarSubSection className={isProfileOwner ? '' : 'fullView'}>
<CustomAvatar size={160} photoUrl={photoUrl} name={avatarName} style={AVATAR_STYLE} />
<Name>{name || <EmptyValue />}</Name>
<UserDetails>{urn?.replace('urn:li:corpuser:', '') || <EmptyValue />}</UserDetails>
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved
{role && <TitleRole>{role}</TitleRole>}
{team && <Team>{team}</Team>}
{dataHubRoleName && <Tag icon={mapRoleIcon(dataHubRoleName)}>{dataHubRoleName}</Tag>}
Expand All @@ -143,6 +150,17 @@ export default function UserInfoSideBar({ sideBarData, refetch }: Props) {
</Space>
</SocialDetails>
<Divider className="divider-aboutSection" />
{ countryCode && (
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved
<LocationSection>
Location
<br />
<LocationSectionText>
<img src={GlobeIcon} alt="Manage Users" style={{ display: 'inline' }} /> &nbsp;
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved
{countries[countryCode].name}
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved
</LocationSectionText>
<Divider className="divider-aboutSection" />
</LocationSection>
)}
<AboutSection>
About
<AboutSectionText>
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/app/entity/user/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ export default function UserProfile() {
undefined,
role: data?.corpUser?.editableProperties?.title || data?.corpUser?.info?.title || undefined,
team: data?.corpUser?.editableProperties?.teams?.join(',') || data?.corpUser?.info?.departmentName || undefined,
samanthafigueredo5 marked this conversation as resolved.
Show resolved Hide resolved
countryCode: data?.corpUser?.info?.countryCode|| undefined,
email: data?.corpUser?.editableProperties?.email || data?.corpUser?.info?.email || undefined,
slack: data?.corpUser?.editableProperties?.slack || undefined,
phone: data?.corpUser?.editableProperties?.phone || undefined,
Expand Down
1 change: 1 addition & 0 deletions datahub-web-react/src/graphql/user.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ query getUser($urn: String!, $groupsCount: Int!) {
fullName
email
departmentName
countryCode
}
editableProperties {
slack
Expand Down
10 changes: 10 additions & 0 deletions datahub-web-react/src/images/Globe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions datahub-web-react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5008,6 +5008,13 @@ cosmiconfig@^8.1.0, cosmiconfig@^8.1.3:
parse-json "^5.2.0"
path-type "^4.0.0"

country-data-list@^1.3.4:
version "1.3.4"
resolved "https://registry.yarnpkg.com/country-data-list/-/country-data-list-1.3.4.tgz#0c88a5b8b5c6cba2e0881ee378b7a24b5216aae4"
integrity sha512-BKwqyeXbmhhzOEf1gcH1Ui1X/ni8YmXTllhCTNW23ja/u7EY1lKS0hrK68kngw5ni6WooXLARXmnHxGnKDWQpQ==
dependencies:
currency-symbol-map "~5"

create-context-state@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/create-context-state/-/create-context-state-2.0.0.tgz#b58d33c553ef6c66958899d06fad4edf1b99ca24"
Expand Down Expand Up @@ -5097,6 +5104,11 @@ csstype@^3.0.2, csstype@^3.0.6, csstype@^3.0.7, csstype@^3.1.0, csstype@^3.1.1:
resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9"
integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw==

currency-symbol-map@~5:
version "5.1.0"
resolved "https://registry.yarnpkg.com/currency-symbol-map/-/currency-symbol-map-5.1.0.tgz#59531fbe977ba95e8d358e90e3c9e9053efb75ad"
integrity sha512-LO/lzYRw134LMDVnLyAf1dHE5tyO6axEFkR3TXjQIOmMkAM9YL6QsiUwuXzZAmFnuDJcs4hayOgyIYtViXFrLw==

"d3-array@2 - 3", "[email protected] - 3":
version "3.2.4"
resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-3.2.4.tgz#15fec33b237f97ac5d7c986dc77da273a8ed0bb5"
Expand Down
Loading