Skip to content

Commit e858b70

Browse files
authored
Merge pull request #17 from unity-sds/features/update-forms
Features/update forms
2 parents c3d3aa4 + 6e0f3b5 commit e858b70

File tree

15 files changed

+844
-242
lines changed

15 files changed

+844
-242
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.4.0] - 2023-12-13
9+
- Updated /job/new endpoint so it lists the applications for which jobs may be executed.
10+
- Moved chirp rebinning job form to /jobs/new/chirp
11+
- Added job submission forms for L1A and L1B PGEs
12+
- Added process utility to help facilitate changes listed above.
13+
814
## [0.3.1] - 2023-12-12
915
- Fixed link associated with logo on mobile platforms
1016

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "unity-ui",
33
"private": true,
4-
"version": "0.3.1",
4+
"version": "0.4.0",
55
"type": "module",
66
"scripts": {
77
"dev": "vite",

src/Root.tsx

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ import {
66
import Home from "./routes/home"
77
import JobMonitoring from "./routes/jobs/monitoring";
88
import NewJob from "./routes/jobs/new";
9+
910
import Navbar from "./components/Navbar"
1011
import WebView from "./components/WebView";
1112

1213
import Config from "./Config";
1314

15+
import { getProcesses, getProcessRoute } from "./utils/processes";
16+
import NotFound from "./routes/errors/not-found";
17+
1418
function Root() {
19+
20+
const processes = getProcesses();
21+
1522
return (
1623
<div className="viewWrapper">
1724
<Navbar />
@@ -21,7 +28,20 @@ function Root() {
2128
<Route path="/jobs/monitoring" element={<JobMonitoring />} />
2229
<Route path="/jobs/monitoring/:jobid_param" element={<JobMonitoring />} />
2330
<Route path="/jobs/new" element={<NewJob />} />
24-
<Route path="*" element={<Home />} />
31+
32+
{
33+
/* Add routes for job execution forms */
34+
processes.map( (item) => {
35+
const path = "/jobs/new/" + item['id'];
36+
const route:JSX.Element | null = getProcessRoute(item['id']);
37+
return (
38+
<Route path={path} element={ (route) ? route : <NotFound />} key={"route_" + item['id']}/>
39+
)
40+
})
41+
}
42+
43+
<Route path="/" element={<Home />} />
44+
<Route path="*" element={<NotFound />} />
2545
</Routes>
2646
</div>
2747
</div>

src/components/BackLink/index.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { Link } from "react-router-dom";
2+
import ChevronLeft from "@nasa-jpl/stellar/icons/chevron_left.svg";
3+
4+
type BackLinkProps = {
5+
label:string;
6+
path:string;
7+
};
8+
9+
export const BackLink = (props:BackLinkProps) => {
10+
11+
const {label, path} = props;
12+
13+
return(
14+
<>
15+
<Link to={path}><img src={ChevronLeft} alt={label} style={{ height: '12px', width: '12px' }}/>{label}</Link>
16+
</>
17+
)
18+
}

src/components/DocumentMeta/DocumentMeta.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export type DocumentMetaProps = {
77

88
export const DocumentMeta = (props:DocumentMetaProps) => {
99

10-
let {title, description} = props;
10+
const {title, description} = props;
1111

1212
return (
1313
<Helmet>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { DocumentMeta } from "../../../components/DocumentMeta/DocumentMeta"
2+
3+
function NotFound() {
4+
5+
return (
6+
<>
7+
<DocumentMeta
8+
title="Not Found"
9+
description="Not Found"
10+
/>
11+
<div className="main-view">
12+
<h1>Not Found</h1>
13+
The requested resource cannot be found
14+
</div>
15+
</>
16+
)
17+
}
18+
19+
export default NotFound

src/routes/jobs/monitoring/index.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,12 @@
88
.job-detail-item {
99
padding-bottom: 8px;
1010
word-wrap: break-word;
11+
}
12+
13+
.button-bar button {
14+
margin-right: 10px;
15+
}
16+
17+
.button-bar button:last-child {
18+
margin-right: 0px;
1119
}

src/routes/jobs/monitoring/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ function JobMonitoring() {
155155
<PanelGroup autoSaveId="job-monitoring-ui" direction="horizontal">
156156
<Panel order={1} className='main-view' style={{overflow: "auto"}}>
157157
<h1>Job Monitoring</h1>
158-
<Button onClick={() => navigate("/jobs/new")}>Run New Job or Batch</Button>
158+
<div className='button-bar'>
159+
<Button onClick={() => navigate("/jobs/new")}>Run New Job</Button>
160+
</div>
159161
<div className="ag-theme-stellar data-grid-container">
160162
<AgGridReact
161163
rowData={rowData} // Row Data for Rows

0 commit comments

Comments
 (0)