summaryrefslogtreecommitdiffstats
path: root/catalog-ui/src/app/ng2/pages/properties-assignment
diff options
context:
space:
mode:
authorJvD_Ericsson <jeff.van.dam@est.tech>2022-11-14 11:33:20 +0000
committerMichael Morris <michael.morris@est.tech>2022-12-01 09:58:42 +0000
commit7eefea2dec674b66f07aaaf21901e183067868b3 (patch)
treeff5429d593e28e28bfd14d875830193435c15423 /catalog-ui/src/app/ng2/pages/properties-assignment
parent4a754a8c898fb397e19876de2d19141d047a9e58 (diff)
Support addition of pattern constraint
Issue-ID: SDC-4260 Change-Id: I2eccf88472c144d8f595a9d8ec028705e924fd67 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
Diffstat (limited to 'catalog-ui/src/app/ng2/pages/properties-assignment')
-rw-r--r--catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts b/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts
index 2e56ce1580..831732dcf5 100644
--- a/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts
+++ b/catalog-ui/src/app/ng2/pages/properties-assignment/constraints/constraints.component.ts
@@ -170,6 +170,14 @@ export class ConstraintsComponent implements OnInit {
if (Array.isArray(constraint.value)) {
return !(constraint.value.length == 0 || this.doesArrayContaintEmptyValues(constraint.value));
}
+ if (constraint.type == ConstraintTypes.pattern) {
+ try {
+ new RegExp(constraint.value);
+ this.valid = true;
+ } catch(e) {
+ this.valid = false;
+ }
+ }
return constraint.value && constraint.type != ConstraintTypes.null
});
}