| Summary: | [client] Project deletion immediately after project creation fails | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> |
| Component: | Client | Assignee: | John Arthorne <john.arthorne> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | susan |
| Version: | 0.2 | ||
| Target Milestone: | 0.2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
John Arthorne
The problem actually occurs during the creation in step 1). After the creation, fileCommands.js does this (line 435):
dojo.hitch(explorer, function() {this.changedItem(this.treeRoot);}));
This calls explorer-table.js (line 40), which does this:
this.fileClient.fetchChildren(parent.ChildrenLocation).then(
function(children) {
eclipse.util.processNavigatorParent(parent, children);
What this does is:
- Get the children of the item to refresh
- Stick the new children into the parent object
However the other properties of the "parent" object are not refreshed. Deletion relies on a different property of the root element to do its work (the "Projects" element). I.e., we need to refresh the root, rather than the children of the root.
Susan, I spent ages looking at this but suspect I'm missing something obvious. How can I completely refresh the tree?
(In reply to comment #1) > Deletion > relies on a different property of the root element to do its work (the > "Projects" element). I.e., we need to refresh the root, rather than the > children of the root. > > Susan, I spent ages looking at this but suspect I'm missing something obvious. > How can I completely refresh the tree? Since you want to completely replace the root element, I think you should use loadResourceList, supplying it the path. That will get rid of the old cached tree root and refetch it. However if we already have the new json object in hand after the create, we could reset this.treeRoot and then do the changedItem. Let me know if you want me to take this. I have fixed this, but I had to add an optional "force" flag to loadResourceList. In this case the path has not changed so loadResourceList doesn't bother doing anything. http://git.eclipse.org/c/e4/org.eclipse.orion.client.git/commit/?id=1c2bdd1bb68faec337d977d567018962fdf971cc |