Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 0 additions & 22 deletions frontend/src/features/courses/components/Overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import { useProgressSnapshot } from '../../dashboard/hooks/useProgressSnapshot'
import { useAuth } from '../../auth'
import { useFavorites } from '../../favorites'
import { useOnboarding } from '../../onboarding'
import { shouldShowRatingChip } from '../../reviews'
import {
TOUR_SAMPLE_COURSES,
getCatalogTourSampleVariant,
Expand Down Expand Up @@ -221,7 +220,6 @@ export function CoursesOverview() {
const [selectedTerms, setSelectedTerms] = useState<Array<'summer' | 'winter'>>([])
const [selectedCourseTypes, setSelectedCourseTypes] = useState<CourseTypeFilterValue[]>([])
const [showOnlyOpenMandatory, setShowOnlyOpenMandatory] = useState<boolean>(false)
const [showOnlyReviewed, setShowOnlyReviewed] = useState<boolean>(false)
const [showUnconfirmedOfferings, setShowUnconfirmedOfferings] = useState<boolean>(false)
const [areFiltersOpen, setAreFiltersOpen] = useState<boolean>(false)
const [sortOption, setSortOption] = useState<CatalogSortOption>('title')
Expand All @@ -235,7 +233,6 @@ export function CoursesOverview() {
selectedStudyAreaCodes.join('|'),
selectedTerms.join('|'),
showOnlyOpenMandatory,
showOnlyReviewed,
showUnconfirmedOfferings,
sortOption,
timeFromDigits,
Expand All @@ -249,7 +246,6 @@ export function CoursesOverview() {
selectedStudyAreaCodes,
selectedTerms,
showOnlyOpenMandatory,
showOnlyReviewed,
showUnconfirmedOfferings,
sortOption,
timeFromDigits,
Expand Down Expand Up @@ -458,11 +454,6 @@ export function CoursesOverview() {
) {
return false
}
// Same "has a displayable rating" test the card chip uses, so the
// filter can never disagree with what the cards show.
if (showOnlyReviewed && !shouldShowRatingChip(course.rating)) {
return false
}
if (
!shouldShowUnconfirmedOfferings
&& !isDefaultVisibleOfferingStatus(offeringStatusByCourseId.get(course.id))
Expand Down Expand Up @@ -490,7 +481,6 @@ export function CoursesOverview() {
selectedTerms,
shouldShowUnconfirmedOfferings,
showOnlyOpenMandatory,
showOnlyReviewed,
sortOption,
studyProgramCode,
timeWindow,
Expand All @@ -508,7 +498,6 @@ export function CoursesOverview() {
+ selectedTerms.length
+ selectedCourseTypes.length
+ (showOnlyOpenMandatory ? 1 : 0)
+ (showOnlyReviewed ? 1 : 0)
+ (showUnconfirmedOfferings ? 1 : 0)
const hasActiveFilters = activeFilterCount > 0

Expand Down Expand Up @@ -546,7 +535,6 @@ export function CoursesOverview() {
setSelectedTerms([])
setSelectedCourseTypes([])
setShowOnlyOpenMandatory(false)
setShowOnlyReviewed(false)
setShowUnconfirmedOfferings(false)
}

Expand Down Expand Up @@ -757,16 +745,6 @@ export function CoursesOverview() {
))}
</div>
</FilterGroup>

<FilterGroup label="Reviews">
<div className="flex flex-wrap gap-2">
<FilterChip
label="Has reviews"
active={showOnlyReviewed}
onClick={() => setShowOnlyReviewed((current) => !current)}
/>
</div>
</FilterGroup>
</div>

<div className="flex flex-wrap items-center justify-end gap-2 border-t border-border-light pt-3">
Expand Down
2 changes: 2 additions & 0 deletions frontend/src/features/i18n/translations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ export const TRANSLATIONS = {
'reviews.loading': 'Loading reviews...',
'reviews.empty': 'No reviews yet. Be the first to share your experience.',
'reviews.count': '{count} reviews',
'reviews.countOne': '1 review',
'reviews.overallLabel': 'Overall',
'reviews.optionalRatings': 'Optional ratings',
'reviews.examLabel': 'Exam and assessment',
Expand Down Expand Up @@ -516,6 +517,7 @@ export const TRANSLATIONS = {
'reviews.loading': 'Bewertungen werden geladen...',
'reviews.empty': 'Noch keine Bewertungen. Teile als Erste oder Erster deine Erfahrung.',
'reviews.count': '{count} Bewertungen',
'reviews.countOne': '1 Bewertung',
'reviews.overallLabel': 'Gesamt',
'reviews.optionalRatings': 'Optionale Bewertungen',
'reviews.examLabel': 'Prüfung und Bewertung',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ function SummaryHeadline({ summary }: { summary: CourseReviewSummary }) {
size="sm"
/>
<span className="text-[11.5px] text-fg-muted">
{t('reviews.count', { count: String(summary.count) })}
{summary.count === 1
? t('reviews.countOne')
: t('reviews.count', { count: String(summary.count) })}
</span>
</div>
</div>
Expand Down
Loading