Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
dd1a6b4
docs: add forth deliverable
elinejaa Nov 13, 2026
086dfef
docs: update functional requirements and application functions
elinejaa Nov 13, 2026
80b47dd
style: run prettier
elinejaa Nov 13, 2026
9aeb33d
docs: update known issues
elinejaa Nov 13, 2026
f0362d4
fix: small spelling fix
carmennt Nov 13, 2026
5a73a52
docs: add intersected filter clarification
elinejaa Nov 13, 2026
e31c2f6
docs: adds a section regarding the purpose of the application
Nov 13, 2026
ba9b03e
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
Nov 13, 2026
e4ef1a0
docs: update sustainability
elinejaa Nov 13, 2026
a621526
docs: testing
carmennt Nov 13, 2026
dd6c29d
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
elinejaa Nov 13, 2026
50168b9
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
carmennt Nov 13, 2026
cdf4f8d
docs: fix env.example
elinejaa Nov 13, 2026
967830d
docs: update accessibility section
Nov 13, 2026
159aa74
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
Nov 13, 2026
db6615c
docs: finding used ports
carmennt Nov 13, 2026
53d9ecc
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
carmennt Nov 13, 2026
68e1b17
docs: update folder stucture
carmennt Nov 13, 2026
a196429
docs: updates AI section
Nov 13, 2026
56cb713
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
Nov 13, 2026
4a1ab71
docs: update scripts with e2e and api testing
carmennt Nov 13, 2026
4a95ef5
docs: fix number error
Nov 13, 2026
d44326d
Merge branch '97-update-readme' of https://git.ntnu.no/IT2810-H26/T10…
Nov 13, 2026
9526d63
Merge remote-tracking branch 'origin' into 97-update-readme
elinejaa Nov 13, 2026
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
1 change: 0 additions & 1 deletion Frontend/.env.example → .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ DB_PORT=
DB_NAME=
DB_USER=
DB_PASSWORD=
HOST=

PG_ADMIN_USER=
PG_ADMIN_PASSWORD=
3 changes: 1 addition & 2 deletions Frontend/src/FrontendLogic/LogicConnection.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
export const BACKEND_URL = import.meta.env.VITE_BACKEND_URL ?? 'http://it2810-10.idi.ntnu.no:3001/'

export const NETWORK_ERROR_MESSAGE =
'Could not reach the server.'
export const NETWORK_ERROR_MESSAGE = 'Could not reach the server.'

export async function Gql<T>(query: string, variables: Record<string, unknown>): Promise<T> {
const token = GetStoredToken()
Expand Down
11 changes: 6 additions & 5 deletions Frontend/src/FrontendLogic/MainPageLogicFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ const mainPageGenreStorageKeys: Record<MainPageGenreSection, string> = {
discounts: 'GameStart:genreMainpage:discounts'
}


function ReportStorageError(action: string, error: unknown) {
const message = error instanceof Error ? error.message : String(error)
console.error(`MainPage: Could not ${action} in session storage: ${message}`)
Expand All @@ -31,17 +30,19 @@ export function SaveMainPageGenre(section: MainPageGenreSection, genre: string)
}

export function GetDiscountedOnlySearchpage(): boolean {
return ReadStored(DISCOUNT_ONLY_KEY, false, IsBoolean, 'session', (error) =>
ReportStorageError('Could not read discounted only games:', error))
return ReadStored(DISCOUNT_ONLY_KEY, false, IsBoolean, 'session', (error) =>
ReportStorageError('Could not read discounted only games:', error)
)
}

export function SaveDiscountedOnlySearchpage(discountedOnly: boolean) {
WriteStored(DISCOUNT_ONLY_KEY, discountedOnly)
}

export function GetSavedRecentReviewCount(): number {
return ReadStored(RECENT_REVIEW_KEY, DEFAULT_REVIEW_COUNT, IsInteger, 'session', (error) =>
ReportStorageError('Could not read recent review count: ', error))
return ReadStored(RECENT_REVIEW_KEY, DEFAULT_REVIEW_COUNT, IsInteger, 'session', (error) =>
ReportStorageError('Could not read recent review count: ', error)
)
}

export function SaveRecentReviewCount(count: number) {
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/FrontendLogic/SearchPageLogicFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ export function SaveFilterMenuOpenSearchpage(isOpen: boolean) {

export function GetFilterMenuOpenSearchpage(): boolean {
return ReadStored(menuStorageKey, false, IsBoolean)
}
}
7 changes: 4 additions & 3 deletions Frontend/src/FrontendLogic/Storage.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import type { User } from "../types/User"
import type { User } from '../types/User'

type StorageKind = 'session' | 'local'

export const IsString = (value: unknown): value is string => typeof value === 'string'
export const IsBoolean = (value: unknown): value is boolean => typeof value === 'boolean'
// export const IsNumber = (value: unknown): value is number =>
// typeof value === 'number' && Number.isFinite(value) && value > 0
export const IsInteger = (value: unknown): value is number => typeof value === 'number' && Number.isInteger(value) && value > 0
export const IsInteger = (value: unknown): value is number =>
typeof value === 'number' && Number.isInteger(value) && value > 0
export const IsStringArray = (value: unknown): value is string[] => Array.isArray(value)
export const IsNull = (value: unknown): value is null => value === 'null'
export const IsUser = (value: unknown): value is User => {
Expand Down Expand Up @@ -62,4 +63,4 @@ export function RemoveStored(key: string, kind: StorageKind = 'session') {
} catch {
console.log(`Could not remove "${key}" from ${kind} storage`)
}
}
}
4 changes: 3 additions & 1 deletion Frontend/src/FrontendLogic/UserLogicFrontend.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@ export function SaveUser(user: User, remember = true) {

// Returns the saved user or null if no user is found.
export function GetSavedUser(): User | null {
const user = ReadStored<User | null>(USER_KEY, null, OrNull(IsUser), 'local') ?? ReadStored<User | null>(USER_KEY, null, OrNull(IsUser))
const user =
ReadStored<User | null>(USER_KEY, null, OrNull(IsUser), 'local') ??
ReadStored<User | null>(USER_KEY, null, OrNull(IsUser))
if (!user) ClearUser()
return user
}
Expand Down
1 change: 0 additions & 1 deletion Frontend/src/css/FriendsPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,3 @@
margin-top: 0;
padding-top: 0;
}

33 changes: 19 additions & 14 deletions Frontend/src/css/Global.css
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ body {

/* Primary: green, darker on hover, pale when disabled */
:is(
.app-button,
.profile-button,
.filtersection .resetButton,
.filtersection .removeFiltersButton,
.genre-carousel-controls .MuiButton-root,
.reviewCardActions .app-button,
.sign-in-and-up-card .MuiButton-contained
).MuiButton-root {
.app-button,
.profile-button,
.filtersection .resetButton,
.filtersection .removeFiltersButton,
.genre-carousel-controls .MuiButton-root,
.reviewCardActions .app-button,
.sign-in-and-up-card .MuiButton-contained
).MuiButton-root {
background-color: var(--primary-component-color);
color: var(--primary-text-color);
}
Expand Down Expand Up @@ -123,11 +123,11 @@ body {

/* Light: white button for use on green cards */
:is(
.app-button--light,
.activeGameWishlistButton,
.activeGameReviewsContent .reviewComposerToggle,
.reviewComposerActions .MuiButton-root
).MuiButton-root {
.app-button--light,
.activeGameWishlistButton,
.activeGameReviewsContent .reviewComposerToggle,
.reviewComposerActions .MuiButton-root
).MuiButton-root {
background-color: var(--primary-background-color);
color: var(--primary-text-color);
text-transform: none;
Expand Down Expand Up @@ -188,7 +188,12 @@ body {
These render in a portal outside the page, so they are styled by their own class. */

/* Select: add "app-menu-item" to each MenuItem (the older class names keep working) */
:is(.app-menu-item, .filterOption, .sortingOptionSearchpage, .sortingOptionWishlist).MuiMenuItem-root.Mui-selected {
:is(
.app-menu-item,
.filterOption,
.sortingOptionSearchpage,
.sortingOptionWishlist
).MuiMenuItem-root.Mui-selected {
background-color: var(--secondary-component-color);
}

Expand Down
4 changes: 3 additions & 1 deletion Frontend/src/hooks/useSearchPageResults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export function useSearchPageResults({ page, search, genres, sort }: SearchPageR
const [countError, setCountError] = useState<string | null>(null)

useEffect(() => {
FetchGenres().then(setAvailableGenres).catch((err: unknown) =>
FetchGenres()
.then(setAvailableGenres)
.catch((err: unknown) =>
setGenresError(err instanceof Error ? err.message : 'Could not load genres')
)
}, [])
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export default function MainPage() {
genresError={genresError}
loadGames={LoadDiscountedGames}
loadingText="Loading discount games..."
emptyText="No discount games found for this genre."
emptyText="No discounted games found for this genre."
showSeeMore
storageKey="discounts"
/>
Expand Down
5 changes: 1 addition & 4 deletions Frontend/src/tests/GameLogicFrontend.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,7 @@ describe('fetchGamesFromDB', () => {

it('does not reuse cached results from the previous cache version', async () => {
const values = new Map([
[
'games:v1:1:0:title-desc::',
JSON.stringify({ fetchedAt: Date.now(), games: [game] })
]
['games:v1:1:0:title-desc::', JSON.stringify({ fetchedAt: Date.now(), games: [game] })]
])
StubLocalStorage(values)
global.fetch = vi.fn().mockResolvedValue(MockResponse({ data: { games: [] } }))
Expand Down
2 changes: 1 addition & 1 deletion Frontend/src/types/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export interface User {
email: string
username: string
token: string
}
}
Loading