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
feat(Helm-Chart): Groups same helm chart into single tile #5699
feat(Helm-Chart): Groups same helm chart into single tile #5699
Conversation
5616dea
to
5acdb6c
Compare
}; | ||
const existingChart = normalizedCharts.findIndex((hlc) => hlc.obj?.name === chartName); | ||
if (existingChart > -1) { | ||
if (normalizedCharts[existingChart].obj?.version < helmChart.obj.version) { |
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.
@rohitkrai03 Should this string comp be fine?
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.
Probably better to use natural sort here for cases like 1.10.0
> 1.2.0
. You can use String,prototype.localeCompare()
with numeric option. Here's an example. It returns 1, meaning 1.10.0
goes after 1.2.0
:
'1.10.0'.localeCompare('1.2.0', undefined, {numeric: true, sensitivity: 'base'});
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.
updated
}; | ||
const existingChart = normalizedCharts.findIndex((hlc) => hlc.obj?.name === chartName); | ||
if (existingChart > -1) { | ||
if (normalizedCharts[existingChart].obj?.version < helmChart.obj.version) { |
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.
Probably better to use natural sort here for cases like 1.10.0
> 1.2.0
. You can use String,prototype.localeCompare()
with numeric option. Here's an example. It returns 1, meaning 1.10.0
goes after 1.2.0
:
'1.10.0'.localeCompare('1.2.0', undefined, {numeric: true, sensitivity: 'base'});
5acdb6c
to
799c6ec
Compare
@@ -19,6 +19,8 @@ type Metadata = { uid?: string; name?: string; namespace?: string }; | |||
|
|||
export type Item = { | |||
obj?: { | |||
name?: 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.
You don't need this change now.
(hlc) => hlc.obj?.name === chartName, | ||
); | ||
if (existingChartIndex > -1) { | ||
const versionCompare = helmChart.obj.version.localeCompare( |
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.
const versionCompare = helmChart.obj.version.localeCompare( | |
const versionCompare = helmChart.obj?.version?.localeCompare( |
799c6ec
to
a9b2770
Compare
a9b2770
to
a5ec35c
Compare
verified this locally, works fine |
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.
/lgtm
/assign @christianvogt |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: abhinandan13jan, christianvogt, debsmita1, rohitkrai03 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 |
/retest Please review the full test history for this PR and help us cut down flakes. |
1 similar comment
/retest Please review the full test history for this PR and help us cut down flakes. |
Fixes:
https://issues.redhat.com/browse/ODC-4085
Analysis / Root cause:
Group helm multiple chart versions together in developer catalog
Solution Description:
Altered normalizeHelm functionality to create single item for all hellm chart versions with same name
Screenshot
After change
Test
Added to catalog test suite
Browser conformation
Chrome 73