Skip to content

Commit

Permalink
Create a barebones more user friendly form
Browse files Browse the repository at this point in the history
  • Loading branch information
soggy-mushroom committed Dec 4, 2024
1 parent 4223c42 commit c423782
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import { Client, Connection } from '@temporalio/client';
import { randomBytes } from 'node:crypto';
import { manuscriptDataSchema } from './form-validation';
import { config } from './config';
import { generateForm } from './form';
import { generateForm, generateScriptForm } from './form';

const app: Express = express();

app.use(express.json());
app.use(BodyParser.urlencoded());

app.get('/', (_, res) => {
res.sendFile(join(__dirname, 'tmp.html'));
res.send(generateScriptForm());
});

app.get('/input', (_, res) => {
Expand Down
33 changes: 33 additions & 0 deletions src/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,36 @@ export const generateForm = () => (`
</body>
</html>
`);

export const generateScriptForm = () => (

Check failure on line 37 in src/form.ts

View workflow job for this annotation

GitHub Actions / test

Multiple spaces found before '=>'
`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Import Manuscript</title>
</head>
<body>
<form action="/script" method="post">
<h2>Manuscript Data</h2>
<label for="msid">MSID:</label>
<input id="msid" name="msid" required/>
<label for="date">Date:</label>
<input id="date" name="date" required/>
<label for="evaluation-summary-id">Evaluation Summary ID:</label>
<input id="evaluation-summary-id" name="evaluation-summary-id" required/>
<label for="peer-review-id">Peer Review ID:</label>
<input id="peer-review-id" name="peer-review-id" required/>
<label for="author-response-id">Author Response ID:</label>
<input id="author-response-id" name="author-response-id" required/>
<br/>
<button type="submit">Submit</button>
</form>
</body>
</html>`
)

Check failure on line 68 in src/form.ts

View workflow job for this annotation

GitHub Actions / test

Newline required at end of file but not found

Check failure on line 68 in src/form.ts

View workflow job for this annotation

GitHub Actions / test

Missing semicolon
5 changes: 0 additions & 5 deletions src/tmp.html

This file was deleted.

0 comments on commit c423782

Please sign in to comment.