mirror of https://github.com/apache/archiva.git
starting filtering on search results
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1295114 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9fd6d23558
commit
cc812c4665
|
@ -223,3 +223,5 @@ search.artifact.results.groupId=Group ID
|
||||||
search.artifact.results.artifactId=Artifact ID
|
search.artifact.results.artifactId=Artifact ID
|
||||||
search.artifact.results.version=Version
|
search.artifact.results.version=Version
|
||||||
search.artifact.searching=Searching .....
|
search.artifact.searching=Searching .....
|
||||||
|
search.artifact.search.form.btn.search=Search
|
||||||
|
search.artifact.search.form.btn.search.filter=Filter Results
|
||||||
|
|
|
@ -647,15 +647,18 @@ $(function() {
|
||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
headerText: $.i18n.prop('search.artifact.results.groupId'),
|
headerText: $.i18n.prop('search.artifact.results.groupId'),
|
||||||
rowText: "groupId"
|
rowText: "groupId",
|
||||||
|
id: "groupId"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headerText: $.i18n.prop('search.artifact.results.artifactId'),
|
headerText: $.i18n.prop('search.artifact.results.artifactId'),
|
||||||
rowText: "artifactId"
|
rowText: "artifactId",
|
||||||
|
id: "artifactId"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
headerText: $.i18n.prop('search.artifact.results.version'),
|
headerText: $.i18n.prop('search.artifact.results.version'),
|
||||||
rowText: "version"
|
rowText: "version",
|
||||||
|
id: "version"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
@ -674,8 +677,7 @@ $(function() {
|
||||||
this.resultViewModel=new ResultViewModel([]);
|
this.resultViewModel=new ResultViewModel([]);
|
||||||
basicSearch=function(){
|
basicSearch=function(){
|
||||||
var queryTerm=this.searchRequest().queryTerms();
|
var queryTerm=this.searchRequest().queryTerms();
|
||||||
if (!queryTerm || $.trim(queryTerm).length<1){
|
if ($.trim(queryTerm).length<1){
|
||||||
$.log("empty");
|
|
||||||
var errorList=[{
|
var errorList=[{
|
||||||
message: $.i18n.prop("search.artifact.search.form.terms.empty"),
|
message: $.i18n.prop("search.artifact.search.form.terms.empty"),
|
||||||
element: $("#main-content #search-basic-form #search-terms" ).get(0)
|
element: $("#main-content #search-basic-form #search-terms" ).get(0)
|
||||||
|
@ -732,6 +734,7 @@ $(function() {
|
||||||
ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
|
ko.applyBindings(self.resultViewModel,searchResultsGrid.get(0));
|
||||||
}
|
}
|
||||||
activateSearchResultsTab();
|
activateSearchResultsTab();
|
||||||
|
mainContent.find("#btn-advanced-search-filter" ).show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(data) {
|
error: function(data) {
|
||||||
|
@ -745,6 +748,16 @@ $(function() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
filterResults=function(){
|
||||||
|
var filtered=[];
|
||||||
|
for (var i=0;i<self.resultViewModel.artifacts().length;i++){
|
||||||
|
if (self.resultViewModel.artifacts()[i].groupId==this.searchRequest().groupId()){
|
||||||
|
filtered.push(self.resultViewModel.artifacts()[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
self.resultViewModel.artifacts(filtered);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
activateSearchResultsTab=function(){
|
activateSearchResultsTab=function(){
|
||||||
|
|
|
@ -209,7 +209,8 @@
|
||||||
data-bind="value: searchRequest().queryTerms" placeholder="${$.i18n.prop('search.artifact.search.form.query.terms')}"/>
|
data-bind="value: searchRequest().queryTerms" placeholder="${$.i18n.prop('search.artifact.search.form.query.terms')}"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button type="submit" id="btn-basic-search" class="btn btn-primary" data-loading-text="${$.i18n.prop('search.artifact.searching')}" data-bind="click: basicSearch">Search</button>
|
<button type="submit" id="btn-basic-search" class="btn btn-primary"
|
||||||
|
data-loading-text="${$.i18n.prop('search.artifact.searching')}" data-bind="click: basicSearch">${$.i18n.prop('search.artifact.search.form.btn.search')}</button>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -252,7 +253,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<button type="submit" id="btn-advanced-search" class="btn btn-primary" class="btn" data-bind="click: advancedSearch">Search</button>
|
<button type="submit" id="btn-advanced-search" class="btn btn-primary"
|
||||||
|
data-bind="click: advancedSearch">${$.i18n.prop('search.artifact.search.form.btn.search')}</button>
|
||||||
|
|
||||||
|
<button type="submit" id="btn-advanced-search-filter" class="btn btn-success hide"
|
||||||
|
data-bind="click: filterResults">${$.i18n.prop('search.artifact.search.form.btn.search.filter')}</button>
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="pill-pane" id="search-osgi-form-pane">
|
<div class="pill-pane" id="search-osgi-form-pane">
|
||||||
|
@ -282,6 +288,11 @@
|
||||||
<th title="${ columnDefinition.title }">${ columnDefinition.headerText }</th>
|
<th title="${ columnDefinition.title }">${ columnDefinition.headerText }</th>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
{{each(i, columnDefinition) columns}}
|
||||||
|
<th title="${ columnDefinition.title }" id="search-filter-auto-${ columnDefinition.id }"><input type="text" place-holder="filter"/></th>
|
||||||
|
{{/each}}
|
||||||
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{{each(i, row) itemsOnCurrentPage()}}
|
{{each(i, row) itemsOnCurrentPage()}}
|
||||||
|
|
Loading…
Reference in New Issue