Skip to content

Commit

Permalink
Merge branch 'main' into installation-wizard/quay-update
Browse files Browse the repository at this point in the history
  • Loading branch information
suryagupta4 authored Oct 28, 2024
2 parents b3c54df + 94b1bf4 commit 8c27eaa
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,8 +415,8 @@ function displayModules(installationType, driverName, CONSTANTS_PARAM) {
$(".storageArrays").show();
$(".cluster-prefix").show();
$(".port-groups").show();
$(".resiliency").hide();
if (document.getElementById("csm-version").value === "1.11.0") {
// Check the CSM version and show the resiliency module if version is greater than 1.11.0
if (isVersionGreaterOrEqualTo(document.getElementById("csm-version").value, "1.11.0")) {
$(".resiliency").show();
}
$(".migration").show();
Expand All @@ -435,7 +435,8 @@ function displayModules(installationType, driverName, CONSTANTS_PARAM) {
$(".observability-operator").show();
$(".observability").hide();
$(".resiliency").hide();
if (document.getElementById("csm-version").value === "1.11.0") {
// Check the CSM version and show the resiliency module if version is greater than 1.11.0
if (isVersionGreaterOrEqualTo(document.getElementById("csm-version").value, "1.11.0")) {
$(".resiliency-operator").show();
}
$(".replication-operator-clusterid").hide();
Expand Down Expand Up @@ -479,6 +480,18 @@ function displayModules(installationType, driverName, CONSTANTS_PARAM) {
}
}

// Function to compare two version strings
function isVersionGreaterOrEqualTo(currentVersion, targetVersion) {
const currentParts = currentVersion.split('.').map(Number);
const targetParts = targetVersion.split('.').map(Number);

for (let i = 0; i < targetParts.length; i++) {
if (currentParts[i] > targetParts[i]) return true;
if (currentParts[i] < targetParts[i]) return false;
}
return true;
}

function displayCommands(releaseNameValue, commandTitleValue, commandNoteValue, commandNoteOperatorValue, csmOperatorNoteValue, command1Value, command2Value, command3Value, CONSTANTS) {
driverNamespace = document.getElementById("driver-namespace").value;
csmVersion = document.getElementById("csm-version").value;
Expand Down

0 comments on commit 8c27eaa

Please sign in to comment.