Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Metadata editing & zones handling #1730

Merged
merged 21 commits into from
May 11, 2024
Merged

Metadata editing & zones handling #1730

merged 21 commits into from
May 11, 2024

Conversation

tkurki
Copy link
Member

@tkurki tkurki commented Apr 28, 2024

Add support for editing metadata and zones handling = raising notifications based on deltas in the server. Previous work with meta deltas with PUT support makes this pretty straightforward.

image

The goal of this PR is to add the functionality, not be pretty - let's get the initial end2end functionality out there.

Todo:

  • state handling & save
  • add /delete field
  • separate "edit mode"
  • units as select, not a text field
  • alertmethods as checkboxes
  • notifications triggering based on zones
  • default alertMethods? if none provided in metadata

@tkurki
Copy link
Member Author

tkurki commented Apr 28, 2024

image

@tkurki
Copy link
Member Author

tkurki commented Apr 28, 2024

For the zones to work we need to either move the zones threshold-state handling logic to server proper or make the plugin use zones data from the server. If the zones editing is going to be in the server admin ui I don't see much point in keeping the plugin around, so integrating the logic in the server seems the best option.

@tkurki tkurki added the feature label Apr 28, 2024
@tkurki
Copy link
Member Author

tkurki commented May 1, 2024

I enabled building docker container for this branch, so you can check it out with docker pull signalk/signalk-server:metadata-editing && docker run --init --rm -it -p 3000:3000 -v /tmp/:/home/node/.signalk --entrypoint /usr/lib/node_modules/signalk-server/bin/signalk-server signalk/signalk-server:metadata-editing --sample-nmea0183-data

@tkurki tkurki marked this pull request as ready for review May 9, 2024 18:38
@tkurki tkurki changed the title [WIP] Metadata editing Metadata editing May 9, 2024
@tkurki tkurki changed the title Metadata editing Metadata editing & zones handling May 9, 2024
@tkurki tkurki requested a review from panaaj May 9, 2024 18:40
@panaaj
Copy link
Member

panaaj commented May 10, 2024

I get the "Something went wrong." message in the data browser screen when selecting "zones" from the dropdown. It throws the following error with the console.

 TypeError: e.map is not a function
    at Pe (Meta.js:456:16)
    at Gi (react-dom.production.min.js:153:146)
    at Ua (react-dom.production.min.js:175:309)
    at To (react-dom.production.min.js:263:406)
    at Eu (react-dom.production.min.js:246:265)
    at xu (react-dom.production.min.js:246:194)
    at mu (react-dom.production.min.js:239:172)
    at react-dom.production.min.js:123:115
    at t.unstable_runWithPriority (scheduler.production.min.js:19:467)
    at Kl (react-dom.production.min.js:122:325)

Given there is a separate "zones" section it should probably be filtered out from the dropdown list.

@tkurki
Copy link
Member Author

tkurki commented May 10, 2024

Nice! Fixed in 038a5da

Don't want to silently disable it, because then users with
active configuration would lose their notifications.
@tkurki tkurki merged commit 6825d7d into master May 11, 2024
5 checks passed
@tkurki tkurki deleted the metadata-editing branch May 11, 2024 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants