Compare commits
No commits in common. "893876ddaa24cc8c1a3bc1a6ac55651566afc4fd" and "37dfdfe46ccfd9f8d21bc4bff53c45e5713e9875" have entirely different histories.
893876ddaa
...
37dfdfe46c
2 changed files with 8 additions and 210 deletions
24
src/App.tsx
24
src/App.tsx
|
@ -40,22 +40,6 @@ export class App extends React.Component<IAppProps> {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
const queryString = window.location.search;
|
|
||||||
const urlParams = new URLSearchParams(queryString);
|
|
||||||
const state = urlParams.get('state');
|
|
||||||
|
|
||||||
if (state === null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
fetch(state)
|
|
||||||
.then((response) => response.json())
|
|
||||||
.then((data: IEditorState) => {
|
|
||||||
this.LoadState(data);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public NewEditor() {
|
public NewEditor() {
|
||||||
// Fetch the configuration from the API
|
// Fetch the configuration from the API
|
||||||
fetchConfiguration().then((configuration: Configuration) => {
|
fetchConfiguration().then((configuration: Configuration) => {
|
||||||
|
@ -102,12 +86,6 @@ export class App extends React.Component<IAppProps> {
|
||||||
const result = reader.result as string;
|
const result = reader.result as string;
|
||||||
const editorState: IEditorState = JSON.parse(result);
|
const editorState: IEditorState = JSON.parse(result);
|
||||||
|
|
||||||
this.LoadState(editorState);
|
|
||||||
});
|
|
||||||
reader.readAsText(file);
|
|
||||||
}
|
|
||||||
|
|
||||||
private LoadState(editorState: IEditorState) {
|
|
||||||
Revive(editorState);
|
Revive(editorState);
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
|
@ -116,6 +94,8 @@ export class App extends React.Component<IAppProps> {
|
||||||
historyCurrentStep: editorState.historyCurrentStep,
|
historyCurrentStep: editorState.historyCurrentStep,
|
||||||
isLoaded: true
|
isLoaded: true
|
||||||
} as IAppState);
|
} as IAppState);
|
||||||
|
});
|
||||||
|
reader.readAsText(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
public render() {
|
public render() {
|
||||||
|
|
|
@ -1,182 +0,0 @@
|
||||||
{
|
|
||||||
"isSidebarOpen": true,
|
|
||||||
"isElementsSidebarOpen": false,
|
|
||||||
"isHistoryOpen": false,
|
|
||||||
"configuration": {
|
|
||||||
"AvailableContainers": [
|
|
||||||
{
|
|
||||||
"Type": "Chassis",
|
|
||||||
"Width": 500,
|
|
||||||
"Style": {
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "red"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Type": "Trou",
|
|
||||||
"Width": 300,
|
|
||||||
"Style": {
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "green"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Type": "Montant",
|
|
||||||
"Width": 100,
|
|
||||||
"Style": {
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "blue",
|
|
||||||
"transform": "translateX(-50%)",
|
|
||||||
"transformOrigin": "center",
|
|
||||||
"transformBox": "fill-box"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"AvailableSymbols": [
|
|
||||||
{
|
|
||||||
"Height": 0,
|
|
||||||
"Image": {
|
|
||||||
"Base64Image": null,
|
|
||||||
"Name": null,
|
|
||||||
"Svg": null,
|
|
||||||
"Url": "https://www.manutan.fr/img/S/GRP/ST/AIG3930272.jpg"
|
|
||||||
},
|
|
||||||
"Name": "Poteau structure",
|
|
||||||
"Width": 0,
|
|
||||||
"XPositionReference": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"Height": 0,
|
|
||||||
"Image": {
|
|
||||||
"Base64Image": null,
|
|
||||||
"Name": null,
|
|
||||||
"Svg": null,
|
|
||||||
"Url": "https://e7.pngegg.com/pngimages/647/127/png-clipart-svg-working-group-information-world-wide-web-internet-structure.png"
|
|
||||||
},
|
|
||||||
"Name": "Joint de structure",
|
|
||||||
"Width": 0,
|
|
||||||
"XPositionReference": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"MainContainer": {
|
|
||||||
"Height": 200,
|
|
||||||
"Width": 1000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"history": [
|
|
||||||
{
|
|
||||||
"MainContainer": {
|
|
||||||
"children": [],
|
|
||||||
"properties": {
|
|
||||||
"id": "main",
|
|
||||||
"parentId": "null",
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"width": 1000,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"stroke": "black"
|
|
||||||
},
|
|
||||||
"userData": {}
|
|
||||||
},
|
|
||||||
"TypeCounters": {}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"MainContainer": {
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"children": [],
|
|
||||||
"properties": {
|
|
||||||
"id": "Chassis-0",
|
|
||||||
"parentId": "main",
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"width": 500,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "red"
|
|
||||||
},
|
|
||||||
"userData": {
|
|
||||||
"type": "Chassis"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": "main",
|
|
||||||
"parentId": "null",
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"width": 1000,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"stroke": "black"
|
|
||||||
},
|
|
||||||
"userData": {}
|
|
||||||
},
|
|
||||||
"TypeCounters": {
|
|
||||||
"Chassis": 0
|
|
||||||
},
|
|
||||||
"SelectedContainerId": "main"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"MainContainer": {
|
|
||||||
"children": [
|
|
||||||
{
|
|
||||||
"children": [],
|
|
||||||
"properties": {
|
|
||||||
"id": "Chassis-0",
|
|
||||||
"parentId": "main",
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"width": 500,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "red"
|
|
||||||
},
|
|
||||||
"userData": {
|
|
||||||
"type": "Chassis"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"children": [],
|
|
||||||
"properties": {
|
|
||||||
"id": "Chassis-1",
|
|
||||||
"parentId": "main",
|
|
||||||
"x": 500,
|
|
||||||
"y": 0,
|
|
||||||
"width": 500,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"borderWidth": 2,
|
|
||||||
"stroke": "red"
|
|
||||||
},
|
|
||||||
"userData": {
|
|
||||||
"type": "Chassis"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"properties": {
|
|
||||||
"id": "main",
|
|
||||||
"parentId": "null",
|
|
||||||
"x": 0,
|
|
||||||
"y": 0,
|
|
||||||
"width": 1000,
|
|
||||||
"height": 200,
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"stroke": "black"
|
|
||||||
},
|
|
||||||
"userData": {}
|
|
||||||
},
|
|
||||||
"TypeCounters": {
|
|
||||||
"Chassis": 1
|
|
||||||
},
|
|
||||||
"SelectedContainerId": "main"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"historyCurrentStep": 2
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue