-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Triggers): Adds Remote Access Code triggers. Closes #3241
- Loading branch information
1 parent
40a15dd
commit a6c1def
Showing
5 changed files
with
105 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import App from "../app"; | ||
|
||
export function remoteAccessSendCode({simulatorId, code}) { | ||
console.log(simulatorId, code); | ||
return {simulatorId, code}; | ||
} | ||
|
||
export function remoteAccessUpdateCode({ | ||
simulatorId, | ||
codeId, | ||
state, | ||
}: { | ||
simulatorId: string; | ||
codeId: string; | ||
state: "Denied" | "Accepted"; | ||
}) { | ||
const simulator = App.simulators.find(s => s.id === simulatorId); | ||
const code = simulator.ship.remoteAccessCodes.find(c => c.id === codeId); | ||
console.log(simulatorId, state, code.code); | ||
return { | ||
simulatorId, | ||
state: state === "Accepted" ? "true" : "false", | ||
code: code.code, | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 77 additions & 0 deletions
77
src/containers/FlightDirector/Triggers/components/triggers/remoteAccess.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
import React from "react"; | ||
|
||
export const remoteAccessSendCode = { | ||
name: "remoteAccessSendCode", | ||
objectKey: "remoteAccessSendCode", | ||
category: "Triggers", | ||
component: () => ( | ||
<div> | ||
Event: Remote Access Code Sent | ||
<div> | ||
<small>"Code" is the code that was sent.</small> | ||
</div> | ||
</div> | ||
), | ||
outputs: [ | ||
{ | ||
id: "triggerOut", | ||
color: "orange", | ||
title: "Triggers the action", | ||
type: "Trigger", | ||
}, | ||
{ | ||
id: "code", | ||
color: "yellow", | ||
title: "Code", | ||
type: "String", | ||
}, | ||
], | ||
inputs: [], | ||
config: [], | ||
}; | ||
export const remoteAccessUpdateCode = { | ||
name: "remoteAccessUpdateCode", | ||
objectKey: "remoteAccessUpdateCode", | ||
category: "Triggers", | ||
component: () => ( | ||
<div> | ||
Event: Remote Access Code Accepted/Denied | ||
<div> | ||
<small>"Code" is the code that was sent.</small> | ||
</div> | ||
<div> | ||
<small> | ||
Possible "State" options:{" "} | ||
<div> | ||
<code>true</code>: Code was accepted | ||
</div> | ||
<div> | ||
<code>false</code>: Code was rejected | ||
</div> | ||
</small> | ||
</div> | ||
</div> | ||
), | ||
outputs: [ | ||
{ | ||
id: "triggerOut", | ||
color: "orange", | ||
title: "Triggers the action", | ||
type: "Trigger", | ||
}, | ||
{ | ||
id: "code", | ||
color: "yellow", | ||
title: "Code", | ||
type: "String", | ||
}, | ||
{ | ||
id: "state", | ||
color: "green", | ||
title: "State", | ||
type: "String", | ||
}, | ||
], | ||
inputs: [], | ||
config: [], | ||
}; |