diff options
author | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2014-08-20 12:23:55 -0400 |
---|---|---|
committer | Silenio Quarti <silenio_quarti@ca.ibm.com> | 2014-08-20 12:23:55 -0400 |
commit | a2f2d7bf09cafcf0385a143753cc60df00855ef7 (patch) | |
tree | a491a676b152ef527defd3c7432bae5db10aabd8 | |
parent | cabbc24fcb1816c9ef9a41358d5782560f7f5d1d (diff) | |
download | org.eclipse.orion.client-origin/silenio/gitSelection.zip org.eclipse.orion.client-origin/silenio/gitSelection.tar.gz org.eclipse.orion.client-origin/silenio/gitSelection.tar.bz2 |
filter repo list and other fixes related to filteringorigin/silenio/gitSelection
4 files changed, 25 insertions, 18 deletions
diff --git a/bundles/org.eclipse.orion.client.git/web/git/css/git.css b/bundles/org.eclipse.orion.client.git/web/git/css/git.css index 7481780..f0226f9 100644 --- a/bundles/org.eclipse.orion.client.git/web/git/css/git.css +++ b/bundles/org.eclipse.orion.client.git/web/git/css/git.css @@ -32,7 +32,7 @@ } .repoDropdownList { - height:calc(100% - 35px); + height:calc(100% - 70px); overflow-y:auto; } diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js index e66988d..d190a88 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitBranchList.js @@ -86,9 +86,6 @@ define([ remotes.push({Type: "TagRoot", Name: messages["tags"]}); //$NON-NLS-0$
}
onComplete(that.processChildren(parentItem, remotes));
- if (remotes.length === 0 && this.section){
- this.section.setTitle(messages["No Remote Branches"]);
- }
}, function(error){
if (progress) progress.done();
that.handleError(error);
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js index dfa3475..c5d3123 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitConfigList.js @@ -27,6 +27,7 @@ define([ this.section = options.section;
this.progressService = options.progressService;
this.gitClient = options.gitClient;
+ this.filterQuery = this.root.mode === "full" ? "" : "user."; //$NON-NLS-1$ //$NON-NLS-0$
}
GitConfigListModel.prototype = Object.create(mExplorer.Explorer.prototype);
objects.mixin(GitConfigListModel.prototype, /** @lends orion.git.GitConfigListModel.prototype */ {
@@ -45,13 +46,8 @@ define([ this.progressService.progress(this.gitClient.getGitCloneConfig(parentItem.repository.ConfigLocation), msg).then( function(resp){
progress.worked("Rendering configuration"); //$NON-NLS-0$
var configurationEntries = resp.Children;
- var filteredConfig = [];
- for(var i=0; i<configurationEntries.length ;i++){
- if (parentItem.mode === "full" || configurationEntries[i].Key.indexOf("user.") !== -1) //$NON-NLS-1$ //$NON-NLS-0$
- filteredConfig.push(configurationEntries[i]);
- }
progress.done();
- onComplete(that.processChildren(parentItem, filteredConfig));
+ onComplete(that.processChildren(parentItem, configurationEntries));
}, function(error){
progress.done();
that.handleError(error);
@@ -123,12 +119,7 @@ define([ createFilter: function() {
uiUtil.createFilter(this.section, messages["Filter items"], function(value) {
this.model.filterQuery = value;
- this.changedItem().then(function () {
- if (this.model.filterQuery)
- for (var i=0; i<this.model.root.children.length; i++) {
- this.myTree.expand(this.model.root.children[i]);
- }
- }.bind(this));
+ this.changedItem();
}.bind(this));
},
display: function() {
diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js index 2c7022b..8655c85 100644 --- a/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js +++ b/bundles/org.eclipse.orion.client.git/web/orion/git/widgets/gitRepoList.js @@ -18,9 +18,10 @@ define([ 'orion/explorers/explorer',
'orion/URITemplate',
'orion/i18nUtil',
+ 'orion/git/uiUtil',
'orion/Deferred',
'orion/objects'
-], function(messages, KeyBinding, mCommandRegistry, mExplorer, URITemplate, i18nUtil, Deferred, objects) {
+], function(messages, KeyBinding, mCommandRegistry, mExplorer, URITemplate, i18nUtil, uiUtil, Deferred, objects) {
var repoTemplate = new URITemplate("git/git-repository.html#{,resource,params*}"); //$NON-NLS-0$
@@ -135,6 +136,15 @@ define([ }
},
processChildren: function(parentItem, children) {
+ var filter = this.filterQuery;
+ if (filter) {
+ children = children.filter(function(item) {
+ return item.Name.indexOf(filter) !== -1;
+ });
+ }
+ if (children.length === 0) {
+ children = [{Type: "NoContent", selectable: false, isNotSelectable: true}]; //$NON-NLS-0$
+ }
children.forEach(function(item) {
item.parent = parentItem;
});
@@ -200,6 +210,12 @@ define([ });
return deferred;
},
+ createFilter: function() {
+ uiUtil.createFilter(this.section, messages["Filter items"], function(value) {
+ this.model.filterQuery = value;
+ this.changedItem();
+ }.bind(this));
+ },
display: function() {
var that = this;
var deferred = new Deferred();
@@ -216,6 +232,7 @@ define([ parentId: this.parentId,
handleError: this.handleError
});
+ this.createFilter();
this.createTree(this.parentId, model, {
setFocus: false, // do not steal focus on load
selectionPolicy: this.selectionPolicy,
@@ -272,7 +289,9 @@ define([ div.appendChild(horizontalBox);
var actionsID, title, description, subDescription, extraDescriptions = [], titleClass = "", titleLink;
- if (item.parent.Type === "RepoRoot") { //$NON-NLS-0$
+ if (item.Type === "NoContent") { //$NON-NLS-0$
+ title = messages[item.Type];
+ } else if (item.parent.Type === "RepoRoot") { //$NON-NLS-0$
if (explorer.showLinks) {
titleLink = require.toUrl(repoTemplate.expand({resource: repo.Location}));
} else {
|