Skip to content

Commit

Permalink
Merge branch 'nextjs' into backend-central-build-check
Browse files Browse the repository at this point in the history
  • Loading branch information
dwu359 authored Sep 24, 2023
2 parents 9cc4d92 + f3c7cd5 commit 9fb4d90
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 100 deletions.
2 changes: 0 additions & 2 deletions .github/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,7 @@
| | | | |- 📜 pytorch-logo.png
| | | |- 📜 demo_video.gif : GIF tutorial of a simple classification training session
| | |- 📜 dlp-logo.ico : DLP Logo
| | |- 📜 dlp-logo.svg : DLP Logo, duplicate of files in public, but essential as the frontend can't read public
| | |- 📜 index.html : Base HTML file that will be initially rendered
| | |- 📜 dlp-logo.png : DLP Logo, duplicate of files in public, but essential as the frontend can't read public
| | |- 📜 manifest.json : Default React file for choosing icon based on
| | |- 📜 robots.txt
| |- 📂 layer_docs:
Expand Down
1 change: 1 addition & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Title of Pull Request HERE

Github Issue Number Here: <YOUR_GITHUB_ISSUE_NUMBER_HERE (include the hashtag)>
**What user problem are we solving?**

**What solution does this PR provide?**
Expand Down
50 changes: 26 additions & 24 deletions backend/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified frontend/public/dlp-logo.ico
Binary file not shown.
Binary file removed frontend/public/dlp-logo.png
Binary file not shown.
1 change: 0 additions & 1 deletion frontend/public/dlp-logo.svg

This file was deleted.

Binary file modified frontend/public/images/logos/dlp_branding/dlp-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 16 additions & 1 deletion frontend/public/images/logos/dlp_branding/dlp-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 15 additions & 26 deletions frontend/src/common/components/NavBarMain.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,23 @@
import AppBar from "@mui/material/AppBar";
import { useAppDispatch, useAppSelector } from "@/common/redux/hooks";
import { isSignedIn, signOutUser } from "@/common/redux/userLogin";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import { FormControlLabel, Icon, Switch } from "@mui/material";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import MenuList from "@mui/material/Menu";
import Container from "@mui/material/Container";
import AppBar from "@mui/material/AppBar";
import Button from "@mui/material/Button";
import MenuItem from "@mui/material/MenuItem";
import Container from "@mui/material/Container";
import Grid from "@mui/material/Grid";
import ArrowDropDownIcon from "@mui/icons-material/ArrowDropDown";
import MenuList from "@mui/material/Menu";
import MenuItem from "@mui/material/MenuItem";
import Stack from "@mui/material/Stack";
import Toolbar from "@mui/material/Toolbar";
import Typography from "@mui/material/Typography";
import storage from "local-storage-fallback";
import Image from "next/image";
import Link from "next/link";
import React, { useEffect, useState } from "react";
import { ThemeProvider } from "styled-components";
import { URLs } from "../../constants";
import DSGTLogo from "/public/images/logos/dlp_branding/dlp-logo.png";
import { useAppDispatch, useAppSelector } from "@/common/redux/hooks";
import {
UserType,
isSignedIn,
setCurrentUser,
signOutUser,
} from "@/common/redux/userLogin";
import Image from "next/image";
import Link from "next/link";

const NavbarMain = () => {
const user = useAppSelector((state) => state.currentUser.user);
Expand Down Expand Up @@ -79,24 +74,19 @@ const NavbarMain = () => {
<Image
src={DSGTLogo}
alt="DSGT Logo"
width={40}
height={40}
width={100}
height={100}
/>
</Icon>
<Typography
noWrap
className="d-flex align-items-center logo-title"
sx={{

mr: 2,
display: { xs: "none", md: "flex" },
textDecoration: "none",

mr: 2,
display: { xs: "none", md: "flex" },
fontWeight: "500",
textDecoration: "none",
fontSize: "17px"
fontWeight: "500",
fontSize: "17px",
}}
>
Deep Learning Playground
Expand Down Expand Up @@ -174,7 +164,6 @@ const NavbarMain = () => {
</MenuItem>
<MenuItem divider>
<Link href="/learn" id="basic-nav-dropdown">

Learn
</Link>
</MenuItem>
Expand Down
32 changes: 13 additions & 19 deletions frontend/src/features/Train/redux/trainspaceApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,34 @@ const trainspaceApi = backendApi
}),
uploadDatasetFile: builder.mutation<
null,
{ dataSource: DATA_SOURCE; file: File }
{ dataSource: DATA_SOURCE; file: File; url: string }
>({
queryFn: async ({ dataSource, file }, _, __, baseQuery) => {
const postObjResponse = await baseQuery({
url: "/api/s3/getUserDatasetFileUploadPresignedPostObj",
method: "POST",
body: {
name: file.name,
data_source: dataSource.toLowerCase(),
},
const getObjResponse = await baseQuery({
url: `/api/lambda/datasets/user/${dataSource}/${file.name}/presigned_upload_url`,
method: "GET",
});
if (postObjResponse.error) {
return { error: postObjResponse.error };
if (getObjResponse.error) {
return { error: getObjResponse.error };
}
const postObj = postObjResponse.data as {
presigned_post_obj: { url: string; fields: Record<string, string> };
const getObj = getObjResponse.data as {
data: string;
message: string;
};
const getObjUrl = getObj.data;
const formData = new FormData();
for (const [key, value] of Object.entries(
postObj.presigned_post_obj.fields
)) {
formData.append(key, value);
}
formData.append("file", file);
const uploadQuery = fetchBaseQuery();
const response = await uploadQuery(
{
url: postObj.presigned_post_obj.url,
method: "POST",
url: getObjUrl,
method: "PUT",
body: formData,
},
_,
__
);

if (response.error) {
return { error: response.error };
}
Expand Down
6 changes: 3 additions & 3 deletions serverless/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3696,9 +3696,9 @@ graphql-yoga@^3.9.0:
tslib "^2.3.1"

graphql@*:
version "16.8.0"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.0.tgz#374478b7f27b2dc6153c8f42c1b80157f79d79d4"
integrity sha512-0oKGaR+y3qcS5mCu1vb7KG+a89vjn06C7Ihq/dDl3jA+A8B3TKomvi3CiEcVLJQGalbu8F52LxkOym7U5sSfbg==
version "16.8.1"
resolved "https://registry.yarnpkg.com/graphql/-/graphql-16.8.1.tgz#1930a965bef1170603702acdb68aedd3f3cf6f07"
integrity sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==

has-flag@^3.0.0:
version "3.0.0"
Expand Down
Loading

0 comments on commit 9fb4d90

Please sign in to comment.