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

Dev->Main #321 #322 #324 #326 #332 #335 #328 #299 #331 #342 #341 #346 #340 #348 #349 #340 #354 #356 #358 #360 #362 #364 #366 #368 #370 #351

Merged
merged 139 commits into from
Dec 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
139 commits
Select commit Hold shift + click to select a range
85f8478
Add custom theme components to App.js #299
dbaslan Dec 20, 2023
8385d23
Add theme toggle button to header.js #299
dbaslan Dec 20, 2023
6835132
Add background darkening div to App.js #299
dbaslan Dec 20, 2023
fa9f4cc
Add header darkening #299
dbaslan Dec 20, 2023
c730bb4
Add inline dark mode colors to each page #299
dbaslan Dec 20, 2023
3318afc
Remove unnecessary comment from App.js
dbaslan Dec 21, 2023
d69592a
Remove another unnecessary comment from App.js
dbaslan Dec 21, 2023
23c20be
Remove yet another unnecessary comment from App.js
dbaslan Dec 21, 2023
006c835
Remove unused theme parameters #299
dbaslan Dec 21, 2023
17b560c
Merge branch 'dev' into feature/299-implement-dark-mode
dbaslan Dec 21, 2023
22b33fc
Removed extra ">" from navbar #299
dbaslan Dec 21, 2023
a6b551a
Merge branch 'dev' into feature/299-implement-dark-mode
dbaslan Dec 22, 2023
0bb41ec
Lower logo in header.js #321
dbaslan Dec 22, 2023
f00bbf1
Shrink create new memory button #322
dbaslan Dec 22, 2023
ea588e1
Fix navbar button padding and position
dbaslan Dec 22, 2023
22f30e2
Merge pull request #323 from SWE574-Fall2023-Group1/imp/321-322-minor…
dbaslan Dec 22, 2023
dc704a8
Remove buttons when disabled #299
dbaslan Dec 22, 2023
a302b06
Change dark mode button text color #299
dbaslan Dec 22, 2023
8141e3a
Add full white background to comment entry box #299
dbaslan Dec 22, 2023
70d7825
Adjust tag container #299
dbaslan Dec 22, 2023
eb0836d
Add line break below tag boxes #299
dbaslan Dec 22, 2023
eaa7e01
Fix page buttons in profile and search results #299
dbaslan Dec 22, 2023
d878865
Merge branch 'dev' into feature/299-implement-dark-mode
dbaslan Dec 22, 2023
a45c7fd
Update recommendation function #324
ckertam Dec 22, 2023
2599022
Merge pull request #325 from SWE574-Fall2023-Group1/bug/324-recommend…
ckertam Dec 22, 2023
1aff0de
Merge branch 'dev' into feature/299-implement-dark-mode
sadikkuzu Dec 22, 2023
4ec74c6
Fix edit biography bug #326
oguzsenna Dec 22, 2023
8369512
Fix location alias for dark mode #299
dbaslan Dec 23, 2023
ea3b1cc
Add spacing between map edit buttons #299
dbaslan Dec 23, 2023
5a8457f
Fix include time box for dark mode #299
dbaslan Dec 23, 2023
b5cdb04
Add margin spacing to tag chips #299
dbaslan Dec 23, 2023
29d14e8
Merge pull request #327 from SWE574-Fall2023-Group1/bug/326-edit-biog…
oguzsenna Dec 23, 2023
e9a5861
Merge branch 'dev' into feature/299-implement-dark-mode
dbaslan Dec 23, 2023
60b7bbe
Fix edit story time include field & localization issue #328
ckertam Dec 23, 2023
a22a9b9
Fix create memory time localization issue #328
ckertam Dec 23, 2023
fefa118
Add new packages for localization #328
ckertam Dec 23, 2023
e77abc7
Merge branch 'dev' into bug/328-time-edit-runtime-error
sadikkuzu Dec 23, 2023
2fca933
Add Register Unit Test #332
aykutkantas Dec 23, 2023
01e835a
Change Login.test.js #332
aykutkantas Dec 23, 2023
ccc0613
Merge pull request #333 from SWE574-Fall2023-Group1/feature/332-unit-…
aykutkantas Dec 23, 2023
24b99f8
Merge branch 'dev' into bug/328-time-edit-runtime-error
sadikkuzu Dec 23, 2023
656d769
Add unit test coverage arguments into frontend-test Makefile target #335
sadikkuzu Dec 23, 2023
be55ace
Add unit test coverage arguments into ci-frontend pipeline #335
sadikkuzu Dec 23, 2023
1c2be38
Merge pull request #337 from SWE574-Fall2023-Group1/feature/335-front…
sadikkuzu Dec 23, 2023
15f19dd
Add AllStories component test #334
aykutkantas Dec 23, 2023
1bf2417
Merge branch 'dev' into feature/299-implement-dark-mode
sadikkuzu Dec 24, 2023
f6acebe
Fix duplicate lines in requirements.in #331
sadikkuzu Dec 24, 2023
6780718
Update @ayhncvdr2 's link in README.md #331
sadikkuzu Dec 24, 2023
f3c46c1
Quiet pull in docker compose command #331
sadikkuzu Dec 24, 2023
c34573d
Quiet upgrade in backend dockerfile #331
sadikkuzu Dec 24, 2023
00f32be
Merge branch 'dev' into bug/328-time-edit-runtime-error
sadikkuzu Dec 24, 2023
85a8a23
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 24, 2023
24b8673
Add StoriesbyFollowingUsers test #334
aykutkantas Dec 24, 2023
0af85af
Merge branch 'feature/334-unit-test-for-home-page' of https://github.…
aykutkantas Dec 24, 2023
f86a099
Merge pull request #330 from SWE574-Fall2023-Group1/bug/328-time-edit…
ckertam Dec 24, 2023
1227be1
Merge branch 'dev' into feature/331-minor-refinements
sadikkuzu Dec 24, 2023
cfeec4e
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 24, 2023
167365e
Add new model unit tests #341
ckertam Dec 24, 2023
89e74b4
Update url names for api view tests #342
ckertam Dec 24, 2023
9939f90
Remove old test cases #342
ckertam Dec 24, 2023
aa7cc73
Add first tests for api views #342
ckertam Dec 24, 2023
c00ebeb
Add get story test #342
ckertam Dec 25, 2023
050ae3a
Add new api tests #342
ckertam Dec 25, 2023
775e51a
Change search radius default value #342
ckertam Dec 25, 2023
9d6ebe2
Merge branch 'dev' into feature/299-implement-dark-mode
dbaslan Dec 25, 2023
0256a41
Merge pull request #314 from SWE574-Fall2023-Group1/feature/299-imple…
dbaslan Dec 25, 2023
b9523ed
Merge branch 'dev' into feature/334-unit-test-for-home-page
dbaslan Dec 25, 2023
a7af87c
Update model tests & remove old test file #341
ckertam Dec 25, 2023
5976bbe
Remove old tests & adjustments #342
ckertam Dec 25, 2023
4d30fdb
Merge branch 'dev' into imp/341-django-model-tests
ckertam Dec 25, 2023
e6f3e62
Merge branch 'dev' into imp/342-django-view-tests
ckertam Dec 25, 2023
5b96f10
Merge branch 'dev' into feature/331-minor-refinements
sadikkuzu Dec 25, 2023
0ee11ca
Merge pull request #338 from SWE574-Fall2023-Group1/feature/331-minor…
sadikkuzu Dec 25, 2023
916d463
Merge branch 'dev' into feature/334-unit-test-for-home-page
sadikkuzu Dec 25, 2023
1037d88
Merge branch 'dev' into imp/341-django-model-tests
sadikkuzu Dec 25, 2023
03aee39
Merge branch 'dev' into imp/342-django-view-tests
sadikkuzu Dec 25, 2023
dbd0664
Merge pull request #344 from SWE574-Fall2023-Group1/imp/342-django-vi…
ckertam Dec 26, 2023
0c5cabe
Merge branch 'dev' into imp/341-django-model-tests
ckertam Dec 26, 2023
3f27f81
Merge pull request #343 from SWE574-Fall2023-Group1/imp/341-django-mo…
ckertam Dec 26, 2023
fb6caa7
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 27, 2023
ed52141
Add profile page unit test #340
aykutkantas Dec 27, 2023
62d7379
Merge branch 'dev' into 340-unit-test-for-profile-pages
aykutkantas Dec 27, 2023
55d5a32
Change pagination test #334
aykutkantas Dec 27, 2023
5d742cd
Add unit test for logout #346
aykutkantas Dec 27, 2023
c875eda
Add unit test for resetpassword #348
aykutkantas Dec 27, 2023
7ec4b75
Merge pull request #347 from SWE574-Fall2023-Group1/346-unit-test-for…
aykutkantas Dec 27, 2023
852d1df
Merge branch 'dev' into 348-unit-test-for-reset-password
aykutkantas Dec 27, 2023
9b8749d
Merge branch 'dev' into 340-unit-test-for-profile-pages
aykutkantas Dec 27, 2023
5372cb5
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 27, 2023
ed035f8
Merge pull request #345 from SWE574-Fall2023-Group1/340-unit-test-for…
aykutkantas Dec 27, 2023
a83beb2
Merge branch 'dev' into 348-unit-test-for-reset-password
aykutkantas Dec 27, 2023
04a94a3
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 27, 2023
08be68c
Merge pull request #350 from SWE574-Fall2023-Group1/348-unit-test-for…
aykutkantas Dec 27, 2023
8ce64c7
Merge branch 'dev' into feature/334-unit-test-for-home-page
aykutkantas Dec 27, 2023
b8e5aa6
Add unit test for userprofileothers #340
aykutkantas Dec 27, 2023
75bef80
Merge branch '340-unit-test-for-profile-pages' of https://github.com/…
aykutkantas Dec 27, 2023
8d7e42c
Merge pull request #339 from SWE574-Fall2023-Group1/feature/334-unit-…
aykutkantas Dec 27, 2023
8a162c8
Merge branch 'dev' into 340-unit-test-for-profile-pages
aykutkantas Dec 27, 2023
eed60ab
Add Loading for Recommendations #349
sadikkuzu Dec 27, 2023
f6fc470
Merge pull request #353 from SWE574-Fall2023-Group1/feature/349-loadi…
sadikkuzu Dec 27, 2023
d236ed5
Merge branch 'dev' into 340-unit-test-for-profile-pages
aykutkantas Dec 27, 2023
a72ac73
Add unit test for recommendations page #354
sadikkuzu Dec 27, 2023
e1ec884
Change font-size in quill editor #356
sadikkuzu Dec 27, 2023
81db041
Unset width for comment content #356
sadikkuzu Dec 27, 2023
e03c696
Merge pull request #352 from SWE574-Fall2023-Group1/340-unit-test-for…
aykutkantas Dec 28, 2023
697aa0c
Merge branch 'dev' into feature/354-unit-test-for-recommendations-page
sadikkuzu Dec 28, 2023
c75d6d9
Merge branch 'dev' into feature/356-frontend-minor-refinements
sadikkuzu Dec 28, 2023
941c135
Merge pull request #355 from SWE574-Fall2023-Group1/feature/354-unit-…
sadikkuzu Dec 28, 2023
df9eb88
Merge branch 'dev' into feature/356-frontend-minor-refinements
sadikkuzu Dec 28, 2023
a74d6b8
Merge pull request #357 from SWE574-Fall2023-Group1/feature/356-front…
sadikkuzu Dec 28, 2023
1be7fa4
Add unit test for comment section #358
aykutkantas Dec 28, 2023
28ec7b9
Add unit test for story details #360
aykutkantas Dec 28, 2023
790c560
Add unit test for tag search #362
aykutkantas Dec 28, 2023
9b953dd
Add unit test for search results #364
aykutkantas Dec 28, 2023
94d9c69
Add unit test for search user results #366
aykutkantas Dec 28, 2023
66edc6f
Add unit test for search story details box #368
aykutkantas Dec 28, 2023
b3d88ae
Merge pull request #359 from SWE574-Fall2023-Group1/358-unit-test-for…
aykutkantas Dec 28, 2023
e3a00f7
Merge branch 'dev' into 360-unit-test-for-story-details
aykutkantas Dec 28, 2023
6102bad
Merge branch 'dev' into feature/364-unit-test-for-search-results
aykutkantas Dec 28, 2023
5b0dc4c
Merge branch 'dev' into feature/368-unit-test-for-search-story-detail…
aykutkantas Dec 28, 2023
249cfc2
Merge branch 'dev' into feature/366-unit-test-for-search-user-results
aykutkantas Dec 28, 2023
c43acc7
Merge pull request #361 from SWE574-Fall2023-Group1/360-unit-test-for…
aykutkantas Dec 28, 2023
22c73f1
Merge branch 'dev' into feature/362-unit-test-for-tag-search
aykutkantas Dec 28, 2023
2285c59
Merge branch 'dev' into feature/364-unit-test-for-search-results
aykutkantas Dec 28, 2023
b507fd1
Change unit test for tag search #368
aykutkantas Dec 28, 2023
3558a5b
Merge branch 'feature/362-unit-test-for-tag-search' of https://github…
aykutkantas Dec 28, 2023
bc20b5a
Merge pull request #365 from SWE574-Fall2023-Group1/feature/364-unit-…
aykutkantas Dec 28, 2023
3228196
Merge branch 'dev' into feature/362-unit-test-for-tag-search
aykutkantas Dec 28, 2023
bf4e3ef
Update file size exceeds error message #370
sadikkuzu Dec 28, 2023
e5bbeb0
Merge pull request #371 from SWE574-Fall2023-Group1/feature/370-profi…
sadikkuzu Dec 28, 2023
f07cc3d
Merge branch 'dev' into feature/368-unit-test-for-search-story-detail…
sadikkuzu Dec 28, 2023
5b26953
Remove blank spaces #362
aykutkantas Dec 28, 2023
3ac4012
Merge branch 'feature/362-unit-test-for-tag-search' of https://github…
aykutkantas Dec 28, 2023
8d8e832
Merge branch 'dev' into feature/362-unit-test-for-tag-search
aykutkantas Dec 28, 2023
94e1aec
Merge pull request #369 from SWE574-Fall2023-Group1/feature/368-unit-…
aykutkantas Dec 28, 2023
75a0ba2
Merge branch 'dev' into feature/362-unit-test-for-tag-search
aykutkantas Dec 28, 2023
9916ec1
Merge pull request #363 from SWE574-Fall2023-Group1/feature/362-unit-…
aykutkantas Dec 28, 2023
f2084bd
Merge branch 'dev' into feature/366-unit-test-for-search-user-results
aykutkantas Dec 28, 2023
202a9ab
Merge pull request #367 from SWE574-Fall2023-Group1/feature/366-unit-…
aykutkantas Dec 28, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ci-backend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
docker --version
docker-compose --version
make env-files
docker compose up -d --build
docker compose up -d --build --quiet-pull --remove-orphans
docker compose ps
docker network ls
docker compose logs db
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ jobs:
docker --version
docker-compose --version
make env-files
docker compose up -d --build
docker compose up -d --build --quiet-pull --remove-orphans
docker compose ps
docker network ls
docker compose logs frontend
make git-stats
docker compose exec -e CI=true -T frontend npm run test
docker compose exec -e CI=true -T frontend npm run test -- --coverage --watchAll=false
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ backend-test:
docker compose exec -T backend python manage.py test

frontend-test:
docker compose exec -e CI=true -T frontend npm run test
docker compose exec -e CI=true -T frontend npm run test -- --coverage --watchAll=false

local-frontend: down
docker compose up db backend -d --build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ This repository contains Group 1's project for SWE574 - Software Development As
For further information and documentation, check our [wiki](https://github.com/SWE574-Fall2023-Group1/SWE574-Fall2023-G1/wiki).

### Group 1 is comprised of:
- [Ayhan Çavdar](https://github.com/ayhncvdr)
- [Ayhan Çavdar](https://github.com/ayhncvdr2)
- [Aykut Kantaş](https://github.com/aykutkantas)
- [Deniz Baran Aslan](https://github.com/dbaslan)
- [Kemal Caner Ertam](https://github.com/ckertam)
Expand Down
9 changes: 5 additions & 4 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,17 @@ WORKDIR /backend
COPY requirements.txt .

RUN : \
&& apt-get update -y \
&& apt-get update -qqqy \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get install -y --no-install-recommends \
&& apt-get install -qqqy --no-install-recommends \
binutils libproj-dev gdal-bin \
gcc g++ \
> /dev/null \
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& python -m pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt \
&& python -m pip install --no-cache-dir -qU pip \
&& pip install --no-cache-dir -qr requirements.txt \
&& python -m nltk.downloader punkt averaged_perceptron_tagger wordnet stopwords \
&& :
# Install system dependencies for NLTK and GDAL in the end
Expand Down
16 changes: 16 additions & 0 deletions backend/frontend/package-lock.json

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

5 changes: 3 additions & 2 deletions backend/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"axios": "^1.3.5",
"date-fns": "^2.30.0",
"dayjs": "^1.11.7",
"google-map-react": "^2.2.0",
"history": "^5.3.0",
Expand Down Expand Up @@ -70,9 +71,9 @@
}
},
"devDependencies": {
"babel-jest": "^27.4.5",
"@babel/core": "^7.17.0",
"@babel/preset-env": "^7.17.0"
"@babel/preset-env": "^7.17.0",
"babel-jest": "^27.4.5"
},
"presets": [
"@babel/preset-env",
Expand Down
16 changes: 13 additions & 3 deletions backend/frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import Header from './components/header/header';
import { createTheme, ThemeProvider } from '@mui/material/styles';

Expand All @@ -13,11 +13,21 @@ const theme = createTheme({
},
});

const customTheme = createTheme();

function App() {
const [currentTheme, setCurrentTheme] = useState('default'); // add a state variable for the current theme

const toggleTheme = () => {
setCurrentTheme(currentTheme === 'default' ? 'custom' : 'default');
};

return (
<ThemeProvider theme={theme}>
<Header/>
<ThemeProvider theme={currentTheme === 'default' ? theme : customTheme}>
{currentTheme === 'custom' && <div style={{position: 'fixed', top: 0, left: 0, width: '100%', height: '100%', backgroundColor: 'rgba(0, 0, 0, 0.8)', zIndex: 1}}></div>}
<div style={{ position: 'relative', zIndex: 2 }}> {/* this will ensure the content stays in front of the div */}
<Header toggleTheme={toggleTheme} currentTheme={currentTheme}/>
</div>
</ThemeProvider>
);
}
Expand Down
4 changes: 3 additions & 1 deletion backend/frontend/src/components/header/header.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
display: flex;
justify-content: space-between;
align-items: center;
background-color: #8E8A8A;;
/* background-color: #3a3a3a;; */
padding: 10px;
max-width: 100%;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
Expand All @@ -45,6 +45,8 @@
transition: all 0.3s ease;
display: flex;
align-items: center;
padding-right: 10px;
padding-left: 10px;

/* Use Josefin Sans */
font-family: 'Josefin Sans', sans-serif;
Expand Down
36 changes: 20 additions & 16 deletions backend/frontend/src/components/header/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ import LocationSearch from "../../pages/search/Timeline";
import SearchResults from "../../pages/search/SearchResults";
import ActivityStream from "../../pages/activity/ActivityStream";
import Recommendations from "../../pages/recom/Recommendations";
import Button from '@mui/material/Button'

function Header() {
function Header({ toggleTheme, currentTheme }) {
console.log("Rendering Header");

const [isLoggedIn, setIsLoggedIn] = useState(false);
Expand Down Expand Up @@ -59,7 +60,7 @@ function Header() {
return (
<Router>
<div className="container">
<nav className="navbar">
<nav className="navbar" style={{ justifyContent: isLoggedIn ? "space-between" : "start", backgroundColor: currentTheme === 'custom' ? '#3a3a3a' : '#8E8A8A' }}>
{!isLoggedIn && (
<>
<Link to="/" className="nav-item nav-link">
Expand All @@ -71,6 +72,7 @@ function Header() {
<Link to="/login" className="nav-item nav-link">
Login
</Link>
<Button style={{ marginRight: "25px", backgroundColor: currentTheme === 'custom' ? 'orange' : 'purple', color:'#ffffff' }} onClick={toggleTheme}> {currentTheme === 'custom' ? 'Light Mode' : 'Dark Mode'} </Button>
</>
)}
{isLoggedIn && (
Expand All @@ -97,6 +99,7 @@ function Header() {
<Link to="/recommendation" className="nav-item nav-link">
Recommendations
</Link>
<Button style={{ marginRight: "25px", backgroundColor: currentTheme === 'custom' ? 'orange' : 'purple', color:'#ffffff' }} onClick={toggleTheme}> {currentTheme === 'custom' ? 'Light Mode' : 'Dark Mode'} </Button>
<UserSearch />
<LogoutButton />
</>
Expand All @@ -113,11 +116,12 @@ function Header() {
<Route
path="/"
element={

<div className="home-container">
<img
src={mainPhoto}
alt="Memories"
style={{ width: "1000px", height: "auto", maxWidth : "100%" }}
style={{ margin: "10%", width: "1000px", height: "auto", maxWidth : "100%" }}
/>
</div>
}
Expand All @@ -140,31 +144,31 @@ function Header() {

{isLoggedIn && (
<>
<Route path="*" element={<Navigate to="/homepage" />} />
<Route path="/homepage" element={<StoryContainer />} />
<Route path="/create-story" element={<CreateStory />} />
<Route path="/story/:id" element={<StoryDetails />} />
<Route path="/user-profile" element={<UserProfile />} />
<Route path="*" element={<Navigate to="/homepage" currentTheme={currentTheme}/>} />
<Route path="/homepage" element={<StoryContainer currentTheme={currentTheme}/>} />
<Route path="/create-story" element={<CreateStory currentTheme={currentTheme}/>} />
<Route path="/story/:id" element={<StoryDetails currentTheme={currentTheme}/>} />
<Route path="/user-profile" element={<UserProfile currentTheme={currentTheme}/>} />
<Route
path="/user-profile/:id"
element={<UserProfileOthers />}
element={<UserProfileOthers currentTheme={currentTheme}/>}
/>
<Route
path="/SearchUserResults/:searchQuery"
element={<SearchUserResults />}
element={<SearchUserResults currentTheme={currentTheme}/>}
/>
<Route path="/story_search" element={<StorySearch />} />
<Route path="/story_search" element={<StorySearch currentTheme={currentTheme}/>} />
<Route
path="/timeline"
element={<LocationSearch />}
element={<LocationSearch currentTheme={currentTheme}/>}
/>
<Route
path="/search-results"
element={<SearchResults />}
element={<SearchResults currentTheme={currentTheme}/>}
/>
<Route path="/edit-story/:storyId" element={<EditStory />} />
<Route path="/activity-stream" element={<ActivityStream />} />
<Route path="/recommendation" element={<Recommendations />} />
<Route path="/edit-story/:storyId" element={<EditStory currentTheme={currentTheme}/>} />
<Route path="/activity-stream" element={<ActivityStream currentTheme={currentTheme}/>} />
<Route path="/recommendation" element={<Recommendations currentTheme={currentTheme}/>} />
</>
)}
</Routes>
Expand Down
6 changes: 3 additions & 3 deletions backend/frontend/src/pages/activity/ActivityStream.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import PersonRemoveIcon from '@mui/icons-material/PersonRemove';
import withAuth from '../../authCheck';


function ActivityStream() {
function ActivityStream({ currentTheme }) {
const [activities, setActivities] = useState([]);
const navigate = useNavigate();

Expand Down Expand Up @@ -187,11 +187,11 @@ function ActivityStream() {

return (
<Box sx={{ m: 'auto', maxWidth: '1200px', height: '100vh', padding: '10px' }}>
<h1 style={{ fontFamily: "'Josefin Sans', sans-serif" }} align="center" gutterBottom>
<h1 style={{fontFamily: "'Josefin Sans', sans-serif", color: currentTheme === 'custom' ? '#ffffff' : '#000000' }} align="center" gutterBottom>
Activity Stream
</h1>
{activities.length === 0 ? (
<Typography variant="subtitle1" align="center">
<Typography style={{ color: currentTheme === 'custom' ? '#ffffff' : '#000000' }}variant="subtitle1" align="center">
There is no activity.
</Typography>
) : (
Expand Down
10 changes: 5 additions & 5 deletions backend/frontend/src/pages/homepage/AllStories.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import locationIcon from '../../assets/images/location.png'
import dateIcon from '../../assets/images/date.png'


function StoriesByFollowingsUsers() {
function StoriesByFollowingsUsers({ currentTheme }) {
const [stories, setStories] = useState([]);
const [loading, setLoading] = useState(true);
const [currentPage, setCurrentPage] = useState(1);
Expand Down Expand Up @@ -172,9 +172,9 @@ function StoriesByFollowingsUsers() {
))
)}
<div className={styles.pagination}>
<Button variant="contained" onClick={() => handlePageChange(currentPage - 1)} disabled={!hasPrevPage}>
{(hasPrevPage) && <Button variant="contained" onClick={() => handlePageChange(currentPage - 1)} disabled={!hasPrevPage}>
Previous
</Button>
</Button>}
{Array.from({ length: totalPages }, (_, index) => (
<Button variant="contained"
key={index}
Expand All @@ -184,9 +184,9 @@ function StoriesByFollowingsUsers() {
{index + 1}
</Button>
))}
<Button variant="contained" onClick={() => handlePageChange(currentPage + 1)} disabled={!hasNextPage}>
{(hasNextPage) && <Button variant="contained" onClick={() => handlePageChange(currentPage + 1)} disabled={!hasNextPage}>
Next
</Button>
</Button>}
</div>
</div>
);
Expand Down
17 changes: 17 additions & 0 deletions backend/frontend/src/pages/homepage/AllStories.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from 'react';
import { render, waitFor, fireEvent } from '@testing-library/react';
import axios from 'axios';
import AllStories from './AllStories';
import '@testing-library/jest-dom';
import { MemoryRouter } from 'react-router-dom';

jest.mock('axios');

describe('AllStories component', () => {
test('renders loading state initially', () => {
const { getByText } = render(<MemoryRouter>
<AllStories />
</MemoryRouter>)
expect(getByText('Loading...')).toBeInTheDocument();
});
});
10 changes: 5 additions & 5 deletions backend/frontend/src/pages/homepage/StoriesbyFollowingUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import locationIcon from '../../assets/images/location.png'
import dateIcon from '../../assets/images/date.png'


function StoriesByFollowingsUsers() {
function StoriesByFollowingsUsers({ currentTheme }) {
const [stories, setStories] = useState([]);
const [loading, setLoading] = useState(true);
const [currentPage, setCurrentPage] = useState(1);
Expand Down Expand Up @@ -174,9 +174,9 @@ function StoriesByFollowingsUsers() {
))
)}
<div className={styles.pagination}>
<Button variant="contained" onClick={() => handlePageChange(currentPage - 1)} disabled={!hasPrevPage}>
{(hasPrevPage) && <Button variant="contained" onClick={() => handlePageChange(currentPage - 1)} disabled={!hasPrevPage}>
Previous
</Button>
</Button>}
{Array.from({ length: totalPages }, (_, index) => (
<Button variant="contained"
key={index}
Expand All @@ -186,9 +186,9 @@ function StoriesByFollowingsUsers() {
{index + 1}
</Button>
))}
<Button variant="contained" onClick={() => handlePageChange(currentPage + 1)} disabled={!hasNextPage}>
{(hasNextPage) && <Button variant="contained" onClick={() => handlePageChange(currentPage + 1)} disabled={!hasNextPage}>
Next
</Button>
</Button>}
</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React from 'react';
import { render, screen, waitFor, fireEvent, act } from '@testing-library/react';
import axios from 'axios';
import StoriesByFollowingsUsers from './StoriesbyFollowingUsers.js';
import { MemoryRouter } from 'react-router-dom';

jest.mock('axios');

describe('StoriesByFollowingsUsers', () => {
it('renders stories correctly', async () => {
axios.get.mockResolvedValue({
data: {
stories: [
{
id: 1,
author: 'user123',
title: 'Test Story',
creation_date: new Date().toISOString(),
location_ids: [{ name: 'Test Location' }],
},
],
has_next: false,
has_prev: false,
total_pages: 1,
},
});
render(<MemoryRouter>
<StoriesByFollowingsUsers />
</MemoryRouter>);
await waitFor(() => {
expect(screen.getByText('Test Story')).toBeInTheDocument();
expect(screen.getByText('Test Location')).toBeInTheDocument();
});
});
});
Loading