intellij-community icon indicating copy to clipboard operation
intellij-community copied to clipboard

Refactor ExportAction

Open ekudel opened this issue 6 years ago • 10 comments

  • Split ExportAction into 2 actions and add them into "InspectionToolWindow.ExportPopup" action group to allow plugins to add more actions there.
  • Add "InspectionToolWindow.Toolbar" action group to allow plugins to add actions into toolbar of "Inspection Results".

ekudel avatar Jun 25 '18 19:06 ekudel

Have you submitted a contributor license agreement? If not, please follow the steps described at http://www.jetbrains.com/agreements/cla/ to sign it.

klikh avatar Jun 25 '18 19:06 klikh

@klikh Ok, I've done it.

ekudel avatar Jun 26 '18 09:06 ekudel

Any updates? :)

ekudel avatar Jul 09 '18 11:07 ekudel

@ekudel there are simple merge conflicts now

zdary avatar Oct 05 '18 03:10 zdary

@ekudel Please rebase the PR on top of current master.

@akozlova @batya239 please take a look at the PR.

klikh avatar Oct 15 '18 07:10 klikh

@klikh Done

ekudel avatar Oct 15 '18 12:10 ekudel

@ekudel Now it's possible to add any action to "InspectionToolWindow.ExportPopup". I don't think it should be a kind of public API. I believe export html/xml actions should be unified and single abstract class should be extracted to export results to arbitrary given format

batya239 avatar Oct 15 '18 13:10 batya239

@batya239 Well, now the only common part of ExportToHTMLAction and ExportToXMLAction is showing "Export" dialog. All other code is completely different: visiting, etc (perhaps it can be changed, but it looks like a quite big task, so I'm just suggesting a small refactoring now). However this dialog is actually HTML-specific (for example it contains "open in browser" checkbox), and for our custom action we don't need it, so I hardly understand what that abstract class (user for all "export" actions) should contain. By the way we want to provide a custom action for exporting to Hybris-compatible XLSX format. However there could be other ways to export inspection results to XLSX provided by the platform or another plugin, so one-to-one relationship between formats and handlers wouldn't seem to work here.

ekudel avatar Oct 15 '18 14:10 ekudel

@klikh @batya239 any updates?

ekudel avatar Oct 18 '18 08:10 ekudel

If needed, I'd prefer the approach which is done for exporting tests image

akozlova avatar Oct 18 '18 16:10 akozlova