-
Notifications
You must be signed in to change notification settings - Fork 30
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
[env/github] map SAML SSO data from Okta into user's profile data #1667
Conversation
Code Climate has analyzed commit 15dfaa4 and detected 3 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Visit the preview URL for this PR (updated for commit 15dfaa4): https://co-reality-staging--preview-pr-1667-zq61mbfg.web.app (expires Mon, 12 Jul 2021 00:11:41 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
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.
A bunch of comments/changes/etc. I'll probably try and fix these up today to save time since I assume you're offline at the moment.
src/components/molecules/ProfilePictureInput/ProfilePictureInput.tsx
Outdated
Show resolved
Hide resolved
src/components/molecules/ProfilePictureInput/ProfilePictureInput.tsx
Outdated
Show resolved
Hide resolved
src/components/molecules/ProfilePictureInput/ProfilePictureInput.tsx
Outdated
Show resolved
Hide resolved
src/components/molecules/ProfilePictureInput/ProfilePictureInput.tsx
Outdated
Show resolved
Hide resolved
Co-authored-by: Glenn 'devalias' Grant <glenn@devalias.net>
…sparkle into feature/apply-SAML-mappings
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.
Few more changes needed here.
src/components/molecules/ProfilePictureInput/ProfilePictureInput.tsx
Outdated
Show resolved
Hide resolved
const getRenderedAvatarImageComponent = useCallback( | ||
(avatarSrc: string, key: string | number) => ( | ||
<div | ||
key={`${avatar}-${index}`} | ||
key={`${avatarSrc}-${key}`} | ||
className="profile-picture-preview-container" | ||
onClick={() => uploadDefaultAvatar(avatar)} | ||
onClick={() => uploadDefaultAvatar(avatarSrc)} | ||
> | ||
<img | ||
src={avatar} | ||
src={avatarSrc} | ||
className="profile-icon profile-picture-preview" | ||
alt={`default avatar ${index}`} | ||
alt={`default avatar ${key}`} | ||
/> | ||
</div> | ||
)); | ||
}, [defaultAvatars, uploadDefaultAvatar]); | ||
), | ||
[uploadDefaultAvatar] | ||
); | ||
|
||
const avatarImages = useMemo(() => { | ||
const renderedAvatarImages = defaultAvatars.map( | ||
getRenderedAvatarImageComponent | ||
); |
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.
I still don't see why we would bother keeping getRenderedAvatarImageComponent
instead of just inlining it within avatarImages
.
defaultAvatars
is a string[]
githubImageSrc
is a string | undefined
So just do something like:
[githubAvatarImage, ...defaultAvatars].filter(isDefined).map((avatarSrc) =>
<div
key={avatarSrc}
// ..snip..
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.
Done in 36f9ee2
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.
Why did you use the index
as part of the key
?
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.
@0xdevalias legacy logic
src/components/organisms/UserProfileModal/UserProfileModal.scss
Outdated
Show resolved
Hide resolved
return ( | ||
<React.Fragment key={question.text}> | ||
<p className="light question">{question.text}</p> | ||
<p className="light no-margin">{question.text}</p> | ||
<h6>{questionAnswer}</h6> | ||
</React.Fragment> | ||
); |
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.
[OOS] But the usage of h6
here is SUPER janky. Header tags shouldn't be used for styling like this. This breaks all sorts of accessibility rules.
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.
Actually.. bootstrap has classes that mirror the header styling. Can you change this to a div or something and use the h6 class at the very least? Should be a quick fix for it i'm guessing.
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.
Why are they junky though? Note that this is for env/github
only
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.
Not sure which bootstrap you are referring to, but it looks like here the h1 tags are also used.
https://mdbootstrap.com/docs/standard/navigation/headers/
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.
'Bootstrap' refers to https://getbootstrap.com/
- https://getbootstrap.com/docs/4.0/content/typography/#headings
-
.h1
through.h6
classes are also available, for when you want to match the font styling of a heading but cannot use the associated HTML element.
-
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.
Done in 41dc9b2
Out of curiousity, hoes does it effect the all sorts of accessibility rules
?
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.
Thanks :)
I explained this way back in the past. But basically headings have a very specific and defined semantic meaning in HTML structure, that is used by screen readers/etc.
This was from a quick google, there may be other/better resources:
Co-authored-by: Glenn 'devalias' Grant <glenn@devalias.net>
Co-authored-by: Glenn 'devalias' Grant <glenn@devalias.net>
src/components/organisms/ProfileModal/EditProfileForm/EditProfileForm.tsx
Outdated
Show resolved
Hide resolved
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.
I believe this comment still needs addressing: #1667 (comment)
But aside from that, I think this looks good to go.
Note: I've only code reviewed, not clickthrough/etc. But if you're happy with how it looks/functions, LGTM!
closes https://github.com/sparkletown/internal-sparkle-issues/issues/767
Get data from Okta and apply it to the app.
Adds new user fields.
Will need to base it offThis has been done nowenv/github
, once it's updated with the lateststaging