From 539712e981a7166961ddf869b7c04922e5596644 Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Thu, 28 Jan 2021 10:14:48 -0500 Subject: [PATCH] feat(Stealth): Adds a checkbox in the stealth core to control whether stealth changes the alert condition. --- server/typeDefs/stealthField.ts | 2 ++ src/components/views/StealthField/core.js | 28 ++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/server/typeDefs/stealthField.ts b/server/typeDefs/stealthField.ts index 4cf02d8ba..f8fee3b3c 100644 --- a/server/typeDefs/stealthField.ts +++ b/server/typeDefs/stealthField.ts @@ -198,6 +198,8 @@ const resolver = { "stealthFieldUpdate", App.systems.filter(s => s.type === "StealthField"), ); + console.log("changed alert", id, change); + pubsub.publish("simulatorsUpdate", App.simulators); }, stealthSensorsSonar(rootValue, {id, sonar}) { App.systems.find(s => s.id === id)?.setSensorsSonar(sonar); diff --git a/src/components/views/StealthField/core.js b/src/components/views/StealthField/core.js index a2318820f..dca6f631f 100644 --- a/src/components/views/StealthField/core.js +++ b/src/components/views/StealthField/core.js @@ -1,7 +1,7 @@ import React, {Component} from "react"; import gql from "graphql-tag.macro"; import {Container, Row, Col, Button} from "helpers/reactstrap"; -import {Query, withApollo} from "react-apollo"; +import {Mutation, Query, withApollo} from "react-apollo"; import {OutputField} from "../../generic/core"; import SubscriptionHelper from "helpers/subscriptionHelper"; @@ -15,6 +15,7 @@ export const STEALTH_CORE_SUB = gql` state charge activated + changeAlert quadrants { fore aft @@ -114,6 +115,31 @@ class StealthFieldCore extends Component { +