mirror of
https://bitbucket.org/wisemapping/wisemapping-frontend.git
synced 2024-11-11 01:43:23 +01:00
Add mindmap load
This commit is contained in:
parent
3d53f74117
commit
18673fd0d1
@ -10,7 +10,7 @@ import FormControlLabel from '@material-ui/core/FormControlLabel';
|
|||||||
import Radio from '@material-ui/core/Radio';
|
import Radio from '@material-ui/core/Radio';
|
||||||
import Select from '@material-ui/core/Select';
|
import Select from '@material-ui/core/Select';
|
||||||
import MenuItem from '@material-ui/core/MenuItem';
|
import MenuItem from '@material-ui/core/MenuItem';
|
||||||
import { Designer, TextExporterFactory, ImageExpoterFactory, Exporter, MindMap } from '@wisemapping/mindplot';
|
import { Designer, TextExporterFactory, ImageExpoterFactory, Exporter, MindMap, RESTPersistenceManager } from '@wisemapping/mindplot';
|
||||||
|
|
||||||
type ExportFormat = 'svg' | 'jpg' | 'png' | 'txt' | 'mm' | 'wxml' | 'xls' | 'md';
|
type ExportFormat = 'svg' | 'jpg' | 'png' | 'txt' | 'mm' | 'wxml' | 'xls' | 'md';
|
||||||
type ExportGroup = 'image' | 'document' | 'mindmap-tool';
|
type ExportGroup = 'image' | 'document' | 'mindmap-tool';
|
||||||
@ -81,6 +81,17 @@ const ExportDialog = ({
|
|||||||
svgElement = workspace.getSVGElement();
|
svgElement = workspace.getSVGElement();
|
||||||
size = workspace.getSize();
|
size = workspace.getSize();
|
||||||
mindmpap = designer.getMindmap();
|
mindmpap = designer.getMindmap();
|
||||||
|
} else {
|
||||||
|
// Load mindmap ...
|
||||||
|
const persistence = new RESTPersistenceManager({
|
||||||
|
documentUrl: '/c/restful/maps/{id}/document',
|
||||||
|
revertUrl: '/c/restful/maps/{id}/history/latest',
|
||||||
|
lockUrl: '/c/restful/maps/{id}/lock',
|
||||||
|
timestamp: global.lockTimestamp,
|
||||||
|
session: global.lockSession,
|
||||||
|
});
|
||||||
|
mindmap = persistence.load(global.mapId)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
let exporter: Exporter;
|
let exporter: Exporter;
|
||||||
@ -105,8 +116,8 @@ const ExportDialog = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (submit) {
|
|
||||||
const { map } = fetchMapById(mapId);
|
const { map } = fetchMapById(mapId);
|
||||||
|
if (submit) {
|
||||||
exporter(exportFormat)
|
exporter(exportFormat)
|
||||||
.then((url: string) => {
|
.then((url: string) => {
|
||||||
// Create hidden anchor to force download ...
|
// Create hidden anchor to force download ...
|
||||||
|
Loading…
Reference in New Issue
Block a user