From d6a64db1ced3d3577886a7aec140a5174cbceb48 Mon Sep 17 00:00:00 2001 From: alexwl Date: Wed, 6 Feb 2019 21:42:29 +0300 Subject: Add identifier search in all indexed packages --- .../components/input-with-autocomplete.hbs | 2 +- javascript/app/templates/package.hbs | 3 +- javascript/app/templates/package/search.hbs | 6 +-- javascript/app/templates/packages.hbs | 24 ++++++++++- javascript/app/templates/search.hbs | 46 ++++++++++++++++++++++ 5 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 javascript/app/templates/search.hbs (limited to 'javascript/app/templates') diff --git a/javascript/app/templates/components/input-with-autocomplete.hbs b/javascript/app/templates/components/input-with-autocomplete.hbs index eb0100d..1a73c07 100644 --- a/javascript/app/templates/components/input-with-autocomplete.hbs +++ b/javascript/app/templates/components/input-with-autocomplete.hbs @@ -14,6 +14,6 @@ {{/if}}
- +
diff --git a/javascript/app/templates/package.hbs b/javascript/app/templates/package.hbs index 8c6d1a4..5f9fa68 100644 --- a/javascript/app/templates/package.hbs +++ b/javascript/app/templates/package.hbs @@ -7,6 +7,7 @@ createSearchUrlFunction=createSearchUrlFunction maxItems=10 selectItem=(action 'showIdentifier') + searchButtonText="Search" placeholder="Identifier" as |identifier|}} {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}}
@@ -31,7 +32,7 @@
{{/resizable-panel}}
-
+
{{outlet}}
{{#bottom-panel visible=bottomPanelVisible topPanelElementId="#file-container" containerElementId="#right-panel" as |section|}} diff --git a/javascript/app/templates/package/search.hbs b/javascript/app/templates/package/search.hbs index ebc4d52..37b3992 100644 --- a/javascript/app/templates/package/search.hbs +++ b/javascript/app/templates/package/search.hbs @@ -2,11 +2,11 @@ Query : {{model.query}}
- {{#paginated-list url=model.url as |identifiers|}} + {{#paginated-list url=model.url as |identifiers|}}
    {{#each identifiers as |identifier|}} -
  • - {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} +
  • + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}}
    {{#if identifier.locationInfo.modulePath}} diff --git a/javascript/app/templates/packages.hbs b/javascript/app/templates/packages.hbs index 6dc4b7b..80464e6 100644 --- a/javascript/app/templates/packages.hbs +++ b/javascript/app/templates/packages.hbs @@ -1,6 +1,26 @@
    -
    - +
    +
    + {{#input-with-autocomplete + onSubmit=(action 'searchIdentifier') + createSearchUrlFunction=createSearchUrlFunction + maxItems=10 + selectItem=(action 'showIdentifier') + searchButtonText="Search in all packages" + placeholder="Haskell identifier" as |identifier|}} + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} +
    + {{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}} + {{#if identifier.locationInfo.modulePath}} + {{identifier.locationInfo.modulePath}} + {{else}} + {{identifier.locationInfo.moduleName}} + {{/if}} +
    + {{/input-with-autocomplete}} +
    +
    +
    {{input class="form-control" type="text" value=query placeholder="Package name"}} Number of packages : {{packages.length}} diff --git a/javascript/app/templates/search.hbs b/javascript/app/templates/search.hbs new file mode 100644 index 0000000..343ce68 --- /dev/null +++ b/javascript/app/templates/search.hbs @@ -0,0 +1,46 @@ +
    +
    +
    +
    + {{#input-with-autocomplete + onSubmit=(action 'searchIdentifier') + createSearchUrlFunction=createSearchUrlFunction + maxItems=10 + selectItem=(action 'showIdentifier') + searchButtonText="Search in all packages" + placeholder="Haskell identifier" as |identifier|}} + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} +
    + {{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}} + {{#if identifier.locationInfo.modulePath}} + {{identifier.locationInfo.modulePath}} + {{else}} + {{identifier.locationInfo.moduleName}} + {{/if}} +
    + {{/input-with-autocomplete}} +
    +
    + Query : {{model.query}} +
    +
    + {{#paginated-list url=model.url as |identifiers|}} +
      + {{#each identifiers as |identifier|}} +
    • + {{identifier.demangledOccName}} :: {{type-signature-text components=identifier.idType.components}} + +
      + {{#if identifier.locationInfo.modulePath}} + Defined in {{identifier.locationInfo.packageId.name}}-{{identifier.locationInfo.packageId.version}} {{identifier.locationInfo.modulePath}} + {{/if}} +
      +
      {{{identifier.doc}}}
      +
    • + {{/each}} +
    + {{/paginated-list}} +
    +
    +
    +
    -- cgit v1.2.3