saurabhkushwaha438 commented on code in PR #14413:
URL: https://github.com/apache/cloudstack/pull/14413#discussion_r4548344585


##########
ui/src/views/compute/wizard/ComputeSelection.vue:
##########
@@ -57,23 +57,42 @@
         </a-col>
         <a-col :md="colContraned" :lg="colContraned" v-if="isCustomized">
           <a-form-item
-            :label="$t('label.memory.mb')"
+            :label="$t('label.memory')"
             :validate-status="errors.memory.status"
             :help="errors.memory.message">
             <a-row :gutter="12">
-              <a-col :md="10" :lg="10" v-show="isConstrained && maxMemory && 
!isNaN(maxMemory)">
+              <a-col :md="14" :lg="14" v-show="isConstrained && maxMemory && 
!isNaN(maxMemory) && maxMemory < 1000000000">
                 <a-slider
-                  :min="minMemory"
-                  :max="maxMemory"
-                  v-model:value="memoryInputValue"
+                  :min="minMemoryInUnit"
+                  :max="maxMemoryInUnit"
+                  :step="memoryStep"
+                  v-model:value="memoryDisplayValue"
                   @change="($event) => updateComputeMemory($event)"
                 />
               </a-col>
-              <a-col :md="4" :lg="4">
-                <a-input-number
-                  v-model:value="memoryInputValue"
-                  @change="($event) => updateComputeMemory($event)"
-                />
+              <a-col :md="isConstrained && maxMemory && !isNaN(maxMemory) && 
maxMemory < 1000000000 ? 10 : 24" :lg="isConstrained && maxMemory && 
!isNaN(maxMemory) && maxMemory < 1000000000 ? 10 : 24">

Review Comment:
   -Replaced the duplicated predicate in lines 64 & 73 ( isConstrained && 
maxMemory &&
   !isNaN(maxMemory) && maxMemory < 100000000e ) with a single clean computed 
boolean
   showMemoryslider.
   -Replaced the magic number ( 1000000000 ) with Number . MAX_SAFE_INTEGER , 
matching the value
   passed down from DeployvM.vue and ScalevM.vue when offerings have no upper 
memory limit.
   Added an explanatory comment describing why the cutoff exists.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to