Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 210960 Details for
Bug 369283
git-repository page should provide a way to change repo config
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fix v1
fix_bug369283.txt (text/plain), 10.50 KB, created by
Szymon Brandys
on 2012-02-14 04:41:36 EST
(
hide
)
Description:
Fix v1
Filename:
MIME Type:
Creator:
Szymon Brandys
Created:
2012-02-14 04:41:36 EST
Size:
10.50 KB
patch
obsolete
>diff --git a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js >index e5c69c2..e46d765 100644 >--- a/bundles/org.eclipse.orion.client.git/web/git/git-repository.js >+++ b/bundles/org.eclipse.orion.client.git/web/git/git-repository.js >@@ -70,6 +70,8 @@ > commandService.registerCommandContribution("eclipse.orion.git.rebase", 1000); > commandService.registerCommandContribution("eclipse.orion.git.resetIndex", 1000); > commandService.registerCommandContribution("eclipse.removeRemote", 1000); >+ commandService.registerCommandContribution("eclipse.orion.git.deleteConfigEntryCommand", 1000); >+ commandService.registerCommandContribution("eclipse.orion.git.editConfigEntryCommand", 1000); > > // add commands specific for the page > var viewAllCommand = new mCommands.Command({ >@@ -86,10 +88,7 @@ > } > }); > commandService.addCommand(viewAllCommand, "dom"); >- >-// // render commands >-// mGitCommands.updateNavTools(serviceRegistry, explorer, "pageActions", "selectionTools", {}); >- >+ > // process the URL to find our bindings, since we can't be sure these bindings were defined when the URL was first processed. > commandService.processURL(window.location.href); > >diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js >index 899d896..6883f1e 100644 >--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js >+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitCommands.js >@@ -1664,6 +1664,101 @@ > }; > > exports.createGitClonesCommands = function(serviceRegistry, commandService, explorer, toolbarId, selectionTools, fileClient) { >+ >+ function displayErrorOnStatus(error) { >+ >+ if (error.status === 401 || error.status === 403) >+ return; >+ >+ var display = []; >+ >+ display.Severity = "Error"; >+ display.HTML = false; >+ >+ try { >+ var resp = JSON.parse(error.responseText); >+ display.Message = resp.DetailedMessage ? resp.DetailedMessage : resp.Message; >+ } catch (Exception) { >+ display.Message = error.message; >+ } >+ >+ serviceRegistry.getService("orion.page.message").setProgressResult(display); >+ } >+ >+ // Git repository configuration >+ >+ var addConfigParameters = new mCommands.ParametersDescription([new mCommands.CommandParameter('key', 'text', 'Key:'), >+ new mCommands.CommandParameter('value', 'text', 'Value:')], false); >+ >+ var addConfigEntryCommand = new mCommands.Command({ >+ name: "New Configuration Entry", >+ tooltip: "Add a new entry to the repository configuration", >+ imageClass: "core-sprite-add", >+ id: "eclipse.orion.git.addConfigEntryCommand", >+ parameters: addConfigParameters, >+ callback: function(data) { >+ var item = data.items; >+ var gitService = serviceRegistry.getService("orion.git.provider"); >+ if (data.parameters.valueFor("key") && data.parameters.valueFor("value")){ >+ gitService.addCloneConfigurationProperty(item.Location, data.parameters.valueFor("key"), data.parameters.valueFor("value")).then( >+ function(jsonData){ >+ dojo.hitch(explorer, explorer.changedItem)(item); >+ }, displayErrorOnStatus >+ ); >+ } >+ } >+ }); >+ commandService.addCommand(addConfigEntryCommand, "dom"); >+ >+ var editConfigParameters = new mCommands.ParametersDescription([new mCommands.CommandParameter('value', 'text', 'Value:')], false); >+ >+ var editConfigEntryCommand = new mCommands.Command({ >+ name: "Edit", >+ tooltip: "Edit the configuration entry", >+ imageClass: "core-sprite-edit", >+ id: "eclipse.orion.git.editConfigEntryCommand", >+ parameters: editConfigParameters, >+ callback: function(data) { >+ var item = data.items; >+ var gitService = serviceRegistry.getService("orion.git.provider"); >+ if (data.parameters.valueFor("value")){ >+ gitService.editCloneConfigurationProperty(item.Location, data.parameters.valueFor("value")).then( >+ function(jsonData){ >+ dojo.hitch(explorer, explorer.changedItem)(item); >+ }, displayErrorOnStatus >+ ); >+ } >+ }, >+ visibleWhen: function(item) { >+ return (item.Key && item.Value && item.Location); >+ } >+ }); >+ commandService.addCommand(editConfigEntryCommand, "object"); >+ >+ var deleteConfigEntryCommand = new mCommands.Command({ >+ name: "Delete", >+ tooltip: "Delete the configuration entry", >+ imageClass: "core-sprite-delete", >+ id: "eclipse.orion.git.deleteConfigEntryCommand", >+ callback: dojo.hitch(this, function(data) { >+ var item = data.items; >+ var gitService = serviceRegistry.getService("orion.git.provider"); >+ if (confirm("Are you sure you want to delete " + item.Key + "?")) { >+ gitService.deleteCloneConfigurationProperty(item.Location).then( >+ function(jsonData) { >+ dojo.hitch(explorer, explorer.changedItem)(item); >+ }, displayErrorOnStatus >+ ); >+ } >+ }), >+ visibleWhen: function(item) { >+ return (item.Key && item.Value && item.Location); >+ } >+ }); >+ commandService.addCommand(deleteConfigEntryCommand, "object"); >+ >+ // >+ > var cloneParameters = new mCommands.ParametersDescription([new mCommands.CommandParameter("url", "url", "Repository URL:")], true); > > function forceSingleItem(item) { >diff --git a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js >index d9206e0..e88aeaf 100644 >--- a/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js >+++ b/bundles/org.eclipse.orion.client.git/web/orion/git/gitRepositoryExplorer.js >@@ -56,7 +56,6 @@ > }; > > GitRepositoryExplorer.prototype.changedItem = function(parent, children) { >- console.info("item changed: " + parent + " " + children); > this.redisplayClonesList(); > }; > >@@ -95,7 +94,8 @@ > that.displayCommits(repositories[0]); > that.displayBranches(repositories[0]); > that.displayTags(repositories[0]); >- that.displayRemotes(repositories[0]); >+ that.displayRemotes(repositories[0]); >+ that.displayConfig(repositories[0]); > } else if (resp.Children[0].Type === "Clone"){ > var repositories = resp.Children; > >@@ -128,6 +128,19 @@ > > that.displayRepositories(repositories, "mini", true); > that.displayTags(repositories[0], "full"); >+ }, function () { >+ dojo.hitch(that, that.handleError)(error); >+ } >+ ); >+ } else if (resp.Children[0].Type === "Config"){ >+ that.registry.getService("orion.git.provider").getGitClone(resp.CloneLocation).then( >+ function(resp){ >+ var repositories = resp.Children; >+ >+ that.initTitleBar(repositories[0], "Configuration"); >+ >+ that.displayRepositories(repositories, "mini", true); >+ that.displayConfig(repositories[0], "full"); > }, function () { > dojo.hitch(that, that.handleError)(error); > } >@@ -995,6 +1008,87 @@ > > }; > >+ // Git Config >+ >+ GitRepositoryExplorer.prototype.displayConfig = function(repository, mode){ >+ >+ var configLocation = repository.ConfigLocation; >+ >+ var that = this; >+ >+ var tableNode = dojo.byId( 'table' ); >+ >+ var titleWrapper = dojo.create( "div", {"class":"auxpaneHeading sectionWrapper toolComposite", "id":"configSectionHeader"}, tableNode ); >+ >+ dojo.create( "div", { id: "configSectionTitle", "class":"layoutLeft", innerHTML: "Configuration" }, titleWrapper ); >+ dojo.create( "div", { id: "configSectionActionsArea", "class":"layoutRight sectionActions"}, titleWrapper ); >+ dojo.create( "div", { id: "viewAllConfigSectionActionsArea", "class":"layoutRight sectionActions"}, titleWrapper ); >+ >+ var parentId = "configSectionHeader"; >+ >+ var slideout = >+ '<div id="' + parentId + 'slideContainer" class="layoutBlock slideParameters slideContainer">' + >+ '<span id="' + parentId + 'slideOut" class="slide">' + >+ '<span id="' + parentId + 'pageCommandParameters" class="parameters"></span>' + >+ '<span id="' + parentId + 'pageCommandDismiss" class="parametersDismiss"></span>' + >+ '</span>' + >+ '</div>'; >+ >+ >+ dojo.place( slideout, titleWrapper ); >+ >+ if (mode === "full"){ >+ this.commandService.registerCommandContribution("eclipse.orion.git.addConfigEntryCommand", 1000, "configSectionActionsArea"); >+ this.commandService.renderCommands(dojo.byId("configSectionActionsArea"), "dom", repository, this, "button"); >+ } >+ >+ var content = >+ '<div class="git-table">' + >+ '<div class="plugin-settings">' + >+ '<list id="configNode" class="plugin-settings-list"></list>' + >+ '</div>' + >+ '</div>'; >+ >+ dojo.place( content, tableNode ); >+ >+ this.registry.getService("orion.git.provider").getGitCloneConfig(configLocation).then( >+ function(resp){ >+ var configurationEntries = resp.Children; >+ >+ if (mode !== "full" && configurationEntries.length !== 0){ >+ that.commandService.registerCommandContribution("eclipse.orion.git.repositories.viewAllCommand", 10, "viewAllConfigSectionActionsArea"); >+ that.commandService.renderCommands(dojo.byId("viewAllConfigSectionActionsArea"), "dom", >+ {"ViewAllLink":"/git/git-repository.html#" + configLocation, "ViewAllLabel":"View All", "ViewAllTooltip":"View all configuration entries"}, that, "button"); >+ } >+ >+ if (configurationEntries.length === 0){ >+ dojo.byId("configSectionTitle").innerHTML = "No Configuration"; >+ return; >+ } >+ >+ for(var i=0; i<configurationEntries.length ;i++){ >+ if (mode === "full" || configurationEntries[i].Key.indexOf("user.") !== -1) >+ that.renderConfigEntry(configurationEntries[i], i); >+ }; >+ }, function(error){ >+ dojo.hitch(that, that.handleError)(error); >+ } >+ ); >+ }; >+ >+ GitRepositoryExplorer.prototype.renderConfigEntry = function(configEntry, index){ >+ var extensionListItem = dojo.create( "div", { "class":"git-list-item " + ((index % 2) ? "darkTreeTableRow" : "lightTreeTableRow") }, dojo.byId("configNode") ); >+ var horizontalBox = dojo.create( "div", null, extensionListItem ); >+ >+ var detailsView = dojo.create( "div", { "class":"stretch"}, horizontalBox ); >+ dojo.create( "span", { "class":"gitMainDescription", innerHTML: configEntry.Key }, detailsView ); >+ dojo.create( "span", { "class":"gitSecondaryDescription", "style":"margin-left:20px", innerHTML: configEntry.Value}, detailsView ); >+ >+ var actionsArea = dojo.create( "div", {"id":"configActionsArea", "class":"git-action-area" }, horizontalBox ); >+ this.commandService.renderCommands(actionsArea, "object", configEntry, this, "tool"); >+ >+ }; >+ > return GitRepositoryExplorer; > }()); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 369283
:
210960
|
210962