-
Notifications
You must be signed in to change notification settings - Fork 2
Update policy violation details based on source #1313
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
Conversation
…erprise into policy-violation-details
) => { | ||
return rows.map(r => { | ||
return !!r.children ? ( | ||
<CanaryRowHeader rowkey={r.rowkey} value={undefined} key={r.rowkey}> |
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.
don't you think that component name need to be changed as it's not related to canary's view 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.
I'd love to, this change will touch many files that i'd love not to include in this PR
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.
Those header breadcrumbs look wild to me 🤔. Is that long string intentional?
@@ -20,11 +20,13 @@ export enum FieldsType { | |||
interface Props { | |||
violations: PolicyValidation[]; | |||
tableType?: FieldsType; | |||
sourcePath?: string; |
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 don't think this can be optional.
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.
Only the application violation
uses it to pass the sourceType kustomization or helmRelease
and the value is being used only in applicationFields
.
It might not be optional then i'll update HeaderPath to create the route link but again both links are different and i'll update links ...etc
What do you think? Do you see it worth the change ?
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.
Yeah, look okay to me 👍
@@ -19,6 +19,10 @@ const Container = styled.div` | |||
`; | |||
const Span = styled.span` | |||
color: ${({ theme }) => theme.colors.white}; | |||
text-overflow: ellipsis; |
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.
Now we're ellipsis
ing it would be neat to add a title
attr so you can know what it is.
@@ -40,7 +48,7 @@ function CanaryRowHeader({ | |||
<div className={classes.rowHeaderWrapper} data-testid={rowkey}> | |||
<div className={classes.cardTitle}>{rowkey}:</div> | |||
<span className={classes.body1}> | |||
{value || '--'} {children} | |||
{!!children ? children : value || '--'} |
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.
Does this work?
{!!children ? children : value || '--'} | |
{children || value || '--'} |
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.
Yes, and look at that beauty
count: policyViolationsCount, | ||
}, | ||
{ label: data?.violation?.name || '' }, | ||
]; |
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.
Maybe we pull this out into its own page at some point and share a common main component to keep things like this a bit simpler.
Update
Policy violation details
based on navigation sourceNavigate from

Application details
Navigate from

Policy details