mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 06:48:21 +00:00
Merge branch 'main' into develop
This commit is contained in:
commit
e4f7da59c1
4 changed files with 18 additions and 17 deletions
2
.version
2
.version
|
|
@ -1 +1 @@
|
|||
0.11.0
|
||||
0.11.1
|
||||
|
|
@ -2,6 +2,7 @@ import React, { createRef } from 'react';
|
|||
import { datasourceService, dataqueryService, appService, authenticationService } from '@/_services';
|
||||
import { DndProvider } from 'react-dnd';
|
||||
import { HTML5Backend } from 'react-dnd-html5-backend';
|
||||
import { defaults } from 'lodash';
|
||||
import { Container } from './Container';
|
||||
import { CustomDragLayer } from './CustomDragLayer';
|
||||
import { LeftSidebar } from './LeftSidebar';
|
||||
|
|
@ -52,6 +53,15 @@ class Editor extends React.Component {
|
|||
};
|
||||
}
|
||||
|
||||
this.defaultDefinition = {
|
||||
components: {},
|
||||
globalSettings: {
|
||||
hideHeader: false,
|
||||
canvasMaxWidth: 1292,
|
||||
canvasBackgroundColor: props.darkMode ? '#2f3c4c' : '#edeff5',
|
||||
},
|
||||
};
|
||||
|
||||
this.state = {
|
||||
currentUser: authenticationService.currentUserValue,
|
||||
app: {},
|
||||
|
|
@ -69,14 +79,7 @@ class Editor extends React.Component {
|
|||
zoomLevel: 1.0,
|
||||
currentLayout: 'desktop',
|
||||
deviceWindowWidth: 450,
|
||||
appDefinition: {
|
||||
components: {},
|
||||
globalSettings: {
|
||||
hideHeader: false,
|
||||
canvasMaxWidth: 1292,
|
||||
canvasBackgroundColor: props.darkMode ? '#2f3c4c' : '#edeff5',
|
||||
},
|
||||
},
|
||||
appDefinition: this.defaultDefinition,
|
||||
currentState: {
|
||||
queries: {},
|
||||
components: {},
|
||||
|
|
@ -245,13 +248,13 @@ class Editor extends React.Component {
|
|||
const appId = this.props.match.params.id;
|
||||
|
||||
appService.getApp(appId).then((data) => {
|
||||
const dataDefinition = data.definition || {};
|
||||
const dataDefinition = defaults(data.definition, this.defaultDefinition);
|
||||
this.setState(
|
||||
{
|
||||
app: data,
|
||||
isLoading: false,
|
||||
editingVersion: data.editing_version,
|
||||
appDefinition: { ...this.state.appDefinition, ...dataDefinition },
|
||||
appDefinition: dataDefinition,
|
||||
slug: data.slug,
|
||||
},
|
||||
() => {
|
||||
|
|
@ -265,7 +268,7 @@ class Editor extends React.Component {
|
|||
};
|
||||
|
||||
setAppDefinitionFromVersion = (version) => {
|
||||
this.appDefinitionChanged(version.definition || {});
|
||||
this.appDefinitionChanged(defaults(version.definition, this.defaultDefinition));
|
||||
this.setState({
|
||||
editingVersion: version,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@ export const LeftSidebar = ({
|
|||
globalSettingsChanged,
|
||||
globalSettings,
|
||||
}) => {
|
||||
console.log('11', globalSettings);
|
||||
const router = useRouter();
|
||||
const [showLeaveDialog, setShowLeaveDialog] = useState(false);
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -74,7 +74,6 @@ class SaveAndPreview extends React.Component {
|
|||
|
||||
editVersion = (version) => () => {
|
||||
this.props.setAppDefinitionFromVersion(version);
|
||||
this.props.fetchApp();
|
||||
};
|
||||
|
||||
saveVersion = (versionId) => {
|
||||
|
|
@ -190,7 +189,7 @@ class SaveAndPreview extends React.Component {
|
|||
</div>
|
||||
<div className="col-auto">
|
||||
<button
|
||||
className="btn btn-sm text-muted font-500 color-primary"
|
||||
className="btn btn-sm color-primary font-500 color-primary"
|
||||
onClick={() => this.saveVersion(version.id)}
|
||||
disabled={
|
||||
savingVersionId === version.id ||
|
||||
|
|
@ -200,14 +199,14 @@ class SaveAndPreview extends React.Component {
|
|||
{savingVersionId === version.id ? 'saving...' : 'save'}
|
||||
</button>
|
||||
<button
|
||||
className="btn btn btn-sm mx-2 text-muted"
|
||||
className="btn btn btn-sm mx-2 color-primary"
|
||||
onClick={this.editVersion(version)}
|
||||
disabled={this.props.editingVersionId === version.id}
|
||||
>
|
||||
edit
|
||||
</button>
|
||||
<a
|
||||
className="btn btn btn-sm mx text-muted"
|
||||
className="btn btn btn-sm mx color-primary"
|
||||
href={`/applications/${appId}/versions/${version.id}`}
|
||||
target="_blank"
|
||||
rel="noreferrer"
|
||||
|
|
|
|||
Loading…
Reference in a new issue