InlineEdit: Implement CM3 integration, using new screen
Add new screen for editing file and commit message content and dispatch to it when a user navigates to a file or commit message in change edit mode from file table. Two buttons are rendered in header of new edit screen: cancel and save. Clicking on both of them takes user to CS2. To differentiate between diff mode and edit mode in dispatcher, new panel is used: ",edit"; "cm" is not used any more, as only CS2 is supported: c/1/1/foo.txt opens SBS2 screen, whereas c/1/1/foo.txt,edit opens new edit screen with integrated CM3 editor. Navigation in edit mode is harmonized from all places: file table and SBS2 now using new edit screen to edit file and commit message content. Edit file content popup dialog is only used in two places: When adding new file to change edit or clicking on "Edit Message" button. In former case this dialog is preserved until it is replaced by repository browser. The usage of edit file icon in file table was dropped. Change-Id: I4d70463357b82a8a3d675dd18b3ea5af99a434b0
This commit is contained in:
		| @@ -79,6 +79,7 @@ import com.google.gerrit.client.dashboards.DashboardList; | ||||
| import com.google.gerrit.client.diff.DisplaySide; | ||||
| import com.google.gerrit.client.diff.SideBySide2; | ||||
| import com.google.gerrit.client.documentation.DocScreen; | ||||
| import com.google.gerrit.client.editor.EditScreen; | ||||
| import com.google.gerrit.client.groups.GroupApi; | ||||
| import com.google.gerrit.client.groups.GroupInfo; | ||||
| import com.google.gerrit.client.patches.PatchScreen; | ||||
| @@ -169,6 +170,15 @@ public class Dispatcher { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   public static String toEditScreen(PatchSet.Id revision, String fileName) { | ||||
|     Change.Id c = revision.getParentKey(); | ||||
|     StringBuilder p = new StringBuilder(); | ||||
|     p.append("/c/").append(c).append("/"); | ||||
|     p.append(revision.getId()).append("/").append(KeyUtil.encode(fileName)); | ||||
|     p.append(",edit"); | ||||
|     return p.toString(); | ||||
|   } | ||||
|  | ||||
|   public static String toPublish(PatchSet.Id ps) { | ||||
|     Change.Id c = ps.getParentKey(); | ||||
|     return "/c/" + c + "/" + ps.get() + ",publish"; | ||||
| @@ -735,6 +745,8 @@ public class Dispatcher { | ||||
|                 patchTable,// | ||||
|                 top,// | ||||
|                 baseId);// | ||||
|           } else if (panel.equals("edit")) { | ||||
|             return new EditScreen(id); | ||||
|           } | ||||
|         } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 David Ostrovsky
					David Ostrovsky