mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-05 22:38:48 +00:00
fix: able to edit app post version released (#2915)
* fix: able to edit app post version released * feat: make datasources & queries realtime
This commit is contained in:
parent
86b763d835
commit
9dbe6368e6
1 changed files with 34 additions and 8 deletions
|
|
@ -221,6 +221,11 @@ class Editor extends React.Component {
|
|||
initEventListeners() {
|
||||
document.addEventListener('mousemove', this.onMouseMove);
|
||||
document.addEventListener('mouseup', this.onMouseUp);
|
||||
this.socket?.addEventListener('message', (event) => {
|
||||
if (event.data === 'versionReleased') this.fetchApp();
|
||||
else if (event.data === 'dataQueriesChanged') this.fetchDataQueries();
|
||||
else if (event.data === 'dataSourcesChanged') this.fetchDataSources();
|
||||
});
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
|
|
@ -388,12 +393,23 @@ class Editor extends React.Component {
|
|||
};
|
||||
|
||||
dataSourcesChanged = () => {
|
||||
this.fetchDataSources();
|
||||
this.socket.send(
|
||||
JSON.stringify({
|
||||
event: 'events',
|
||||
data: { message: 'dataSourcesChanged', appId: this.state.appId },
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
dataQueriesChanged = () => {
|
||||
this.fetchDataQueries();
|
||||
this.setState({ addingQuery: false });
|
||||
this.setState({ addingQuery: false }, () => {
|
||||
this.socket.send(
|
||||
JSON.stringify({
|
||||
event: 'events',
|
||||
data: { message: 'dataQueriesChanged', appId: this.state.appId },
|
||||
})
|
||||
);
|
||||
});
|
||||
};
|
||||
|
||||
switchSidebarTab = (tabIndex) => {
|
||||
|
|
@ -792,12 +808,22 @@ class Editor extends React.Component {
|
|||
};
|
||||
|
||||
onVersionRelease = (versionId) => {
|
||||
this.setState({
|
||||
app: {
|
||||
...this.state.app,
|
||||
current_version_id: versionId,
|
||||
this.setState(
|
||||
{
|
||||
app: {
|
||||
...this.state.app,
|
||||
current_version_id: versionId,
|
||||
},
|
||||
},
|
||||
});
|
||||
() => {
|
||||
this.socket.send(
|
||||
JSON.stringify({
|
||||
event: 'events',
|
||||
data: { message: 'versionReleased', appId: this.state.appId },
|
||||
})
|
||||
);
|
||||
}
|
||||
);
|
||||
};
|
||||
|
||||
onZoomChanged = (zoom) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue