Skip to content

Commit

Permalink
[#501] Web: Allow the user to adjust the previous signatures.
Browse files Browse the repository at this point in the history
  • Loading branch information
a-stacey committed Sep 10, 2019
1 parent 7fe51a8 commit 8e54c86
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion projects/web/src/components/submitTrail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ export function SubmitTrail(props: QueryProps) {
props.routeProps.location.state.eventSubmissionTrailData == null ?
[] : props.routeProps.location.state.eventSubmissionTrailData;

const previousSignaturesInit = eventSubmissionTrailData == [] ||
eventSubmissionTrailData.previousSignatures == null ?
[] : eventSubmissionTrailData.previousSignatures;
const [previousSignaturesText, setPreviousSignaturesText] = React.useState(previousSignaturesInit.join(", "));
const previousSignatures = previousSignaturesText.split(",")
.map((value:string) => value.trim())
.filter((value:string) => value !== "");

const [previousTrailUserText, setPreviousTrailUserText] = React.useState("");
let previousTrail: SignedTrailEntry[] = [];
try {
Expand Down Expand Up @@ -67,7 +75,6 @@ export function SubmitTrail(props: QueryProps) {
/>
}

const previousSignatures = eventSubmissionTrailData.previousSignatures == null ? [] : eventSubmissionTrailData.previousSignatures;
const newUnsignedTrailEntry = {
"version": 1,
"timestamp": (new Date).toISOString(),
Expand Down Expand Up @@ -113,6 +120,14 @@ export function SubmitTrail(props: QueryProps) {
<h3>New Trail Entry</h3>
<div className="row">
<div className="column border-right">
<label>Previous Trail Entry Signatures
<p>(to add to the trail entry for the last event created)</p>
<input type="text"
placeholder="Previous Trail Entry Signatures"
value={previousSignaturesText}
onChange={(e) => setPreviousSignaturesText(e.target.value)}
/>
</label>
<label>3RD Party Previous Trail
<textarea style={({ height: "1em" })}
value={previousTrailUserText}
Expand Down

0 comments on commit 8e54c86

Please sign in to comment.