Skip to content

Commit

Permalink
Metadata editing & zones handling (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkurki authored May 11, 2024
1 parent 0756f1d commit 6825d7d
Show file tree
Hide file tree
Showing 9 changed files with 654 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- master
- "build-docker"
- documentation
- metadata-editing
tags:
- '*'
- '!v*'
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@
"@signalk/signalk-to-nmea0183": "^1.0.0",
"@signalk/vesselpositions": "^1.0.0",
"@signalk/udp-nmea-plugin": "^2.0.0",
"@signalk/zones": "^1.0.0",
"signalk-to-nmea2000": "^2.16.0",
"signalk-n2kais-to-nmea0183": "^1.3.1",
"mdns": "^2.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/server-admin-ui/src/containers/Full/Full.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import Footer from '../../components/Footer/Footer'
import Dashboard from '../../views/Dashboard/Dashboard'
import Embedded from '../../views/Webapps/Embedded'
import Webapps from '../../views/Webapps/Webapps'
import DataBrowser from '../../views/DataBrowser'
import DataBrowser from '../../views/DataBrowser/DataBrowser'
import Playground from '../../views/Playground'
import Apps from '../../views/appstore/Apps/Apps'
import Configuration from '../../views/Configuration/Configuration'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from 'reactstrap'
import moment from 'moment'
import { CopyToClipboard } from 'react-copy-to-clipboard'
import Meta from './Meta'

const timestampFormat = 'MM/DD HH:mm:ss'

Expand Down Expand Up @@ -67,7 +68,7 @@ class DataBrowser extends Component {
this.handleMessage = this.handleMessage.bind(this)
this.handleContextChange = this.handleContextChange.bind(this)
this.handleSearch = this.handleSearch.bind(this)
this.handleMeta = this.handleMeta.bind(this)
this.toggleMeta = this.toggleMeta.bind(this)
}

handleMessage(msg) {
Expand Down Expand Up @@ -206,7 +207,7 @@ class DataBrowser extends Component {
localStorage.setItem(searchStorageKey, event.target.value)
}

handleMeta(event) {
toggleMeta(event) {
this.setState({ ...this.state, includeMeta: event.target.checked })
localStorage.setItem(metaStorageKey, event.target.checked)
}
Expand Down Expand Up @@ -264,7 +265,7 @@ class DataBrowser extends Component {
id="Meta"
name="meta"
className="switch-input"
onChange={this.handleMeta}
onChange={this.toggleMeta}
checked={this.state.includeMeta}
/>
<span
Expand Down Expand Up @@ -406,18 +407,12 @@ class DataBrowser extends Component {
.sort()
.map((key) => {
const meta = this.state.meta[this.state.context][key]
const formatted = JSON.stringify(meta, null, 2)
const path = key
return (
<tr key={path}>
<td>{path}</td>
<td>
<pre
className="text-primary"
style={{ whiteSpace: 'pre-wrap' }}
>
{formatted}
</pre>
<Meta meta={meta} path={path} />
</td>
</tr>
)
Expand Down
Loading

0 comments on commit 6825d7d

Please sign in to comment.