Эх сурвалжийг харах

HUE-5647 [editor] Improved colors in the autocomplete dropdown

Johan Ahlen 8 жил өмнө
parent
commit
a870101

+ 9 - 3
desktop/core/src/desktop/static/desktop/js/hue.colors.js

@@ -109,12 +109,18 @@ var HueColors = {
     return _bands;
     return _bands;
   },
   },
 
 
-
-  getCUIChartColors: function () {
-    var normalizedColors = {}, i;
+  getNormalizedColors: function () {
+    var normalizedColors = {};
     this.CUIScaleColors.forEach(function (scaleDef) {
     this.CUIScaleColors.forEach(function (scaleDef) {
       normalizedColors[scaleDef.name] = scaleDef.colors;
       normalizedColors[scaleDef.name] = scaleDef.colors;
     });
     });
+    return normalizedColors;
+  },
+
+  getCUIChartColors: function () {
+    var i;
+
+    var normalizedColors = this.getNormalizedColors();
 
 
     // optimal visual sequence by contrasting colors
     // optimal visual sequence by contrasting colors
     var sequence = ['blue', 'lime', 'blue-gray', 'pink', 'steel', 'purple', 'teal', 'red', 'orange', 'green'],
     var sequence = ['blue', 'lime', 'blue-gray', 'pink', 'steel', 'purple', 'teal', 'red', 'orange', 'green'],

+ 33 - 60
desktop/core/src/desktop/static/desktop/js/sqlAutocompleter3.js

@@ -16,30 +16,42 @@
 
 
 var SqlAutocompleter3 = (function () {
 var SqlAutocompleter3 = (function () {
 
 
-  var colors = HueColors.getCUIChartColors();
+  var normalizedColors = HueColors.getNormalizedColors();
+
+  var COLORS = {
+    POPULAR: normalizedColors['blue'][7],
+    KEYWORD: normalizedColors['blue'][4],
+    COLUMN: normalizedColors['green'][2],
+    TABLE: normalizedColors['pink'][3],
+    DATABASE: normalizedColors['teal'][5],
+    SAMPLE: normalizedColors['purple'][5],
+    IDENT_CTE_VAR: normalizedColors['orange'][3],
+    UDF: normalizedColors['purple-gray'][3],
+    HDFS: normalizedColors['red'][2]
+  };
 
 
   var CATEGORIES = {
   var CATEGORIES = {
     ALL: { color: HueColors.BLUE, label: AutocompleterGlobals.i18n.category.all },
     ALL: { color: HueColors.BLUE, label: AutocompleterGlobals.i18n.category.all },
-    POPULAR: { color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_AGGREGATE: { weight: 1500, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_GROUP_BY: { weight: 1400, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_ORDER_BY: { weight: 1300, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_FILTER: { weight: 1200, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_ACTIVE_JOIN: { weight: 1200, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    POPULAR_JOIN_CONDITION: { weight: 1100, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular },
-    COLUMN: { weight: 1000, color: colors[20].color, label: AutocompleterGlobals.i18n.category.column },
-    SAMPLE: { weight: 900, color: colors[5].color, label: AutocompleterGlobals.i18n.category.sample },
-    IDENTIFIER: { weight: 800, color: colors[8].color, label: AutocompleterGlobals.i18n.category.identifier },
-    CTE: { weight: 700, color: colors[7].color, label: AutocompleterGlobals.i18n.category.cte },
-    TABLE: { weight: 600, color: colors[1].color, label: AutocompleterGlobals.i18n.category.table },
-    DATABASE: { weight: 500, color: colors[0].color, label: AutocompleterGlobals.i18n.category.database },
-    UDF: { weight: 400, color: colors[4].color, label: AutocompleterGlobals.i18n.category.udf },
-    HDFS: { weight: 300, color: colors[9].color, label: AutocompleterGlobals.i18n.category.hdfs },
-    VIRTUAL_COLUMN: { weight: 200, color: colors[2].color, label: AutocompleterGlobals.i18n.category.column },
-    COLREF_KEYWORD: { weight: 100, color: colors[3].color, label: AutocompleterGlobals.i18n.category.keyword },
-    VARIABLE: { weight: 50, color: colors[6].color, label: AutocompleterGlobals.i18n.category.variable },
-    KEYWORD: { weight: 0, color: colors[11].color, label: AutocompleterGlobals.i18n.category.keyword },
-    POPULAR_JOIN: { weight: -1, color: colors[10].color, label: AutocompleterGlobals.i18n.category.popular }
+    POPULAR: { color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular },
+    POPULAR_AGGREGATE: { weight: 1500, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'agg-udf' },
+    POPULAR_GROUP_BY: { weight: 1400, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'group-by' },
+    POPULAR_ORDER_BY: { weight: 1300, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'order-by' },
+    POPULAR_FILTER: { weight: 1200, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'filter' },
+    POPULAR_ACTIVE_JOIN: { weight: 1200, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'join' },
+    POPULAR_JOIN_CONDITION: { weight: 1100, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'join-condition' },
+    COLUMN: { weight: 1000, color: COLORS.COLUMN, label: AutocompleterGlobals.i18n.category.column, detailsTemplate: 'column' },
+    SAMPLE: { weight: 900, color: COLORS.SAMPLE, label: AutocompleterGlobals.i18n.category.sample, detailsTemplate: 'value' },
+    IDENTIFIER: { weight: 800, color: COLORS.IDENT_CTE_VAR, label: AutocompleterGlobals.i18n.category.identifier, detailsTemplate: 'identifier' },
+    CTE: { weight: 700, color: COLORS.IDENT_CTE_VAR, label: AutocompleterGlobals.i18n.category.cte, detailsTemplate: 'cte' },
+    TABLE: { weight: 600, color: COLORS.TABLE, label: AutocompleterGlobals.i18n.category.table, detailsTemplate: 'table' },
+    DATABASE: { weight: 500, color: COLORS.DATABASE, label: AutocompleterGlobals.i18n.category.database, detailsTemplate: 'database' },
+    UDF: { weight: 400, color: COLORS.UDF, label: AutocompleterGlobals.i18n.category.udf, detailsTemplate: 'udf' },
+    HDFS: { weight: 300, color: COLORS.HDFS, label: AutocompleterGlobals.i18n.category.hdfs, detailsTemplate: 'hdfs' },
+    VIRTUAL_COLUMN: { weight: 200, color: COLORS.COLUMN, label: AutocompleterGlobals.i18n.category.column, detailsTemplate: 'column' },
+    COLREF_KEYWORD: { weight: 100, color: COLORS.KEYWORD, label: AutocompleterGlobals.i18n.category.keyword, detailsTemplate: 'keyword' },
+    VARIABLE: { weight: 50, color: COLORS.IDENT_CTE_VAR, label: AutocompleterGlobals.i18n.category.variable, detailsTemplate: 'variable' },
+    KEYWORD: { weight: 0, color: COLORS.KEYWORD, label: AutocompleterGlobals.i18n.category.keyword, detailsTemplate: 'keyword' },
+    POPULAR_JOIN: { weight: -1, color: COLORS.POPULAR, label: AutocompleterGlobals.i18n.category.popular, detailsTemplate: 'join' }
   };
   };
 
 
   var hiveReservedKeywords = {
   var hiveReservedKeywords = {
@@ -330,7 +342,6 @@ var SqlAutocompleter3 = (function () {
           meta: AutocompleterGlobals.i18n.meta.keyword,
           meta: AutocompleterGlobals.i18n.meta.keyword,
           category: CATEGORIES.KEYWORD,
           category: CATEGORIES.KEYWORD,
           weightAdjust: keyword.weight,
           weightAdjust: keyword.weight,
-          detailsTemplate: 'keyword',
           details: null
           details: null
         };
         };
       });
       });
@@ -349,7 +360,6 @@ var SqlAutocompleter3 = (function () {
                 value: self.parseResult.lowerCase ? keyword.toLowerCase() : keyword,
                 value: self.parseResult.lowerCase ? keyword.toLowerCase() : keyword,
                 meta: AutocompleterGlobals.i18n.meta.keyword,
                 meta: AutocompleterGlobals.i18n.meta.keyword,
                 category: CATEGORIES.COLREF_KEYWORD,
                 category: CATEGORIES.COLREF_KEYWORD,
-                detailsTemplate: 'keyword',
                 details: {
                 details: {
                   type: colRef.type
                   type: colRef.type
                 }
                 }
@@ -372,7 +382,6 @@ var SqlAutocompleter3 = (function () {
           value: identifier.name,
           value: identifier.name,
           meta: identifier.type,
           meta: identifier.type,
           category: CATEGORIES.IDENTIFIER,
           category: CATEGORIES.IDENTIFIER,
-          detailsTemplate: 'identifier',
           details: null
           details: null
         });
         });
       });
       });
@@ -391,7 +400,6 @@ var SqlAutocompleter3 = (function () {
             value: columnAlias.name,
             value: columnAlias.name,
             meta: AutocompleterGlobals.i18n.meta.alias,
             meta: AutocompleterGlobals.i18n.meta.alias,
             category: CATEGORIES.COLUMN,
             category: CATEGORIES.COLUMN,
-            detailsTemplate: 'column-alias',
             details: columnAlias
             details: columnAlias
           });
           });
         } else {
         } else {
@@ -399,7 +407,6 @@ var SqlAutocompleter3 = (function () {
             value: columnAlias.name,
             value: columnAlias.name,
             meta: type,
             meta: type,
             category: CATEGORIES.COLUMN,
             category: CATEGORIES.COLUMN,
-            detailsTemplate: 'column-alias',
             details: columnAlias
             details: columnAlias
           });
           });
         }
         }
@@ -421,7 +428,6 @@ var SqlAutocompleter3 = (function () {
           value: prefix + expression.name,
           value: prefix + expression.name,
           meta: AutocompleterGlobals.i18n.meta.commonTableExpression,
           meta: AutocompleterGlobals.i18n.meta.commonTableExpression,
           category: CATEGORIES.CTE,
           category: CATEGORIES.CTE,
-          detailsTemplate: 'cte',
           details: null
           details: null
         });
         });
       });
       });
@@ -446,7 +452,6 @@ var SqlAutocompleter3 = (function () {
               weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
               weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
                   return otherType === colRef.type.toUpperCase();
                   return otherType === colRef.type.toUpperCase();
               }).length > 0 ? 1 : 0,
               }).length > 0 ? 1 : 0,
-              detailsTemplate: 'udf',
               details: functionsToSuggest[name]
               details: functionsToSuggest[name]
             })
             })
           });
           });
@@ -466,7 +471,6 @@ var SqlAutocompleter3 = (function () {
             weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
             weightAdjust: functionsToSuggest[name].returnTypes.filter(function (otherType) {
               return otherType === types[0].toUpperCase();
               return otherType === types[0].toUpperCase();
             }).length > 0 ? 1 : 0,
             }).length > 0 ? 1 : 0,
-            detailsTemplate: 'udf',
             details: functionsToSuggest[name]
             details: functionsToSuggest[name]
           })
           })
         });
         });
@@ -491,7 +495,6 @@ var SqlAutocompleter3 = (function () {
             value: prefix + self.backTickIfNeeded(db) + (suggestDatabases.appendDot ? '.' : ''),
             value: prefix + self.backTickIfNeeded(db) + (suggestDatabases.appendDot ? '.' : ''),
             meta: AutocompleterGlobals.i18n.meta.database,
             meta: AutocompleterGlobals.i18n.meta.database,
             category: CATEGORIES.DATABASE,
             category: CATEGORIES.DATABASE,
-            detailsTemplate: 'database',
             details: null
             details: null
           })
           })
         });
         });
@@ -528,7 +531,6 @@ var SqlAutocompleter3 = (function () {
                 tableName: tableMeta.name,
                 tableName: tableMeta.name,
                 meta: AutocompleterGlobals.i18n.meta[tableMeta.type.toLowerCase()],
                 meta: AutocompleterGlobals.i18n.meta[tableMeta.type.toLowerCase()],
                 category: CATEGORIES.TABLE,
                 category: CATEGORIES.TABLE,
-                detailsTemplate: 'table',
                 details: tableMeta.comment ? tableMeta : null
                 details: tableMeta.comment ? tableMeta : null
               });
               });
             });
             });
@@ -601,14 +603,12 @@ var SqlAutocompleter3 = (function () {
               value: 'BLOCK__OFFSET__INSIDE__FILE',
               value: 'BLOCK__OFFSET__INSIDE__FILE',
               meta: AutocompleterGlobals.i18n.meta.virtual,
               meta: AutocompleterGlobals.i18n.meta.virtual,
               category: CATEGORIES.VIRTUAL_COLUMN,
               category: CATEGORIES.VIRTUAL_COLUMN,
-              detailsTemplate: 'column',
               details: null
               details: null
             });
             });
             columnSuggestions.push({
             columnSuggestions.push({
               value: 'INPUT__FILE__NAME',
               value: 'INPUT__FILE__NAME',
               meta: AutocompleterGlobals.i18n.meta.virtual,
               meta: AutocompleterGlobals.i18n.meta.virtual,
               category: CATEGORIES.VIRTUAL_COLUMN,
               category: CATEGORIES.VIRTUAL_COLUMN,
-              detailsTemplate: 'column',
               details: null
               details: null
             });
             });
           }
           }
@@ -642,7 +642,6 @@ var SqlAutocompleter3 = (function () {
                 meta: type,
                 meta: type,
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (column.identifierChain && column.identifierChain.length > 0) {
             } else if (column.identifierChain && column.identifierChain.length > 0) {
@@ -651,7 +650,6 @@ var SqlAutocompleter3 = (function () {
                 meta: type,
                 meta: type,
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             }
             }
@@ -677,7 +675,6 @@ var SqlAutocompleter3 = (function () {
                 meta: 'map',
                 meta: 'map',
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (column.type.indexOf('map') === 0) {
             } else if (column.type.indexOf('map') === 0) {
@@ -686,7 +683,6 @@ var SqlAutocompleter3 = (function () {
                 meta: 'map',
                 meta: 'map',
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (column.type.indexOf('struct') === 0) {
             } else if (column.type.indexOf('struct') === 0) {
@@ -695,7 +691,6 @@ var SqlAutocompleter3 = (function () {
                 meta: 'struct',
                 meta: 'struct',
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (column.type.indexOf('array') === 0 && self.snippet.type() === 'hive') {
             } else if (column.type.indexOf('array') === 0 && self.snippet.type() === 'hive') {
@@ -704,7 +699,6 @@ var SqlAutocompleter3 = (function () {
                 meta: 'array',
                 meta: 'array',
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (column.type.indexOf('array') === 0) {
             } else if (column.type.indexOf('array') === 0) {
@@ -713,7 +707,6 @@ var SqlAutocompleter3 = (function () {
                 meta: 'array',
                 meta: 'array',
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (types[0].toUpperCase() !== 'T' && types.filter(function (type) { return type.toUpperCase() === column.type.toUpperCase() }).length > 0) {
             } else if (types[0].toUpperCase() !== 'T' && types.filter(function (type) { return type.toUpperCase() === column.type.toUpperCase() }).length > 0) {
@@ -723,7 +716,6 @@ var SqlAutocompleter3 = (function () {
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 weightAdjust: 1,
                 weightAdjust: 1,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             } else if (SqlFunctions.matchesType(self.snippet.type(), types, [column.type.toUpperCase()]) ||
             } else if (SqlFunctions.matchesType(self.snippet.type(), types, [column.type.toUpperCase()]) ||
@@ -733,7 +725,6 @@ var SqlAutocompleter3 = (function () {
                 meta: column.type,
                 meta: column.type,
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: column
                 details: column
               })
               })
             }
             }
@@ -745,7 +736,6 @@ var SqlAutocompleter3 = (function () {
               meta: 'column',
               meta: 'column',
               category: CATEGORIES.COLUMN,
               category: CATEGORIES.COLUMN,
               table: table,
               table: table,
-              detailsTemplate: 'column',
               details: column
               details: column
             })
             })
           });
           });
@@ -756,7 +746,6 @@ var SqlAutocompleter3 = (function () {
             meta: 'key',
             meta: 'key',
             category: CATEGORIES.COLUMN,
             category: CATEGORIES.COLUMN,
             table: table,
             table: table,
-            detailsTemplate: 'column',
             details: data
             details: data
           });
           });
           columnSuggestions.push({
           columnSuggestions.push({
@@ -764,7 +753,6 @@ var SqlAutocompleter3 = (function () {
             meta: 'value',
             meta: 'value',
             category: CATEGORIES.COLUMN,
             category: CATEGORIES.COLUMN,
             table: table,
             table: table,
-            detailsTemplate: 'column',
             details: data
             details: data
           });
           });
         }
         }
@@ -775,7 +763,6 @@ var SqlAutocompleter3 = (function () {
               meta: field.type,
               meta: field.type,
               category: CATEGORIES.COLUMN,
               category: CATEGORIES.COLUMN,
               table: table,
               table: table,
-              detailsTemplate: 'column',
               details: field
               details: field
             });
             });
           });
           });
@@ -788,7 +775,6 @@ var SqlAutocompleter3 = (function () {
                 meta: field.type,
                 meta: field.type,
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: field
                 details: field
               });
               });
             }
             }
@@ -803,7 +789,6 @@ var SqlAutocompleter3 = (function () {
                     meta: field.type,
                     meta: field.type,
                     category: CATEGORIES.COLUMN,
                     category: CATEGORIES.COLUMN,
                     table: table,
                     table: table,
-                    detailsTemplate: 'column',
                     details: field
                     details: field
                   });
                   });
                 } else {
                 } else {
@@ -812,7 +797,6 @@ var SqlAutocompleter3 = (function () {
                     meta: field.type,
                     meta: field.type,
                     category: CATEGORIES.COLUMN,
                     category: CATEGORIES.COLUMN,
                     table: table,
                     table: table,
-                    detailsTemplate: 'column',
                     details: field
                     details: field
                   });
                   });
                 }
                 }
@@ -823,7 +807,6 @@ var SqlAutocompleter3 = (function () {
                   meta: field.type,
                   meta: field.type,
                   category: CATEGORIES.COLUMN,
                   category: CATEGORIES.COLUMN,
                   table: table,
                   table: table,
-                  detailsTemplate: 'column',
                   details: field
                   details: field
                 });
                 });
               }
               }
@@ -835,7 +818,6 @@ var SqlAutocompleter3 = (function () {
                 meta: data.item.type,
                 meta: data.item.type,
                 category: CATEGORIES.COLUMN,
                 category: CATEGORIES.COLUMN,
                 table: table,
                 table: table,
-                detailsTemplate: 'column',
                 details: data.item
                 details: data.item
               });
               });
             }
             }
@@ -895,7 +877,6 @@ var SqlAutocompleter3 = (function () {
           value: '${' + self.parseResult.colRef.identifierChain[self.parseResult.colRef.identifierChain.length - 1].name + '}',
           value: '${' + self.parseResult.colRef.identifierChain[self.parseResult.colRef.identifierChain.length - 1].name + '}',
           meta: AutocompleterGlobals.i18n.meta.variable,
           meta: AutocompleterGlobals.i18n.meta.variable,
           category: CATEGORIES.VARIABLE,
           category: CATEGORIES.VARIABLE,
-          detailsTemplate: 'variable',
           details: null
           details: null
         });
         });
       }
       }
@@ -909,7 +890,6 @@ var SqlAutocompleter3 = (function () {
               value: isString ? startQuote + sample + endQuote : new String(sample),
               value: isString ? startQuote + sample + endQuote : new String(sample),
               meta: AutocompleterGlobals.i18n.meta.value,
               meta: AutocompleterGlobals.i18n.meta.value,
               category: CATEGORIES.SAMPLE,
               category: CATEGORIES.SAMPLE,
-              detailsTemplate: 'value',
               details: null
               details: null
             })
             })
           });
           });
@@ -942,7 +922,6 @@ var SqlAutocompleter3 = (function () {
                   value: suggestHdfs.path === '' ? '/' + file.name : file.name,
                   value: suggestHdfs.path === '' ? '/' + file.name : file.name,
                   meta: file.type,
                   meta: file.type,
                   category: CATEGORIES.HDFS,
                   category: CATEGORIES.HDFS,
-                  detailsTemplate: 'hdfs',
                   details: file
                   details: file
                 });
                 });
               }
               }
@@ -1020,7 +999,6 @@ var SqlAutocompleter3 = (function () {
                 meta: AutocompleterGlobals.i18n.meta.join,
                 meta: AutocompleterGlobals.i18n.meta.join,
                 category: suggestJoins.prependJoin ? CATEGORIES.POPULAR_JOIN : CATEGORIES.POPULAR_ACTIVE_JOIN,
                 category: suggestJoins.prependJoin ? CATEGORIES.POPULAR_JOIN : CATEGORIES.POPULAR_ACTIVE_JOIN,
                 popular: true,
                 popular: true,
-                detailsTemplate: 'join',
                 details: value
                 details: value
               });
               });
             }
             }
@@ -1070,7 +1048,6 @@ var SqlAutocompleter3 = (function () {
                 meta: AutocompleterGlobals.i18n.meta.joinCondition,
                 meta: AutocompleterGlobals.i18n.meta.joinCondition,
                 category: CATEGORIES.POPULAR_JOIN_CONDITION,
                 category: CATEGORIES.POPULAR_JOIN_CONDITION,
                 popular: true,
                 popular: true,
-                detailsTemplate: 'join-condition',
                 details: value
                 details: value
               });
               });
             }
             }
@@ -1142,7 +1119,6 @@ var SqlAutocompleter3 = (function () {
                 category: CATEGORIES.POPULAR_AGGREGATE,
                 category: CATEGORIES.POPULAR_AGGREGATE,
                 popular: true,
                 popular: true,
                 weightAdjust: Math.min(value.totalQueryCount, 99),
                 weightAdjust: Math.min(value.totalQueryCount, 99),
-                detailsTemplate: 'aggregate-function',
                 details: value
                 details: value
               });
               });
             })
             })
@@ -1185,7 +1161,6 @@ var SqlAutocompleter3 = (function () {
                 category: CATEGORIES.POPULAR_GROUP_BY,
                 category: CATEGORIES.POPULAR_GROUP_BY,
                 popular: true,
                 popular: true,
                 weightAdjust: Math.min(value.columnCount, 99),
                 weightAdjust: Math.min(value.columnCount, 99),
-                detailsTemplate: 'group-by',
                 details: value
                 details: value
               });
               });
             });
             });
@@ -1228,7 +1203,6 @@ var SqlAutocompleter3 = (function () {
                 category: CATEGORIES.POPULAR_ORDER_BY,
                 category: CATEGORIES.POPULAR_ORDER_BY,
                 popular: true,
                 popular: true,
                 weightAdjust: Math.min(value.columnCount, 99),
                 weightAdjust: Math.min(value.columnCount, 99),
-                detailsTemplate: 'order-by',
                 details: value
                 details: value
               });
               });
             });
             });
@@ -1282,7 +1256,6 @@ var SqlAutocompleter3 = (function () {
                       meta: AutocompleterGlobals.i18n.meta.filter,
                       meta: AutocompleterGlobals.i18n.meta.filter,
                       category: CATEGORIES.POPULAR_FILTER,
                       category: CATEGORIES.POPULAR_FILTER,
                       popular: true,
                       popular: true,
-                      detailsTemplate: 'filter',
                       details: popularValue
                       details: popularValue
                     });
                     });
                   });
                   });

+ 22 - 6
desktop/libs/notebook/src/notebook/templates/hue_ace_autocompleter.mako

@@ -161,7 +161,7 @@ from desktop.views import _ko
           </div>
           </div>
         </div>
         </div>
         <!-- ko if: focusedEntry() && focusedEntry().details -->
         <!-- ko if: focusedEntry() && focusedEntry().details -->
-        <div class="autocompleter-details" data-bind="template: { name: 'autocomplete-details-' + focusedEntry().detailsTemplate, data: focusedEntry }"></div>
+        <div class="autocompleter-details" data-bind="template: { name: 'autocomplete-details-' + focusedEntry().category.detailsTemplate, data: focusedEntry }"></div>
         <!-- /ko -->
         <!-- /ko -->
       </div>
       </div>
     </div>
     </div>
@@ -172,15 +172,15 @@ from desktop.views import _ko
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
   </script>
   </script>
 
 
-  <script type="text/html" id="autocomplete-details-column-alias">
-    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
-  </script>
-
   <script type="text/html" id="autocomplete-details-udf">
   <script type="text/html" id="autocomplete-details-udf">
     <div class="details-code" data-bind="text: details.signature"></div>
     <div class="details-code" data-bind="text: details.signature"></div>
     <div data-bind="text: details.description"></div>
     <div data-bind="text: details.description"></div>
   </script>
   </script>
 
 
+  <script type="text/html" id="autocomplete-details-database">
+    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
+  </script>
+
   <script type="text/html" id="autocomplete-details-table">
   <script type="text/html" id="autocomplete-details-table">
     <div class="details-header">${ _('Comment') }</div>
     <div class="details-header">${ _('Comment') }</div>
     <div data-bind="text: details.comment"></div>
     <div data-bind="text: details.comment"></div>
@@ -190,6 +190,10 @@ from desktop.views import _ko
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
   </script>
   </script>
 
 
+  <script type="text/html" id="autocomplete-details-variable">
+    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
+  </script>
+
   <script type="text/html" id="autocomplete-details-hdfs">
   <script type="text/html" id="autocomplete-details-hdfs">
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
   </script>
   </script>
@@ -202,7 +206,19 @@ from desktop.views import _ko
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
   </script>
   </script>
 
 
-  <script type="text/html" id="autocomplete-details-aggregate-function">
+  <script type="text/html" id="autocomplete-details-agg-udf">
+    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
+  </script>
+
+  <script type="text/html" id="autocomplete-details-value">
+    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
+  </script>
+
+  <script type="text/html" id="autocomplete-details-identifier">
+    <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
+  </script>
+
+  <script type="text/html" id="autocomplete-details-cte">
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
     <pre data-bind="text: ko.mapping.toJSON(details)"></pre>
   </script>
   </script>