浏览代码

HUE-9433 [assist] Fix exceptions in the UDF assist filter

Johan Ahlen 5 年之前
父节点
当前提交
19e43ee69a
共有 1 个文件被更改,包括 15 次插入15 次删除
  1. 15 15
      desktop/core/src/desktop/js/ko/components/assist/ko.assistFunctionsPanel.js

+ 15 - 15
desktop/core/src/desktop/js/ko/components/assist/ko.assistFunctionsPanel.js

@@ -172,30 +172,30 @@ class ConnectorUdfCategories {
       const replaceRegexp = new RegExp('(' + lowerCaseQuery + ')', 'i');
       this.categories().forEach(category => {
         category.functions.forEach(fn => {
-          if (fn.signature.toLowerCase().indexOf(lowerCaseQuery) === 0) {
+          if (fn.signature().toLowerCase().indexOf(lowerCaseQuery) === 0) {
             fn.weight = 2;
-            fn.signatureMatch(fn.signature.replace(replaceRegexp, '<b>$1</b>'));
-            fn.descriptionMatch(fn.description);
+            fn.signatureMatch(fn.signature().replace(replaceRegexp, '<b>$1</b>'));
+            fn.descriptionMatch(fn.description());
             result.push(fn);
-          } else if (fn.signature.toLowerCase().indexOf(lowerCaseQuery) !== -1) {
+          } else if (fn.signature().toLowerCase().indexOf(lowerCaseQuery) !== -1) {
             fn.weight = 1;
-            fn.signatureMatch(fn.signature.replace(replaceRegexp, '<b>$1</b>'));
-            fn.descriptionMatch(fn.description);
+            fn.signatureMatch(fn.signature().replace(replaceRegexp, '<b>$1</b>'));
+            fn.descriptionMatch(fn.description());
             result.push(fn);
           } else if (
-            fn.description &&
-            fn.description.toLowerCase().indexOf(lowerCaseQuery) !== -1
+            fn.description() &&
+            fn.description().toLowerCase().indexOf(lowerCaseQuery) !== -1
           ) {
-            fn.signatureMatch(fn.signature);
-            fn.descriptionMatch(fn.description.replace(replaceRegexp, '<b>$1</b>'));
+            fn.signatureMatch(fn.signature());
+            fn.descriptionMatch(fn.description().replace(replaceRegexp, '<b>$1</b>'));
             fn.weight = 0;
             result.push(fn);
           } else {
-            if (fn.signatureMatch() !== fn.signature) {
-              fn.signatureMatch(fn.signature);
+            if (fn.signatureMatch() !== fn.signature()) {
+              fn.signatureMatch(fn.signature());
             }
-            if (fn.descriptionMatch() !== fn.desciption) {
-              fn.descriptionMatch(fn.description);
+            if (fn.descriptionMatch() !== fn.description()) {
+              fn.descriptionMatch(fn.description());
             }
           }
         });
@@ -204,7 +204,7 @@ class ConnectorUdfCategories {
         if (a.weight !== b.weight) {
           return b.weight - a.weight;
         }
-        return a.signature.localeCompare(b.signature);
+        return a.signature().localeCompare(b.signature());
       });
       return result;
     });