This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git


The following commit(s) were added to refs/heads/master by this push:
     new 0d61ec00 Test constraint regex value in composer as a full line match, 
same as in the backend
0d61ec00 is described below

commit 0d61ec006d113c433ceb49a9e4719c35f3b1b552
Author: Mykola Mandra <[email protected]>
AuthorDate: Thu Jul 28 10:03:44 2022 +0100

    Test constraint regex value in composer as a full line match, same as in 
the backend
    
    Signed-off-by: Mykola Mandra <[email protected]>
---
 .../app/components/providers/blueprint-service.provider.js             | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 
a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
 
b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
index 4307b4d7..270176bd 100644
--- 
a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
+++ 
b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
@@ -487,7 +487,8 @@ function BlueprintService($log, $q, $sce, paletteApi, 
iconGenerator, dslService,
                         }
                         break;
                     case 'regex':
-                        if (isSet() && !(new RegExp(args).test(val()))) {
+                        let matchFullLine = '^' + args + '$';
+                        if (isSet() && !(new 
RegExp(matchFullLine).test(val()))) {
                             message = `<samp>${config.name}</samp> does not 
match the required format: <samp>${args}</samp>`;
                         }
                         break;

Reply via email to