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

UI update #105

Draft
wants to merge 387 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
387 commits
Select commit Hold shift + click to select a range
880f384
move strict search checkbox
swh00tw Oct 20, 2022
8ce9fe9
remove strict search checkbox
swh00tw Oct 20, 2022
3564bbc
fix bug
swh00tw Oct 20, 2022
f6741e3
setToFirstPage while refetch search result
swh00tw Oct 20, 2022
4527699
fix bug
swh00tw Oct 20, 2022
3ec8680
UI fix
swh00tw Oct 20, 2022
da3a850
update toast
swh00tw Oct 21, 2022
94e95fd
finish toast
swh00tw Oct 21, 2022
b5679ff
add basic right panel layout
swh00tw Oct 21, 2022
961e006
finish panel animation
swh00tw Oct 21, 2022
657e6a6
finish right panel
swh00tw Oct 21, 2022
2c5b954
add menu
swh00tw Oct 21, 2022
a18c4a7
fix bug
swh00tw Oct 21, 2022
8c08a15
fix bug
swh00tw Oct 21, 2022
a04478e
fix bug
swh00tw Oct 21, 2022
8688b76
finish menu option
swh00tw Oct 21, 2022
7787d00
fix bug
swh00tw Oct 21, 2022
43b267b
fix UI
swh00tw Oct 21, 2022
72c1d59
add placeholder
swh00tw Oct 24, 2022
4feb2ec
close menu onClick
swh00tw Oct 24, 2022
0e1e177
change wording
swh00tw Oct 24, 2022
b26c40d
refactor filters
swh00tw Oct 24, 2022
eb0d207
change folder name
swh00tw Oct 24, 2022
9bceeca
refactor code
swh00tw Oct 24, 2022
ec55cf6
extract component
swh00tw Oct 24, 2022
90002ae
add general Course Type filter
swh00tw Oct 24, 2022
db9c043
add CommonTargetDept filter
swh00tw Oct 24, 2022
53895eb
finish common course type
swh00tw Oct 24, 2022
ea5ee86
add pearmy filter
swh00tw Oct 24, 2022
366a47f
finish add college filter
swh00tw Oct 24, 2022
84a25a2
finish filters part
swh00tw Oct 25, 2022
ebbd6f9
finish integrate new filter & search API
swh00tw Oct 25, 2022
2aee4cf
add program filter
swh00tw Oct 28, 2022
f2f4214
finish search feature
swh00tw Oct 28, 2022
56ba40d
modify dept filter UI
swh00tw Oct 31, 2022
f0d8be8
modify program filter UI
swh00tw Oct 31, 2022
18f352f
fix bug
swh00tw Nov 1, 2022
a3508ac
add empty state
swh00tw Nov 1, 2022
db12786
refactor search loading logic
swh00tw Nov 1, 2022
40a5b4d
add loading state
swh00tw Nov 1, 2022
fecc7a3
add user panel loading state
swh00tw Nov 1, 2022
765151e
remove guest mode code
swh00tw Nov 1, 2022
79fa14d
add last check functionality
swh00tw Nov 1, 2022
9f2aa51
add custom font
swh00tw Nov 1, 2022
a2c417f
finish InstructionModal
swh00tw Nov 1, 2022
11f6992
finish external link UI
swh00tw Nov 1, 2022
a52bdc9
modify instruction modal ui
swh00tw Nov 1, 2022
98eb29c
finish chinese precaution
swh00tw Nov 1, 2022
5b83b62
finish foreign precaution table
swh00tw Nov 2, 2022
eb53c93
finish PE course precaution modal
swh00tw Nov 2, 2022
08a56ed
finsih pe/army/ntu_system precaution
swh00tw Nov 3, 2022
5726580
finish chemistry ntusystem modal
swh00tw Nov 3, 2022
9f98cd9
add calculas modal
swh00tw Nov 3, 2022
05e4ac4
finish all precaution modal
swh00tw Nov 3, 2022
3fac874
finish ALL precautions
swh00tw Nov 3, 2022
f279b64
fix wording
swh00tw Nov 8, 2022
05a2779
finish domain expertise search mode
swh00tw Nov 8, 2022
1026b09
modify style
swh00tw Nov 8, 2022
fe54cb3
modify courseTable btn
swh00tw Nov 8, 2022
7eb180a
add CourseTable button
swh00tw Nov 8, 2022
04242ac
modify mega menu
swh00tw Nov 8, 2022
6bdf7eb
modify mega menu
swh00tw Nov 8, 2022
63393e2
delete sunday
swh00tw Nov 8, 2022
004e588
modify wording
swh00tw Nov 8, 2022
7260a46
fix bug
swh00tw Nov 8, 2022
c79e552
fix wording
swh00tw Nov 8, 2022
005a95f
make linter happy
swh00tw Nov 8, 2022
16dfae5
modify layout
swh00tw Nov 8, 2022
5b0d3e8
fix wording
swh00tw Nov 10, 2022
ff6fe38
fix UI
swh00tw Nov 10, 2022
196008c
fix unique key warning
swh00tw Nov 10, 2022
0b88840
finish document page
swh00tw Nov 11, 2022
4248ac3
delete unused page
swh00tw Nov 11, 2022
798f312
fix UI
swh00tw Nov 11, 2022
7857286
finish news page
swh00tw Nov 11, 2022
720ebba
add help page
swh00tw Nov 11, 2022
ea5f5f6
finish tutorial Tab
swh00tw Nov 11, 2022
5905c19
finish FAQ Tab
swh00tw Nov 11, 2022
4f450d8
fix UI
swh00tw Nov 14, 2022
a12c7c1
finish custom Accordion
swh00tw Nov 14, 2022
9ab6814
finish custom accordion
swh00tw Nov 14, 2022
ec24468
finish FAQ
swh00tw Nov 14, 2022
78154d2
fix UI
swh00tw Nov 14, 2022
f50ed26
finish footer
swh00tw Nov 15, 2022
c52a457
modify UI
swh00tw Nov 15, 2022
3c7212a
modify dept filter
swh00tw Nov 15, 2022
ead5a31
fix bug
swh00tw Nov 15, 2022
e6d8b1a
finish courseinfo page layout
swh00tw Nov 15, 2022
c0363b3
clear unused code
swh00tw Nov 16, 2022
ffd139b
clear unused code
swh00tw Nov 16, 2022
512a6f5
finish tabs in courseinfo page
swh00tw Nov 16, 2022
08eb759
clear dead code
swh00tw Nov 16, 2022
3d63298
clear dead code
swh00tw Nov 16, 2022
a256d06
makes linter happy
swh00tw Nov 16, 2022
6fae7ed
add basicInfo tab
swh00tw Nov 16, 2022
459f7ac
finish basicInfo tab footer
swh00tw Nov 16, 2022
47a305b
add BasicInfoDataTag
swh00tw Nov 16, 2022
10f0ab6
finish basicInfoTab
swh00tw Nov 16, 2022
13d02a3
fix bug
swh00tw Nov 18, 2022
ee8573c
remove unused module
swh00tw Nov 18, 2022
4155daa
clear unused code
swh00tw Nov 18, 2022
60f7a36
add new filter property
swh00tw Nov 18, 2022
3f51ac3
add new filter
swh00tw Nov 18, 2022
2727442
add grouping course type filter
swh00tw Nov 18, 2022
4724a42
remove comment
swh00tw Nov 18, 2022
4abe8c3
remove unauth panel placeholder
swh00tw Nov 22, 2022
a2680f7
remove unused import
swh00tw Nov 22, 2022
43b8991
add custom icon
swh00tw Nov 22, 2022
6e7d24a
finish 2nd tab
swh00tw Nov 22, 2022
519a20c
add loading animation
swh00tw Nov 22, 2022
f73f124
clear console.log
swh00tw Nov 22, 2022
3a6ad38
finish 3rd tab
swh00tw Nov 22, 2022
80116be
refactor code
swh00tw Nov 24, 2022
12e5bd3
merge grading panel into syllabus panel
swh00tw Nov 24, 2022
fe2f699
fix bug
swh00tw Nov 24, 2022
afce768
makes linter happy
swh00tw Nov 24, 2022
5ec0767
add donut chart
swh00tw Nov 24, 2022
9586c62
finish donut chart
swh00tw Nov 24, 2022
87f0fb9
adjust donut thickness
swh00tw Nov 24, 2022
d7c55b4
adjust nprogress style
swh00tw Nov 28, 2022
640003a
update link
swh00tw Nov 28, 2022
695b982
update sorting wording
swh00tw Nov 28, 2022
07d7399
modify dept filter UI
swh00tw Nov 28, 2022
382ae3d
add external link
swh00tw Nov 28, 2022
ede391d
add user dropdown
swh00tw Nov 29, 2022
5ee6447
update husky
swh00tw Nov 29, 2022
1a9bfd2
add new filter
swh00tw Nov 29, 2022
fa6fe39
add new filter
swh00tw Nov 30, 2022
3427ed7
add filter component
swh00tw Nov 30, 2022
37c6b68
refactor single dept filter
swh00tw Nov 30, 2022
1bde8ad
restructure filter
swh00tw Nov 30, 2022
1d89adf
refactor code
swh00tw Nov 30, 2022
8dbfdfe
add new filter
swh00tw Nov 30, 2022
d7fd705
temporary finish singleDeptFilter
swh00tw Nov 30, 2022
3a040d2
add breadcrumb
swh00tw Nov 30, 2022
a147bb1
finish basic layout of coursetable page
swh00tw Dec 2, 2022
7bad6ff
finish style table body and cell
swh00tw Dec 2, 2022
41aef73
change dir name
swh00tw Dec 2, 2022
66f1d7f
extract courseTable
swh00tw Dec 2, 2022
745d2a6
refactor Table Data
swh00tw Dec 2, 2022
1cb37ec
refactor code
swh00tw Dec 2, 2022
6b22c87
add comment
swh00tw Dec 2, 2022
10ecc56
add filter courses algorithm
swh00tw Dec 2, 2022
eb7817b
finish courses2rle function
swh00tw Dec 2, 2022
e6d657a
clear console log
swh00tw Dec 4, 2022
c7cacde
update user dropdown link
swh00tw Dec 5, 2022
1ca6cbc
adjust style
swh00tw Dec 5, 2022
9cd4e38
refactor style
swh00tw Dec 6, 2022
40ca5cd
modify course rle function
swh00tw Dec 6, 2022
e050843
refactor style
swh00tw Dec 6, 2022
d1a4ba3
fix bug
swh00tw Dec 6, 2022
dd897a3
adjust course table card style
swh00tw Dec 6, 2022
564b3e3
modify course table card
swh00tw Dec 6, 2022
7714d95
export const
swh00tw Dec 6, 2022
45e64c9
finish portal rendering
swh00tw Dec 6, 2022
0f61214
refactor code
swh00tw Dec 6, 2022
8eb6cb5
add interval mnumber converter utls
swh00tw Dec 7, 2022
1381587
finish courseTableCard portal
swh00tw Dec 7, 2022
5846d1a
modify portal ui
swh00tw Dec 7, 2022
5f5a8db
finish alert dialog
swh00tw Dec 7, 2022
e3d3a45
adjust style
swh00tw Dec 8, 2022
a9004d5
refactor code
swh00tw Dec 8, 2022
f723c15
update type name
swh00tw Dec 8, 2022
83877d3
fix table header style
swh00tw Dec 8, 2022
b37ee34
modify UI
swh00tw Dec 8, 2022
d525dc0
add display mode switch
swh00tw Dec 8, 2022
d33888d
finish adding tabs
swh00tw Dec 8, 2022
e5d4a00
merge filterCourse and rle functions
swh00tw Dec 9, 2022
e265d84
change file name
swh00tw Dec 9, 2022
b152138
finish refactor calc conflicted courses
swh00tw Dec 9, 2022
b9c6014
add conflicted course badge
swh00tw Dec 9, 2022
cf13afc
add useMemo
swh00tw Dec 9, 2022
49cdde8
change file name
swh00tw Dec 9, 2022
87e62e3
add hover course feature
swh00tw Dec 9, 2022
6a30b30
improve hover feature
swh00tw Dec 9, 2022
37a2597
fix ui bug
swh00tw Dec 9, 2022
2489436
finish courseTable
swh00tw Dec 9, 2022
747e2e2
refactor code
swh00tw Dec 12, 2022
1a8594d
finish courseTableCard
swh00tw Dec 13, 2022
44b8712
add courseOrderList
swh00tw Dec 13, 2022
b66a497
fix worng url
swh00tw Dec 13, 2022
5b14465
export component
swh00tw Dec 13, 2022
02fc904
finish basic course sortable row
swh00tw Dec 13, 2022
ce3872b
add trashcan icon
swh00tw Dec 13, 2022
11b75d7
finish sortable row
swh00tw Dec 13, 2022
006199a
add sortable functionality
swh00tw Dec 13, 2022
bb585b0
add prepareToRemove function
swh00tw Dec 13, 2022
57bbf99
finish reorder onBlur function
swh00tw Dec 14, 2022
61f5315
add save function
swh00tw Dec 14, 2022
3a93e63
add hintMessage
swh00tw Dec 14, 2022
2d4c699
fix UI bug
swh00tw Dec 14, 2022
7ea8fa2
fix UI bug
swh00tw Dec 14, 2022
b887759
fix UI bug
swh00tw Dec 14, 2022
2083a1f
add intercept route change hook
swh00tw Dec 14, 2022
80c15c1
finish adding unsaved warning modal
swh00tw Dec 14, 2022
48fb511
trigger workflow run
swh00tw Dec 14, 2022
85b1da4
fix bug
swh00tw Dec 15, 2022
e89aa6c
refactor code
swh00tw Dec 15, 2022
56e0689
add courseOrderTable
swh00tw Dec 15, 2022
930cd8b
refactor code
swh00tw Dec 15, 2022
39e5ca1
refactor code
swh00tw Dec 15, 2022
793477d
refactor code
swh00tw Dec 15, 2022
77db062
refactor code
swh00tw Dec 15, 2022
9cac0d5
add parsing functions for courseOrderTable
swh00tw Dec 15, 2022
6fa06f5
finish courseOrderTableCard
swh00tw Dec 15, 2022
331e1ca
add courseOrderTable modal
swh00tw Dec 16, 2022
30b2446
add modal UI
swh00tw Dec 16, 2022
06846ea
add sortable row
swh00tw Dec 17, 2022
ddb21ca
add sortable row
swh00tw Dec 17, 2022
f3419fb
add dnd functions
swh00tw Dec 17, 2022
3b87f22
fix bug
swh00tw Dec 17, 2022
cb47d68
finish isEdited
swh00tw Dec 17, 2022
a96560e
add save function on modal
swh00tw Dec 17, 2022
87c6470
add hintMessage
swh00tw Dec 17, 2022
84fc2d2
add warning dialog
swh00tw Dec 17, 2022
578b16d
delete unused files
swh00tw Dec 19, 2022
b196d51
change route name
swh00tw Dec 19, 2022
25f338e
disable btn
swh00tw Dec 19, 2022
0ce1a28
add collection page basic layout
swh00tw Dec 19, 2022
0419f75
fixed collection page layout
swh00tw Dec 19, 2022
034be09
finish collection page
swh00tw Dec 19, 2022
4fc5d50
finish collection page
swh00tw Dec 19, 2022
2742edf
delete unused file
swh00tw Dec 19, 2022
d8621c4
refactor filters
swh00tw Dec 19, 2022
b5b121d
refactor filters
swh00tw Dec 19, 2022
c5b5559
finish coursetable info modal
swh00tw Dec 20, 2022
15e95e6
update filter type
swh00tw Dec 20, 2022
7136065
refactor filter type
swh00tw Dec 20, 2022
bb28f98
modify filter type
swh00tw Dec 20, 2022
1920631
change isSelective to isCompulsory
swh00tw Dec 21, 2022
689a2ea
change singleDeptIsSelective to singleDeptIsCompulsory
swh00tw Dec 21, 2022
d30bf53
add comment
swh00tw Dec 21, 2022
7e88df4
change otherLimit type name
swh00tw Dec 21, 2022
62b1721
change filter tpye name
swh00tw Dec 21, 2022
93f1436
change host_college to courseProvider
swh00tw Dec 21, 2022
d2ee780
change filter component name
swh00tw Dec 21, 2022
983d90b
finish refactor filter type name
swh00tw Dec 21, 2022
4916c14
change isSelectiveOption
swh00tw Dec 21, 2022
c9cd156
change filter component type
swh00tw Dec 21, 2022
82c8843
delete unused code
swh00tw Dec 21, 2022
c5d1842
move type def
swh00tw Dec 21, 2022
06ae8cc
change file name
swh00tw Dec 21, 2022
0f05044
move file
swh00tw Dec 21, 2022
04569ce
add query type and search query state
swh00tw Dec 21, 2022
31d6dc8
add comment
swh00tw Dec 21, 2022
4d769d0
Modify help page to fit mobile layout
Pinsyuan Dec 22, 2022
33f5cd3
Merge branch 'feature/new-design-system' of https://github.com/NTUCou…
swh00tw Dec 22, 2022
4a178e4
fix table layout
swh00tw Dec 23, 2022
758969d
fix header layout
swh00tw Dec 23, 2022
d852a50
add homepage bg
swh00tw Dec 23, 2022
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
Prev Previous commit
Next Next commit
modify filter type
  • Loading branch information
swh00tw committed Dec 20, 2022
commit bb28f9800c5f5005db47f1de8a276d9be16604c3
52 changes: 22 additions & 30 deletions src/components/Filters/SingleDeptFilterModal.tsx
Original file line number Diff line number Diff line change
@@ -45,15 +45,16 @@ import { CloseIcon } from "@chakra-ui/icons";
import { searchDept } from "@/components/Filters/DeptFilterModal";
import Dropdown from "@/components/Dropdown";
import { ChevronDownIcon } from "@chakra-ui/icons";
import { IsSelectiveOption, isSelectiveOptions } from "@/types/search";

// TODO: add API & hook to fetch options
interface DropdownGroupProps extends FlexProps {
readonly deptId: string | null;
readonly selectedCourseType: string | null;
readonly setSelectedCourseType: (courseType: string | null) => void;
readonly isSingleDeptSelective: boolean | null;
readonly isSingleDeptSelective: IsSelectiveOption;
readonly setIsSingleDeptSelective: (
isSingleDeptSelective: boolean | null
isSingleDeptSelective: IsSelectiveOption
) => void;
readonly suggestedGrade: string | null;
readonly setSuggestedGrade: (suggestedGrade: string | null) => void;
@@ -69,25 +70,21 @@ function DropdownGroup(props: DropdownGroupProps) {
setSuggestedGrade,
...rest
} = props;
const selectiveOptions = {
All: {
const selectiveOptions: Record<
IsSelectiveOption,
{
label: string;
}
> = {
all: {
label: "必修 + 選修",
value: null,
},
Selective: {
selective: {
label: "選修",
value: true,
},
Required: {
required: {
label: "必修",
value: false,
},
} as const;
const findSelevtiveOption = (value: boolean | null) => {
if (value === null) {
return selectiveOptions.All;
}
return value ? selectiveOptions.Selective : selectiveOptions.Required;
};
return (
<Flex alignItems={"center"} {...rest}>
@@ -109,7 +106,11 @@ function DropdownGroup(props: DropdownGroupProps) {
fontSize: "12px",
}}
>
{findSelevtiveOption(isSingleDeptSelective).label}
{isSingleDeptSelective === "all"
? "必修 + 選修"
: isSingleDeptSelective === "selective"
? "選修"
: "必修"}
</Text>
<ChevronDownIcon />
</HStack>
@@ -122,17 +123,9 @@ function DropdownGroup(props: DropdownGroupProps) {
}}
>
<RadioGroup
value={
isSingleDeptSelective === null
? "All"
: isSingleDeptSelective
? "Selective"
: "Required"
}
value={isSingleDeptSelective}
onChange={(next) => {
setIsSingleDeptSelective(
next === "All" ? null : next === "Selective" ? true : false
);
setIsSingleDeptSelective(next as IsSelectiveOption);
}}
gap={2}
>
@@ -289,9 +282,8 @@ function SingleDeptFilterModal({
const [selectedCourseType, setSelectedCourseType] = useState<string | null>(
searchFilters.department_course_type
);
const [isSingleDeptSelective, setIsSingleDeptSelective] = useState<
boolean | null
>(searchFilters.singleDeptIsSelective);
const [isSingleDeptSelective, setIsSingleDeptSelective] =
useState<IsSelectiveOption>(searchFilters.singleDeptIsSelective);
const [suggestedGrade, setSuggestedGrade] = useState(
searchFilters.suggestedGrade
);
@@ -349,7 +341,7 @@ function SingleDeptFilterModal({
// fire when click "Reset"
// set local state to empty array
setSelectedDept(null);
setIsSingleDeptSelective(null);
setIsSingleDeptSelective(isSelectiveOptions[0]);
setSelectedCourseType(null);
setSuggestedGrade(null);
};
4 changes: 2 additions & 2 deletions src/components/Providers/CourseSearchingProvider.tsx
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ const emptyFilterObject: Filter = {
grouping_course_type: [],
dept: null,
department_course_type: null,
singleDeptIsSelective: null,
singleDeptIsSelective: isSelectiveOptions[0],
suggestedGrade: null,
};

@@ -214,7 +214,7 @@ const CourseSearchingProvider: React.FC<{
return (
searchFilters.dept !== null ||
searchFilters.department_course_type !== null ||
searchFilters.singleDeptIsSelective !== null ||
searchFilters.singleDeptIsSelective !== isSelectiveOptions[0] ||
searchFilters.suggestedGrade !== null
);
}
2 changes: 1 addition & 1 deletion src/types/search.tsx
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ export type Filter = {
grouping_course_type: string[]; // groupingCourseTypes
dept: Department | null; // for singleDept, department
department_course_type: string | null; // for singleDept, departmentCourseTypes
singleDeptIsSelective: boolean | null; // for singleDept, isSelectiveSingleDept
singleDeptIsSelective: IsSelectiveOption; // for singleDept, isSelectiveSingleDept
suggestedGrade: string | null; // for singleDept, suggestedGrade
};