-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Adds avatarUrl handling to the hidden refs popover #3936
base: main
Are you sure you want to change the base?
Conversation
d0564d9
to
34a2e4f
Compare
34a2e4f
to
c6a5767
Compare
import React from 'react'; | ||
import { CodeIcon } from '../../../shared/components/code-icon.react'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention |
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.
What is the reason for disabling lint here?
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.
our eslint config works incorrect with react component names because react component name is not camelCased
import { CodeIcon } from '../../../shared/components/code-icon.react'; | ||
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export function RemoteIcon({ refOptData }: Readonly<{ refOptData: GraphRefOptData }>) { |
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.
This file feels more like a subcomponent, not a util.
|
||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export function RemoteIcon({ refOptData }: Readonly<{ refOptData: GraphRefOptData }>) { | ||
console.log({ ref: refOptData }); |
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.
Please remove console logs before moving to PR.
import type { GraphRefOptData } from '@gitkraken/gitkraken-components'; | ||
import { refTypes } from '@gitkraken/gitkraken-components'; |
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'm not sure that the component is bundled such that importing from it in more files won't affect our bundle size, so this may or may not matter, but let's try to keep these imports in protocol
of this domain and then pass them here, like we did with other types.
export function compareGraphRefOpts(a: GraphRefOptData, b: GraphRefOptData): number { | ||
const comparationResult = a.name.localeCompare(b.name); | ||
if (comparationResult === 0) { | ||
// If names are equals | ||
if (a.type === refTypes.REMOTE) { | ||
return -1; | ||
} | ||
} | ||
return comparationResult; | ||
} |
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.
This could use a comment explaining what is being compared and why. Also, for my own understanding, why are we only considering the type of a
and not b
?
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.
This part is copied from GitkrakenComponents lib
Description
Tried to reuse methods and components from the GraphComponents module, but it cannot be imported. Implemented very simplified copies of required functions to show avatarUrl and sort the list
Checklist
Fixes $XXX -
orCloses #XXX -
prefix to auto-close the issue that your PR addresses