Skip to content

Commit

Permalink
part 2 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
bagnishant committed Oct 31, 2023
1 parent 13d1957 commit b79e987
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 6 deletions.
3 changes: 3 additions & 0 deletions frontend/src/common/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import React from "react";
import { COLORS, URLs } from "../../constants";
import { LinkedIn, YouTube, Instagram, GitHub } from "@mui/icons-material";
import { ThemeProvider, createTheme } from "@mui/material/styles";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faReact } from "@fortawesome/free-brands-svg-icons";

const theme = createTheme({
components: {
Expand Down Expand Up @@ -57,6 +59,7 @@ const Footer = () => {
>
<GitHub />
</a>
<FontAwesomeIcon icon={faReact} size="3x"/>
</div>
</ThemeProvider>
<div
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/common/components/NavBarMain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ const NavbarMain = () => {
<Grid item>
{isSignedIn(user) ? (
<Link href="/train" passHref className="nav-link">
Train
Hello World
</Link>
) : null}
</Grid>
Expand All @@ -123,8 +123,8 @@ const NavbarMain = () => {
</Link>
</Grid>
<Grid item>
<Link href={URLs.donate} passHref className="nav-link">
Donate
<Link href="https://youtu.be/WxlSZJ2EXzo?si=S9P1Kl2YS4EMU_ck&t=1217" passHref className="nav-link">
Custom Link
</Link>
</Grid>
{isSignedIn(user) ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ const TrainspaceStepInner = ({
train(trainspace)
.unwrap()
.then(({ trainspaceId }) => {
console.log(trainspaceId);
router.push({ pathname: `/train/${trainspaceId}` }).then(() => {
dispatch(removeTrainspaceData());
});
Expand Down Expand Up @@ -145,7 +146,6 @@ const TrainspaceStepInner = ({
if (step === TRAINSPACE_SETTINGS.steps.length - 1) {
setIsButtonClicked(true);
}

handleSubmit(submitTrainspace)();
}}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ interface OnChangeArgs {
interface LayerNodeData {
label:
| (typeof STEP_SETTINGS.PARAMETERS.layers)[ALL_LAYERS]["label"]
| "Start";
| "Beginning";
value: ALL_LAYERS | "root";
parameters?: number[];
onChange: (args: OnChangeArgs) => void;
Expand All @@ -282,7 +282,7 @@ const ROOT_NODE: Node<LayerNodeData> = {
position: { x: DEFAULT_X_POSITION, y: 0 },
deletable: false,
data: {
label: "Start",
label: "Beginning",
value: "root",
parameters: [],
onChange: () => undefined,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ const TabularParametersStep = ({
trainspace?.parameterData?.targetCol ?? (null as unknown as undefined),
features: trainspace?.parameterData?.features ?? [],
problemType: trainspace?.parameterData?.problemType ?? "CLASSIFICATION",
randomButton: trainspace?.parameterData?.randomButton ?? "OPTION_1",
criterion: trainspace?.parameterData?.criterion ?? "CELOSS",
optimizerName: trainspace?.parameterData?.optimizerName ?? "SGD",
shuffle: trainspace?.parameterData?.shuffle ?? true,
Expand Down Expand Up @@ -189,6 +190,26 @@ const TabularParametersStep = ({
)}
/>
</FormControl>
<FormControl>
<FormLabel>Random MUI Radio Buttons (does nothing)</FormLabel>
<Controller
name="randomButton"
control={control}
rules={{ required: true }}
render={({ field: { onChange, value } }) => (
<RadioGroup row value={value} onChange={onChange}>
{STEP_SETTINGS["PARAMETERS"].randomButtons.map((randomButton) => (
<FormControlLabel
key={randomButton.value}
value={randomButton.value}
control={<Radio />}
label={randomButton.label}
/>
))}
</RadioGroup>
)}
/>
</FormControl>
<Controller
name="criterion"
control={control}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const TrainspaceStepInner = ({
train(trainspace)
.unwrap()
.then(({ trainspaceId }) => {
console.log(trainspaceId);
router.push({ pathname: `/train/${trainspaceId}` }).then(() => {
dispatch(removeTrainspaceData());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ export const STEP_SETTINGS = {
{ label: "Classification", value: "CLASSIFICATION" },
{ label: "Regression", value: "REGRESSION" },
],
randomButtons: [
{ label: "Option 1", value: "OPTION_1" },
{ label: "Option 2", value: "OPTION_2" },
],
criterions: [
{
label: "L1 (Absolute Error) Loss",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export interface ParameterData {
targetCol: string;
features: string[];
problemType: (typeof STEP_SETTINGS)["PARAMETERS"]["problemTypes"][number]["value"];
randomButton: (typeof STEP_SETTINGS)["PARAMETERS"]["randomButtons"][number]["value"];
criterion: (typeof STEP_SETTINGS)["PARAMETERS"]["criterions"][number]["value"];
optimizerName: (typeof STEP_SETTINGS)["PARAMETERS"]["optimizers"][number]["value"];
shuffle: boolean;
Expand Down
1 change: 1 addition & 0 deletions frontend/src/pages/login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ const Login = () => {
}

if (user !== undefined) {
console.log(email);
return <></>;
}

Expand Down

0 comments on commit b79e987

Please sign in to comment.