Skip to content

Commit

Permalink
Fix for new project deserialization and panel editing (#42)
Browse files Browse the repository at this point in the history
* More fixes

* Fixes to update panel

* Force running to be false on load

* Update readme

* Update install instructions
  • Loading branch information
eatonphil committed Sep 9, 2021
1 parent 32b84a1 commit 47864a1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ scripting, and visualization in a single platform.

![A screenshot of app.datastation.multiprocess.io](./screenshot.png)

## Major Features
## Features

* Cross-platform: Windows, macOS, and Linux
* Query SQLite, PostgreSQL- and MySQL-compatible databases
* Query SQLite, SQL Server PostgreSQL- and MySQL-compatible databases
* With builtin support for proxying over SSH
* Query HTTP servers
* With builtin support for proxying over SSH
Expand All @@ -21,10 +21,7 @@ scripting, and visualization in a single platform.

## Install

Zip files for the latest release provided on the
[releases](https://github.com/multiprocessio/datastation/releases)
page. x86-64 builds for Mac and Windows are available. In the future
this will expand to ARM and Linux.
Install instructions are available [on the website here](https://datastation.multiprocess.io/docs/installation.html).

## Documentation

Expand Down
9 changes: 6 additions & 3 deletions shared/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ export class PanelResultMeta extends PanelResult {
}

static fromJSON(raw: any): PanelResultMeta {
raw = raw || {};
raw.loading = false;
const prm = mergeDeep(new PanelResultMeta(), raw);
if (!raw) {
return prm;
}
prm.lastRun =
typeof raw.lastRun === 'string'
? new Date(raw.lastRun)
Expand Down Expand Up @@ -105,6 +104,7 @@ export class ConnectorInfo {
}

static fromJSON(raw: any): ConnectorInfo {
raw = raw || {};
const ci = mergeDeep(new ConnectorInfo(), raw);

switch (raw.type) {
Expand Down Expand Up @@ -224,6 +224,7 @@ export class PanelInfo {
}

static fromJSON(raw: any): PanelInfo {
raw = raw || {};
let pit: PanelInfo = mergeDeep(new PanelInfo(raw.type || 'literal'), raw);

switch (pit.type) {
Expand Down Expand Up @@ -401,6 +402,7 @@ export class ProjectPage {
}

static fromJSON(raw: any): ProjectPage {
raw = raw || {};
const pp = new ProjectPage();
pp.panels = (raw.panels || []).map(PanelInfo.fromJSON);
pp.name = raw.name;
Expand Down Expand Up @@ -436,6 +438,7 @@ export class ProjectState {
}

static fromJSON(raw: any): ProjectState {
raw = raw || {};
const ps = new ProjectState();
ps.projectName = raw.projectName || '';
ps.pages = (raw.pages || []).map(ProjectPage.fromJSON);
Expand Down
6 changes: 3 additions & 3 deletions ui/Panels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ export function Panels({
updatePage(page);
}

function updatePanel(page: ProjectPage, panelId: string, panelIndex: number) {
function updatePanel(page: ProjectPage, panelId: string) {
return (panel: PanelInfo) => {
const panelIndex = page.panels.findIndex((p) => p.id === panelId);
page.panels[panelIndex] = panel;
updatePage(page);
reevalPanel(panelId, true);
Expand Down Expand Up @@ -66,9 +67,8 @@ export function Panels({
{page.panels.map((panel, panelIndex) => (
<React.Fragment key={panel.id}>
<Panel
key={panel.id}
panel={panel}
updatePanel={updatePanel(page, panel.id, panelIndex)}
updatePanel={updatePanel(page, panel.id)}
panelResults={panelResults}
reevalPanel={reevalPanel}
panelIndex={panelIndex}
Expand Down

0 comments on commit 47864a1

Please sign in to comment.