From 466a40ebbb50b1790d91bd7f88f9a149cde992ad Mon Sep 17 00:00:00 2001 From: Cindy Lu Date: Fri, 29 Apr 2016 08:30:31 -0700 Subject: [PATCH] Magic Search inline doc cleanup clientFullTextSearch is supposed to be boolean cleanup some mocked code for accuracy Change-Id: I9f6f3a730b826745dcd2c2990e36ca83c64f4709 --- .../hz-magic-search-bar.directive.js | 30 ++++++++++++++++++- .../hz-magic-search-context.directive.js | 9 +++--- .../magic-search/magic-search.module.js | 6 ---- .../magic-search/st-magic-search.directive.js | 30 ++++++++++++++++++- 4 files changed, 63 insertions(+), 12 deletions(-) diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js index eed160086..16c1ca304 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-bar.directive.js @@ -35,7 +35,35 @@ * * @example * ``` - * + * + * var filterFacets = [ + * { + * label: gettext('Name'), + * name: 'name', + * singleton: true + * }, + * { + * label: gettext('VCPUs'), + * name: 'vcpus', + * singleton: true + * }, + * { + * label: gettext('RAM'), + * name: 'ram', + * singleton: true + * }, + * { + * label: gettext('Public'), + * name: 'isPublic', + * singleton: true, + * options: [ + * { label: gettext('No'), key: false }, + * { label: gettext('Yes'), key: true } + * ] + * }]; + * + * * * * ``` diff --git a/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js b/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js index 1cb568c13..aeada6495 100644 --- a/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js +++ b/horizon/static/framework/widgets/magic-search/hz-magic-search-context.directive.js @@ -38,7 +38,9 @@ * * @param {object} filterFacets Facets allowed for searching * @param {object=} filterStrings Help content shown in search bar - * @param {object=} clientFullTextSearch if full text search is to be done on the client + * @param {boolean=} clientFullTextSearch if true, performs full text search + * exclusively on the client + * * Facets: * ``` * var nameFacet = { @@ -69,9 +71,8 @@ * @example * ``` * + * filter-strings="filterStrings" + * filter-facets="filterFacets"> * * *
diff --git a/horizon/static/framework/widgets/magic-search/magic-search.module.js b/horizon/static/framework/widgets/magic-search/magic-search.module.js index 893e04574..e6cc2970a 100644 --- a/horizon/static/framework/widgets/magic-search/magic-search.module.js +++ b/horizon/static/framework/widgets/magic-search/magic-search.module.js @@ -25,12 +25,6 @@ * used with the Eucalyptus third-party MagicSearch module at * https://github.com/eucalyptus/magic-search. * - * | Directives | - * |-------------------------------------------------------------------| - * | {@link MagicSearch.directive:hzMagicSearchBar `hzMagicSearchBar`} | - * | {@link MagicSearch.directive:magicOverrides `magicOverrides`} | - * | {@link MagicSearch.directive:stMagicSearch `stMagicSearch`} | - * */ angular .module('horizon.framework.widgets.magic-search', ['ui.bootstrap']); diff --git a/horizon/static/framework/widgets/magic-search/st-magic-search.directive.js b/horizon/static/framework/widgets/magic-search/st-magic-search.directive.js index f43d5a4c2..a82bff129 100644 --- a/horizon/static/framework/widgets/magic-search/st-magic-search.directive.js +++ b/horizon/static/framework/widgets/magic-search/st-magic-search.directive.js @@ -38,7 +38,35 @@ * * @example * ``` - * + * + * var filterFacets = [ + * { + * label: gettext('Name'), + * name: 'name', + * singleton: true + * }, + * { + * label: gettext('VCPUs'), + * name: 'vcpus', + * singleton: true + * }, + * { + * label: gettext('RAM'), + * name: 'ram', + * singleton: true + * }, + * { + * label: gettext('Public'), + * name: 'isPublic', + * singleton: true, + * options: [ + * { label: gettext('No'), key: false }, + * { label: gettext('Yes'), key: true } + * ] + * }]; + * + * * * *