Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resizing the image and the highlighter #45

Open
wants to merge 68 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
8f3f398
Added test files w/ imports for each functional component and added j…
MZiegler96 Jul 24, 2024
f8c75cb
Added server side test files w/ imports. Finalized package json confi…
MZiegler96 Jul 24, 2024
5cd5d29
getting started with Konva react library
FMcapper Jul 24, 2024
4c1e3af
created a new db
Jul 24, 2024
b3b796b
Merge pull request #1 from heat-chicken/yiqun
yiqunzheng Jul 24, 2024
23c583a
Merge branch 'dev' of https://github.com/heat-chicken/fashion-selecto…
FMcapper Jul 24, 2024
6c9e012
Added jest-mock to dependencies. Renamed test files to 'test' instead…
MZiegler96 Jul 25, 2024
0c892cf
changed 'import's to 'require's. Added mockSupabaseClient.
MZiegler96 Jul 25, 2024
003abce
deleted useless files
Jul 25, 2024
2fc330f
get user details from Oauth login
ryangilbert Jul 25, 2024
6b2e49f
Merge pull request #2 from heat-chicken/yiqun
yiqunzheng Jul 25, 2024
1ac8559
Add .DS_Store to .gitignore
Jul 25, 2024
4074b0d
Merge branch 'dev' into yiqun
Jul 25, 2024
22c5302
barebones upload functionality
FMcapper Jul 26, 2024
8a7819d
deprecating export button
FMcapper Jul 26, 2024
3b5b8c4
ignoring ds store
FMcapper Jul 26, 2024
405ffa8
Merge branch 'dev' of https://github.com/heat-chicken/fashion-selecto…
FMcapper Jul 26, 2024
bec1386
added signup function to signup component
Jul 26, 2024
4fdae1a
Merge pull request #4 from heat-chicken/yiqun
yiqunzheng Jul 26, 2024
c01e917
added user controller to handle sign up
Jul 26, 2024
1ecf9f2
Oauth on login and signup & get user details
ryangilbert Jul 26, 2024
516da75
Merge pull request #5 from heat-chicken/yiqun
yiqunzheng Jul 26, 2024
1a22b83
resolve merge conflicts
ryangilbert Jul 26, 2024
b8f2de1
implemented login flow
Jul 27, 2024
26f27e2
Merge pull request #3 from heat-chicken/ryan/supabase-auth-start
ryangilbert Jul 27, 2024
9c6252c
resolve merge conflict of login component
Jul 27, 2024
69a6c25
Merge pull request #6 from heat-chicken/yiqun
yiqunzheng Jul 27, 2024
faf09c7
ttrying out cors stuff
FMcapper Jul 27, 2024
f928d91
Add redux toolkit
ryangilbert Jul 27, 2024
d14561f
Merge pull request #7 from heat-chicken/redux
ryangilbert Jul 27, 2024
f1224c6
deleted separate test files. Set up playwright for E2E tests.
MZiegler96 Jul 27, 2024
f462f56
Merge branch 'dev' of https://github.com/heat-chicken/fashion-selecto…
FMcapper Jul 27, 2024
38f7d93
Set up playwright to run app on webserver for tests.
MZiegler96 Jul 27, 2024
365e197
first complete draft of upload flow
FMcapper Jul 27, 2024
352fb12
save email to db
Jul 28, 2024
6c00d23
display a message to user to ask them to login when they try to save …
Jul 29, 2024
29ff528
updating file transfer
FMcapper Jul 30, 2024
fe0ab8c
Merge pull request #8 from heat-chicken/kidpix
FMcapper Jul 30, 2024
104c01f
playwright PR
MZiegler96 Jul 30, 2024
42d6bc0
adding ImageForm
FMcapper Jul 30, 2024
1ba596a
resolve merge conflict
Jul 30, 2024
b1e90cc
resolved merge conflicts
MZiegler96 Jul 30, 2024
548be3b
Merge pull request #9 from heat-chicken/yiqun-redux
yiqunzheng Jul 30, 2024
caa1066
Merge branch 'dev' of https://github.com/heat-chicken/fashion-selecto…
FMcapper Jul 30, 2024
6b46f00
added closet to nav bar
Jul 30, 2024
4bc035f
added some comments to login and signup
Jul 30, 2024
32b51a0
Write user to database on manual or Oauth signup
ryangilbert Jul 31, 2024
c45bcad
Merge pull request #11 from heat-chicken/yiqun-redux
yiqunzheng Jul 31, 2024
ad93b17
resolve merge conflicts
ryangilbert Jul 31, 2024
7d8b59e
Merge pull request #12 from heat-chicken/oauth-signup-db
ryangilbert Jul 31, 2024
89a87d0
functional bing search from upload
FMcapper Jul 31, 2024
e5de68e
replaced localstorage with cookies
Jul 31, 2024
9037c31
Render/Button Functionality tests complete.
MZiegler96 Jul 31, 2024
bafe3a7
committing for merge
MZiegler96 Jul 31, 2024
f7d14a2
resolved conflicts
MZiegler96 Jul 31, 2024
d2e2e7e
Merge pull request #14 from heat-chicken/yiqun-redux
yiqunzheng Jul 31, 2024
9daedf6
Merge pull request #13 from heat-chicken/kidpix
FMcapper Jul 31, 2024
81440fb
Merge pull request #10 from heat-chicken/testing
MZiegler96 Jul 31, 2024
34ce22f
make closet persistent by cookies
Aug 1, 2024
37ee203
Merge pull request #15 from heat-chicken/yiqun/user-persist
yiqunzheng Aug 1, 2024
d9cfbcf
checking in on the merge
FMcapper Aug 1, 2024
0595c7e
fixing typo
FMcapper Aug 1, 2024
31fa77d
Merge pull request #16 from heat-chicken/kidpix
FMcapper Aug 1, 2024
f734c29
search page user persist using cookie
Aug 1, 2024
2030a7b
Merge pull request #17 from heat-chicken/yiqun/user-persist
yiqunzheng Aug 2, 2024
8602375
stashing progress
FMcapper Aug 3, 2024
90a9bdf
Merge branch 'dev' of https://github.com/heat-chicken/fashion-selecto…
FMcapper Aug 3, 2024
1a1fc4e
Building resize functionality and cleaning up upload interface
FMcapper Aug 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Install dependencies
run: npm ci
- name: Install Playwright Browsers
run: npx playwright install --with-deps
- name: Run Playwright tests
run: npx playwright test
- uses: actions/upload-artifact@v4
if: always()
with:
name: playwright-report
path: playwright-report/
retention-days: 30
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.env
node_modules
.env
node_modules/
.DS_Store
9 changes: 9 additions & 0 deletions __mocks__/mockSupabaseClient.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const from = jest.fn(() => ({
insert: jest.fn(() => ({
select: jest.fn(),
})),
}));

const supabase = { from };

module.exports = supabase;
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
115 changes: 55 additions & 60 deletions client/src/components/App.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
// App.jsx
import React, {useEffect} from 'react';
import React, { useEffect } from 'react';
import { BrowserRouter as Router, Route, Routes } from 'react-router-dom';
import { Box, CssBaseline } from '@mui/material';
import { ThemeProvider, styled } from '@mui/material/styles';
import { gapi } from 'gapi-script';
import Nav from './Nav';
import Home from './Home';
import Search from './Search';
import ShowImages from './ShowImages';
import Login from './Login';
import SignUp from './SignUp';
import About from './About';
import Background from './Background';
import SecretCloset from './SecretCloset';
import MyCloset from './MyCloset'
import Upload from './Upload';

import customTheme from '../themes/customTheme';
import backgroundImage from '../assets/images/background1.jpg';
import { GoogleOAuthProvider } from '@react-oauth/google';
import { GoogleLogin } from '@react-oauth/google';
import { store } from '../store.js';
import { Provider } from 'react-redux';

const google_key = process.env.CLIENT_ID;

const scope = "";
const scope = '';
const BackgroundBox = styled(Box)(({ theme }) => ({
position: 'relative',
minHeight: '100vh',
Expand All @@ -42,7 +42,6 @@ const BackgroundBox = styled(Box)(({ theme }) => ({
},
}));


const ContentContainer = styled(Box)(({ theme }) => ({
position: 'relative',
zIndex: 1,
Expand All @@ -52,67 +51,63 @@ const ContentContainer = styled(Box)(({ theme }) => ({

console.log('App.jsx is running');

<App />

<App />;

function App() {

console.log(google_key)
// to remove, why google oauth is here?
console.log(google_key);
useEffect(() => {

function start(){
gapi.auth2.init({
client_id: '135318755257-cbm6k01p765cp64udecsj4vt7mghnc7s.apps.googleusercontent.com',
scope: '/login'
})

// gapi.client.init({
// client_id: clientID,
// scope: scope
// })
};

gapi.load('client:auth2', start)

})
const onSuccess = (res)=>{
console.log('successfully logged in')
navigate('/home');
//res.redirect('/home')
}

const onFailure = (res)=>{
console.log('fail', res)
}
function start() {
gapi.auth2.init({
client_id:
'135318755257-cbm6k01p765cp64udecsj4vt7mghnc7s.apps.googleusercontent.com',
scope: '/login',
});

// gapi.client.init({
// client_id: clientID,
// scope: scope
// })
}

gapi.load('client:auth2', start);
});
const onSuccess = (res) => {
console.log('successfully logged in');
navigate('/home');
//res.redirect('/home')
};

const onFailure = (res) => {
console.log('fail', res);
};

return (
<GoogleOAuthProvider clientId= {google_key} >

<ThemeProvider theme={customTheme}>
<CssBaseline />
<Router>
<Background />
<ContentContainer>
<Nav />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/search" element={<Search />} />
<Route path="/login" element={<Login />} />
<Route path="/signUp" element={<SignUp />} />
<Route path="/about" element={<About />} />
<Route path="/secretCloset" element={<SecretCloset />} />


</Routes>
</ContentContainer>
</Router>
</ThemeProvider>

</GoogleOAuthProvider>
<Provider store={store}>
<GoogleOAuthProvider clientId={google_key}>
<ThemeProvider theme={customTheme}>
<CssBaseline />
<Router>
<Background />
<ContentContainer>
<Nav />
<Routes>
<Route path="/" element={<Home />} />
<Route path="/search" element={<Search />} />
<Route path="/login" element={<Login />} />
<Route path="/signUp" element={<SignUp />} />
<Route path="/about" element={<About />} />
<Route path="/secretCloset" element={<SecretCloset />} />
<Route path="/upload" element={<Upload />} />
</Routes>
</ContentContainer>
</Router>
</ThemeProvider>
</GoogleOAuthProvider>
</Provider>
);
}


export default App;

// <Route path="/myCloset" element={<MyCloset />} />
// <Route path="/myCloset" element={<MyCloset />} />
45 changes: 45 additions & 0 deletions client/src/components/ImageForm.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// ImageForm.jsx

import React, { useState } from 'react';
import CircularProgress from '@mui/material/CircularProgress';
import TextField from '@mui/material/TextField';
import Button from '@mui/material/Button';
import { useDispatch, useSelector } from 'react-redux';
import { describe, } from '../slices/promptSlice'

function ImageForm({ onImageGenerated, handleSubmit, imageUpload, errors, setErrors }) {
const itemDescription = useSelector(store => store.prompt.itemDescription);
const [loading, setLoading] = useState(false);


const dispatch = useDispatch();



return (
<form onSubmit={handleSubmit}>
<TextField
id='item_description_text_box'
// defaultValue="hi"
label='Item description'
value={itemDescription}
onChange={(e) => dispatch(describe(e.target.value))}
error={errors.itemDescription}
multiline
helperText={errors.itemDescription ? 'Item description is required' : 'Describe the clothes in detail: color, style, features, etc.'}
rows = {5}
/>
<br />
<br />
<Button variant='contained' type='submit'>
Generate Image
</Button>
{imageUpload != undefined && <p>Uploaded image ready.</p>}
<br />
<br />
{loading && <CircularProgress />}
</form>
);
}

export default ImageForm;
Loading