From c13b9700a4987244c13708a0ee4dda33b6e8dcab Mon Sep 17 00:00:00 2001 From: useruseruse Date: Wed, 21 Feb 2024 23:40:02 +0900 Subject: [PATCH 1/4] add redux devTools --- src/App.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/App.jsx b/src/App.jsx index e23a783..867d647 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -55,6 +55,7 @@ const store = createStore( writeReviews: writeReviewsReducer, planner: plannerReducer, }), + window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), ); class App extends Component { From 13f0dd2ebbc9a9f0620d297ba6f88c0ae7d75ac1 Mon Sep 17 00:00:00 2001 From: useruseruse Date: Wed, 6 Mar 2024 22:00:16 +0900 Subject: [PATCH 2/4] migrate planner/arbitary planner item --- .../model/planner/arbitraryPlannerItem.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/shapes/model/planner/arbitraryPlannerItem.tsx diff --git a/src/shapes/model/planner/arbitraryPlannerItem.tsx b/src/shapes/model/planner/arbitraryPlannerItem.tsx new file mode 100644 index 0000000..a39c919 --- /dev/null +++ b/src/shapes/model/planner/arbitraryPlannerItem.tsx @@ -0,0 +1,16 @@ +import department from '../subject/department'; + +interface arbitraryPlannerItem { + id: number; + item_type: 'ARBITRARY'; + is_excluded: boolean; + year: number; + semester: 1 | 2 | 3 | 4; + department?: department; + type: string; + type_en: string; + credit: number; + credit_au: number; +} + +export default arbitraryPlannerItem; From 76b2dfdf0a1b6fdaa9da78affdeb03903b6c662b Mon Sep 17 00:00:00 2001 From: useruseruse Date: Wed, 6 Mar 2024 22:56:13 +0900 Subject: [PATCH 3/4] migrate to futurePlannerItem.tsx planner.tsx takenPlannerItem.tsx --- .../model/planner/arbitraryPlannerItem.tsx | 4 +--- .../model/planner/futurePlannerItem.tsx | 10 ++++++++++ src/shapes/model/planner/planner.tsx | 19 +++++++++++++++++++ src/shapes/model/planner/takenPlannerItem.tsx | 10 ++++++++++ 4 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 src/shapes/model/planner/futurePlannerItem.tsx create mode 100644 src/shapes/model/planner/planner.tsx create mode 100644 src/shapes/model/planner/takenPlannerItem.tsx diff --git a/src/shapes/model/planner/arbitraryPlannerItem.tsx b/src/shapes/model/planner/arbitraryPlannerItem.tsx index a39c919..efa3c9c 100644 --- a/src/shapes/model/planner/arbitraryPlannerItem.tsx +++ b/src/shapes/model/planner/arbitraryPlannerItem.tsx @@ -1,6 +1,6 @@ import department from '../subject/department'; -interface arbitraryPlannerItem { +export default interface arbitraryPlannerItem { id: number; item_type: 'ARBITRARY'; is_excluded: boolean; @@ -12,5 +12,3 @@ interface arbitraryPlannerItem { credit: number; credit_au: number; } - -export default arbitraryPlannerItem; diff --git a/src/shapes/model/planner/futurePlannerItem.tsx b/src/shapes/model/planner/futurePlannerItem.tsx new file mode 100644 index 0000000..4bb15a7 --- /dev/null +++ b/src/shapes/model/planner/futurePlannerItem.tsx @@ -0,0 +1,10 @@ +import course from '../subject/course'; + +export default interface futurePlannerItem { + id: number; + item_type: 'FUTURE'; + is_excluded: boolean; + year: number; + semester: 1 | 2 | 3 | 4; + course: course; +} diff --git a/src/shapes/model/planner/planner.tsx b/src/shapes/model/planner/planner.tsx new file mode 100644 index 0000000..7a69467 --- /dev/null +++ b/src/shapes/model/planner/planner.tsx @@ -0,0 +1,19 @@ +import takenPlannerItem from './takenPlannerItem'; +import futurePlannerItem from './futurePlannerItem'; +import arbitraryPlannerItem from './arbitraryPlannerItem'; +import generalTrack from '../graduation/generalTrack'; +import majorTrack from '../graduation/majorTrack'; +import additionalTrack from '../graduation/additionalTrack'; + +export default interface planner { + id: number; + start_year: number; + end_year: number; + general_track: generalTrack; + major_track: majorTrack; + additional_tracks: additionalTrack[]; + taken_items: takenPlannerItem[]; + future_items: futurePlannerItem[]; + arbitrary_items: arbitraryPlannerItem[]; + arrange_order: number; +} diff --git a/src/shapes/model/planner/takenPlannerItem.tsx b/src/shapes/model/planner/takenPlannerItem.tsx new file mode 100644 index 0000000..930f46a --- /dev/null +++ b/src/shapes/model/planner/takenPlannerItem.tsx @@ -0,0 +1,10 @@ +import course from '../subject/course'; +import lecture from '../subject/lecture'; + +export default interface takenPlannerItem { + id: number; + item_type: 'TAKEN'; + is_excluded: boolean; + lecture: lecture; + course: course; +} From 7c83800df1b820d7b28137647cc9bff2f7b745b6 Mon Sep 17 00:00:00 2001 From: Seungbin Oh Date: Mon, 11 Mar 2024 17:55:32 +0900 Subject: [PATCH 4/4] chore: show redux devtools extension only in dev --- src/App.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/App.jsx b/src/App.jsx index 867d647..8a3406a 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -55,7 +55,9 @@ const store = createStore( writeReviews: writeReviewsReducer, planner: plannerReducer, }), - window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(), + process.env.NODE_ENV === 'development' + ? window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__() + : null, ); class App extends Component {