-
Notifications
You must be signed in to change notification settings - Fork 21
Dev -> Engagements #1406
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
Dev -> Engagements #1406
Changes from all commits
aa4b5c9
c0ee28c
6cf84b5
905c256
b33b925
f8f7de9
8d2c316
b530246
fa871ac
440c14c
5e1dd7f
1422386
16c640c
49eea51
5bafaef
cc66789
7cf6173
17c4257
e149a45
c3ca9bc
b90b66f
64edac4
afbe389
0d36298
9b889f1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,7 @@ | ||
| /* eslint-disable complexity */ | ||
| import { UserProfile } from '~/libs/core' | ||
| import { UserProfile, UserRole } from '~/libs/core' | ||
|
|
||
| import { ADMIN_ROLES } from '../config' | ||
|
|
||
| declare global { | ||
| interface Window { tcUniNav: any } | ||
|
|
@@ -125,3 +127,37 @@ export function isValidURL(urlToValidate: string): boolean { | |
| export function formatPlural(count: number, baseWord: string): string { | ||
| return `${baseWord}${count === 1 ? '' : 's'}` | ||
| } | ||
|
|
||
| /** | ||
| * Check if the user can download the profile | ||
| * @param authProfile - The authenticated user profile | ||
| * @param profile - The profile to check if the user can download | ||
| * @returns {boolean} - Whether the user can download the profile | ||
| */ | ||
| export function canDownloadProfile(authProfile: UserProfile | undefined, profile: UserProfile): boolean { | ||
| if (!authProfile) { | ||
| return false | ||
| } | ||
|
|
||
| // Check if user is viewing their own profile | ||
| if (authProfile.handle === profile.handle) { | ||
| return true | ||
| } | ||
|
|
||
| // Check if user has admin roles | ||
| if (authProfile.roles?.some(role => ADMIN_ROLES.includes(role.toLowerCase() as UserRole))) { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| return true | ||
| } | ||
|
|
||
| // Check if user has PM or Talent Manager roles | ||
| const allowedRoles = ['Project Manager', 'Talent Manager'] | ||
| if (authProfile | ||
| .roles?.some( | ||
| role => allowedRoles.some(allowed => role.toLowerCase() === allowed.toLowerCase()), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| ) | ||
| ) { | ||
| return true | ||
| } | ||
|
|
||
| return false | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ import { KeyedMutator } from 'swr' | |
| import classNames from 'classnames' | ||
|
|
||
| import { NamesAndHandleAppearance, useMemberTraits, UserProfile, UserTraitIds, UserTraits } from '~/libs/core' | ||
| import { CopyButton } from '~/apps/admin/src/lib/components/CopyButton' | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
|
|
||
| import { AddButton, EditMemberPropertyBtn, EmptySection } from '../../components' | ||
| import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config' | ||
|
|
@@ -119,6 +120,18 @@ const AboutMe: FC<AboutMeProps> = (props: AboutMeProps) => { | |
| /> | ||
| ) | ||
| } | ||
|
|
||
| {props.profile?.email | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [❗❗ |
||
| && ( | ||
| <div className={styles.titleWrap}> | ||
| <p className='body-main-bold'>Contact</p> | ||
| <div className={styles.email}> | ||
| <p className={styles.emailText}>{props.profile.email}</p> | ||
| <CopyButton className={styles.copyButton} text={props.profile.email} /> | ||
| </div> | ||
| </div> | ||
| )} | ||
|
|
||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,12 +7,68 @@ | |
| height: 100%; | ||
|
|
||
| .profileHeaderWrap { | ||
| position: relative; | ||
| background: url('../../lib/assets/profile-header-bg.png') no-repeat right top / auto, linear-gradient(#0d83c5, #0e89d5); | ||
|
|
||
| @include ltelg { | ||
| background: url('../../lib/assets/profile-header-bg-mobile.png') no-repeat right top /100% 100%; | ||
| } | ||
|
|
||
| .downloadButtonWrap { | ||
| position: absolute; | ||
| top: $sp-4; | ||
| right: calc((100% - #{$xxl-min}) / 2); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [ |
||
| max-width: $xxl-min; | ||
| width: 100%; | ||
| display: flex; | ||
| justify-content: flex-end; | ||
| padding-right: $sp-8; | ||
| z-index: 10; | ||
|
|
||
| @include ltexl { | ||
| right: $sp-8; | ||
| } | ||
|
|
||
| @include ltemd { | ||
| padding-right: $sp-6; | ||
| right: $sp-6; | ||
| } | ||
|
|
||
| @include ltesm { | ||
| padding-right: $sp-4; | ||
| right: $sp-4; | ||
| } | ||
|
|
||
| @include ltelg { | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [💡 |
||
| position: absolute; | ||
| top: $sp-4; | ||
| right: $sp-4; | ||
| left: auto; | ||
| max-width: none; | ||
| width: auto; | ||
| padding: 0; | ||
| pointer-events: auto; | ||
| } | ||
|
|
||
| > * { | ||
| pointer-events: auto; | ||
| } | ||
| } | ||
|
|
||
| .downloadButton { | ||
| color: $tc-white; | ||
| padding: $sp-2 $sp-4; | ||
| border-radius: 4px; | ||
| font-weight: $font-weight-bold; | ||
| font-family: $font-roboto; | ||
| font-size: 16px; | ||
|
|
||
| &:disabled { | ||
| opacity: 0.6; | ||
| cursor: not-allowed; | ||
| } | ||
| } | ||
|
|
||
| .profileHeaderContent { | ||
| padding: 0; | ||
| max-height: 260px; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[❗❗
correctness]Removing
LeaveStatus.WIPRO_HOLIDAYfromlegendStatusOrdermay affect any functionality that relies on the order of statuses. Ensure that this change is intentional and does not break any dependent logic.