-
Notifications
You must be signed in to change notification settings - Fork 98
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
Fix/pci rancher version fix sort tapc 2629 #15272
base: develop
Are you sure you want to change the base?
Conversation
}; | ||
|
||
export const sortVersions = (versions: RancherVersion[]): RancherVersion[] => { | ||
return [...versions].sort((a, 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.
Copy should be handled by caller. In your specific case since there is a filter before you do not need to copy the array
@@ -26,6 +26,29 @@ export const getCurrentVersionInfo = ( | |||
return getVersionInfoByName(currentVersion, versions); | |||
}; | |||
|
|||
export const compareVersions = (v1: string, v2: string): number => { |
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 think we should use https://www.npmjs.com/package/semver instead
if (sortedVersions.length === 0) { | ||
return null; | ||
} |
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 case is already handled line 72
return sortVersions(availableVersions)[availableVersions.length - 1]; | ||
} | ||
return null; | ||
}, [versions, selectedVersion]); |
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 : selectedVersion
is in this array ?
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's a mistake, a previous dependecy i forget to delete
Signed-off-by: CDS Translator Agent <[email protected]>
Signed-off-by: CDS Translator Agent <[email protected]>
ref: TAPC-2629 Signed-off-by: Pierre-Philippe <[email protected]>
ref: TAPC-2629 Signed-off-by: Pierre-Philippe <[email protected]>
ref: TAPC-2629 Signed-off-by: Pierre-Philippe <[email protected]>
ref: TAPC-2629 Signed-off-by: Pierre-Philippe <[email protected]>
ref: TAPC-2629 Signed-off-by: Pierre-Philippe <[email protected]>
dd9cd75
to
92012b8
Compare
Quality Gate passedIssues Measures |
develop
Description
Related