Skip to content

Commit

Permalink
[2703] Remove the explorer menu used to export diagrams as SVG images
Browse files Browse the repository at this point in the history
Bug: #2703
Signed-off-by: Axel RICHARD <axel.richard@obeo.fr>
  • Loading branch information
AxelRICHARD authored and sbegaudeau committed Nov 30, 2023
1 parent 60e8c73 commit f5f05a9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 30 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.adoc
Expand Up @@ -131,6 +131,9 @@ Make some border node transparent when the node is in a list node in the convert
- https://github.com/eclipse-sirius/sirius-web/issues/2646[#2646] [diagram] Fix an issue where the palette was re rendering too much.
- https://github.com/eclipse-sirius/sirius-web/issues/2685[#2685] [diagram] Fix direct edit of edge labels with F2.
- https://github.com/eclipse-sirius/sirius-web/issues/2464[#2464] [diagram] Apply the fit-to-screen after the first layout
- https://github.com/eclipse-sirius/sirius-web/issues/2703[#2703] [diagram] Remove the explorer menu used to export diagrams as SVG image.
This menu was using Sprotty export, which has been replaced by ReactFlow by default (see https://github.com/eclipse-sirius/sirius-web/issues/2671[#2671]).
The only way to export diagram as SVG image is to use the ReactFlow toolbar located at the top left of each diagram.

=== New Features

Expand Down
Expand Up @@ -10,38 +10,11 @@
* Contributors:
* Obeo - initial API and implementation
*******************************************************************************/
import { ServerContext, ServerContextValue } from '@eclipse-sirius/sirius-components-core';
import { TreeItemContextMenuComponentProps } from '@eclipse-sirius/sirius-components-trees';
import ListItemIcon from '@material-ui/core/ListItemIcon';
import ListItemText from '@material-ui/core/ListItemText';
import MenuItem from '@material-ui/core/MenuItem';
import GetAppIcon from '@material-ui/icons/Image';
import React, { Fragment, forwardRef, useContext } from 'react';
import { Fragment, forwardRef } from 'react';

export const DiagramTreeItemContextMenuContribution = forwardRef(
(
{ editingContextId, item, onClose }: TreeItemContextMenuComponentProps,
ref: React.ForwardedRef<HTMLAnchorElement>
) => {
const { httpOrigin } = useContext<ServerContextValue>(ServerContext);

return (
<Fragment key="diagram-tree-item-context-menu-contribution">
<MenuItem
key="exportSVG"
divider
ref={ref}
component="a"
onClick={onClose}
href={`${httpOrigin}/api/editingcontexts/${editingContextId}/representations/${item.id}`}
type="application/octet-stream"
data-testid="exportSVG">
<ListItemIcon>
<GetAppIcon fontSize="small" />
</ListItemIcon>
<ListItemText primary="Export to SVG" />
</MenuItem>
</Fragment>
);
({}: TreeItemContextMenuComponentProps, _: React.ForwardedRef<HTMLLIElement>) => {
return <Fragment key="diagram-tree-item-context-menu-contribution"></Fragment>;
}
);

0 comments on commit f5f05a9

Please sign in to comment.