Skip to content

Commit f808ec8

Browse files
author
The Technocrat
authored
Revert "678 lab 641 add run job view" (#681)
1 parent a155dbd commit f808ec8

11 files changed

Lines changed: 40 additions & 198 deletions

File tree

frontend/app/components/HomeMenu/HomeMenu.tsx

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,23 @@ export const HomeMenu = () => {
3838
</ListItemButton>
3939
</ListItem>
4040
<ListItem disablePadding>
41-
<ListItemButton onClick={() => handleNavigation('/graph/add')}>
42-
<ListItemText primary="Add a Graph" />
41+
<ListItemButton onClick={() => handleNavigation('/job/init')}>
42+
<ListItemText primary="Initialize a Job" />
4343
</ListItemButton>
4444
</ListItem>
4545
<ListItem disablePadding>
46-
<ListItemButton onClick={() => handleNavigation('/graph/list')}>
47-
<ListItemText primary="View Graphs" />
46+
<ListItemButton onClick={() => handleNavigation('/job/view')}>
47+
<ListItemText primary="Submit a Job" />
48+
</ListItemButton>
49+
</ListItem>
50+
<ListItem disablePadding>
51+
<ListItemButton onClick={() => handleNavigation('/iograph/draw')}>
52+
<ListItemText primary="Draw an IO Graph" />
53+
</ListItemButton>
54+
</ListItem>
55+
<ListItem disablePadding>
56+
<ListItemButton onClick={() => handleNavigation('/iograph/list')}>
57+
<ListItemText primary="View IO Graphs" />
4858
</ListItemButton>
4959
</ListItem>
5060
<ListItem disablePadding>

frontend/app/graph/add/page.tsx

Lines changed: 0 additions & 100 deletions
This file was deleted.

frontend/app/iograph/draw/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from 'react'
2+
3+
4+
export default function ListDataFiles() {
5+
return <div>ToDo: Add Wireframe for this view</div>
6+
}

frontend/lib/redux/slices/graphAddSlice/gaphAddSlice.ts

Lines changed: 0 additions & 58 deletions
This file was deleted.

gateway/handlers/graphs.go

Whitespace-only changes.

gateway/handlers/tools.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ func AddToolHandler(db *gorm.DB) http.HandlerFunc {
7878
CID: cid,
7979
WalletAddress: walletAddress,
8080
Name: tool.Name,
81-
ToolJson: toolJSON,
8281
}
8382

8483
result := db.Create(&toolEntry)
Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1-
-- This just resets the DB to a clean state
2-
-- Clear your schema_migrations (truncate schema_migrations;) table if you want to run this again
3-
-- This should be removed before we do stable stage/production deploys
1+
-- Add the 'name' column without NOT NULL constraint
2+
ALTER TABLE tools ADD COLUMN name VARCHAR(255);
43

5-
DROP TABLE IF EXISTS tools;
6-
DROP TABLE IF EXISTS users;
7-
DROP TABLE IF EXISTS jobs;
8-
DROP TABLE IF EXISTS jobs_id_seq;
9-
DROP TABLE IF EXISTS tool_entities;
10-
DROP TABLE IF EXISTS users_id_seq;
11-
DROP TABLE IF EXISTS data_files;
4+
-- Extract and set the 'name' value from 'ToolJSON' for all rows
5+
UPDATE tools
6+
SET name = sub.name
7+
FROM (
8+
SELECT t.cid, j.value as name
9+
FROM tools t, LATERAL json_each_text(t.tool_json::json) as j(key, value)
10+
WHERE j.key = 'name'
11+
) sub
12+
WHERE tools.cid = sub.cid;
13+
14+
-- Set the NOT NULL constraint on 'name'
15+
ALTER TABLE tools ALTER COLUMN name SET NOT NULL;
16+
17+
-- Drop the 'ToolJSON' column
18+
ALTER TABLE tools DROP COLUMN tool_json;

gateway/models/tool.go

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
package models
22

3-
import (
4-
"gorm.io/datatypes"
5-
)
6-
73
type Tool struct {
8-
CID string `gorm:"primaryKey;column:cid;type:varchar(255);not null"` // column name specified to avoid GORM default snake case
9-
Name string `gorm:"type:text;not null;unique"`
10-
WalletAddress string `gorm:"type:varchar(42);not null"`
11-
ToolJson datatypes.JSON `gorm:"type:json"`
4+
CID string `gorm:"primaryKey;column:cid;type:varchar(255);not null"` // column name specified to avoid GORM default snake case
5+
Name string `gorm:"type:text;not null;unique"`
6+
WalletAddress string `gorm:"type:varchar(42);not null"`
127
}

go.mod

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ require (
1212
github.com/ipfs/go-ipfs-api v0.3.0
1313
github.com/rs/cors v1.8.2
1414
github.com/spf13/cobra v1.7.0
15-
gorm.io/datatypes v1.2.0
1615
gorm.io/driver/postgres v1.5.2
1716
gorm.io/gorm v1.25.4
1817
)
@@ -80,7 +79,6 @@ require (
8079
github.com/go-openapi/spec v0.20.7 // indirect
8180
github.com/go-openapi/swag v0.22.3 // indirect
8281
github.com/go-pkgz/expirable-cache v1.0.0 // indirect
83-
github.com/go-sql-driver/mysql v1.7.0 // indirect
8482
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
8583
github.com/godbus/dbus/v5 v5.1.0 // indirect
8684
github.com/gogo/protobuf v1.3.2 // indirect
@@ -323,7 +321,6 @@ require (
323321
gopkg.in/warnings.v0 v0.1.2 // indirect
324322
gopkg.in/yaml.v2 v2.4.0 // indirect
325323
gopkg.in/yaml.v3 v3.0.1 // indirect
326-
gorm.io/driver/mysql v1.4.7 // indirect
327324
k8s.io/apimachinery v0.27.2 // indirect
328325
k8s.io/klog/v2 v2.90.1 // indirect
329326
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect

0 commit comments

Comments
 (0)