| Summary: | [Compare]Add more options in compare widget and diff provider. | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | libing wang <libingw> |
| Component: | Client | Assignee: | libing wang <libingw> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P3 | CC: | evan_hughes, Szymon.Brandys |
| Version: | 0.3 | ||
| Target Milestone: | 1.0 RC1 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
libing wang
checked in first draft with 1be1a8bbe7573887f1ba4738c05ebf29d9a0a45c. Need some more options on the widget construction. With your recent changes my compare in RTC integration stopped working. Moreover I'm not sure how GitDiffProvider which is a Git-specific thing may be part of compare-container.js which is a generic thing. I used to use the compare in the following way: _inlineCompareContainer = new mCompareContainer.InlineCompareContainer(new mDiffProvider.DiffProvider(this._registry), this._registry, this._parent.id); and then this._inlineCompareContainer.resolveDiff(diffURI, callbacks...) What should I do now? Use GitDiffProvider? (In reply to comment #2) > With your recent changes my compare in RTC integration stopped working. > Moreover I'm not sure how GitDiffProvider which is a Git-specific thing may be > part of compare-container.js which is a generic thing. > > I used to use the compare in the following way: > _inlineCompareContainer = new mCompareContainer.InlineCompareContainer(new > mDiffProvider.DiffProvider(this._registry), this._registry, this._parent.id); > and then > this._inlineCompareContainer.resolveDiff(diffURI, callbacks...) > > What should I do now? Use GitDiffProvider? Yes, you have to use GitDiffProvider, which is wrapper of the existing APIs from gitClient. You should also construct the widget from options and use .startup(). e.g: var diffProvider = new mCompareContainer.GitDiffProvider(serviceRegistry); var options = { readonly: true, diffProvider: diffProvider }; _inlineCompareContainer = new mCompareContainer.InlineCompareContainer(serviceRegistry, "inline-compare-viewer", options); _inlineCompareContainer.setOptions({hasConflicts: this._model.isConflict(itemModel.type), complexURL: itemModel.diffURI}); _inlineCompareContainer.startup(); I've been improving the diff provider for better consumability so that it is not restricted to the order where we called the provider APIs. Your code is not in the repo so I did not know you are using the inline widget directly. The new approach of the diff provider is to provide all the diff pararmeters(diff contetnt, 2 sets of file URI, file Name and file type) By this, other consumers(e.g. RTC) can easily provide theirs. I will add documentation on those APIs when it is finalized but for now please follow the usage inside git-status-table.js. We have now inline, side-by-side and toggle-able compare widgets widely used in different places. All the options are there. |