aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/utils/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/src/app/shared/utils/utils.ts')
-rw-r--r--vid-webpack-master/src/app/shared/utils/utils.ts19
1 files changed, 19 insertions, 0 deletions
diff --git a/vid-webpack-master/src/app/shared/utils/utils.ts b/vid-webpack-master/src/app/shared/utils/utils.ts
index d63a3c997..3db770738 100644
--- a/vid-webpack-master/src/app/shared/utils/utils.ts
+++ b/vid-webpack-master/src/app/shared/utils/utils.ts
@@ -2,6 +2,21 @@ import * as _ from 'lodash'
export class Utils {
+ static getMaxFirstLevel(properties, flags: { [key: string]: boolean }) : number | null{
+ return this.getMaxInstancesAllowed(properties, 'max_instances', flags)
+ }
+
+ static getMaxVfModule(properties, flags: { [key: string]: boolean }) : number | null{
+ return this.getMaxInstancesAllowed(properties, 'maxCountInstances', flags)
+ }
+
+ static getMaxInstancesAllowed(properties, filedName: string, flags: { [key: string]: boolean }) : number | null{
+ if (!_.isNil(properties) && !_.isNil(properties[filedName])) {
+ return properties[filedName];
+ }
+ return (flags && !!flags['FLAG_2002_UNLIMITED_MAX']) ? null : 1;
+ }
+
public static clampNumber = (number, min, max) => {
return Math.max(min, Math.min(number, max));
};
@@ -179,6 +194,10 @@ export class Utils {
return (convertedAsdcModel);
};
+ public static isALaCarte(instantiationType) {
+ return instantiationType !== 'Macro';
+ }
+
private static convertOldModel(serviceModel ) {
let resource = {};
let convertedAsdcModel = {