Commit 4a7b5173 authored by Nikhil Doifode's avatar Nikhil Doifode
Browse files

Resolved review comments

parent 3b744cf6
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -296,7 +296,7 @@ const validateCpuValue = count => {

  const p = Number(count);
  if (p !== '' && p === 0) {
    return 'count !== 0';
    return 'Must be a float greater than 0';
  }
  return null;
};
@@ -313,7 +313,7 @@ const validateMemoryValue = count => {

  const p = Number(count);
  if (p !== '' && p === 0) {
    return 'count !== 0 ';
    return 'Must be an integer greater than 0';
  }
  return null;
};
@@ -689,7 +689,7 @@ const CpuGroup = ({ onUpdate, element }) => {
        element={element}
        validate={validateCpuValue}
        isNumber={true}
        label="Min CPU"
        label="Min CPU Count"
        fieldName={FIELD_CPU_MIN}
        cydata={CFG_ELEM_CPU_MIN}
      />
@@ -699,7 +699,7 @@ const CpuGroup = ({ onUpdate, element }) => {
        element={element}
        validate={validateCpuValue}
        isNumber={true}
        label="Max CPU"
        label="Max CPU Count"
        fieldName={FIELD_CPU_MAX}
        cydata={CFG_ELEM_CPU_MAX}
      />
@@ -726,7 +726,7 @@ const MemoryGroup = ({ onUpdate, element }) => {
        element={element}
        validate={validateMemoryValue}
        isNumber={true}
        label="Max memory (MB)"
        label="Max Memory (MB)"
        fieldName={FIELD_MEMORY_MAX}
        cydata={CFG_ELEM_MEMORY_MAX}
      />
+2 −2
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ class CfgPageContainer extends Component {
    var cpuMax = getElemFieldVal(element, FIELD_CPU_MAX);
    if (cpuMin !== null && cpuMax !== null) {
      if (parseFloat(cpuMin) > parseFloat(cpuMax)) {
        this.props.cfgElemSetErrMsg('Min CPU > Max CPU which is not acceptable');
        this.props.cfgElemSetErrMsg('Min CPU > Max CPU');
        return false;
      }
    }
@@ -292,7 +292,7 @@ class CfgPageContainer extends Component {
    var memoryMax = getElemFieldVal(element, FIELD_MEMORY_MAX);
    if (memoryMin !== null && memoryMax !== null) {
      if (parseInt(memoryMin) > parseInt(memoryMax)) {
        this.props.cfgElemSetErrMsg('Min Memory > Max Memory which is not acceptable');
        this.props.cfgElemSetErrMsg('Min Memory > Max Memory');
        return false;
      }
    }
+8 −9
Original line number Diff line number Diff line
@@ -958,15 +958,14 @@ export function createProcess(uniqueId, name, type, element) {
        getElemFieldVal(element, FIELD_GPU_TYPE).toUpperCase(),
      count: gpuCount
    };

    process.cpuConfig = {
      min: cpuMin && !isNaN(cpuMin) !== null ? parseFloat(cpuMin) : null,
      max: cpuMax && !isNaN(cpuMax) !== null ? parseFloat(cpuMax): null
    };
    process.memoryConfig = {
      min: memoryMin !== null && !isNaN(memoryMin) ? parseInt(memoryMin) : null,
      max: memoryMax !== null && !isNaN(memoryMax) ? parseInt(memoryMax) : null
    };
    process.cpuConfig = (cpuMin && !isNaN(cpuMin)) || (cpuMax && !isNaN(cpuMax)) ? {
      min: cpuMin && !isNaN(cpuMin) ? parseFloat(cpuMin) : null,
      max: cpuMax && !isNaN(cpuMax) ? parseFloat(cpuMax): null
    } : null;
    process.memoryConfig = (memoryMin && !isNaN(memoryMin)) || (memoryMax && !isNaN(memoryMax)) ? {
      min: memoryMin && !isNaN(memoryMin) ? parseInt(memoryMin) : null,
      max: memoryMax && !isNaN(memoryMax) ? parseInt(memoryMax) : null
    } : null;
    process.placementId = getElemFieldVal(element, FIELD_PLACEMENT_ID);
  }
  if (process.netChar) {