@devtron-labs/devtron-fe-common-lib 0.0.59-beta-6 → 0.0.59-beta-9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -5,4 +5,4 @@ export interface ValidationResponseType {
5
5
  export declare const validateName: (name: string) => ValidationResponseType;
6
6
  export declare const validateDescription: (description: string) => ValidationResponseType;
7
7
  export declare const validateRequiredPositiveNumber: (value: string | number) => ValidationResponseType;
8
- export declare const validatePositiveInteger: (value: string | number) => ValidationResponseType;
8
+ export declare const validateRequiredPositiveInteger: (value: string | number) => ValidationResponseType;
package/dist/index.js CHANGED
@@ -28900,6 +28900,7 @@ exports.BuildInfraProfileVariants = void 0;
28900
28900
 
28901
28901
  var _a$1;
28902
28902
  var BUILD_INFRA_INPUT_CONSTRAINTS = {
28903
+ // Will not enforce any decimal specification on input field
28903
28904
  STEP: 'any',
28904
28905
  MIN: 0,
28905
28906
  DECIMAL_PLACES: 2,
@@ -29480,7 +29481,7 @@ var validateRequiredPositiveNumber = function (value) {
29480
29481
  message: MESSAGES.MAX_SAFE_INTEGER,
29481
29482
  };
29482
29483
  }
29483
- if (Number(value) <= 0) {
29484
+ if (numericValue <= 0) {
29484
29485
  return {
29485
29486
  isValid: false,
29486
29487
  message: MESSAGES.VALID_POSITIVE_NUMBER,
@@ -29490,7 +29491,7 @@ var validateRequiredPositiveNumber = function (value) {
29490
29491
  isValid: true,
29491
29492
  };
29492
29493
  };
29493
- var validatePositiveInteger = function (value) {
29494
+ var validateRequiredPositiveInteger = function (value) {
29494
29495
  if (!value) {
29495
29496
  return {
29496
29497
  isValid: false,
@@ -29510,7 +29511,7 @@ var validatePositiveInteger = function (value) {
29510
29511
  message: MESSAGES.MAX_SAFE_INTEGER,
29511
29512
  };
29512
29513
  }
29513
- if (Number(value) <= 0) {
29514
+ if (numericValue <= 0) {
29514
29515
  return {
29515
29516
  isValid: false,
29516
29517
  message: MESSAGES.VALID_POSITIVE_INTEGER,
@@ -29729,7 +29730,7 @@ var useBuildInfraForm = function (_a) {
29729
29730
  }
29730
29731
  case exports.BuildInfraConfigTypes.BUILD_TIMEOUT: {
29731
29732
  currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = __assign(__assign({}, currentConfiguration[exports.BuildInfraConfigTypes.BUILD_TIMEOUT]), { value: value, unit: unit });
29732
- currentInputErrors[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = validatePositiveInteger(value).message;
29733
+ currentInputErrors[exports.BuildInfraConfigTypes.BUILD_TIMEOUT] = validateRequiredPositiveInteger(value).message;
29733
29734
  break;
29734
29735
  }
29735
29736
  case exports.BuildInfraInheritActions.ACTIVATE_CPU:
@@ -30107,6 +30108,6 @@ exports.useThrottledEffect = useThrottledEffect;
30107
30108
  exports.useWindowSize = useWindowSize;
30108
30109
  exports.validateDescription = validateDescription;
30109
30110
  exports.validateName = validateName;
30110
- exports.validatePositiveInteger = validatePositiveInteger;
30111
30111
  exports.validateRequestLimit = validateRequestLimit;
30112
+ exports.validateRequiredPositiveInteger = validateRequiredPositiveInteger;
30112
30113
  exports.validateRequiredPositiveNumber = validateRequiredPositiveNumber;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.59-beta-6",
3
+ "version": "0.0.59-beta-9",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -14,6 +14,7 @@ import {
14
14
  } from './types'
15
15
 
16
16
  export const BUILD_INFRA_INPUT_CONSTRAINTS = {
17
+ // Will not enforce any decimal specification on input field
17
18
  STEP: 'any',
18
19
  MIN: 0,
19
20
  DECIMAL_PLACES: 2,
@@ -26,7 +26,7 @@ import {
26
26
  validateName,
27
27
  validateRequiredPositiveNumber,
28
28
  getCommonSelectStyle,
29
- validatePositiveInteger,
29
+ validateRequiredPositiveInteger,
30
30
  } from '../../../Shared'
31
31
 
32
32
  export const validateRequestLimit = ({
@@ -288,7 +288,7 @@ export const useBuildInfraForm = ({
288
288
  unit,
289
289
  }
290
290
 
291
- currentInputErrors[BuildInfraConfigTypes.BUILD_TIMEOUT] = validatePositiveInteger(value).message
291
+ currentInputErrors[BuildInfraConfigTypes.BUILD_TIMEOUT] = validateRequiredPositiveInteger(value).message
292
292
  break
293
293
  }
294
294
 
@@ -81,7 +81,7 @@ export const validateRequiredPositiveNumber = (value: string | number): Validati
81
81
  }
82
82
  }
83
83
 
84
- if (Number(value) <= 0) {
84
+ if (numericValue <= 0) {
85
85
  return {
86
86
  isValid: false,
87
87
  message: MESSAGES.VALID_POSITIVE_NUMBER,
@@ -93,7 +93,7 @@ export const validateRequiredPositiveNumber = (value: string | number): Validati
93
93
  }
94
94
  }
95
95
 
96
- export const validatePositiveInteger = (value: string | number): ValidationResponseType => {
96
+ export const validateRequiredPositiveInteger = (value: string | number): ValidationResponseType => {
97
97
  if (!value) {
98
98
  return {
99
99
  isValid: false,
@@ -117,7 +117,7 @@ export const validatePositiveInteger = (value: string | number): ValidationRespo
117
117
  }
118
118
  }
119
119
 
120
- if (Number(value) <= 0) {
120
+ if (numericValue <= 0) {
121
121
  return {
122
122
  isValid: false,
123
123
  message: MESSAGES.VALID_POSITIVE_INTEGER,