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
Add the component and utility for helm release grouping #3913
Add the component and utility for helm release grouping #3913
Conversation
/kind feature |
b3213b0
to
4dc667a
Compare
4dc667a
to
42438de
Compare
42438de
to
dfa2e4d
Compare
&__label { | ||
cursor: pointer; | ||
} | ||
} |
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.
add extra line 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.
fixed
frontend/public/imgs/logos/helm.svg
Outdated
@@ -0,0 +1 @@ | |||
<svg xmlns="http://www.w3.org/2000/svg" role="img" viewBox="-6.49 -6.74 316.49 363.74"><mask id="a" fill="#fff"><path fill-rule="evenodd" d="m0 0h313.303155v159.864865h-313.303155z"/></mask><mask id="b" fill="#fff"><path fill-rule="evenodd" d="m0 0h313.303155v159.864865h-313.303155z"/></mask><g fill="none" fill-rule="evenodd"><path fill="#000" d="m11.6785714 189h19.7858357v26.789h23.9037v-26.789h19.7858358v75.25h-19.7858358v-28.695333h-23.9037v28.695333h-19.7858357zm86.1738429 75.25v-75.25h46.8030427v16.354333h-27.017207v12.240667h23.9037v16.655333h-23.9037v13.846h27.017207v16.153667zm68.4971567 0v-75.25h19.785836v55.384h27.117643v19.866zm77.536372-75.25 30.733328 27.892667 30.632893-27.892667h8.938779v75.25h-19.886272v-38.628333l-19.6854 17.959666-19.785835-17.859333v38.528h-19.886272v-75.25z" transform="translate(-11 -51)"/><g><g fill="#000" mask="url(#a)" transform="matrix(1 0 0 -1 .958 404)"><path d="m203.460676 95.6875425c6.93631 0 12.559301-14.8092194 12.559301-33.0773172s-5.622991-33.0773172-12.559301-33.0773172c-6.936311 0-12.559301 14.8092194-12.559301 33.0773172s5.62299 33.0773172 12.559301 33.0773172z" transform="rotate(35 137.931 151.55)"/><path d="m30.1423223 95.6875425c6.9363104 0 12.559301-14.8092194 12.559301-33.0773172s-5.6229906-33.0773172-12.559301-33.0773172-12.5593009 14.8092194-12.5593009 33.0773172 5.6229905 33.0773172 12.5593009 33.0773172z" transform="scale(-1 1) rotate(35 -104.692 -68.258)"/><path d="m116.732815 66.2752676c6.936311 0 12.559301-14.8092193 12.559301-33.0773172 0-18.2680978-5.62299-33.07731713-12.559301-33.07731713-6.93631 0-12.559301 14.80921933-12.559301 33.07731713 0 18.2680979 5.622991 33.0773172 12.559301 33.0773172z" transform="matrix(-1 0 0 1 272.629 53.67)"/></g><path stroke="#000" stroke-width="20" d="m251.467006 173.099849c-20.230076-33.609969-56.889565-56.067908-98.755776-56.067908-40.720798 0-76.5158766 21.245901-97.0586959 53.334588m2.1981107 129.169534c20.8403036 30.232701 55.5559042 50.026591 94.8605852 50.026591 39.376099 0 74.146424-19.865887 94.974049-50.191495" mask="url(#a)" transform="matrix(1 0 0 -1 .958 404)"/></g><g><g fill="#000" mask="url(#b)" transform="translate(.958 -51)"><path d="m203.460676 95.6875425c6.93631 0 12.559301-14.8092194 12.559301-33.0773172s-5.622991-33.0773172-12.559301-33.0773172c-6.936311 0-12.559301 14.8092194-12.559301 33.0773172s5.62299 33.0773172 12.559301 33.0773172z" transform="rotate(35 141.831 150.32)"/><path d="m30.1423223 95.6875425c6.9363104 0 12.559301-14.8092194 12.559301-33.0773172s-5.6229906-33.0773172-12.559301-33.0773172-12.5593009 14.8092194-12.5593009 33.0773172 5.6229905 33.0773172 12.5593009 33.0773172z" transform="scale(-1 1) rotate(35 -100.792 -69.488)"/><path d="m116.732815 66.2752676c6.936311 0 12.559301-14.8092193 12.559301-33.0773172 0-18.2680978-5.62299-33.07731713-12.559301-33.07731713-6.93631 0-12.559301 14.80921933-12.559301 33.07731713 0 18.2680979 5.622991 33.0773172 12.559301 33.0773172z" transform="matrix(-1 0 0 1 272.629 51.211)"/></g><path stroke="#000" stroke-width="20" d="m251.467006 170.64039c-20.230076-33.609969-56.889565-56.067908-98.755776-56.067908-40.720798 0-76.5158766 21.2459-97.0586959 53.334587m2.1981107 129.169534c20.8403036 30.232702 55.5559042 50.026591 94.8605852 50.026591 39.376099 0 74.146424-19.865886 94.974049-50.191494" mask="url(#b)" transform="translate(.958 -51)"/></g></g></svg> |
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.
add new line at the end.
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.
fixed
y={y + height + 20} | ||
paddingX={8} | ||
paddingY={4} | ||
kind="HelmRelease" |
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.
Instead of hard coding HelmRelease
can we use element.getData().kind
? Or is there a model for Helm release that we can use?
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.
There is no model or kind for this group.
if (isHelmReleaseNode(deploymentConfig)) { | ||
groupsData = [ | ||
...getTopologyHelmReleaseGroupItem( | ||
deploymentConfig, | ||
topologyGraphAndNodeData.graph.groups, | ||
), | ||
]; | ||
} else { | ||
groupsData = [ | ||
...getTopologyGroupItems(deploymentConfig, topologyGraphAndNodeData.graph.groups), | ||
]; | ||
} |
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.
It would be good to move HelmReleaseGroupItem call into getTopologyGroupItems
function, we could return different group based on the conditions there. So that later on we can have all group related login in one place rather that adding more if else here. Any thoughts ?
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 agree. fixed
834ab91
to
90e1e79
Compare
@openshift/team-devconsole-ux For the type badge, should it be located after the label text as shown above more more inline with what is shown at https://docs.google.com/document/d/1TjzqcUgz6A6_3SiUsqCG1qsHK9z6hAKWMqvEYW7a1ew/edit#heading=h.g319y27ad91p (before the resource badge). |
@jeff-phillips-18 there seems to be a different design for the helm group icon. I followed this design which is marked final https://docs.google.com/document/d/1JVDrPC5Ow2Qmxn9mH1BmPuJhukP5op4Kp4z34xZ95qE/edit#heading=h.aaw0sjx7rogf |
@@ -123,6 +149,7 @@ class ComponentFactory { | |||
case TYPE_REVISION_TRAFFIC: | |||
return TrafficLink; | |||
case TYPE_WORKLOAD: | |||
console.log('##################33', kind, type); |
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
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.
removed
90e1e79
to
6c0fe6b
Compare
@karthikjeeyar fixed! |
6c0fe6b
to
f189115
Compare
@sahil143 As per the final design doc the icon has to be in the front. Note: if the helm chart doesn't have icon then default it to helm icon cc: @serenamarie125 @openshift/team-devconsole-ux |
const releaseExists = _.some(groups, { name: releaseLabel }); | ||
if (!releaseExists) { | ||
groups.push({ | ||
id: `group:${releaseLabel}`, |
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.
Your prefix would be better to be helm specific. Perhaps helm-release:
const [badgeSize, badgeRef] = useSize([kind]); | ||
const [labelSize, labelRef] = useSize([children, textSize, badgeSize]); | ||
const iconSpace = kind && badgeSize ? badgeSize.width + paddingX : 0; | ||
const labelSizeWidth = icon ? paddingX * 2 + iconSpace + iconSize / 2 : paddingX * 2 + iconSpace; |
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.
Remove the duplicate parts to before the ternary operation.
<image | ||
x={x + labelSize.width / 2 + paddingX - iconSize / 2 + iconPadding} | ||
y={y + iconPadding} | ||
width={30} |
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.
Iconsize - iconpadding * 2?
You seem to be doing a lot computed values but this size remains static even though it is as relative value.
const HelmRelease: React.FC<HelmReleaseProps> = ({ element, dragging, filters }) => { | ||
const [hover, hoverRef] = useHover(); | ||
const { x, y, width, height } = element.getBounds(); | ||
const dragNodeRef = useDragNode()[1]; |
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.
Use deconstructing
// TODO remove with 2.0 | ||
onMouseEnter?: React.MouseEventHandler<SVGGElement>; | ||
onMouseLeave?: React.MouseEventHandler<SVGGElement>; | ||
} | ||
|
||
const FILTER_ID = 'SvgBoxedTextDropShadowFilterId'; | ||
const iconFilterID = 'SVGBoxedTextRectIconFilter'; | ||
const iconSize = 36; |
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 is a computed value of 30 + padding * 2
export const isHelmReleaseNode = (obj: K8sResourceKind): boolean => { | ||
return ( | ||
_.get(obj, ['metadata', 'labels', 'heritage'], null) === 'Helm' || | ||
!!_.get(obj, ['metadata', 'labels', 'chart'], false) |
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.
Use optional chaining
@karthikjeeyar @christianvogt Since the UX is changed. I have raised a bug to fix the location of the icon the grouping label because same is taken care by @jeff-phillips-18 PR: #3981. Once that PR is merged, We can fix this in a bug. |
initial implementation initial implementation remove styles for selected and fine tune initial implementation align the item to UX designs add tests for utility and update test use fill attribute istead of styles update snapshot add corner radius to helm icon refactor disable dnd for helm release node decrease opacity on filtered items fix llint error lint and destructuring
f189115
to
a63c5ba
Compare
Not really following this conversation - but we can get core functionality in now and shore up the UX differences through the bug afterwards. |
Verified locally |
/approve |
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 looks good, thanks for updating the location of the helm icon near the app label. That change was made for topology groupings after the helm chart/release designs were set. Thanks for updating!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: christianvogt, karthikjeeyar, sahil143, serenamarie125 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
ODC-story: https://issues.redhat.com/browse/ODC-2622
This PR adds the grouping for the helm release nodes
updated screentshot
[TODO]: