-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from CS3219-AY2425S1/frontend/question-descrip…
…tion DRAFT - Sort and Filter Feature
- Loading branch information
Showing
12 changed files
with
254 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export interface Category { | ||
category_id: string, | ||
category_name: string | ||
} |
2 changes: 1 addition & 1 deletion
2
peer-prep-fe/src/components/question-list/question-list.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 41 additions & 5 deletions
46
peer-prep-fe/src/components/search-and-filter/search-and-filter.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,49 @@ | ||
<div class="container"> | ||
<div class="search-container"> | ||
<input class="search-bar" type="search" placeholder="Search..." [(ngModel)]="searchTerm" /> | ||
<button type="submit" (click)="searchQuestions()"> | ||
<button type="submit" class="search-button" (click)="searchQuestions()"> | ||
<i class="fa-solid fa-magnifying-glass search-icon"> </i> | ||
</button> | ||
</div> | ||
|
||
<div class="button-container"> | ||
<button id="button" (click)="sortQuestions()">SORT</button> | ||
<button id="button">FILTER</button> | ||
<button id="button" (click)="openAddModal()" >ADD QUESTION</button> | ||
<button id="button" (click)="sortQuestions()">SORT</button> | ||
|
||
<!-- Filter Button with Hover --> | ||
<div class="filter-container"> | ||
<button id="button" (mouseover)="showFilterOptions = true"> | ||
FILTER | ||
</button> | ||
|
||
<!-- Dropdown Content to toggle between Difficulty and Category buttons, or options --> | ||
<div class="dropdown-content" *ngIf="showFilterOptions" (mouseleave)="showFilterOptions = false"> | ||
|
||
<!-- Show Difficulty and Category buttons if no filter option is selected --> | ||
<div *ngIf="!isDifficultyClicked && !isCategoryClicked"> | ||
<button class="dropdown-btn" (click)="showDifficultyOptions()">Difficulty</button> | ||
<button class="dropdown-btn" (click)="showCategoryOptions()">Category</button> | ||
</div> | ||
|
||
<!-- Show Difficulty Options --> | ||
<div *ngIf="isDifficultyClicked"> | ||
<button (click)="filterByDifficulty('Easy')">Easy</button> | ||
<button (click)="filterByDifficulty('Medium')">Medium</button> | ||
<button (click)="filterByDifficulty('Hard')">Hard</button> | ||
</div> | ||
|
||
<!-- Show Category Options --> | ||
<div *ngIf="isCategoryClicked"> | ||
<button *ngFor="let category of categories" | ||
(click)="filterByCategory(category)" | ||
> | ||
{{ category}} | ||
</button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
|
||
<button id="button" (click)="openAddModal()">ADD QUESTION</button> | ||
</div> | ||
</div> | ||
</div> | ||
|
5 changes: 3 additions & 2 deletions
5
peer-prep-fe/src/components/search-and-filter/search-and-filter.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 52 additions & 3 deletions
55
peer-prep-fe/src/components/search-and-filter/search-and-filter.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.